Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

downloading the data by tab delimiter.

Former Member
0 Kudos

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

4 REPLIES 4

former_member242255
Active Contributor
0 Kudos

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

Former Member
0 Kudos

hi,

check link..

Regards,

Ven M

Former Member
0 Kudos

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.

SuhaSaha
Advisor
Advisor
0 Kudos

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