Application Development 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: 

set cursor on a parameter

Former Member
0 Kudos

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....!

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

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

9 REPLIES 9

athavanraja
Active Contributor
0 Kudos

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

jayanthi_jayaraman
Active Contributor
0 Kudos

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

0 Kudos

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...

0 Kudos

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

0 Kudos

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>

0 Kudos

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!!!!!!

0 Kudos

at selection-screen on <param> should work - if it doesn't then just post your code here we can fix it.

Regards

Raja

0 Kudos

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....

Former Member
0 Kudos

Hi Jim

I think it is possible with Set Cursor Field P_error

u can try this.