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

Read Warning message and throw an additional error message

Former Member
0 Likes
1,355

Hi Experts,

I have a requirement.

When ever there is a warning message VL 150 is triggered during delivery creation.

An Error message as to be triggered, which will block the partial delivery being created.

Program : MV50AFZ1

User Exit :   FORM USEREXIT_SAVE_DOCUMENT_PREPARE.

Why i am not configuring this in the Message level is because i need this error to be triggered only to some order types.

Is it possible to read a warning message from the Error log from the user exit ?

I need the code to read the warning message and and throw an Error message stating that "The Part delivery is not allowed in "XXXX" Order types"

I am not from ABAP background. If this is possible then i will give the requirement to our technical team. 

Appreciate all your support.

1 ACCEPTED SOLUTION
Read only

roberto_vacca2
Active Contributor
0 Likes
1,067

Hi.

You should have  CVBFS table online and  with this code you'll get the warning message (If Present)

read table cvbfs with key MSGID  = 'VL'

                                       MSGNO = '150'

                                       MSGTY  = 'W'.

IF sy-subrc EQ 0.

"Throw your error message

ENDIF.

Hope to help

Bye

5 REPLIES 5
Read only

roberto_vacca2
Active Contributor
0 Likes
1,068

Hi.

You should have  CVBFS table online and  with this code you'll get the warning message (If Present)

read table cvbfs with key MSGID  = 'VL'

                                       MSGNO = '150'

                                       MSGTY  = 'W'.

IF sy-subrc EQ 0.

"Throw your error message

ENDIF.

Hope to help

Bye

Read only

0 Likes
1,067

Hi Roberto,

Many thanks for your reply.

I will try this with team and will let you know once it is done.

-

Kamal

Read only

0 Likes
1,067

Hi Roberto,

I have a requirement same as the above.

I need to change an error message into warning message only for a particular transaction.

I.e we need the error message during creation but not during changing.

Can you please help me with this ?

Appreciate your support

-

Kamal

Read only

0 Likes
1,067

Hi.

I don't know if I get it, but Usually you can verify creation/changing mode by watching sy-tcode field value.

Hope to help

Bye

Read only

0 Likes
1,067

Many thanks for your reply Roberto.