Application Development and Automation 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: 
Read only

Generating tab delimited file on presentation server

PS_1978
Active Participant
0 Likes
661

Hi All,

I have to generate a tab delimited file on presentation server. The file shouldn't have '#' as separator. Instead it should be separated by TAB (when you press TAB button, some spaces will come naa... like that) ' '. Please advice me how to do this...

Thanks in Advance,

Regards,

Phani

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
632

Hi,

Check this example..

DATA: BEGIN OF itab OCCURS 0,

matnr TYPE matnr,

werks TYPE werks_d,

END OF itab.

itab-matnr = 'ABC'.

itab-werks = 'ASDF'.

APPEND itab.

itab-matnr = 'EFG'.

itab-werks = 'DHIS'.

APPEND itab.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'C:\test.txt'

write_field_separator = 'X'

TABLES

data_tab = itab

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.

ELSE.

MESSAGE s208(00) WITH 'File downloaded'.

ENDIF.

Thanks,

Naren

Hi All,

I have to generate a tab delimited file on presentation server. The file shouldn't have '#' as separator. Instead it should be separated by TAB (when you press TAB button, some spaces will come naa... like that) ' '. Please advice me how to do this...

Thanks in Advance,

Regards,

Phani

3 REPLIES 3
Read only

Former Member
0 Likes
632

Hi,

You can use the function module GUI_DOWNLOAD and passing the parameter WRITE_FIELD_SEPARATOR = 'X'..Which will download tab delimited..

Thanks,

Naren

Read only

Former Member
0 Likes
633

Hi,

Check this example..

DATA: BEGIN OF itab OCCURS 0,

matnr TYPE matnr,

werks TYPE werks_d,

END OF itab.

itab-matnr = 'ABC'.

itab-werks = 'ASDF'.

APPEND itab.

itab-matnr = 'EFG'.

itab-werks = 'DHIS'.

APPEND itab.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'C:\test.txt'

write_field_separator = 'X'

TABLES

data_tab = itab

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.

ELSE.

MESSAGE s208(00) WITH 'File downloaded'.

ENDIF.

Thanks,

Naren

Read only

former_member404244
Active Contributor
0 Likes
632

Hi,

use the FM GUI_DOWNLOAD and U need to pass WRITE_FIELD_SEPARATOR = 'X'...Ur job will be done..

Regards,

nagaraj