forked from kkayacan/abap-reference
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSAVE_TEXT.abap
28 lines (26 loc) · 903 Bytes
/
SAVE_TEXT.abap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
DATA lt_lines TYPE STANDARD TABLE OF tline.
LOOP AT lt_out_lines ASSIGNING FIELD-SYMBOL(<lv_line>).
APPEND INITIAL LINE TO lt_lines ASSIGNING FIELD-SYMBOL(<ls_line>).
<ls_line>-tdformat = '*'.
<ls_line>-tdline = <lv_line>.
ENDLOOP.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = VALUE thead( tdobject = 'BELEG'
tdname = |{ ip_key+10(4) }{ ip_key(10) }{ ip_key+14(4) }|
tdid = '0002'
tdspras = sy-langu
tdlinesize = '072'
mandt = sy-mandt )
savemode_direct = abap_true
TABLES
lines = lt_lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc = 0.
COMMIT WORK.
ENDIF.