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

Error log handling during delivery creation

Former Member
0 Likes
2,123

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.

7 REPLIES 7
Read only

Former Member
0 Likes
1,300

Hi

Using function module 'FORMAT_MESSAGE' you can capture the messages.

Regards

Kiran Sure

Read only

0 Likes
1,300

using this FM... the errors would show up in the log ???

Read only

0 Likes
1,300

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

Read only

0 Likes
1,300

My requirement is that i want to display all these message in the delivery creation log and the respective delivery should not be saved ...

Read only

0 Likes
1,300

Hi

Have you found a solution ? Can you tell what it is ?

regards

Read only

Former Member
0 Likes
1,300

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

Read only

Former Member
0 Likes
1,300

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.