Application Development and Automation 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: 
Read only

Capturing messages in BDC

Bema
Active Participant
0 Likes
753

Hi,

I have to do the recording for transaction AS01.If I enter , 20 for the no: of similar assets field, it will create 20 fixed assets with similar fields.

Can I capture these 20 Fixed asset nos in BDC.I am using Call transaction Method.

Regards,

Beena

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
701

Hi

You can get all messages by message table:

DATA: T_MESSAGES TYPE TABLE OF BDCMSGCOLL.

CALL TRANSACTION tcod

..................

MESSAGES INTO T_MESSAGES.

Max

Hi,

I have to do the recording for transaction AS01.If I enter , 20 for the no: of similar assets field, it will create 20 fixed assets with similar fields.

Can I capture these 20 Fixed asset nos in BDC.I am using Call transaction Method.

Regards,

Beena

6 REPLIES 6
Read only

Former Member
0 Likes
702

Hi

You can get all messages by message table:

DATA: T_MESSAGES TYPE TABLE OF BDCMSGCOLL.

CALL TRANSACTION tcod

..................

MESSAGES INTO T_MESSAGES.

Max

Read only

Former Member
0 Likes
701

You can get it in the following way :

DATA: i_MESSAGES TYPE TABLE OF BDCMSGCOLL.

CALL TRANSACTION AS01 MESSAGES INTO i_MESSAGES.

Now you can get the message by looping this i_messages internal table.

Regards,

Subho

Read only

Former Member
0 Likes
701

Hi Beena ,

Do as Max suggested.

call transaction 'AS01' using bdcdata options from xctuparams messages into it_messages.

loop at it_messages.

call function 'FORMAT_MESSAGE'

.

..

*write the message

endloop.

Read only

Former Member
0 Likes
701

Hai Beena

Go through the following way for capturing Error records using Messages

data : it_messages like bdcmsgcoll occurs 0 with header line.

data : V_message(255).

call transaction 'XK01' using it_bdc

mode 'N'

update 'S'

messages into it_messages.

if sy-subrc <> 0.

if V_flag <> 'X'.

perform open_group.

V_flag = 'X'.

endif.

perform bdc_transaction. "using 'XK01'.

endif.

perform format_messages.

refresh : it_bdc,it_messages.

&----


*& Form format_messages

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM format_messages .

loop at it_messages.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = it_messages-MSGID

LANG = 'EN'

NO = it_messages-MSGNR

V1 = it_messages-MSGV1

V2 = it_messages-MSGV2

V3 = it_messages-MSGV3

V4 = it_messages-MSGV4

IMPORTING

MSG = V_message

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.

write : / V_message.

clear : V_message.

endloop.

ENDFORM. " format_messages

Thanks & regards

Sreenivasulu P

Read only

Former Member
0 Likes
701

Hi Beena ,

You can very well capture your asset nos.

once you catch all your messages into t_bdcmsgcoll , try with this pseudo code.

loop at t_bdcmsgcoll where msgtyp = 'S'.

t_assetno = t_bdcmsgcoll-msgv1 .

append t_assetno .

endloop.

In the table t_assetno now you will have all your asset numbers.

Regards,

Raghav

Read only

Former Member
0 Likes
701

Hi Beena,

Yes u can do it!!!

u have to define an internal table of type BDCMSGCOLL which is a table for messages only u jus have to add a statement when u use CALL TRANSACTION-

MESSAGES INTO ITAB.

ITAB IS UR INTERNAL TABLE OF TYPE BDCMSGCOLL.

Hope this helps.

Seema.