03-26-2012 6:57 PM
Hello experts,
I want to set flag FIXMG in EKPO through function Module.
I was searching in FM: BAPI_PO_CHANGE but not getting relevant field to update.
Please suggest any other function module if it exist.
This flag exists in last column of line item of purchase order ME23N.
Please help me to resolve this asap.
Regards,
Ankur
03-26-2012 9:19 PM
03-28-2012 3:00 PM
Hi Tuncay,
I think this field is added in upgraded version EHP5. Please check your SAP version. May be it is an old one.
03-28-2012 3:07 PM
Hi Ankur,
Correct. We don't have EPH5. We have just ECC 6.0, no enhancement package!
So it seems - as you pointed out - EKPO-FIXMG came with one of EHP packages. So check your BAPI_PO_CHANGE to see when it was changed last time. For example in my system it was changed on September 20, 2006.
And BAPIMEPOITEM structure - for items parameter - was changed on June 15, 2005.
Long story short: Maybe FIXMG field was added to EKPO table, but it's not supported by BAPI_PO_CHANGE yet!
03-28-2012 3:10 PM
Start with Note 1591410 - Preparatory ABAP Dictionary changes which is one of two ways to add this field in EKPO (second one is instal SP)
Then check Note 1571800 - EKPO-FIXMG: Fixed date and quantity not taken into account and Note 1628392 - Various corrections for STOs using FIXMG and all related notes.
Regards,
Raymond
PS: In the program associated to the first note the follwing lines of code are commented
* BAPI gets enhanced only as of EhP6
*
* CALL METHOD lcl_wb=>add_field_to_table
* EXPORTING
* i_tabname = 'BAPIMEPOITEM'
* i_fieldname = 'DATE_QTY_FIXED'
* i_rollname = 'ME_FIXMG'
* i_context = 'SPE_CRM_FKREL'.
*
* CALL METHOD lcl_wb=>add_field_to_table
* EXPORTING
* i_tabname = 'BAPIMEPOITEMX'
* i_fieldname = 'DATE_QTY_FIXED'
* i_rollname = 'BAPIUPDATE'
* i_context = 'SPE_CRM_FKREL'.
03-28-2012 3:45 PM
In the field is not avaialbe in the your BAPI then follow the following steps for BAPI extension.
1) Include your field in the CI include of the following strucutre.
2) Implement the BADI ME_BAPI_PO_CUST Method to used will be IF_EX_ME_BAPI_PO_CREATE_02~MAP2I_EXTENSIONIN. Check demo implemenation class CL_MMPUR_FB_BAPI_PO_CUST. .
3) For Item level this method is called at point shown below. Here l_data is of type
mepoitem and l_data is of type mepoitemx. Simply read your exitensionin table for that particular item and modify the fields in l_data and set the corresponding field in l_datax. It should work.
4) While calling the BAPI populate the extension table with values STRUCUTRE = BAPI_TE_MEPOITEM and obviously the value of the fields you append to the structure.
It should then be able to save data to to the database
For more details refer the below link
http://help.sap.com/saphelp_wp/helpdata/en/c3/4099a68b8911d396b70004ac96334b/frameset.htm