ABAP/4
ABAP/4 Example Code: How to call SAPscript form from ABAP report
Now we already have SAPscript form name ’ZFORM001’ and in this form we have element ’LINE1’ on window ’MAIN’. We want to call this form from ABAP report.
Example:
START-OF-SELECTION.
PERFORM OPEN_FORM.
PERFORM START_FORM.
PERFORM WRITE_FORM USING ’LINE1’.
PERFORM END_FORM.
PERFORM CLOSE_FORM.
*&---------------------------------------------------------------------*
*& Form OPEN_FORM
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM OPEN_FORM .
CALL FUNCTION ’OPEN_FORM’
* EXPORTING
* APPLICATION = ’TX’
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
* DEVICE = ’PRINTER’
* DIALOG = ’X’
* FORM = ’ ’
* LANGUAGE = SY-LANGU
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = ’*’
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
CODEPAGE = 11
OTHERS = 12
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
- thitima's blog
- Add new comment
- Read more
- 11411 reads
ABAP/4 Example Code: SAVE_TEXT
You can create and save long text by apply function module ’SAVE_TEXT’.
Example: We will create program for create standard text. The created text will be contained text ’Test Create Text’. you can input name of long text on selection screen. After you run this program, you can check the output of program in transaction SO10 (Standard Text).
DATA: GW_THEAD LIKE THEAD,
IT_LINE TYPE TABLE OF TLINE WITH HEADER LINE.
PARAMETERS: P_TXTNAM LIKE THEAD-TDNAME.
START-OF-SELECTION.
- thitima's blog
- Add new comment
- Read more
- 10325 reads
ABAP/4 Example Code: GET & GET ... LATE
*** Using Logical Database: F1S ***
TABLES: SPFLI,
SFLIGHT,
SBOOK,
SCARR.
START-OF-SELECTION.
GET SPFLI.
WRITE:/ ’SPFLI: ’, SPFLI-CARRID, SPFLI-CONNID, SPFLI-AIRPFROM, SPFLI-AIRPTO.
GET SFLIGHT.
WRITE:/ ’ SFLIGHT: ’, SFLIGHT-CARRID, SFLIGHT-CONNID,
SFLIGHT-FLDATE.
GET SBOOK.
WRITE:/ ’ SBOOK: ’, SBOOK-CARRID, SBOOK-CONNID,
- thitima's blog
- Add new comment
- Read more
- 2586 reads
How to define variable in SAPscript
You can define variable in SAPscript by apply statement ’DEFINE’.
Example: We will define variable name = ’TXT1’ and initial value = ’Text1’. After we already define it, we will write a value of field.
/: DEFINE &TXT1& = ’Text1’
* Test Define Text = &TXT1&
The Output is
- thitima's blog
- Add new comment
- Read more
- 9517 reads
How to debugging SAPscript form
Go to transaction SE71 and input form name that you want to debug.
Select menu Utilities -> Activate Debugger.
System will generate message that debugger success or fail.
After you run program that call this form, system will skip to form debugger.
- thitima's blog
- 1 comment
- Read more
- 11650 reads
How to import & export SAPscript form
You can import and export SAPscript form by using report ’RSTXSCRP’.
You can specify form name in field ’Object name’.
About mode options:
- thitima's blog
- Add new comment
- Read more
- 2624 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