2008 May 12 7:17 AM
Hi all,
Im using a user exit USEREXIT_SAVE_DOCUMENT_PREPARE for assigning HU's.
During this process if i encounter an error, i want to show that in the log and the delivery should not be saved.
Im using transaction VL10A ( Background process)
Currently im using a subroutine message_handling. Using this im able to show all my errors in the log, but the delivery gets saved.
Can anuone suggest a method by which i can display the errors in the log while background processing and the delivery should not be saved.
Thank you .
Radhika.
Hi all,
Im using a user exit USEREXIT_SAVE_DOCUMENT_PREPARE for assigning HU's.
During this process if i encounter an error, i want to show that in the log and the delivery should not be saved.
Im using transaction VL10A ( Background process)
Currently im using a subroutine message_handling. Using this im able to show all my errors in the log, but the delivery gets saved.
Can anuone suggest a method by which i can display the errors in the log while background processing and the delivery should not be saved.
Thank you .
Radhika.
2008 May 12 7:21 AM
Hi
Using function module 'FORMAT_MESSAGE' you can capture the messages.
Regards
Kiran Sure
2008 May 12 7:34 AM
2008 May 12 7:35 AM
Hi radika,
U can catch the errors using the Function Module and Display them.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = it_messtab-msgid
lang = it_messtab-msgspra
no = it_messtab-msgnr
v1 = it_messtab-msgv1
v2 = it_messtab-msgv2
IMPORTING
msg = it_message
EXCEPTIONS
others = 0.
All the error meaages will be get stored in IT_MESSAGE.
Now u can process IT_MESSAGE and display the messages.
Beat regards,
raam
2008 May 12 8:54 AM
My requirement is that i want to display all these message in the delivery creation log and the respective delivery should not be saved ...
2009 Jun 05 11:33 AM
Hi
Have you found a solution ? Can you tell what it is ?
regards
2008 May 12 7:25 AM
Hi,
Using function module 'FORMAT_MESSAGE' you can capture the messages.
Here is a sample of the program code for that:
LOOP AT it_messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = it_messtab-msgid
lang = it_messtab-msgspra
no = it_messtab-msgnr
v1 = it_messtab-msgv1
v2 = it_messtab-msgv2
IMPORTING
msg = g_msg
EXCEPTIONS
OTHERS = 0.
IF it_messtab-msgtyp = 'S'.
it_sucess-sucess_rec = g_msg.
it_sucess-lifnr = it_header-lifnr." Based on your field
it_sucess-tabix = v_lines.
APPEND it_sucess.
ELSEIF it_messtab-msgtyp = 'E'.
it_error-error_rec = g_msg.
it_error-lifnr = it_header-lifnr.
it_error-tabix = v_lines.
APPEND it_error.
ELSE.
it_info-info_rec = g_msg.
it_info-lifnr = it_header-lifnr.
it_info-tabix = v_lines.
APPEND it_info.
ENDIF.
ENDLOOP.
Regards,
SHiva
2009 Nov 09 1:51 PM
Hi Radhika,
Did you manage to solved it? I have the same problem for VL04... I need to avoid the delivery creation if certain condition occurs, and add a message in the error log.