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:
IF sy-ucomm = ' ' or sy-ucomm = 'ONLI'.
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 it is not setting. Why is this happening? What am I doing wrong? How can I set the cursor on a field in this situation?
Move your SET CURSOR FIELD before the message is output. Also, as S_WERKS is a select option, you need to specify S_WERKS-LOW.
Dig Deeper on SAP ABAP
Related Q&A from Matthew Billingham
An SAP user is trying to run a report in an SAP ALV Grid online and wants to know how to get the data in the report to appear along with the header. Continue Reading
An SAP user needs to transfer customer purchase order spreadsheet data to SAP VA01 to create a new sales order. Continue Reading
A SearchSAP.com reader wants to know if it's possible to write an SAP ABAP program that will read source code and then create an SAP ABAP function ... Continue Reading