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

Former Member
0 Kudos

Hi all,

I am doing BDC using call Transaction to create Vendor, and getting messages into IT_messages.

my requirement is when the vendor is created , move some required fields to Ztable.

so i took the parameter "msgtyp", if it is not 'E' move the data to Ztable but

in the messages it giving first 'S' then 'E' with error message for one record.

Data is moving to Ztable but vendor is not getting created.

Please any suggestion on this.

Regards,

Sri

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi Srikanth,

Dont do it based on the returned message type, because for example 'NO BATCH INPUT DATA FOUND', This message will be returned with type 'S' ( Here your read statement fails ). Do it based on the sy-subrc value.

Do it like.

call transaction ....

if sy-subrc ne 0.

"Error occurred.

loop at it_mess into wa_mess.

"Here consider all the messages as error, build the message keeping a message type error as constant

endloop.

else.

no error

loop at it_mess into wa_mess.

"Here consider all the messages as success, build the message keeping a message type success as constant

endloop.

endif.

3 REPLIES 3

Former Member
0 Kudos

Hello Srikanth,

Loop through the message table to check for all lines. Are you doing this ?

But this is not the only criteria. There may be cases where message table does not contain any error messages, but SY-SUBRC returns 1001. Check this as well.

Why not go for a BAPI or else if you still want to use BDC, you can use the concept of events.

When a vendor in created a even will be raised. You have to create a receiver function module where you can push the entries to your Z table.

Rajavnsh

0 Kudos

Hi Ravi,

I solved it. using read statement.

READ it_messtad into wa_messtab with key 'E'

if sy-subrc = 0.

don't move data

else.

move the data.

endif.

Regards,

sri

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi Srikanth,

Dont do it based on the returned message type, because for example 'NO BATCH INPUT DATA FOUND', This message will be returned with type 'S' ( Here your read statement fails ). Do it based on the sy-subrc value.

Do it like.

call transaction ....

if sy-subrc ne 0.

"Error occurred.

loop at it_mess into wa_mess.

"Here consider all the messages as error, build the message keeping a message type error as constant

endloop.

else.

no error

loop at it_mess into wa_mess.

"Here consider all the messages as success, build the message keeping a message type success as constant

endloop.

endif.