Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Capturing messages in BDC session

Former Member
0 Likes
872

Hi All,

I have a loop construct containing a BDC session to create POs. I need to capture the PO number created and pass it on to a second BDC seesion in the same loop pass to to GR (Goods Receipt for PO).

How can I get the PO number from the PO BDC Session? Please help as it is urgent.

Best regards

Soumya

Hi All,

I have a loop construct containing a BDC session to create POs. I need to capture the PO number created and pass it on to a second BDC seesion in the same loop pass to to GR (Goods Receipt for PO).

How can I get the PO number from the PO BDC Session? Please help as it is urgent.

Best regards

Soumya

7 REPLIES 7
Read only

Former Member
0 Likes
823

If the BDC is successfull, you will get a message that the PO is created in the message table(BDCMSGCOLL). One of the parameters will be the PO number.

Regards,

Ravi

Read only

Former Member
0 Likes
823

after updation it show the message po will be created

so u capture the message window number and the data to

populate into internal table and store it presentation server

Read only

0 Likes
823

hi,

Once PO gets generated you can retrieve that one from <b>BDCMSGCOLL</b> table in to a variable and can pass that to required transaction.

Regards,

Santosh

Read only

rahulkavuri
Active Contributor
0 Likes
823

We can capture the messages whenever the BDC is successul, check the code in BOLD

  LOOP AT IT_SALES.

    PERFORM POPULATE_BDC.

    CALL TRANSACTION 'VA01' USING IT_BDCDATA
                                  MODE MODE
                                  UPDATE UPDATE
                                  MESSAGES INTO IT_MSGS.

    IF NOT IT_MSGS[] IS INITIAL.

<b>      LOOP AT IT_MSGS WHERE mstyp = ‘S’.

        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            ID        = IT_MSGS-MSGID
            LANG      = 'EN'
            NO        = IT_MSGS-MSGNR
            V1        = IT_MSGS-MSGV1
            V2        = IT_MSGS-MSGV2
            V3        = IT_MSGS-MSGV3
            V4        = IT_MSGS-MSGV4
          IMPORTING
            MSG       = V_MSG
          EXCEPTIONS
            NOT_FOUND = 1
            OTHERS    = 2.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.</b>        ENDIF.
        WRITE:/ V_MSG.
      ENDLOOP.

    ENDIF.

  ENDLOOP.

Read only

Former Member
0 Likes
823

Hi,

you can check the LOG of the BDC session in SM35 transaction for that Session.

Regards

vijay

Read only

0 Likes
823

Hi All,

I am using session method so BDCMSGCOLL may not be applicable. Also SM35 is not applicable as I need the PO number at runtime to process in another session.

regards

Soumya

Read only

0 Likes
823

Hi Soumya,

I suggest one solution. Just use the Call transaction for the PO creation by which u can received a PO number after that u can call the Posting using session method.

Thanks