Posts

Showing posts with the label sample code events

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