‎2011 Jan 13 9:08 AM
hi all,
In BDC iam creating purchase order using Call transaction method. So iam uploading datas from flat file(header and item details).
so In the call transaction if I use 'A'(all screen mode) then i can get the purchase order number in bdcmsgcoll(MSGV2).
data itab3 like table of bdcmsgcoll.
CALL TRANSACTION 'ME21' USING ITAB2 mode 'A' UPDATE 'S' MESSAGES INTO itab3.
If i use 'N'(no screen mode) then i cannot able to get the purchase order number in bdcmsgcoll(MSGV2).
CALL TRANSACTION 'ME21' USING ITAB2 mode 'N' UPDATE 'S' MESSAGES INTO itab3.
Is there any other way to rectify how to get the purchase order number in 'N'(no screen mode)???
Moderator message: please use more descriptive subject lines for your posts.
Edited by: Thomas Zloch on Jan 13, 2011 11:50 AM
‎2011 Jan 13 9:22 AM
Hi siva ,
when processing in mode A did you get any popups or anything which was not done by ok codes and you had to manually take an action .
‎2011 Jan 13 9:34 AM
hi
no i didnt do anything manually. using okcode popup only i did for all screens
‎2011 Jan 13 9:36 AM
Hi,
check the sy0subrc after the BDC call..
The sy-subrc returned after the call transaction is 1001
CALL TRANSACTION 'ME21' USING ITAB2 mode 'A' UPDATE 'S' MESSAGES INTO itab3.
if sy-subrc gt 1000.
"try to check popup..
endif.
read the error messages with the function mod 'FORMAT_MESSAGE'.
DATA: lv_MESSTAB(250).
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = SY-LANGU
NO = SY-MSGNO
V1 = SY-MSGV1
V2 = SY-MSGV2
V3 = SY-MSGV3
V4 = SY-MSGV4
IMPORTING
MSG = lv_messtab
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.
ENDIF.
Prabhudas
‎2011 Jan 13 9:59 AM
hi
yes i got sy-subrc returned as 1001. but its working fine in 'A' all screen mode in call transaction.
but in 'N' (no screen) mode i cant get the PO number in msgv2 in bdcmsgcoll...
‎2011 Jan 13 10:57 AM
If there is any sort of messages( ex: screen field not found,no batch inpput data etc ) then the mode N will fail. In mode A may be you are proceeding. In mode N what are you getting in the message tab othre than the final message.
‎2011 Jan 13 10:58 AM
Hi,
I also faced similar issue few months a go.
While creating recording in SHDB check the last checkbox 'Simulate Background Mode'
with that recording create your BDC is will work.
Regards
Bikas