‎2007 Jun 07 7:24 AM
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
‎2007 Jun 07 7:30 AM
‎2007 Jun 07 7:29 AM
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..
‎2007 Jun 07 7:29 AM
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
‎2007 Jun 07 7:29 AM
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.
‎2007 Jun 07 7:30 AM
‎2007 Jun 07 7:32 AM
*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.
‎2007 Jun 07 7:33 AM