Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

What are the mandatory fields to create a purchase order ?

reethimanth_k
Explorer
0 Kudos

I'm looking to create a customized PO using RFC unless BAPI_PO_CREATE, unfortunately, I do not have the access to ME21N T-code. I need the mandatory fields for POHeader as well POItem. Can any one help me on this regard.

1 ACCEPTED SOLUTION

kiran_k8
Active Contributor
0 Kudos

Reethimanth,

SPRO>>Materials Management>>Purchasing>>Purchase Order>>Define Screen Layout at Document Level>>Select ME21,click on Details ( magnifying glass button) and double click on the respective Field Selection keys.Here you will get to see all the required fields.

K.Kiran.

4 REPLIES 4

Former Member
0 Kudos

Hi

While most of the mandatory fields will be similar across systems, there maybe configured or custom validations to content with.

You'll need to develop this function in a development environment.....

Whoever has asked you to perform this needs to be advised that you cannot perform your job function by not having access to this transaction in the development environment.

Anyone denying you access to this transaction in a development environment is not helping the ongoing development and support of the system.

Chase however you need to get the right access, escalate to your manager anyone standing in your way.

Regards

Arden

0 Kudos

Thank you Arden, will look for the access and work on it.

kiran_k8
Active Contributor
0 Kudos

Reethimanth,

SPRO>>Materials Management>>Purchasing>>Purchase Order>>Define Screen Layout at Document Level>>Select ME21,click on Details ( magnifying glass button) and double click on the respective Field Selection keys.Here you will get to see all the required fields.

K.Kiran.

Former Member
0 Kudos

Hi Reethimanth,

     i have developed a program recently to create Purchase order with BAPI 'BAPI_PO_CREATE' with minimum fields which is required to create Purchase order, For your reference i have attached my code check bold letters,


if it is helpful give me stars.


*&---------------------------------------------------------------------*

*& Report  ZPO_BAPI_LOK

*&

*&---------------------------------------------------------------------*

*& Author : Lokesh Srinivasan

*& Date    : 22-06-2015

*&---------------------------------------------------------------------*

REPORT  zpo_bapi_lok.

DATA ls_poheader     TYPE bapimepoheader.

DATA ls_poheaderx   TYPE bapimepoheaderx.

DATA ls_poitem          TYPE bapimepoitem.

DATA ls_poitemx        TYPE bapimepoitemx.

DATA ls_poaccount    TYPE bapimepoaccount.

DATA ls_poaccountx  TYPE bapimepoaccountx.

DATA lt_return            TYPE STANDARD TABLE OF bapiret2.

DATA lt_poitem           TYPE STANDARD TABLE OF bapimepoitem.

DATA lt_poitemx         TYPE STANDARD TABLE OF bapimepoitemx.

DATA lt_poaccount     TYPE STANDARD TABLE OF bapimepoaccount.

DATA lt_poaccountx   TYPE STANDARD TABLE OF bapimepoaccountx.

ls_poheader-comp_code   = '1000'.

ls_poheader-doc_type    = 'NB'.

ls_poheader-item_intvl  = '00001'.

ls_poheader-vendor      = '0000001000'.

ls_poheader-pmnttrms    = '0001'.

ls_poheader-purch_org   = '1000'.

ls_poheader-pur_group   = '001'.

ls_poheader-currency    = 'EUR'.


ls_poheaderx-comp_code  = 'X'.

ls_poheaderx-doc_type   = 'X'.

ls_poheaderx-item_intvl = 'X'.

ls_poheaderx-vendor     = 'X'.

ls_poheaderx-pmnttrms   = 'X'.

ls_poheaderx-purch_org  = 'X'.

ls_poheaderx-pur_group  = 'X'.

ls_poitem-po_item       = '00001'.

ls_poitem-material      = '100-100'.

ls_poitem-plant         = '1000'.

ls_poitem-stge_loc      = '0001'.

ls_poitem-quantity      = '15.000'.

ls_poitem-tax_code      = 'V0'.

ls_poitem-item_cat      = '0'.

ls_poitem-acctasscat    = 'K'.

APPEND ls_poitem TO lt_poitem.

ls_poitemx-po_item      = '00001'.

ls_poitemx-material     = 'X'.

ls_poitemx-plant        = 'X'.

ls_poitemx-stge_loc     = 'X'.

ls_poitemx-quantity     = 'X'.

ls_poitemx-tax_code     = 'X'.

ls_poitemx-item_cat     = 'X'.

ls_poitemx-acctasscat   = 'X'.

APPEND ls_poitemx TO lt_poitemx.

ls_poaccount-po_item     = '00001'.

ls_poaccount-serial_no   = '01'.

ls_poaccount-quantity    = '15.000'.

ls_poaccount-gl_account  = '0000400000'.

ls_poaccount-costcenter  = '0000001000'.

ls_poaccount-co_area     = '1000'.

APPEND ls_poaccount TO lt_poaccount.

ls_poaccountx-po_item    = '00001' .

ls_poaccountx-serial_no  = '01' .

ls_poaccountx-quantity   = 'X'.

ls_poaccountx-gl_account = 'X'.

ls_poaccountx-costcenter = 'X'.

ls_poaccountx-co_area    = 'X'.

APPEND ls_poaccountx TO lt_poaccountx .

CALL FUNCTION 'BAPI_PO_CREATE1'

  EXPORTING

    poheader                     = ls_poheader

    poheaderx                    = ls_poheaderx

TABLES

   return                       = lt_return

   poitem                       = lt_poitem

   poitemx                      = lt_poitemx

   poaccount                    = lt_poaccount

   poaccountx                   = lt_poaccountx.

          .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

* EXPORTING

*   WAIT          =

* IMPORTING

*   RETURN        =

          .

BREAK-POINT.