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: 

bdcmsgcoll

Former Member
0 Kudos

I am updating single record thro crmd_order transaction ...

service ticket is generated by system ...

i need to get the service ticket number as information message ..

help me pls with lil code n logic ... u 'll b highly rewarded..

Thanks in advance.

7 REPLIES 7

Former Member
0 Kudos

I believe you are using CALL TRANSACTION to update data. In this you must be getting all messages to an internal table.

Read last record of internal table and format the same using fm FORMAT_MESSAGE. If message type is 'S', then display associated message as information message.

varma_narayana
Active Contributor
0 Kudos

Hi..

Try this Logic.

Loop at itab.

Perform Mapping.

Call transaction '<tcode>'

using it_bdcdata

mode 'N'

Message into it_bdcmsgcoll.

if sy-subrc = 0.

Describe table it_bdcmsgcoll.

Read table it_bdcmsgcoll into wa_bdcmsgcoll index sy-tfill. "Last record

MESSAGE ID wa_bdcmsgcoll-MSGID

TYPE 'I'

NUMBER wa_bdcmsgcoll-MSGNR

WITH wa_bdcmsgcoll-MSGV1

wa_bdcmsgcoll-MSGV2

wa_bdcmsgcoll-MSGV3

wa_bdcmsgcoll-MSGV4.

Endif.

Reward if Helpful.

Refresh it_bdcmsgcoll .

Refresh it_bdcdata .

Endloop.

Former Member
0 Kudos

Thanks for the responce guys ...

But the problem is whn i try to debug the it_bdcmsgcoll i am not getting any data ..

any suggestions plz

0 Kudos

Can you paste your CALL TRANSACTION code here. Also let us know how are you doing error handling.

Former Member
0 Kudos

CALL TRANSACTION 'CRMD_ORDER' USING IT_BDCDATA MODE 'N'

messages into messtab.

READ TABLE MESSTAB WITH KEY MSGTYP = 'S'.

IF SY-SUBRC = 0.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = MESSTAB-MSGID

LANG = MESSTAB-MSGSPRA

NO = MESSTAB-MSGNR

V1 = MESSTAB-MSGV1

V2 = MESSTAB-MSGV2

V3 = MESSTAB-MSGV3

V4 = MESSTAB-MSGV4

IMPORTING

MSG = L_MSTRING

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.

ENDIF.

0 Kudos

Hi..

Note : After call transaction it will always the Store the messages in thos table.

Try this way .. using break-points.

CALL TRANSACTION 'CRMD_ORDER' USING IT_BDCDATA MODE 'N'

messages into messtab.

IF SY-SUBRC = 0.

BREAK-POINT.

READ TABLE MESSTAB WITH KEY MSGTYP = 'S'.

IF SY-SUBRC = 0.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = MESSTAB-MSGID

LANG = MESSTAB-MSGSPRA

NO = MESSTAB-MSGNR

V1 = MESSTAB-MSGV1

V2 = MESSTAB-MSGV2

V3 = MESSTAB-MSGV3

V4 = MESSTAB-MSGV4

IMPORTING

MSG = L_MSTRING

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

ENDIF.

ELSE.

BREAK-POINT.

ENDIF.

REWARD IF HELPFUL.

Former Member
0 Kudos

HEY I 'M NOT GETTIN THE SERVICE TICK NUM ..

IN MSGV1 I 'M GETTING SOME FIELD NAME...