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

Capture Screen message while ME21N

How can I capture the PO Number while executing Me21N.

In one report I am called ME21N. SAP Displays message PO <PO Number > Created. I want to capture the PO Number and wanted to do further processing.

I tried to get data from SYST MSGV1, MSGV2 MSGV3 MSGV3. But all variables are blank.

I cant use set and get parameters. Because if user exit PO creation without creating the PO then get parameter picks the last created PO number.

CALL TRANSACTION 'ME21N'.

EBELN = ???????

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 04:02 PM

    ME21N is an enjoy SAP transaction and hence a BDC cannt be written. The case I can see is you could have justy calles the transaction ME21N and then manually posted the document.

    Now since it is an enjoy SAP transaction, you cannot capture the messages also. If you really want to capture the messages, then use BAPI for PO creation. Else use ME21 to post document and capture messages.

    Naveen.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Rich Heilman

      I have to Call Just ME21N and then user will create the PO mannually. after he saves the PO I want the PO number for further processing.

      by using the following code I can Capture the PO number, but the problem is that it will behave like a BDC with differnet screen attribute.

      Note i_BDCDATA table is blank.

      DATA : EBELN TYPE EBELN.

      CALL TRANSACTION 'ME21N'

      USING i_bdcdata

      MESSAGES INTO i_messtab.

      **

      *CLEAR i_messtab.

      *SORT i_messtab DESCENDING by msgtyp.

      *READ TABLE i_messtab WITH KEY msgtyp = 'S'.

      *IF sy-subrc = 0 .

      EBELN = i_messtab-msgv2.

      I just want to capture the screen value after ME21N.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 04:15 PM

    Hi,

    I think Its better uesd the standard Bapi BAPI_PO_CREATE1 to create PO's. It will written the PO number created in export parameter and aslo capture the screen messages in return table.

    Thanks

    Rajeev

    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.