09-29-2007 5:50 AM
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.
09-29-2007 5:54 AM
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.
09-29-2007 6:06 AM
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.
09-29-2007 6:20 AM
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
09-29-2007 6:29 AM
Can you paste your CALL TRANSACTION code here. Also let us know how are you doing error handling.
09-29-2007 7:09 AM
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.
09-29-2007 7:26 AM
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.
09-29-2007 8:04 AM
HEY I 'M NOT GETTIN THE SERVICE TICK NUM ..
IN MSGV1 I 'M GETTING SOME FIELD NAME...