05-14-2009 1:19 PM
Dear All,
I am using OPEN DATASET 'FILENAME' FOR OUTPUT for downloading the data.
While downloading i want to download by TAB delimiter space between the each field. So, wat is the
syntax to download in this format
if any one have a sample code, pls reply with the same.
Thanks
NSK
05-14-2009 1:24 PM
CONSTANTS:
C_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
if you are reading from the file you should write
OPEN DATASET 'Filename' for OUTPUT..
and while fillinf the output file
you should
CONCAENATE all the fields
into a flat strucutre
SEPARATED by TAB.
you have to read the dataset into some internal table and then do whatever you watn split at TAB and all
Edited by: Sravan Kumar on May 14, 2009 5:55 PM
05-14-2009 1:26 PM
05-14-2009 1:26 PM
Use WS_DOWNLOAD, GUI_DOWNLOAD to download the file from UNIX.
If you are talking about reading the file in internal table the file should in the TAB delimited format.
05-14-2009 1:32 PM
Hello,
You have to use the const. CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB for this.
DATA:
L_V_TAB TYPE CHAR1,
L_V_FILE_DATA TYPE STRING.
L_V_TAB = CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
OPEN DATASET 'FILENAME' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC = 0.
LOOP AT ITAB INTO WA.
CONCATENATE WA-F1 WA-F2 ... WA-FN INTO L_V_FILE_DATA SEPARATED BY L_V_TAB.
ENDLOOP.
ENDIF.
CLOSE DATASET 'FILENAME'.
Hope this helps.
BR,
Suhas