Blogs
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
- 2328 reads
- sugree's blog
- Add new comment
- 521 reads
Bandwidth Minimization Problem
My colleague has organized Windows Supercomputing Contest 2006 at Kasetsart University. It is a kind of MPI programming contest but all codes must be compiled and ran on Windows Compute Cluster Server 2003. Anyway, this contest is just the first time so he made focus on students inside Kasetsart University including all bachelor degrees from 1st to 4th year. However, all competitors had to attend a short 2-day training course to learn basic of parallel programming and how to implement MPI application especially for Windows Cluster. The contest problem is to write a program to solve specified problem in 3 weeks at home.
- sugree's blog
- Add new comment
- Read more
- 1181 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
- 1634 reads
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
- 6322 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
- 5583 reads
Recent comments
2 years 11 weeks ago
2 years 16 weeks ago
2 years 16 weeks ago
2 years 17 weeks ago
2 years 17 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 20 weeks ago
2 years 20 weeks ago