‎2005 Aug 21 7:40 AM
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.
‎2005 Aug 21 8:01 AM
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
‎2005 Aug 21 8:45 AM
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
‎2005 Aug 21 3:18 PM
Should be like this ,Thats all.
SET CURSOR FIELD 'S_WERKS'.
MESSAGE e023 WITH text-e04.