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

Set cursor problem.

gopalkrishna_baliga
Participant
0 Likes
528

I have a selection screen where I have a parameter and a select-option.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS : p_apofan type ymsm_apo_ahsname-apo_fan_name OBLIGATORY.

SELECT-OPTIONS s_werks FOR wa_werks.

SELECTION-SCREEN END OF BLOCK b1.

i am validating data entry in these fields at screen-selection:

AT SELECTION-SCREEN.

IF sy-ucomm = ' ' or sy-ucomm = 'ONLI'.

PERFORM validate_apofan.

PERFORM validate_plant.

endif.

In the validation subroutine i have written validation code. If it not valid then show error message and set the cursor.

MESSAGE e023 WITH text-e04.

SET CURSOR FIELD 'S_WERKS'.

But the cursor is not setting in s_werks field. What is the problem?

I have even tried SET CURSOR FIELD 'S_WERKS-LOW' and even then it is not setting.

Why is this happening? What am I doing wrong? how to set the cursor on a field in this situation?

Please help me.

3 REPLIES 3
Read only

athavanraja
Active Contributor
0 Likes
477

try

at selection-screen on s_werks .

    • do the validation for s_werks here

at selection-screen on p_apofan .

    • do the validation for p_apofan here

with this method you just need to issue the error message. no need the set the cursor , it will automatically happen.

Regards

Raja

Read only

Former Member
0 Likes
477

Hi,

You can't use "SET CURSOR" in PAI event ( AT SELECTION-SCREEN is PAI ). You can use "SET CURSOR" in PBO (AT SELECTION-SCREEN OUTPUT ). Also when you use SELECT-OPTIONS is better to specify the field (s_werks-low or s_werks-high). If you use error message in PBO, your screen will not be processed, so it's better to use in PBO anther type of message ( type "S").

If you find some answers useful, please assign reward points.

Svetlin

Message was edited by: Svetlin Rusev

Read only

Former Member
0 Likes
477

Should be like this ,Thats all.

SET CURSOR FIELD 'S_WERKS'.

MESSAGE e023 WITH text-e04.