You can check the SAP demo programs starting with BCALV_GRID_*
You can check the SAP demo programs starting with BCALV_GRID_*
You can simply add integer value if your variable is typed DATUM.
DATA : lw_date TYPE sy-datum.
lw_date = '20170927'.
lw_processed_date = lw_date + 5.
* ==> lw_processed_date = 20171002
In theory, you can’t access the text symbols of one program into another program.
They are program dependent.
Nevertheless, if you need to do that, there is the following statement in ABAP.
DATA : li_textpool TYPE TABLE OF textpool.
READ TEXTPOOL 'SAPLLCPP' INTO li_textpool LANGUAGE sy-langu.
The code below shows how to retrieve a characteristic value in mass.
The characteristic in example is named INDICE.
Read More
The goal is to call Transaction with parameters and skip first screen.
Example to call the Prod Order display transaction :
SET PARAMETER ID 'ANR' FIELD w_of_number.
CALL TRANSACTION 'CO03' AND SKIP FIRST SCREEN.
The example below show how to call a transaction and skip first screen when it in not possible to SET parameters ID.
Read More
To display content of internal table into ALV grid, use this method :
DATA : lo_table TYPE REF TO cl_salv_table.
* Create ALV
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lo_table
CHANGING
t_table = gi_data_to_display ).
CATCH cx_salv_msg.
ENDTRY.
* Display ALV grid
lo_table->display( ).
Example of use in SAP demo program : SALV_DEMO_TABLE_REAL_SIMPLE.
DATA : lw_char10 TYPE char10,
lw_vbeln TYPE vbeln.
lw_char10 = '300841'.
UNPACK lw_char10 TO lw_vbeln. " ==> LW_VBELN = 0000300841
SHIFT lw_char LEFT DELETING LEADING '0'.
Several synthax below to do the same thing :
(Notice that you have to work with a field type CHAR to remove the ZERO, will not work with a NUMC variable)
DATA : li_tab TYPE TABLE OF trdir-name,
infotab TYPE t_varinfo OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'PRINT_SELECTIONS'
EXPORTING
mode = li_tab
rname = sy-repid "program name
rvariante = '' "variant name
TABLES
infotab = infotab.
LOOP AT infotab.
WRITE / infotab-line.
ENDLOOP.
Macros that I’m using for formatting reports quicker.
Theses are declared in the TOP of report.