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

Gui_download

Former Member
0 Likes
1,169

Hello All,

While using gui_download i am passing an internal table containing 22 fields and while down loading into my desktop the file does not contain any delimiter.

i dont know how to seperate my down loaded files with delimeters.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,147

Hi,

Check this code..

REPORT  ZTESTAA.



TYPE-POOLS:TRUXS.
DATA: BEGIN OF ITAB OCCURS 0,
     VBELN
LIKE VBAP-VBELN,
      POSNR LIKE VBAP-POSNR,
      END OF ITAB.
DATA:
ITAB1 TYPE TRUXS_T_TEXT_DATA.
SELECT VBELN         POSNR         UP TO
10 ROWS         FROM VBAP         INTO TABLE ITAB.
CALL FUNCTION
  'SAP_CONVERT_TO_CSV_FORMAT'
  EXPORTING
    I_FIELD_SEPERATOR    = ';'
  TABLES
    I_TAB_SAP_DATA       = ITAB
  CHANGING
    I_TAB_CONVERTED_DATA = ITAB1
  EXCEPTIONS
    CONVERSION_FAILED    = 1
    OTHERS               = 2.
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 'GUI_DOWNLOAD'
  EXPORTING
    FILENAME = 'C:TEMPtest.txt'
  TABLES
    DATA_TAB = ITAB1
  EXCEPTIONS
    OTHERS   = 1.

regards

vijay

Hello All,

While using gui_download i am passing an internal table containing 22 fields and while down loading into my desktop the file does not contain any delimiter.

i dont know how to seperate my down loaded files with delimeters.

9 REPLIES 9
Read only

Former Member
0 Likes
1,148

Hi,

Check this code..

REPORT  ZTESTAA.



TYPE-POOLS:TRUXS.
DATA: BEGIN OF ITAB OCCURS 0,
     VBELN
LIKE VBAP-VBELN,
      POSNR LIKE VBAP-POSNR,
      END OF ITAB.
DATA:
ITAB1 TYPE TRUXS_T_TEXT_DATA.
SELECT VBELN         POSNR         UP TO
10 ROWS         FROM VBAP         INTO TABLE ITAB.
CALL FUNCTION
  'SAP_CONVERT_TO_CSV_FORMAT'
  EXPORTING
    I_FIELD_SEPERATOR    = ';'
  TABLES
    I_TAB_SAP_DATA       = ITAB
  CHANGING
    I_TAB_CONVERTED_DATA = ITAB1
  EXCEPTIONS
    CONVERSION_FAILED    = 1
    OTHERS               = 2.
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 'GUI_DOWNLOAD'
  EXPORTING
    FILENAME = 'C:TEMPtest.txt'
  TABLES
    DATA_TAB = ITAB1
  EXCEPTIONS
    OTHERS   = 1.

regards

vijay

Read only

Former Member
0 Likes
1,147

Hi,

Welcome to SDN!!!!!!!!!!!

Hey y dont you go for .xls

This will serve your problem.File name you give one default 'Download File.xls'.

data: fname like rlgrap-filename value 'Download File.xls'.

Thanks.

If this helps you reward with points.

Read only

Former Member
0 Likes
1,147

Hi,

Use the filepath extention as .XLS .

DATA: FILE_PATH1 TYPE RLGRAP-FILENAME .

FILE_PATH1 = 'C:\test.XLS'.

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

FILENAME = FILE_PATH1

FILETYPE = 'DAT'

TABLES

DATA_TAB = ITAB.

Rgds,

J

Read only

Former Member
0 Likes
1,147

Hi Kumar,

Just pass the parameter WRITE_FIELD_SEPARATOR of GUI_DOWNLOAD as 'X'. This will place a delimiter.

Regards,

Srikanth

Read only

Former Member
0 Likes
1,147

Actually in this case the user will specify the delimeter from the selection screen and i need to use that delimiter in the file.

subbu.

Read only

0 Likes
1,147

Hi Kumar,

Then Concatenate all the fields of the internal table with the seperator:

DATA:

BEGIN OF it_final OCCURS 1,

line TYPE char512,

END OF it_final.

LOOP AT itab.

CONCATENATE itab-f1 w_seperator " which user has given

itab-f2 w_seperator

.....

INTO it_final-line.

APPEND it_final.

ENDLOOP.

Now call the GUI_DOWNLOAD passing it_final.

Regards,

Srikanth

Read only

Former Member
0 Likes
1,147

Hi kumaraswamy,

1. Simply using gui_download

will not give any field-separator.

2. if we pass this parameter in this fm,

WRITE_FIELD_SEPARATOR = 'X'

then there will be a field-sepatror

TAB

(it won't be any visible charcter like ; : | etc.

regards,

amit m.

Read only

Former Member
0 Likes
1,147

Now i got it.

Thanks Srikanth.

Regards,

subbu.

Read only

0 Likes
1,147

Hope you got the reply....

You should close the discussion by rewarding the worthy...

Regards,

Srikanth