Application Development and Automation 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: 
Read only

Changing PO while creation via BAPI

Former Member
0 Likes
956

Hi,

I have situation where I have to change the line items in the PO before it's getting creating.

There's a Idoc which is coming in the system and then using BAPI_PO_CREATE is creating the Purchase Order. In bapi there is a call for Function module <b>'ME_POST_PO'</b> in subroutine

<b>PERFORM po_post TABLES return

USING purchaseorder.</b>

in this FM in the subroutine <b>PERFORM pruefen(sapmm06e)</b> there is another subroutine called <b>PERFORM customer_data_check.</b> in which a USER-exit <b>CALL FUNCTION 'EXIT_SAPMM06E_012'</b> is being called I tried changing the data here but to no avail.

I tried by exporting the values from idoc to memory and then importing it in this user exit and making a loop at table TEKPO and calling FM <b>MEPO_DOC_HEADER_GET</b> and FM <b>MEPO_DOC_PROCESS</b> one after another in sequence. But instead of getting changed line items the return code is '1' and it's not updating the fields.

<u><i>Is there a way to update the fields in table tekpo and then passing the same values further for PO creation.</i></u>. Please suggest

/Manik

3 REPLIES 3
Read only

Former Member
0 Likes
594

Hi Manik;

You may want to give it a go with the user exit function EXIT_SAPLEINM_012, which is part of enhancement MM06E001. I have always had good luck updating the PO with that enhancement.

Cheers,

John

Read only

0 Likes
594

Hi John,

This is a create scenario and i want to update the field in table tekpo. If i try updating directly then this is not possible since in the the user-exit the tables are passed as ref-values and once back they will have the same values as earlier.

/Manik

Read only

Former Member
0 Likes
594

Can you not change it in the IDOC itself, before calling the BAPI? There will be several exits in those function modules. I think yours will be IDOC_INPUT_ORDERS.

Srinivas