Skip to Content

Updting the custom fields of PO Item

Hi I have added 1 field in the po item and po header throough secreen enhancement, now the requirment is whenever user enters any value in the header custom field, the same data should be updated to all the items...... tried to use

EXIT_SAPMM06E_018 which is working fine when I have only one item and it is working fine when user opens the item . my requirment is user will just add the data at header's custom field and will not open each and every item but the same data should be copied to all the items...tried to use

PROCESS_ITEM, check and post methods of badi.... in check method I am able to change standard fields

but not working for the custom fields, did not find a solution yet that's y posting again.... please suggest

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 28, 2019 at 05:52 AM

    Hi Ilyas,

    thats strange because I am doing the same in PROCESS_ITEM and it is working. Check it again. Try this code and debug it to see if you got the zfield filled before set_data.

     "get header data
     CALL METHOD im_item->get_header
     RECEIVING
     re_header = lo_header.
    
     CALL METHOD lo_header->get_data
     RECEIVING
     re_data = head_data.
    
     CALL METHOD im_item->get_data
     RECEIVING
     re_data = item_data.
    
    
    *- inherit the value from header Z field to item Z field
    IF head_data-zfield IS NOT INITIAL AND item_data-zfield IS INITIAL.
    item_data-zfield = head_data-zfield.
     CALL METHOD im_item->set_data
     EXPORTING
     im_data = item_data.
    ENDIF.
    
    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Peter,

      Thanks for your answer....the above code works fine when I am creating a purchase order, but the problem is coming when i am changing the existing purchase order..... this method is not triggering when I am changin the po through me22n... please suggest, is there any way that we can use above code for changing the PO......

  • Posted on Jun 28, 2019 at 10:37 AM

    Hi Peter,

    Thanks for your answer....the above code works fine when I am creating a purchase order, but the problem is coming when i am changing the existing purchase order..... this method is not triggering when I am changin the po through me22n... please suggest, is there any way that we can use above code for changing the PO......

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.