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: 

download on to .DAT file

anupam_srivastava2
Participant
0 Kudos

Hi All

I have got a requirement, where I have data in defferent internal tables.

one table for File Header Segment

second table for Data Header Segment

third table for Data Item Segment

fourth table for File Trailer Segment

Now I want to download all the data onto one .DAT file with data of one segment should be on one line, and there should be linefeed, and data of second table should come on second line.

I tried using GUI_Download but in that we can use only one internal table, Does any body know where we can download data from different tables into one file.

Thanks in advance for your help..

cheer

AJ

5 REPLIES 5

Former Member
0 Kudos

Hi AJ,

I think you can use the same FM to APPEND the records from different internal tables to the same file. There is an importing parameter (APPEND) that would allow you to append data to the same file.

Best Regards,

Ram.

Edited by: ram Kumar on Sep 10, 2008 1:57 PM

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

In GUI_UPLOAD Fm theer is one parameter called APPEND.

Pass 'X' to this from second table onwards. It appends to the same file.

so For first table this APPEND parameter should be space, For second, third and fourth tables set this parameter to 'X'.

Instead of calling this FM 4 times u can put it in PERFORM.

eg:


 PERFORM download USING 'X' itab1.
 PERFORM download USING space itab2.
 PERFORM download USING space itab3.
 PERFORM download USING space itab4.

FORM download USING append_flag TABLES itab.
CALL FM GUI_DOWNLOAD.
"In append parameter pass append_flag, in tables pass itab.
ENDFORM.

Hope it solves ur problem.

Thanks,

Vinod.

0 Kudos

Hi Vinod

How should I define itab as. because right now it gives the error message itab not defined, thing is in form...endform.....itab have different values.

so how can we define itab as???????

0 Kudos

Hi,

In which version of SAP u r in. I am in 4.6C. I am using below statements. Its not giving any errors.


DATA: itab1 TYPE STANDARD TABLE OF mara,
      itab2 TYPE STANDARD TABLE OF marc.

PERFORM download TABLES: itab1,
                         itab2.

FORM download TABLES itab.

ENDFORM.

If it doesn't work then u may have to call FM for 4 times or pass 4 tables parameters and apply the logic.

Thanks,

Vinod.

anupam_srivastava2
Participant
0 Kudos

FORM DOWNLOAD USING FILEPATH APPEND_FLAG

CHANGING value(ITAB) TYPE TABLE .

ENDFORM.

IT WORKS IN THIS WAY........ACTUALLY i AM USING ECC5.

THANKS EVERYBODY FOR YOUR HELP