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: 

To set flag FIXMG(fixed date & Quantity) using standard FM

Former Member
0 Kudos

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

5 REPLIES 5

TuncayKaraca
Active Contributor
0 Kudos

FIXMG is not in EKPO field!

0 Kudos

Hi Tuncay,

I think this field is added in upgraded version EHP5. Please check your SAP version. May be it is an old one.

0 Kudos

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!

raymond_giuseppi
Active Contributor
0 Kudos

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'.

Private_Member_49934
Contributor
0 Kudos

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.

  • BAPI_TE_MEPOITEM -> FIXMG  type ME_FIXMG
  • BAPI_TE_MEPOITEMX -> FIXMG TYPE BAPIUPDATE
  • Activate the CI includes

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