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

to show error message while creating sales order

Former Member
0 Likes
1,290

Hello All, My requirement is to display error message when a field(xxx) is not populated in the item level.

The same field(xxx) is at header level also and error message should not be populated if it is blank.

Am using the Include MV45AFZZ for the same and have written my code in the subroutine

  USEREXIT_SAVE_DOCUMENT_PREPARE.

Now while saving it is through message when the header field(xxx) is blank and the item data is not yet prepared.

Hello All, My requirement is to display error message when a field(xxx) is not populated in the item level.

The same field(xxx) is at header level also and error message should not be populated if it is blank.

Am using the Include MV45AFZZ for the same and have written my code in the subroutine

  USEREXIT_SAVE_DOCUMENT_PREPARE.

Now while saving it is through message when the header field(xxx) is blank and the item data is not yet prepared.

5 REPLIES 5
Read only

lijisusan_mathews
Active Contributor
0 Likes
962

Which internal table have you used to check the values? You must have used the one with header data.

Suzie

Read only

0 Likes
962

Hi Suzie,

The problem is both the header as well as item is referring to the same structure VBKD.

Read only

0 Likes
962

Header and Item levels records are generally in different internal tables even though the structure is different..

There has to be table starting with X like Xvbkd etc.. with the required data.

Just check the Global s tab in debugging mode, to check if any other tables are available.

Read only

0 Likes
962

Hello Liji,

I am using XVBKD structure, the problem is while creating the sales order I am chacking if xvbkd-posnr is having value ( i.e. not equal to zero) and field XX is blank then raise an error message.

When I am creating the sales order and gave the basic data and saved, it is getting saved without displaying error message. when I have check in debugging POSNR value is 0 the condition is failed and error message is not being displayed.

Read only

0 Likes
962

I din't get what you said, but is this what you are trying to do?

if ( xvbkd-posnr is not initial ) and ( xvbkd-posnr ne '000000' ).

Chk field xx <> space.

endif.