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

Message display issue

Former Member
0 Likes
762

Hi All,

I have created a program.

If user enters a wrong sales organization in the selection screen, the system should reflect an error message " Sales Organization xxxx does not exist".

For this, i have made the following code.

at selection-screen.

select single vkorg from tvko into tvko-vkorg where vkorg eq salesorg-low

or vkorg eq salesorg-high.

if sy-subrc ne 0.

message e001(zsd_r055).

endif.

In message class, i have written message as "Sales Organization & salesorg-low & does not exist".

But in the message, teh XXXX portion should reflect the value entered in the selection screen.

How to code it......??????

Regards

Pavan

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
726

Try

  SELECT-OPTIONS salesorg FOR tvko-vkorg.

  AT SELECTION-SCREEN ON salesorg.

    SELECT SINGLE vkorg FROM tvko INTO tvko-vkorg
      WHERE vkorg IN salesorg.
    IF sy-subrc NE 0.
      MESSAGE e001(zsd_r055) WITH salesorg-low salesorg-high.
    ENDIF.

Where text of message like 'xxxx &1 and &2 xxxxx'.

Regards

6 REPLIES 6
Read only

Former Member
0 Likes
726

Hi Pavan,

This is the example which I used in my program.

AT SELECTION-SCREEN.

*-----If no value has been entered.

IF p_vbeln IS INITIAL.

MESSAGE text-002 TYPE 'E'.

ENDIF.

Double click on text-002 and type the kind of message you would like to appear if p_vblen (parameter) is not entered.

TYPE 'E'. means that error reported is of type Error.

This should solve your query.

Reward Points if useful.

Thanks,

Tej..

Read only

Former Member
0 Likes
726

Hi

<b>You can give the message class along with the REPORT Name

MESSAGE-ID ZZ. then there is no need of giving along with the message.

and in the Message class define the message like

"Sales Organization & does not exist".

don't give field name

and in the message

message e001(zsd_r055) with salesorg-low.</b>

at selection-screen.

select single vkorg from tvko into tvko-vkorg where vkorg in salesorg.

if sy-subrc ne 0.

<b> message e001(zsd_r055) with salesorg-low.</b>

endif.

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
726

Hi Pavan,

Add this to your code,

Data : XXXX(10) Type c.

pass the salesorg-low value into XXXX.

Then In message class write this,

"Sales Organization" , XXXX, " does not exist".

Thanks.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
727

Try

  SELECT-OPTIONS salesorg FOR tvko-vkorg.

  AT SELECTION-SCREEN ON salesorg.

    SELECT SINGLE vkorg FROM tvko INTO tvko-vkorg
      WHERE vkorg IN salesorg.
    IF sy-subrc NE 0.
      MESSAGE e001(zsd_r055) WITH salesorg-low salesorg-high.
    ENDIF.

Where text of message like 'xxxx &1 and &2 xxxxx'.

Regards

Read only

Former Member
0 Likes
726

*Selection Screen validation for Company code

AT SELECTION-SCREEN ON p_vkorg.

Select single vkorg into l_vkorg

from tvko where vkorg = p_vkorg.

IF sy-subrc NE 0.

*Error message for Invalid Company Code

MESSAGE e001 WITH p_vkorg .

ENDIF.

Read only

0 Likes
726

and in message e00`1 give as

salesorg & doesnot exit.