Application Development 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: 

BDC

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

If you are using call transaction then


data : msgtab type standard table of BDCMSGCOLL.

Use CALL TRANSACTION .... MESSAGES INTO msgtab.

12 REPLIES 12

Former Member
0 Kudos

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

0 Kudos

Hello Aman,

Can u plz provide me sample code.

Thanks in advance.

Ravi

0 Kudos

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

former_member194669
Active Contributor
0 Kudos

If you are using call transaction then


data : msgtab type standard table of BDCMSGCOLL.

Use CALL TRANSACTION .... MESSAGES INTO msgtab.

0 Kudos

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

0 Kudos

>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..?

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

> do new recording such that information message also should be recorded

is it..?

0 Kudos

> 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

Former Member
0 Kudos

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.