Posts

Showing posts with the label at selection screen event in sap abap

Sample Program On AT SELECTION-SCREEN Event.

Image
Sample program On SET CURSOR FIELD. Sometimes there is a requirement to place the cursor on the field having a wrong value in the selection screen. REPORT ztest. TABLES:bsid. DATA: temp_hkont TYPE bsid-hkont, temp_kunnr TYPE bsid-kunnr, temp_bukrs TYPE bsid-bukrs. SELECT-OPTIONS: s_bukrs FOR bsid-bukrs. PARAMETERS: s_hkont LIKE bsid-hkont. PARAMETERS: s_kunnr LIKE bsid-kunnr. AT SELECTION-SCREEN. CLEAR: temp_hkont. IF s_hkont IS NOT INITIAL.     SELECT SINGLE hkont FROM bsid INTO temp_hkont                   WHERE hkont = s_hkont.       IF sy-subrc <> 0.           MESSAGE 'Enter a valid G/L Account' TYPE 'E'.       ENDIF. ENDIF. CLEAR: temp_kunnr. IF s_hkont IS NOT INITIAL.     SELECT SINGLE kunnr FROM bsid INTO temp_kunnr                   WHERE kunnr = s_kunnr. ...

SAP ABAP-AT SELECTION-SCREEN Event, Example With Output.

Image
At Selection-Screen Event gets triggered right after the Initialization event. This event is basically used to validate fields present in selection screen. Through this event, checks can be incorporated on selection screen fields and appropriate message can be sent back to the screen/user. In simple words, when the user enters the value in the fields of the selection screen and executes it , AT SELECTION-SCREEN event gets triggered. It is used to check or validate the values entered by the user for the fields on selection screen. Authority checks can also be performed in this event. This event gets triggered in two ways: When the user enters the value in the fields of selection screen and executes it (F8). When the user enters the “ENTER” BUTTON on the selection screen. DIFFERENT TYPES OF AT SELECTION-SCREEN EVENTS (In order of execution): At Selection-Screen Output. At Selection-Screen On Value Request For <Field>. At Selection-Screen On Help Request For ...