09-25-2008 4:03 AM
Helo Experts,
I have developed a BDC program using transaction XK01.After executing this progarm I m able to successfully create vendor code.
At the end of Program , it shows msg like
S Vendor 000045734 has been created for company code XYZ Purcahsing Organization 8900
(this msg is auto generated by BDC).
I m not able to capture it in internal table.
Plz tell where this BDC generated code is saved.
Ravi
09-25-2008 4:10 AM
If you are using call transaction then
data : msgtab type standard table of BDCMSGCOLL.
Use CALL TRANSACTION .... MESSAGES INTO msgtab.
a®
09-25-2008 4:08 AM
Are you doing a call Transaction or you execute the session from SM35 ? If you are doing a Call Transaction you can capture messages in the BDCMSGCOLL table.
A
09-25-2008 4:12 AM
Hello Aman,
Can u plz provide me sample code.
Thanks in advance.
Ravi
09-25-2008 4:14 AM
Below is Sample Code which calls T-Code SU01.
* Batch-Input-Data and Messages
DATA: itwa_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE,
itwa_messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
* Batch-Input-Parameter
DATA wa_btci_para LIKE ctu_params.
* Set Batch-Input-Parameter
wa_btci_para-dismode = 'N'. "Mode 'No Display'(Mode A/E/N)
wa_btci_para-updmode = 'S'. "synchronous Posting
CALL TRANSACTION 'SU01' USING itwa_bdcdata OPTIONS FROM wa_btci_para
MESSAGES INTO itwa_messtab.
For more user friendly messages you can Convert the BDCMSGCOLL to table to BAPIRET2 using FM CONVERT_BDCMSGCOLL_TO_BAPIRET2.
Aman
09-25-2008 4:10 AM
If you are using call transaction then
data : msgtab type standard table of BDCMSGCOLL.
Use CALL TRANSACTION .... MESSAGES INTO msgtab.
a®
09-25-2008 4:19 AM
Hello,
I m doing like this.But it is not executing
data : msgtab type standard table of BDCMSGCOLL.
data: begin of it_bdcdata occurs 0.
include structure bdcdata.
data: end of it_bdcdata.
loop at it_success.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'USE_ZAV'.
perform bdc_field using 'BDC_OKCODE'
....
.....
CALL TRANSACTION 'XK01' using it_bdcdata MESSAGES INTO msgtab.
Ravi
09-25-2008 4:32 AM
>CALL TRANSACTION 'XK01' using it_bdcdata MESSAGES INTO msgtab.
you are not at all speicying the mode and update in the above code...>? how are you activating then..?
09-25-2008 4:10 AM
Hi,
Use the the addition 'MESSAGES INTO ...' along with CALL TRANSACTION statement.
The message internal table should be in type of something like BDCMSGCOLL.
Regards,
R.Nagarajan.
09-25-2008 4:10 AM
hai,
information message that u r getting in genrated by t.code
xk01( that is standard) . so while recording give some vendor that is exiting for that company code and p.org , and record
so that u will be getting that message also in bdcdata.
shan.
09-25-2008 4:43 AM
hai,
do new recording such that information message also should be recorded (message ur getting is generated by system itself so while recording , record in such a way with vendor already present for that company.code and p.org)
shan.
09-25-2008 4:50 AM
> do new recording such that information message also should be recorded
is it..?
09-25-2008 4:56 AM
> do new recording such that information message also should be recorded
sucess messages get generated after SAVE, so recording not possbile for info message after SAVE
a®
09-25-2008 6:43 AM
call transaction 'ME63' using bdcdata mode 'N' update 'S' messages into messtab.
loop at messtab.
select single * from t100 where sprsl = messtab-msgspra
and arbgb = messtab-msgid
and msgnr = messtab-msgnr.
if sy-subrc = 0.
l_mstring = t100-text.
if l_mstring cs '&1'.
replace '&1' with messtab-msgv1 into l_mstring.
replace '&2' with messtab-msgv2 into l_mstring.
replace '&3' with messtab-msgv3 into l_mstring.
replace '&4' with messtab-msgv4 into l_mstring.
replace '&5' with space into l_mstring.
replace '&6' with space into l_mstring.
replace '&7' with space into l_mstring.
replace '&8' with space into l_mstring.
else.
replace '&' with messtab-msgv1 into l_mstring.
replace '&' with messtab-msgv2 into l_mstring.
replace '&' with messtab-msgv3 into l_mstring.
replace '&' with messtab-msgv4 into l_mstring.
endif.
condense l_mstring.
wa_log-msgtyp = messtab-msgtyp.
wa_log-lifnr = wa_elbk-lifnr.
wa_log-msg = l_mstring.
append wa_log to it_log.
clear wa_log.
clear wa_elbk.
endif.
endloop.
You can declare an internal table and append yhese messages as i have done in it_log.
types : begin of t_log,
msgtyp type c,
lifnr type elbk-lifnr,
msg(255) type c,
end of t_log.