Code: Alles auswählen.
FUNCTION Z_MOSER_TEST_OBJECT_GET.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(LANGU) TYPE LAISO
*" VALUE(USERID) TYPE SY-UNAME
*" VALUE(TYP) TYPE x6
*" VALUE(MODE) TYPE x7
*" VALUE(TCODE) TYPE x8
*" VALUE(LOIOID) TYPE x9
*" REFERENCE(STR_CONTENT_FILE) TYPE STRING
*" REFERENCE(STR_CONTENT_FILE_MIME_TYPE) TYPE STRING
*" VALUE(STR_METADATA_FILE) TYPE STRING
*" TABLES
*" MESSAGELIST STRUCTURE x4
*" CONTEXT STRUCTURE x3
*" RETURNVALUES STRUCTURE x10
*"----------------------------------------------------------------------
*&---------------------------------------------------------------------*
*& Report Z_MOSER_TEST_RFC
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
DATA:
ret_code TYPE x5,
new_code TYPE sdok_propv,
message LIKE TABLE OF x4,
tbincontent LIKE x3 OCCURS 0 WITH HEADER LINE,"#EC *
lbincontent LIKE LINE OF tbincontent,
tabfileinfo LIKE x2 OCCURS 0 WITH HEADER LINE,
tabfilecontent TYPE TABLE OF x1
lonfilecontent LIKE LINE OF tabfilecontent,
str_file_name TYPE String,
tab_file_parts TYPE zsit_Text,
int_lines TYPE i,
bln_refobj TYPE boolean.
bln_refobj = ''.
if typ = 'OBJ_TV' OR
typ = 'OBJ_BD' OR
typ = 'OBJ_TV_PRO' OR
typ = 'OBJ _ET_PRO' OR
typ = 'OBJ_BD_PRO'.
bln_refobj = 'X'.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = 0
filename = 'c:\temp\test.xml'
FILETYPE = 'ASC'
* Kennzeichen, das anzeigt, ob die Daten an eine vorhandene Datei angehängt werden sollen.
*Leer: Die Daten sollen nicht an eine vorhandene Datei angehängt werden sondern wird ersetzt
* x: Die Daten sollen an die Daten einer vorhandenen Datei angehängt werden Es wird eine neue Datei angelegt,
* wenn keine Datei mit diesem Namen vorhanden ist
APPEND = ''
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ''
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
*Wenn diese Option aktiviert ist, wird der Benutzer gefragt, ob eine vorhandene Datei
* überschrieben werden soll. Andernfalls wird die Datei überschrieben, ohne den Benutzer zu fragen.
* CONFIRM_OVERWRITE = 'x'
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
* SHOW_TRANSFER_STATUS = ABAP_TRUE
*IMPORTING
*FILELENGTH = 0
tables
data_tab = tabfilecontent
* FIELDNAMES =
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* OTHERS = 22
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'Z_DBGT_OBJECT_GET'
EXPORTING
langu = langu
userid = userid
typ = typ
mode = mode
TCODE = tcode
LOIOID = loioid
IMPORTING
returncode = ret_code
new_tcode = new_code
TABLES
tabfileinfo = tabfileinfo
tabfilecontent = tabfilecontent
messagelist = message.
"context = contex.
WRITE / 'Hat alles geklappt'.
ENDFUNCTION.
Code: Alles auswählen.
SELECT * FROM iTab INTO CORRESPONDING FIELDS OF TABLE tabfilecontent
WHERE *Bedingungen sofern gebraucht* .
Code: Alles auswählen.
TABLES: ekko, eban, esll.
Code: Alles auswählen.
SELECT * FROM ekko INTO CORRESPONDING FIELDS OF TABLE tabfilecontent.
Code: Alles auswählen.
tabfilecontent = vorher_erstellte_tabelle.
Code: Alles auswählen.
DATA: tabfilecontent TYPE TABLE OF x1,
ls_tabfilecontent TYPE tabfilecontent,
ls_vorher_erstellte_tabelle TYPE vorher_erstellte_tabelle.
CLEAR: ls_tabfilecontent, ls_vorher_erstellte_tabelle, tabfilecontent.
LOOP AT vorher_erstellte_tabelle INTO ls_vorher_erstellte_tabelle.
ls_tabfilecontent-variable1 = ls_vorher_erstellte_tabelle-variable1.
APPEND ls_tabfilecontent TO tabfilecontent.
ENDLOOP.
Code: Alles auswählen.
FUNCTION Z_MOSER_TEST_OBJECT_GET.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(LANGU) TYPE LAISO
*" VALUE(USERID) TYPE SY-UNAME
*" VALUE(TYP) TYPE x1
*" VALUE(MODE) TYPE x2
*" VALUE(TCODE) TYPE x3 OPTIONAL
*" VALUE(LOIOID) TYPE x4 OPTIONAL
*" REFERENCE(STR_CONTENT_FILE) TYPE STRING
*" REFERENCE(STR_CONTENT_FILE_MIME_TYPE) TYPE STRING
*" VALUE(STR_METADATA_FILE) TYPE STRING
*" TABLES
*" MESSAGELIST STRUCTURE x5
*" CONTEXT STRUCTURE x6
*" RETURNVALUES STRUCTURE x7
*"----------------------------------------------------------------------
TYPES:
BEGIN OF str_object_get,
LANGU TYPE LAISO,
USERID TYPE SY-UNAME,
TYP TYPE x1,
MODE TYPE x2,
TCODE TYPE x3,
LOIOID TYPE x4,
END OF str_object_get.
Code: Alles auswählen.
DATA:
ret_code TYPE x8,
new_code TYPEx9,
message LIKE TABLE OFx5
tbincontent LIKE sdokcntbin OCCURS 0 WITH HEADER LINE,"#EC *
lbincontent LIKE LINE OF tbincontent,
tabfileinfo LIKE sdokfilaci OCCURS 0 WITH HEADER LINE,
tabfilecontent TYPE TABLE OF x7,
lin_tabfilecontent LIKE LINE OF tabfilecontent,
bln_refobj TYPE boolean,
tab_str_object_get TYPE TABLE OF str_object_get,
1_str_object_get TYPE str_object_get.
Code: Alles auswählen.
CLEAR: lin_tabfilecontent, tab_str_object_get, tabfilecontent.
LOOP AT tab_str_object_get INTO 1_str_object_get.
APPEND lin_tabfilecontent TO tabfilecontent.
ENDLOOP.
Code: Alles auswählen.
DATA: ....
tab_str_object_get TYPE TABLE OF str_object_get,
...