Current Position:Home > Updating custom field in table EKKO within user exit when PO is saved

Updating custom field in table EKKO within user exit when PO is saved

Update:10-11Source: network consolidation
Advertisement
I am trying to update a custom field in table EKKO when a PO is saved.  I am using FM EXIT_SAPMM06E_013, within enhancement MM06E005.  Since EKKO is not a table that can be updated with this user exit, I am using a technic that I read about on SDN where I assign a field symbol to the calling program variable and then am able to access data within EKKO table.  But when I pass this data back into the field symbol, for some reason this field is not getting saved when the PO is saved.  In debug mode, it looks like this field is getting updated, but when I look in the table after the PO is saved, it is not there.  My code sample is below.  What I am doing wrong?
data:
  CHAR(50) VALUE '(SAPLMEPO)EKKO-ZHDRCSTCENTER',
  g_zhdrcstcenter like ekko-zhdrcstcenter,
  FIELD-SYMBOLS <F1> type any.
if i_ekko-ekorg = '5401'.
  ASSIGN (char) to <F1>.
  g_zhdrcstcenter = <F1>.
  move '0000113322' to g_zhdrcstcenter.
  <F1> = g_zhdrcstcenter.
endif.
Thanks!
Sarah Smyth.

The Best Answer

Advertisement
Firstly, have you investigated using EXIT_SAPMM06E_008 to set any custom fields you have added in the EKKO_CI / CI_EKKODB structure?.. that might work more easily.
In terms of doing an assign back into a calling program's memory, it can work but it's probably worth setting a break point in your code then stepping through watching the values in EKKO - sometimes you can find subsequent code that re-writes an earlier copy of values back into the structure, thereby preventing you doing your change...  SAP does warn this method is for "internal use".  Also check in your debugger that it's SAPLMEPO and not SAPMM06E you need.
  • Updating custom field in table EKKO within user exit when PO is saved Update:10-11

    I am trying to update a custom field in table EKKO when a PO is saved.  I am using FM EXIT_SAPMM06E_013, within enhancement MM06E005.  Since EKKO is not a table that can be updated with this user exit, I am using a technic that I read about on SDN wh

  • BADI or User exit  for FB50 to update custom field in table COEP Update:10-11

    Hi all, i have added one custom field in table COEP through include CI_COBL . when i do posting through sales order(VA02) or purchase order(ME22n) that custom fields in COEP get updated with controlling document and through BADI AC_DOCUMENT i m updat

  • Updating Custom field in Table BUT000 using BAPI 'BAPI_ISUPARTNER_CHANGE'. Update:11-30

    Hi, I have added a new custom field in table BUT000. Now i want to update that field with 'X' and i have used EXTENSIONIN parameter in the BAPI 'BAPI_ISUPARTNER_CHANGE'. i have populated the field name(Custom field name) and value 'X' to that structu

  • MM06E005 - Custom fields to table ekko using CI_EKKODB Update:10-11

    Hi, I've added some new fields to this structure. I've added then this to the header screen of me32k. I need to write some abap code to make this field work, I mean now appers but is not written/read from the database table. In which userexits should

  • Error using Bapi_PO_Change for update custom fields Update:11-30

    Dear Expert, I have requirement for update custom field in table ekko. I used BAPI_PO_CHANGE with PO_number as a key. Then i put the value of custom field in segment TABLES - EXTENSIONIN. But I get error : "ERROR TRANSFERING EXTENSIONIN DATA FOR ENHA

  • Need to update custom fields in MSEG table using "BAPI_GOODSMVT_CREATE" Update:10-11

    Hi All, There is a requirement to update custom fields in table MSEG which are part of append structure. There is a option to update the custom fields using the one of the tables parameters "EXTENSIONIN". Anyone please advice how can I update th

  • Updating custom fields in BSEG table Update:11-30

    Hi Experts, I searched through SDN but did not find satisfactory answer to my problem. The scenario is that FIDCC2 Idoc is coming to SAP system. This Idoc has extended to include few custom fields. These fields need to be updated in table BSEG. Table

  • Updating custom field in a standard table - AFVC Update:11-30

    Hi All, We have created a custom field in table AFVC. While updating other things related to that Order/Operation, we need to update this custom field. Can you kindly let me know how we can approach this? Do we use a direct Modify/update statement in

  • How Update Custom fields for EABL DB table by using BAPI_MTRREADDOC_UPLOAD Update:11-30

    Hi friends, How can I Update Custom fields for EABL DB table by using BAPI_MTRREADDOC_UPLOAD for the parameter EXTENSIONIN of type BAPIPAREX I am passing the Structure as BAPI_TE_EABL in that structure MRIDNUMBER as EABL-ABLBELNR field value ZMESSAGE

  • BAPI_EQUI_CREATE  to update custom fields. Update:11-30

    Is it possible to update custom fields in  Equipment master (EQUI table) using FM 'BAPI_EQUI_CREATE '? If yes, pls let me know which structure needs to updated. Thanks, DeepaI would think that just the name would be a key indicator.....CREATE but you