2006 Jun 08 10:07 AM
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
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.
2006 Jun 08 10:13 AM
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
2006 Jun 08 10:17 AM
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
2006 Jun 08 10:19 AM
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
2006 Jun 08 10:18 AM
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.
2006 Jun 08 10:18 AM
Hi,
you can check the LOG of the BDC session in SM35 transaction for that Session.
Regards
vijay
2006 Jun 08 10:49 AM
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
2006 Jun 08 12:05 PM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |