ABAP/4
How to create User Groups for ABAP/4 Query
When you create ABAP/4 query in SAP, assigning the user group is a necessary process. The user group specify who are authorized to use the ABAP/4 query. You can create the user group as following:
- Go to transaction SQ03
- Input user group name that want to create and click . System will popup screen for input user group description.
In the example, i want to create user group name ’USRGRP1’.
- thitima's blog
- Add new comment
- Read more
- 2010 reads
Step to create ABAP/4 Query
The ABAP/4 query is one method in ’SAP R/3 Report Development Tools’. You can create the simply report by this way. In this way, we have 4 mains steps to create it as following:
- Create User Groups
- Create InfoSets
- Assign user group to infoSet.(You can swap create infoSets as first and create user groups as second.)
- Create the query base on the selected infoSet
- thitima's blog
- 2 comments
- Read more
- 1740 reads
How to insert alternative comand in SAP smartforms
The alternative command looks like IF statement in ABAP/4.
IF (condition) {
*** True ***
...
} ELSE {
*** False ***
...
}.
You can insert alternative command as follows:
- Select window that you want to insert alternative command and right click. System will list object that you can create.
In the example, I have window name ’%WINDOW1’ and I want to insert alternative command in this window.
- thitima's blog
- Add new comment
- Read more
- 2652 reads
ABAP/4 Example Code: ALV List by FM 'REUSE_ALV_LIST_DISPLAY'
Example
TYPE-POOLS: SLIS.
DATA: it_spfli TYPE TABLE OF spfli WITH HEADER LINE,
it_cat TYPE SLIS_T_FIELDCAT_ALV,
wa_cat TYPE slis_fieldcat_alv.
START-OF-SELECTION.
SELECT * FROM spfli
INTO TABLE it_spfli.
PERFORM create_field_catalog.
CALL FUNCTION ’REUSE_ALV_LIST_DISPLAY’
EXPORTING
* I_INTERFACE_CHECK = ’ ’
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ’ ’
* I_CALLBACK_PROGRAM = ’ ’
* I_CALLBACK_PF_STATUS_SET = ’ ’
* I_CALLBACK_USER_COMMAND = ’ ’
* I_STRUCTURE_NAME =
* IS_LAYOUT =
IT_FIELDCAT = it_cat[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = ’X’
* I_SAVE = ’ ’
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IR_SALV_LIST_ADAPTER =
* IT_EXCEPT_QINFO =
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = it_spfli
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*&---------------------------------------------------------------------*
*& Form create_field_catalog
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM create_field_catalog .
IF it_cat[] is initial.
clear wa_cat.
wa_cat-col_pos = 1.
wa_cat-fieldname = ’CARRID’.
wa_cat-datatype = ’CHAR’.
wa_cat-inttype = ’C’.
wa_cat-intlen = 3.
wa_cat-seltext_l = ’Airline Code’.
wa_cat-seltext_m = ’Airline Code’.
wa_cat-seltext_s = ’Airline Code’.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 2.
wa_cat-fieldname = ’CONNID’.
wa_cat-datatype = ’NUMC’.
wa_cat-inttype = ’N’.
wa_cat-intlen = 4.
wa_cat-seltext_l = ’Flight Conn. No’.
wa_cat-seltext_m = ’Flight Conn. No’.
wa_cat-seltext_s = ’Flight Conn. No’.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 3.
wa_cat-fieldname = ’CITYFROM’.
wa_cat-datatype = ’CHAR’.
wa_cat-inttype = ’C’.
wa_cat-intlen = 20.
wa_cat-seltext_l = ’Dep. city’.
wa_cat-seltext_m = ’Dep. city’.
wa_cat-seltext_s = ’Dep. city’.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 4.
wa_cat-fieldname = ’AIRPFROM’.
wa_cat-datatype = ’CHAR’.
wa_cat-inttype = ’C’.
wa_cat-intlen = 3.
wa_cat-seltext_l = ’Dep. airport’.
wa_cat-seltext_m = ’Dep. airport’.
wa_cat-seltext_s = ’Dep. airport’.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 5.
wa_cat-fieldname = ’CITYTO’.
wa_cat-datatype = ’CHAR’.
wa_cat-inttype = ’C’.
wa_cat-intlen = 20.
wa_cat-seltext_l = ’Arrival city’.
wa_cat-seltext_m = ’Arrival city’.
wa_cat-seltext_s = ’Arrival city’.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 6.
wa_cat-fieldname = ’AIRPTO’.
wa_cat-datatype = ’CHAR’.
wa_cat-inttype = ’C’.
wa_cat-intlen = 3.
wa_cat-seltext_l = ’Dest. airport’.
wa_cat-seltext_m = ’Dest. airport’.
wa_cat-seltext_s = ’Dest. airport’.
append wa_cat to it_cat.
ENDIF.
ENDFORM. " create_field_catalog
- thitima's blog
- 2 comments
- Read more
- 19262 reads
Global data in SAP smartforms
We can define global variables in SAP smartforms but these are not contained in form interface by define them in Global Settings -> Global Definitions and select Global Data tab.
See above picture, we can define variable from:
- Data type (DATE, CHAR, NUMC etc.)
- Structure in Data Dictionary
- Defined Type in Types tab
Technorati Tags: ABAP,
- thitima's blog
- Add new comment
- Read more
- 1804 reads
Difference between MOVE ... TO and WRITE ... TO in ABAP/4
See Example
DATA: gv_char1(20) TYPE c,
gv_char2(20) TYPE c,
dec1(10) TYPE p DECIMALS 2 VALUE ’122345.89’.
START-OF-SELECTION.
* Date *
WRITE:/ ’Date variable’.
WRITE sy-datum to gv_char1.
WRITE:/ ’WRITE TO ’, gv_char1.
MOVE sy-datum to gv_char2.
WRITE:/ ’MOVE TO ’, gv_char2.
SKIP 1.
* Decimal *
WRITE:/ ’Decimal variable’.
WRITE dec1 to gv_char1.
WRITE:/ ’WRITE TO ’, gv_char1.
MOVE dec1 to gv_char2.
WRITE:/ ’MOVE TO ’, gv_char2.
- thitima's blog
- Add new comment
- Read more
- 5274 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