Skip to Content
author's profile photo Former Member
Former Member

ME21N Update Text in Line Item User Exit

Hi, I have created a new PO text item for use in ME21N that I want to populate from document details held in the material master. After entering a material number what user exit do I need to use to update internal tables for display of the document details before they are saved along with the other PO details. I know the tables where the material document details are held. Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 20, 2007 at 11:36 AM

    BADI ME_PROCESS_PO_CUST.

    Note that this BADI has a number of methods with parameters defined as "Importing" which makes it look like you cannot change data, but some of these parameters are "TYPE REF TO" objects which themselves have methods such as GET_DATA and SET_DATA that actually allow you to access and change the fields.

    Search for previous posts including "ME_PROCESS_PO_CUST" - there is sample code in some of them.

    In transaction SE19, if you display the BADI then select menu option goto >sample code >display, you will be able to drill down on the PROCESS_ITEM method to some SAP supplied sample code.

    This includes the definitions and method calls to get the item data:

    DATA: ls_mepoitem TYPE mepoitem.

    ls_mepoitem = im_item->get_data( ).

    You then just change relevant fields in structure ls_mepoitem and call the set_data method to pass the data back

    call method im_item->set_data exporting im_data = ls_mepoitem.

    Take care with what you change - SAP does not validate that you have passed back correct / consistant data.

    Not sure if the text field you want will be available - you may need to look at further methods of the BADI or of the parameter objects. If you drill down on the objects that the method parameters are defined as TYPE REF TO you will see the methods that are available - the GET_DATA and SET_DATA ones I have mentioned above are only a small part of the options. If there are none dealing with texts at the Header / Line, then you may need to put your code in at the latest method available (once the PO number is allocated) and call the SAVE_TEXT function module to do your update - not 100% way of doing it because standard code may save in update event and have rollback handling.

    To use the BADI you will need to create an implementation of it - there is a menu option in SE18 to do this, or you can use SE19.

    Andrew

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      My task is this below using BADI...........! plz give solution for this task..

      1> I will enter all the details in me21n to create Standard PO no... When i click SAVE button in me21n,

      what r the details entered in the screen me21n should be moved to one internal tables... Is there any solution for this .... Plz replay me soon,,,,,,,,,,,!

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2007 at 03:22 PM

    Take a look at BADI ME_PROCESS_PO_CUST.

    Search for previous threads on this BADI - some have sample code.

    You can also see sample code in SE18 (there is a menu option to go to sample code)

    Andrew

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Andrew, thanks for the reply.

      When the BAdi is envoked we will know the material and will be able to read in the material document details but what are the internal tables to be updated at this point or are there function modules we can use to pass the data to so it gets formatted correctly?

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.