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: 

BAPI_PO_CREATE1 - cannot control line item numbering

0 Kudos
1,273

Hi,

I'm using BAPI_PO_CREATE1 to create purchase orders, but have encountered an issue that I can't find how to resolve.

My source data file contains PO lines numbers in the range 0001, 0002, 0003 0004 etc. When the BAPI generates the PO everything is fine. However when the file contains 0001, 0002, 0004 (ie line 0003 does not exist), the BAPI generates the PO but introduces its own line numbering, so I see 0001, 0002 & 0003.

In the POHEADER structure I've defined the ITEM_INTVL to be 0001, so I can understand why the BAPI creates the lines numbers as it does, but what I'm looking for is a way to ensure that the line numbers take on the values I've supplied. Therefore in the 2nd example where 0003 is missing, this will be reflected in exactly the same way in the PO.

Any help is much appreciated.

Regards.

Mike

6 REPLIES 6

Former Member
0 Kudos
501

0 Kudos
501

Hi,

Thanks for the quick reply.

Unfortunately the link you sent me doesn't resolve my problem. What I'm ideally looking for is a field within one of the structures used by BAPI_PO_CREATE1 that forces the PO to retain the line numbers I pass into the BAPI.

Regards.

Mike

0 Kudos
501

Hi Michael,



*In the Table option in BAPI_PO_CREATE1



*In POACCOUNT
  it_bapi_poaccountx-serial_no  =  '00'.
  it_bapi_poaccount-itm_number =   '10'.

*In POACCOUNTX
  it_bapi_poaccountx-po_itemx   = 'X'.
  it_bapi_poaccountx-serial_nox = 'X'.
  it_bapi_poaccountx-itm_number = 'X'.
  
*Donot forget to specify the PO_ITEM field in both  

Regards,

Arun Sambargi.

Former Member
0 Kudos
501

Hay Mike,

I have same problem. I need to know how you solved. I need to control line item numbering externally when using BAPI_PO_CREATE1.Its urgent,can you reply me.

Thanks

Upendra

0 Kudos
501

Hello Mike,

Did you ever get a solution to this problem. I have the same business requirement. I need to know how you solved. I need to control line item numbering externally when using BAPI_PO_CREATE1. Its urgent,can you reply to me.

Thanks

Jamie

Former Member
501

POHEADER-ITEM_INTVL is INITIAL.

POHEADERX-ITEM_INTVL = 'X'.

For details, please see INCLUDE L2012F24 line123.

IF ( poheader-item_intvl IS INITIAL )

AND ( NOT poheaderx-item_intvl IS INITIAL ).

  • no renumbering

ELSE.

  • renumber item numbers

...

Regards,

Eason