‎2010 Oct 06 1:01 PM
Hi All,
I am working on a BDC development.
After CALL TRANSACTION KB15 syntax, i would like to capture the document number which has been created in the call trasaction step. How to capture the document number in such scenario???
Regards
Pavan
‎2010 Oct 06 1:05 PM
Hi,
Did you check if the bdcmessgecoll table is returning the docuent number or not. if it is returning to get that messge use FORMAT_MESSAGE FM to read the success message returned from the transaction.
‎2010 Oct 06 1:10 PM
Hi Pavan Sanganal ,
Using the System Message in Message Tab which you will capture in your message tab. For example :
CALL TRANSACTION 'F-43' USING IT_BDCDATA
OPTIONS FROM WA_CTU_PARAMS
MESSAGES INTO IT_MESSTAB.
"Here all messages will be stored in IT_MESSTAB
"If message type IT_MESSTAB-MSGTYP = 'S' then it should be the message you are looking for
"Note : There may be many Success(S) messages
LOOP AT IT_MESSTAB.
DATA : L_F_TEXT(150).
CLEAR L_F_TEXT.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_MESSTAB-MSGID
LANG = SY-LANGU
NO = IT_MESSTAB-MSGNR
V1 = IT_MESSTAB-MSGV1
V2 = IT_MESSTAB-MSGV2
V3 = IT_MESSTAB-MSGV3
V4 = IT_MESSTAB-MSGV4
IMPORTING
MSG = L_F_TEXT
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WA_FINAL-TYPE = IT_MESSTAB-MSGTYP.
WA_FINAL-LIFNR = WA_RECORD-LIFNR.
WA_FINAL-WRBTR = WA_RECORD-WRBTR.
WA_FINAL-TEXT = L_F_TEXT.
APPEND WA_FINAL TO IT_FINAL.
CLEAR : WA_FINAL.
ENDIF.
Thanks & Regards,
Rock.
‎2010 Oct 06 1:10 PM
Generally from the success message
We've the message like, "Document 12345678 has been posted successfully". You can get the DocNum from the message itself.
BR,
Suhas
‎2010 Oct 06 1:21 PM
hi,
Check your Document Number in BDCMSGCOLL or after call transaction call FM "FORMAT_MESSAGE" so that all the Error and Success message get stored in an internal table.
Thanks,
Pranav Saxena
‎2010 Oct 06 2:18 PM
Moderator message - Please search before asking - post locked Rob