Create SAP PO with Explicit PO Number

Explicit PO Number: This post will explain how to create a SAP PO ( Purchasing Order) with Explicit PO Number.

The first part will cover SAP PO Number Customizing and the second part will explain how to create explicit PO Number.

Customizing for Explicit PO Number

In order to allow External number to SAP PO ( Purchase Order ), customizing for PO Number range should be set to External.

So Define a SAP PO document Type then assign a number range for external numbers.

Create External Number Range for Purchasing Document

Launch the SAP Tcode OMH6 : Number Ranges for Purch. Documents

Check also, the following SAP Tcodes for Number Ranges

  • OMH6 Number Ranges for Purch. Documents
  • OMH7 Number Ranges for Purch. Requisition
  • OMH8 Number Ranges for Service Package
  • OMH9 Number Ranges for Entry Sheet

Assign External Number Range to Purchasing Document Type

To assign External Number Range to Purchasing Document Type, Navigate through SPRO to
Purchasing > Define Document Types

Set the following information

Related Post
  • Type for Document Types
  • Item Number Interval
  • No Range Internal
  • No Range External

Create SAP PO Explicit PO Number using BAPI

Once the Customizing for External Number Range for PO is done, you can move to ABAP report/Code.

In order to create a SAP Purchasing document with an External PO number use the standard BAPI BAPI_PO_CREATE1 (Create Purchase Order).

Check also List of Important SAP SD Tables (Sales and Distribution).

The main input parameters for PO Number are

  • POHEADER : Header Data- type BAPIMEPOHEADER
  • POHEADERX: Header Data (Change Parameter)- type BAPIMEPOHEADERX

Use field the POHEADER-PO_NUMBER (EBELN CHAR 10 0 Purchasing Document Number) for the External PO Number for the Purchase Document you want to create.

Set POHEADERX-PO_NUMBER = ‘X’

Call the BAPI BAPI_PO_CREATE1 will all the SAP Purchasing Order Details.

" Data declaration
DATA: LS_POHEADER   TYPE BAPIMEPOHEADER.
DATA: LS_POHEADERX  TYPE BAPIMEPOHEADERX.


" Set External PO 
ls_poheader-po_number   = iv_external_po.

" Set Update Flag External PO 
ls_poheaderx-po_number  = abap_true.  " 'X'

" Call SAP PO Creation BAPI 
CALL FUNCTION 'BAPI_PO_CREATE1'
  EXPORTING
    POHEADER                    = LS_POHEADER
    POHEADERX                   = LS_POHEADERX ...

Check more information about Purchasing Document and Most Useful SAP EDI Transactions (SAP Idocs Tcodes) & SAP EDI Tables

Share
Published by
John

Recent Posts

The Most Important SAP ISU Tables

SAP ISU Tables for Technical master data, for Billing Master Data, Billing and invoicing Tables?…

December 22, 2020

SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd Lecture

SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd…

November 18, 2020

The Main SAP Dunning Transaction Codes

Dunning is the business practice of informing a customer of past due payment. Dunning letters…

November 28, 2019

SAP Accounts Payable Tcodes & Accounts Receivable Tcodes ( SAP AP Tcodes & SAP AR Tcodes)

SAP AP Tcodes & SAP AR Tcodes: House Banks Tcodes, Advance Payments or Down Payments,…

August 1, 2019

The Most Important SAP Payment Terms Tables (ZTERM, Text…)

What are the main SAP Payment Terms Tables ? What are the related Tables in…

October 21, 2018

The most Important SAP Work Center Tables in SAP PP

Work center consists of master data related to routing of products. It contains data related…

October 21, 2018