06-10-2005 9:23 AM
Hi,
I want my ABAP program to diplay an error message whenever a particular paramater is left blank. This will happen if a checkbox will be checked. If the error message will be displayed I also want the cursor to be put on that blank parameter. However if a checkbox will not be check there is no need to display an error message message.
PARAMETERS: p_error(200) TYPE c,
cb_check AS CHECKBOX.
AT SELECTION-SCREEN.
IF cb_check = 'X'.
IF p_error = space.
???????????????????????.
MESSAGE e055(00). "Error message
ENDIF.
ENDIF.
Question: what statement should be placed in ????????????????????????? part...
Thanks in Advance....!
06-10-2005 9:33 AM
Hi,
If you want specifically,try this.
SET CURSOR FIELD 'P_ERROR'.
Note:It should be in capital letter[p_error-won't work.]
Message was edited by: Jayanthi Jayaraman
06-10-2005 9:27 AM
AT SELECTION-SCREEN on p_error .
if cb_cehck eq 'X' and
p_error is initial .
MESSAGE e055(00). "Error message
endif .
check this out, this will meet your requirment.
If your question is answered, mark the thread as answered and close it.
Regards
Raja
06-10-2005 9:33 AM
Hi,
If you want specifically,try this.
SET CURSOR FIELD 'P_ERROR'.
Note:It should be in capital letter[p_error-won't work.]
Message was edited by: Jayanthi Jayaraman
06-10-2005 9:38 AM
The suggestion of Raja is good, but there were times when this validation doesnt work, sometimes error message were not displayed....
As for Jayanthi, I tried that statements it seems not working.
Anyway thanks for both of you...
If there are more suggestion I will greatly apprecitiate them...
06-10-2005 9:42 AM
Hi,
Try
SET CURSOR FIELD 'P_ERROR'.
P_ERROR should be in captial letters.
It worked.I tried.Try once more.
<b>Have a look at this link to reward points.
/people/mark.finnern/blog/2004/08/10/spread-the-love
Message was edited by: Jayanthi Jayaraman
06-10-2005 9:47 AM
The very purpose of AT SELECTION-SCREEN <b>on p_error</b> . is exactly to handle this kind of issues.
<i>but there were times when this validation doesnt work, sometimes error message were not displayed....</i>
what where those times? if you could explain the scenario we can find a solution.
Anyhow i guess with my answer your issue is resolved, if yes can you mark the thread as answered and close it.
Regards
Raja
<a href="/people/mark.finnern/blog/2004/08/10/spread-the-love to say THANKS the SDN way</a>
06-10-2005 9:47 AM
Hi Jayanthi,
Yes, It works, I've just forgot to put single quotes on P_ERROR.... it should be 'P_ERROR'...
Thanks a lot,
And to all of you who tried to help me thanks so much!!!!!!
06-10-2005 9:49 AM
at selection-screen on <param> should work - if it doesn't then just post your code here we can fix it.
Regards
Raja
06-10-2005 10:00 AM
PARAMETERS: p_file(200) TYPE c,
p_error(200) TYPE c,
cb_check AS CHECKBOX.
AT SELECTION-SCREEN on p_error.
IF cb_check = 'X'.
if p_error is initial.
MESSAGE e055(00).
endif.
endif.
Above is my initial code..
After I type value on the parameter p_file, and check cb_check right away (without putting my cursor on p_error), an error message was not displayed.
Raja, Thanks so much for your effort....
06-10-2005 9:35 AM
Hi Jim
I think it is possible with Set Cursor Field P_error
u can try this.