ABAP/4
ABAP/4 Example Code: Factorial
DATA: output TYPE i.
PARAMETERS: p_num TYPE i.
START-OF-SELECTION.
PERFORM factorial USING p_num
CHANGING output.
WRITE:/ output.
*&---------------------------------------------------------------------*
*& Form factorial
*&---------------------------------------------------------------------*
* text
*-----------------------------------
- Add new comment
- Read more
- 2035 reads
ABAP/4 Example Code: Fibonacci
DATA: output TYPE i.
PARAMETERS: p_num TYPE i.
START-OF-SELECTION.
PERFORM fibonacci USING p_num
CHANGING output.
WRITE:/ output.
*&---------------------------------------------------------------------*
*& Form fibonacci
*&---------------------------------------------------------------------*
* text
*---------------------------------------
- Add new comment
- Read more
- 2339 reads
Delete PC Directory in ABAP/4
Example: We will delete directory ’Temp’ on drive C:
CALL FUNCTION ’GUI_REMOVE_DIRECTORY’
EXPORTING
DIRNAME = ’C:\Temp’
EXCEPTIONS
FAILED = 1
OTHERS = 2
&
- Add new comment
- Read more
- 917 reads
Create PC Directory in ABAP/4
Example: We will create directory ’Temp’ on drive C:
CALL FUNCTION ’GUI_CREATE_DIRECTORY’
EXPORTING
DIRNAME = ’C:\Temp’
EXCEPTIONS
FAILED = 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.
- Add new comment
- Read more
- 1560 reads
How to Get Name of Months in ABAP/4
You can get name of months by select table ’T247’
DATA: it_month_name TYPE TABLE OF t247 WITH HEADER LINE.
SELECT * INTO TABLE it_month_name FROM T247
WHERE spras = sy-langu.
or using function module ’MONTH_NAMES_GET’
DATA: it_month_name TYPE TABLE OF t247 WITH HEADER LINE.
CALL FUNCTION ’MONTH_NAMES_GET’
EXPORTING
LANGUAGE = SY-LANGU
* IMPORTING
* RETURN_CODE =
TABLES
MONTH_NAMES = it_month_name
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 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.
- Add new comment
- Read more
- 1827 reads
Related Function Module in SAPscript
Fn Name Description
START_FORM Start Layout Set
OPEN_FORM Open Layout Set
WRITE_FORM Write data by specified text element in window
WRITE_FORM_LINES Write data in TLINE structure to window
CLOSE_FORM Close Layout Set
END_FORM End Layout Set
CONTROL_FORM Create SAPscript Control Statement
- thitima's blog
- Add new comment
- Read more
- 1154 reads
Recent comments
3 years 4 weeks ago
3 years 9 weeks ago
3 years 9 weeks ago
3 years 10 weeks ago
3 years 10 weeks ago
3 years 12 weeks ago
3 years 12 weeks ago
3 years 12 weeks ago
3 years 13 weeks ago
3 years 13 weeks ago