ABAP/4
Date Mask Template in command SET DATE MASK for SAPscript
Syntax
/: SET DATE MASK = ’template’
Template Description
DD Day 2 digits
DDD Short name of day
DDDD Long name of day
MM Month 2 digits
MMM Short name of month
MMMM Long name of month
YY Year 2 digits
YYYY Year 4 digits
Example
SAPscript
- thitima's blog
- Add new comment
- Read more
- 4900 reads
How to initial value of SELECT-OPTIONS in ABAP/4
We can initial value of SELECT-OPTIONS in event INITIALIZATION.
Example
TABLES: sflight.
SELECT-OPTIONS: s_carrid FOR sflight-carrid.
INITIALIZATION.
s_carrid-sign = ’I’.
s_carrid-option = ’EQ’.
s_carrid-low = ’AA’.
APPEND s_carrid.
s_carrid-low = ’AB’.
APPEND s_carrid.
s_carrid-low = ’AC’.
APPEND s_carrid.
The output is:
- thitima's blog
- 1 comment
- Read more
- 14339 reads
Loop ... Assigning & Loop ... Into in ABAP/4
Loop ... Into
LOOP AT itab INTO wa_tab.
...
...
...
wa_tab-fld1 = ’X’.
MODIFY itab FROM wa_tab.
ENDLOOP.
Loop ... Assigning
Loop ... Assigning is faster than Loop ... Into because when you modify field-symbol, system automatically update data in internal table.
LOOP AT itab ASSIGNING.
...
...
...-fld1 = ’X’.
ENDLOOP.
- thitima's blog
- Add new comment
- 6739 reads
ABAP/4 Example Code: Download ABAP Spool to PDF
*** This program receive spool id and destination file name ***
DATA: it_pdf TYPE TABLE OF TLINE WITH HEADER LINE,
gv_string TYPE string.
PARAMETERS: p_spool LIKE TSP01-RQIDENT,
p_file LIKE RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION ’KD_GET_FILENAME_ON_F4’
EXPORTING
* PROGRAM_NAME = SYST-REPID
* &nb
- thitima's blog
- Add new comment
- Read more
- 3866 reads
ABAP/4 Example Code: Download OTF Spool to PDF
*** This program receive spool id and destination file name ***
DATA: it_pdf TYPE TABLE OF TLINE WITH HEADER LINE,
gv_string TYPE string.
PARAMETERS: p_spool LIKE TSP01-RQIDENT,
p_file LIKE RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION ’KD_GET_FILENAME_ON_F4’
EXPORTING
* PROGRAM_NAME = SYST-REPID
* DYNPRO_N
- thitima's blog
- Add new comment
- Read more
- 3277 reads
How to define macro in ABAP/4
We can define macro by apply statement DEFINE ... END-OF-DEFINITION.
Example
Note: You can define parameters only 9 (&1 ...
DATA: itab TYPE TABLE OF sflight WITH HEADER LINE.
RANGES: r_carrid FOR sflight-carrid.
DEFINE append_range.
&1-sign = &2.
&1-option = &3.
&1-low = &4.
append &1.
END-OF-DEFINITION.
INITIALIZATION.
append_range r_carrid ’I’ ’EQ’ ’AA’.
append_range r_carrid ’I’ ’EQ’ ’AB’.
START-OF-SELECTION.
SELECT * FROM sflight INTO TABLE itab
WHERE carrid in r_carrid.
IF SY-SUBRC = 0.
LOOP AT itab.
WRITE:/ itab-carrid, itab-connid, itab-fldate.
ENDLOOP.
ENDIF.
- thitima's blog
- Add new comment
- Read more
- 3087 reads
Recent comments
3 years 29 weeks ago
3 years 34 weeks ago
3 years 35 weeks ago
3 years 35 weeks ago
3 years 36 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago