‎2005 Sep 07 7:45 PM
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
‎2005 Sep 07 8:04 PM
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
‎2005 Sep 08 9:01 AM
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
‎2005 Sep 07 11:00 PM
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