Code: Alles auswählen.
DATA: L_PATH TYPE STRING VALUE 'C:\tmp\USER.SCV'.
...
..
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ';'
* I_LINE_HEADER =
* I_FILENAME = ''
* I_APPL_KEEP = ' '
TABLES
I_TAB_SAP_DATA = IT_USER
CHANGING
I_TAB_CONVERTED_DATA = CSV_CONVERTED_TABLE
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
* Export der CSV zum Übergeben Pfad
PERFORM SAFE_CSV USING L_IMG_EXP_USER_FULLPATH.
*
* --------------------------------------------------------------------
*----------------------------------------------------------------------*
FORM SAFE_CSV USING L_PATH TYPE STRING.
*
* CALL FUNCTION 'GUI_DOWNLOAD'
* EXPORTING
** FILENAME = L_IMG_EXP_ROLENAME_FULLPATH
* FILENAME = L_PATH
* TABLES
* DATA_TAB = CSV_CONVERTED_TABLE.
open dataset L_PATH for output in text mode.
LOOP AT CSV_CONVERTED_TABLE.
transfer CSV_CONVERTED_TABLE to L_PATH.
ENDLOOP.
close dataset L_PATH.
ENDFORM. "SAFE_CSV
stony007_de hat geschrieben:Muss als itab in der OPEN DATASET die I_TAB_CONVERTED_DATA?
Code: Alles auswählen.
DATA: L_PATH TYPE STRING VALUE 'C:\tmp\USER.SCV'.
[\code]
OPEN DATASET geht nur auf dem Aplikation-Server nicht auf dem FrontEnd!
[code]
open dataset L_PATH for output in text mode MESSAGE fehler_datei_open
IF sy-subrc <> 0.
WRITE / fehler_datei_open.
ELSE.
...
ENDIF.
Code: Alles auswählen.
* Workarea für CSV Data definieren
DATA CSV_CONVERTED_WORKAREA LIKE LINE OF CSV_CONVERTED_TABLE.
...
..
.
FORM SAFE_CSV USING L_PATH TYPE STRING.
* OPEN DATA SET um IM BACKEND DATEN ZU Speichern
OPEN DATASET L_PATH FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT CSV_CONVERTED_TABLE INTO CSV_CONVERTED_WORKAREA.
TRANSFER CSV_CONVERTED_WORKAREA TO L_PATH.
ENDLOOP.
CLOSE DATASET L_PATH.
ENDFORM. "SAFE_CSV