Update Custom fields in MSEG in MIGO through MB_MIGO_BADI

Hi All,
I have to update my custom fields in MSEG table after getting them from user in MIGO transaction. I am using BADI--> MB_MIGO_BADI for this. There is method called POST_DOCUMENT in BADI but it is having MSEG as importing parameter. Also, How can i send my custom fields to BADI. If some how I send them how to update MSEG through this BADI.
Please help me out in this. This is urgent.
Thanks,
Ravi

Hi Ravi,
    I have the same issue . So can you please help me on the same.
    Through the BADI : MB_MIGO_BADI~POST_DOCUMENT method I have to update a customer field named zznotno.
       Added By Kamal on 21/07/2010 Ticket No 8000003778 ***
  DATA : lt_goitem TYPE TABLE OF goitem,
         wa_goitem LIKE LINE OF lt_goitem. .
  FIELD-SYMBOLS: <mseg> TYPE mseg,
                 <fs>   TYPE ANY.
  IMPORT lt_goitem TO lt_goitem FROM MEMORY ID 'GT_GOITEM'.
  LOOP AT it_mseg ASSIGNING  <mseg>.
    IF <mseg>-bwart = '415' OR
       <mseg>-bwart = '301'.
      IF <mseg>-sobkz = 'Q'.
        READ TABLE lt_goitem INTO wa_goitem WITH KEY zeile = <mseg>-zeile.
        IF sy-subrc IS INITIAL.
          wa_mseg-zznotno = <mseg>-zznotno.       <<<<<<<<<
          ASSIGN ('(SAPLMIGO)mseg') TO <fs>.
          MOVE wa_mseg-zznotno TO <fs>-zznotno .
         MODIFY it_mseg FROM wa_mseg TRANSPORTING zznotno.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
End Addition By Kamal on 21/07/2010 Ticket No 8000003778 ***
Thanks and regards
kamal kumar

Similar Messages

  • Updating custom fields to MSEG through MIGO

    Hi,
    I got a requirement to add a tab with custom fields in MIGO transaction, which I did using BADI MB_MIGO_BADI
    and requirement also says to extend table MSEG with custom fields and store the values in MSEG.
    I have gone through example implimentation and updated MSEG in similar way. IS it a good approach to extend MSEG table? I read one thread says we can't extend MSEG table with custom fields. is it true?
    Goods receipt will be done only through MIGO to restrict inconsistensies in material documents.
    One more question.
    How to restrict the additional custom screen to be displayed for particular action in MIGO?
    Thanks

    Hi,
    Yes you can do it, i did it with the same BADI method to update to custom fields in MSEG table through MIGO transaction.
    Here is the steps you need to follow :-
    1. Create a append structure or you can use the CI include to add fields in MSEG table. I did it though append structure only.
    2. Create a implementaion of MB_MIGO_BADI through SE18 or SE19 transaction.
    3. Inplement the interface IF_EX_MB_MIGO_BADI methods, the details of interface implementaions are described below:-
    Attribute
    GV_VEND_LOT     Instance Attribute     Public     Type     CHAR1     'X' : Purchase order Type NB (Standard PO) found                                                                               
    GIT_MSEG     Instance Attribute     Public     Type     TY_T_MSEG     Table MSEG                                                                               
    GV_BSART     Instance Attribute     Public     Type     ESART     Purchasing Document Type                                                                               
    GV_GRMODE     Instance Attribute     Public     Type     CHAR1     X: Document is of Type GR with PO and Y : Document with Mat.                                                                               
    GWA_MSEG     Instance Attribute     Public     Type     MSEG     Document Segment: Material                                                                               
    GC_CLASS_ID     Constant     Private     Type     MIGO_CLASS_ID     Class ID for MIGO Components (External Detail Screen)     'ZIMP_MB_MIGO_BADI'
    GV_LINE_ID     Instance Attribute     Private     Type     GOITEM-GLOBAL_COUNTER     LINE_ID of Line Displayed in Detail                                                                               
    GIT_LINE_ID     Instance Attribute     Private     Type     /KYK/TRG_NUMC6     Range Table: NUMC6                                                                               
    GWA_LINE_ID     Instance Attribute     Private     Type     /KYK/SRG_NUMC6     Range Structure: NUMC6                                                                               
    GC_X     Constant     Private     Type     CHAR1     'X' : Select     'X'
    GC_BSART     Constant     Private     Type     ESART     Purchasing Document Type     'NB' 
    IF_EX_MB_MIGO_BADI~INIT
    METHOD if_ex_mb_migo_badi~init.
      IF gv_grmode = gc_x.
    Regristration of BAdI-Implementation:
    Append class attribute GF_CLASS_ID (='ZIMP_MB_MIGO_BADI') to
    regristration table.
        APPEND gc_class_id TO ct_init.
      ENDIF.
    ENDMETHOD.
    IF_EX_MB_MIGO_BADI~PBO_DETAIL
    METHOD if_ex_mb_migo_badi~pbo_detail.
    Lines added to do display Vendor lot tab in the item level
    Only for Purchase order type NB (Standard PO)
    Local constants
      DATA : lc_cprog TYPE sycprog VALUE 'ZMMM_MIGO_VENDOR_COO',
             lc_dynnr TYPE sydynnr VALUE '0100'.
            lc_heading TYPE migo_badi_heading VALUE 'Vendor Lot Number'.
    Read Line item from buffer table
    if sy-subrc =0 then only display vendor lot tab
      READ TABLE git_line_id WITH KEY low = i_line_id
      BINARY SEARCH TRANSPORTING NO FIELDS.
      IF sy-subrc EQ 0 AND ( gv_grmode IS NOT INITIAL
        AND gv_vend_lot = gc_x ).
        e_cprog   = lc_cprog. " Program name
        e_dynnr   = lc_dynnr. " Screen number
        e_heading = text-001. " Tab Heading
        gv_line_id = i_line_id. " line Item
      ENDIF.
    ENDMETHOD.
    IF_EX_MB_MIGO_BADI~PAI_DETAIL
    METHOD if_ex_mb_migo_badi~pai_detail.
      IF gv_grmode IS NOT INITIAL AND gv_vend_lot = gc_x.
    'X':  The Method LINE_MODIFY Is Processed
        e_force_change = gc_x.
    Reset the Flag for next line item selection
        CLEAR gv_vend_lot.
      ENDIF.
    ENDMETHOD.
    IF_EX_MB_MIGO_BADI~LINE_MODIFY
    METHOD if_ex_mb_migo_badi~line_modify.
      IF cs_goitem-ebeln IS NOT INITIAL.
    Look for Purchase order number from EKKO and get the Order Type.
    If the Order type is NB (Standard PO) then set the flag GV_VEND_LOT.
        SELECT SINGLE bsart FROM ekko INTO gv_bsart
          WHERE ebeln = cs_goitem-ebeln.
        IF sy-subrc EQ 0 AND gv_bsart = gc_bsart.
          gv_vend_lot = gc_x.
          IF NOT i_line_id IS INITIAL.
            gwa_line_id-low = i_line_id.
          ENDIF.
          IF git_line_id IS NOT INITIAL.
            SORT git_line_id BY low.
          ENDIF.
          READ TABLE git_line_id WITH KEY
          low = i_line_id BINARY SEARCH
          TRANSPORTING NO FIELDS.
          IF sy-subrc <> 0 AND gwa_line_id IS NOT INITIAL.
            APPEND gwa_line_id TO git_line_id.
          ENDIF.
        ELSE.
          CLEAR gv_vend_lot.
        ENDIF.
        CLEAR : gv_bsart,
                gwa_line_id.
      ENDIF.
    *************Buffer MSEG table with custom fields **********************
    *Item is Adopted in Document
      IF NOT cs_goitem-take_it IS INITIAL.
        CLEAR gwa_mseg.
        MOVE-CORRESPONDING cs_goitem TO gwa_mseg.
        APPEND gwa_mseg TO git_mseg.
      ENDIF.
    ENDMETHOD.
    METHOD if_ex_mb_migo_badi~post_document.
    Delete duplicate line item if avail in GIT_MSEG table
      SORT git_mseg BY zeile.
      DELETE ADJACENT DUPLICATES FROM git_mseg COMPARING zeile.
    To access these valu in Ennhancement Spot ZENHIMPL_MM_MB_MIGO_BADI_MB
      EXPORT : git_mseg FROM git_mseg TO MEMORY ID 'GIT_MSEG',
               gv_grmode FROM gv_grmode TO MEMORY ID 'GV_GRMODE'.
    Refresh all class content
      CLEAR : gv_vend_lot,
              gv_bsart,
              gv_grmode,
              gwa_mseg,
              gv_line_id,
              gwa_line_id.
      REFRESH : git_mseg,
                git_line_id.
    ENDMETHOD.    
    METHOD if_ex_mb_migo_badi~mode_set.
    Local Constants
      DATA : lc_a01 TYPE goaction VALUE 'A01', " Goods Receipt
             lc_r01 TYPE refdoc VALUE 'R01',   " Purchase order
             lc_a04 TYPE goaction VALUE 'A04', " Display
             lc_r02 TYPE refdoc VALUE 'R02',   " Material Document
             lc_y   TYPE char1 VALUE 'Y'.      " Indicator for Display material document
    Set mode variable for Good Receipt with Purchase order
      IF i_action = lc_a01 AND i_refdoc = lc_r01.
        gv_grmode = gc_x.
      ELSEIF i_action = lc_a04 AND i_refdoc = lc_r02.
    Set mode variable for Good Receipt with Purchase order
        gv_grmode = lc_y.
      ELSE.
        CLEAR gv_grmode.
      ENDIF.
    ENDMETHOD.
    METHOD if_ex_mb_migo_badi~publish_material_item.
      IF ls_goitem-ebeln IS NOT INITIAL.
    Look for Purchase order number from EKKO and get the Order Type.
    If the Order type is NB (Standard PO) then set the flag GV_VEND_LOT.
    This method is used to material document display
        SELECT SINGLE bsart FROM ekko INTO gv_bsart
          WHERE ebeln = ls_goitem-ebeln.
        IF sy-subrc EQ 0 AND gv_bsart = gc_bsart.
          gv_vend_lot = gc_x.
          IF NOT ls_goitem-zeile IS INITIAL.
            gwa_line_id-low = ls_goitem-zeile.
          ENDIF.
          IF git_line_id IS NOT INITIAL.
            SORT git_line_id BY low.
          ENDIF.
          READ TABLE git_line_id WITH KEY
          low = ls_goitem-zeile BINARY SEARCH
          TRANSPORTING NO FIELDS.
          IF sy-subrc <> 0 AND gwa_line_id IS NOT INITIAL.
            APPEND gwa_line_id TO git_line_id.
          ENDIF.
        ELSE.
          CLEAR gv_vend_lot.
        ENDIF.
        CLEAR : gv_bsart,
                gwa_line_id.
      ENDIF.
    ENDMETHOD.
    METHOD modify_mseg.
      DATA : lwa_mseg TYPE mseg.
    Check if buffer MSEG table is not initial
    and mode is GR with PO then only update XMSEG from GIT_MSEG
      IMPORT : git_mseg TO git_mseg FROM MEMORY ID 'GIT_MSEG',
               gv_grmode TO gv_grmode FROM MEMORY ID 'GV_GRMODE'.
      IF git_mseg IS NOT INITIAL
         AND gv_grmode = gc_x.
        SORT git_mseg BY zeile.
        LOOP AT xy_mseg INTO lwa_mseg.
    Identify the record and update XMSEG
          CLEAR gwa_mseg.
          READ TABLE git_mseg
          INTO gwa_mseg
          WITH KEY zeile = lwa_mseg-zeile BINARY SEARCH.
          IF sy-subrc EQ 0.
            MODIFY xy_mseg FROM gwa_mseg
            TRANSPORTING zvendlot zcoo WHERE zeile = gwa_mseg-zeile.
          ENDIF.
          CLEAR lwa_mseg.
        ENDLOOP.
    Reset buffer table and mode
        REFRESH git_mseg.
        CLEAR gv_grmode.
      ENDIF.
    Free memory ids
      FREE MEMORY ID : 'GIT_MSEG',
                       'GV_GRMODE'.
    ENDMETHOD.
    4. Now go to the function module MB_POST_GOODS_MOVEMENT andcall the method modify_msegfrom the implemented class ZCL_IM__MB_MIGO_BADI.
    ENHANCEMENT 110  ZENHIMPL_MM_MB_MIGO_BADI_MB.    "active version
    Data declaration for badi method
      Data : lo_ZCL_IM__MB_MIGO_BADI TYPE REF TO ZCL_IM__MB_MIGO_BADI.
      CREATE OBJECT lo_ZCL_IM__MB_MIGO_BADI.
      if sy-subrc eq 0 and xmseg[] is NOT INITIAL.
        CALL METHOD lo_zcl_im__mb_migo_badi->modify_mseg
          CHANGING
            xy_mseg = xmseg[].
      endif.
    ENDENHANCEMENT.   
    Regards,
    Dhirendra Pandit

  • Need to update custom fields in MSEG table using "BAPI_GOODSMVT_CREATE"

    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 the custom field thru EXTENSIONIN.
    Thanks in advance.
    cheers,
    Vijay

    see the help
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/4099948b8911d396b70004ac96334b/frameset.htm
    Regards
    Kiran Sure

  • BADI MB_MIGO_BADI not updating custom field in MSEG Table

    Dear Experts,
    I am working on screen exit In MIGO transaction for transfer Posting.
    I checked that BADI MB_MIGO_BADI having facility for screen exit and method line_modify having facility to change GOITEM Structure for the changed line item.
    Now, to make this functionality work I have enhanced include structure CI_COBL which is available in both mseg table and goitem structure, now I have this customized fields on my custome tab through the enhancement and also to update this value 2 custom fields created in goitem structure and MSEG table through include structure  CI_COBL.
    Here my question is at the time of transfer posing creation in MIGO when I am passing the value in custom fields through screen and assigning it to custom fields of structure GOITEM through LINE_MODIFY method, it is giving me below worning message
    BADI: Field GOITEM-ZZIDNLF is not ready for input. (Change is not taken over)
    Now I have debuged the code, also checkout many threads and came to know that because of few checks in standred program (iNCLUDE:LMIGOKL3) these fields will not be updated WHERE IT always checks whether these fields are ready for input or not and if not ready then instead of assigning the values it throws worning message.
    Now can you please through some light how can I go ahead as I have check out many threads and also tried to change value of cs_goitem structure using field symbol but throughing dump that it is blocked against changes through field symbol.
    The helpful answers will be highly appriciated.

    Hi,
    In the badi mentioned by you GOITEM is the importing parameters & if the relevant field is not used in any MIGO screen you cannot change the data.
    Please check example BADI interface: IF_EX_MB_MIGO_BADI~LINE_MODIFY
    Please check the BADI documentation:
    Changed data in GOITEM is only adopted if the relevant fields are visible and ready for input.
    Changed data in GOITEM is not adopted if the relevant field is not used in any MIGO screen (warning via MIGO 049).
    Changed data in GOITEM is not adopted if the relevant fields are not ready for input (warning via MIGO 050)
    Thanks and Regards,
    Chandra

  • BAPI_GOODSMVT_CREATE ---- need to update custom field in MSEG table

    Greetings all,
    I'm using 'BAPI_GOODSMVT_CREATE' to create goods movements. also I need to update one cutom field(z-field) in MSEG table. Could anyone please advice how can I update the custom field thru EXTENSIONIN.
    thanks in advance.

    see the help
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/4099948b8911d396b70004ac96334b/frameset.htm
    Regards
    Kiran Sure

  • Updating custom fields in BSEG table

    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 BSEG also contains these custom fields. However, the Idoc processing routine is not updating custom fields in table BSEG with the data coming in Idoc. How can I do that?
    Thanks in advance,
    Netrey

    This message is processed by function module IDOC_INPUT_FIDCC2. If you drill down into the code a little bit, you should be able to find BTE/open FI or user exit calls (CALL CUSTOMER-FUNCTION) before the document is being posted.
    I found two that are using the ACCIT structure for passing the line items, which should contain your customer fields as well, if they were added to BSEG properly (via transaction OXK3).
    Please have a look.
    Thomas

  • BAPI_EQUI_CREATE  to update custom fields.

    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,
    Deepa

    I would think that just the name would be a key indicator.....CREATE but you want to Update....Why wouldn't you use BAPI_EQUI_CHANGE to update existing equipment records.  I would expect to have to extend the BAPI to handle the new fields.

  • Error using Bapi_PO_Change for update custom fields

    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 ENHANCEMENT CI_EKKODB".
    When I checked, I found the difference between data type the value for BAPI_PO_CHANGE (Usinf structure BAPIPAREX) and data type for custom field in table EKKO.
    Data Type in BAPI_PO_CHANGE is CHAR (you can see in structure BAPIPAREX). And data type for the custom field is DECIMAL.
    I found the note '1124803', but the correction note was not applicable for us because our released system is 500.
    Is there any suggestion or solution for resolve our problem?
    Really appreciate your help.
    Thanks.

    Hi Laxmikanth Bethi ,
    I tried with BAPI_PO_CHANGE in level header, and SAP was support the BAPI. And also i tried to appending the same fields in MEPOHEADR & MEPOHEADERX structures, but the problem is the type of my custom fields are DECIMAL, then the type MEPOHEADR & MEPOHEADERX structures are CHARACTER. So i got the error :  "ERROR TRANSFERING EXTENSIONIN DATA FOR ENHANCEMENT CI_EKKODB".
    Because the types are difference.
    Have you any suggestion to solve this problem?
    Really appreciate for your input.

  • Updating custom fields in DFKKOP when returning a refund

    Hi all,
    I am looking for an event to update custom fields on DFKKOP on the item level when returning a refund in PSCD. So far I have tried using events 290, 295. I know that somewhere the clearing document(AUGBL) is cleared. Haven't as yet found out where.
    Kind regards,
    Ameeta
    Moderator note:  Duplicate postings in several forums is a violation of the rules of engagement.  Please use this thread for responses Updating custom fields in DFKKOP during refunds retunrs
    Edited by: William Eastman on Mar 9, 2010 2:51 PM

    Hi all,
    I am looking for an event to update custom fields on DFKKOP on the item level when returning a refund in PSCD. So far I have tried using events 290, 295. I know that somewhere the clearing document(AUGBL) is cleared. Haven't as yet found out where.
    Kind regards,
    Ameeta
    Moderator note:  Duplicate postings in several forums is a violation of the rules of engagement.  Please use this thread for responses Updating custom fields in DFKKOP during refunds retunrs
    Edited by: William Eastman on Mar 9, 2010 2:51 PM

  • Extending sales order change BAPI and updating custom fields

    Hi
    i added 3 new fields into VA01/02/03 screen.i added at the header level in the additional data tab B area and appended them in VBAK table.
    i want to change these values using sales order change BAPI.i added the fields in the structure VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX.
    may i know what else i need to do?should i move them anywhere with in the code or does the bapi take those values automatically using EXTENSIONIN structure?
    also can some one send me code to actually check if bapi is changing my values?
    if poss tell me how should i populate values into BAPI.

    After adding field in structures VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX, create pair of name-value pair extensiot structure and value.
    Fill values as follows :
    Data :   ls_parex  TYPE  bapiparex,
                lt_parex  TYPE STANDARD TABLE OF  bapiparex.
    ls_parex-structure = 'BAPE_VBAK'.
    ls_parex-valuepart1+0(10) = Sales order no
    ls_parex-valuepart1+10(XX) = somevalue.  <---- Value for custom field no 1
    ls_parex-valuepart1+XX(XX) = somevalue.  <---- Value for custom field no 2
    APPEND ls_parex TO lt_parex  .
    clear ls_parex.
    ls_parex-structure = 'BAPE_VBAKX'.
    ls_parex-valuepart1+0(10) = Sales order no
    ls_parex-valuepart1+10(1) = 'X'. <--- checkbox mark for custom field no 1
    ls_parex-valuepart1+11(1) = 'X'. <--- checkbox mark for custom field no 2
    APPEND ls_parex TO lt_parex.
    Same pair for VBAKKOZ & VBAKKOZX
    Updating custom fields
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = Sales order number
          order_header_inx = 'U'   <--- U for update
        TABLES
          extensionin      = lt_parex[].
    Edited by: nkarwa on Oct 25, 2010 12:39 PM

  • How Update Custom fields for EABL DB table by using BAPI_MTRREADDOC_UPLOAD

    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 some text of 30 char and
    ZSKIPC of 2 char
    but I am not able to update that data for the MRIDNUMBER (ABLBELNR ) in DB table EABL
    I am getting RETURN Structure message type E
    as
    "Upload interim entries: Maintain one table only"
    Can any one provide me solution
    Thanks in Advance
    Ganesh

    Hi,
    Refer the following SAP notes.
    1. Note 485557 - BAPI_REQUISITION_CREATE: 'EXTENSIONIN' customer enhancements
    2. Note 584902 - BAPI_REQUISITION_CHANGE: ExtensionIn not connected
    3. Note 792132 - EBAN, EBKN: user-defined fields are not filled
    Regards,
    Harish

  • To Update Custom field in mch1 table through MIGO Tcode

    Dear champs,
    I have added one custom field in mch1 table ( date ).
    Now , In MIGO Tcode when i am doing posting, MCH1 table is also updated.
    I want to know how to update my custom field in mch1 table at the time of posting.
    Please tell me where to write logic to update mch1 table.
    Regards,
    Satyen Trivedi

    Hi Satyen,
           what data has to be update in MCH1 table new field, for this did you added any screen or you want to implement your own custom logic.
    1) if you implemented the screen , then you have to write logic there itself.
    2) If you want to update through custom logic , then you takeup with the  Enhancements or BADI.
    Regards,
    Krishna

  • Saving custom fields to MSEG added in additional TAB in MIGO transaction

    Hi Experts,
    I am facing an issue with an enhancement in MIGO transaction for which i need help. I have gone through several threads with similar issues but none of them have solved my issue. I have worked around with all BADIs of MIGO and user exits available but to no avail so I am posting a new thread.
    The requirement is pretty straight forward of adding a custom TAB in item details section of MIGO transaction. I have done that using BADI: MB_MIGO_BADI, method PBO_DETAIL. I created a screen with my custom fields and passed them in this method. The TAB appears as expected with all the fields. The custom fields are in MSEG table which has been enhanced and it needs to be updated with the user values on the screen.
    The issue creeps in when there are multiple materials in the purchasing document and user works around with them. Say he clicks on the second material and in the custom TAB changes its details in custom fields. Now he clicks on the fourth material and changes its details. Continues this for all the materials in random order. How do i identify in my custom screen [developed separately and called in PBO_DETAIL of the BADI] which details belong to which material or line number. The only way to do it is by using the purchasing order number and line item number. These are not available in my custom screen and needs to be exported from somewhere and imported there. I have not been able to identify the point where export can be done.
    Can anyone help me out with this problem? Either the point where export can be done or any other way of identifying the link between the line number / material number and the custom field details entered by the user.
    Thanks,
    Ritvik

    Hi Ritvik,
    you will not need it.
    The item methods will process exactly the item what the addional item data are related to. In PBO_DETAIL and PAI_DETAIL, use parameter I_LINE_ID for the item reference.
    Note: Not only read SCN etc,  also the parameters desciption of the methods used.
    Regards,
    Clemens

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

    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.

    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.

  • BADI or User exit  for FB50 to update custom field in table COEP

    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 updating that custom field in COEP.
    but when i do manual posting through FB50 controlling document is generated in COEP but i m not able to update that custom field
    because in this case BADI AC_DOCUMENT  is not get triggered.
    is there any BADI or User exit or enhancement spot for FB50 through which i can update that custom field in table COEP

    Hi Sandy,
    Thanks for u r reply,
    RFAVIS01 is not getting triggered through FB50
    and F180A001 ( EXIT_SAPLF048_001) is getting triggered but it doesnt contain COEP field in its parameter
    import - F180A_DOC_HEAD_TAB
                 F180A_DOC_ITEM_TAB
    changing - RELATION_TAB

Maybe you are looking for

  • Can not dislplay Chinese correctly for sybase db, but correct display Chinese for Oracle db.

    i using sqldeveloper to connect sybase ase 12.5 server and stored Chinese. but when i query out the data , it can not dislplay Chinese correctly, even i using sybase jdbc driver or jtds jdbc driver both error. so how to setup sqldeveloper to support

  • How do I get rid of the tabs at the top of the page and put them back down on the bottom?

    After installing updates the tab bar is at the top of the page. I want to have it on the bottom like it was before the updates.

  • Running VI in the background

    I want to run a VI in the background that performs the acquisition from a Field Point from time to time, and keep my interface VI unlocked for the user while the data acquisition is being done. Anyone knows how to do that?? Thanks!!!

  • ... how can i use 'enter' in java (text) -.-

    Hi all, first the simple version; How can i use 'enter' in java. Like turn HELLO into H E L L O The not so simpler version IF needed; I have the following piece of code;' if (line.startsWith("Monday")) {      String subjectsMonday = " math and philos

  • Video image problem

    Hi...A neighbor has a iMac G5 and has developed a video/image problem. The iMac boots up and sometimes shows an ok screen for a little time, sometimes not. What emerges is an array of digital black on white graphic line images (maybe I should upload