Posts

Showing posts with the label ABAP

How to access an internal table of one program in another program

Image
How to access an internal table of one program in another program. Step 1. Declare a Data Type DATA :  ls_data  TYPE REF TO data . TYPES  DATE_RANGE  TYPE  RANGE  OF  SY - DATUM . Step 2. Declare Field Symbols. FIELD-SYMBOLS :  <lt_data>  TYPE table . Step 3. Create a Ranges and selection parameter as per your Requirement DATA ( DATE ) =  VALUE  DATE_RANGE (    (  SIGN  =  'I'  OPTION  =  'BT'  LOW  =  '20180820'  HIGH  =  '20180820' ) ). Step 4. The below code will restrict ALV to display. cl_salv_bs_runtime_info => set (  EXPORTING  display   =  abap_false                                   ...

Handle and show SQL Exception show in popup message box in SAP ABAP

Image
1. Delare a variable ( lo_exc). You can use any word. DATA   lo_exc  TYPE REF TO  cx_root . 2. Use TRY and CATCH Syntax TRY. select single MATNRR from MARA INTO (varable) UP TO 1 ROWS. CATCH    CX_SY_DYNAMIC_OSQL_SEMANTICS INTO lo_exc. MESSAGE lo_exc TYPE 'I' DISPLAY LIKE 'E'. ENDTRY. Note: This Exception (  CX_SY_DYNAMIC_OSQL_SEMANTICS  ) return SQL Query Errors. Result: