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

Download data from multiple database to different flat file

Former Member
0 Likes
709

Hi Experts,

I am having a problem to download data from different DB to different flat file. Hope you guys able to provide the details code based on the following situtation. Appreciate your help. Thanks!

Eg:

- I required to download the below data from different table to 3 different flat file based on the selection parameters. Let said based on the Date_join.

<u>Table 1 - Table Name: Course Record</u>

StudentNo

S_Course

<u>Table 2- Table Name: Student Details </u>

StudentNo

S_Add

S_aAge

<u>Table 3- Table Name: Student_results</u>

StudentNo

S_Mark

S_Subject

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
678

Hi Take the 3 tables data into 3 different internal tables.

Then call GUI_DOWNLOAD 3 times each time passing different internal table and different file names....

reward if helpful...

Hi Experts,

I am having a problem to download data from different DB to different flat file. Hope you guys able to provide the details code based on the following situtation. Appreciate your help. Thanks!

Eg:

- I required to download the below data from different table to 3 different flat file based on the selection parameters. Let said based on the Date_join.

<u>Table 1 - Table Name: Course Record</u>

StudentNo

S_Course

<u>Table 2- Table Name: Student Details </u>

StudentNo

S_Add

S_aAge

<u>Table 3- Table Name: Student_results</u>

StudentNo

S_Mark

S_Subject

5 REPLIES 5
Read only

Former Member
0 Likes
679

Hi Take the 3 tables data into 3 different internal tables.

Then call GUI_DOWNLOAD 3 times each time passing different internal table and different file names....

reward if helpful...

Read only

0 Likes
678

Hi,

Could you provide sample code to extract data (based on my example table) to internal table which data have to get from 3 different DB.

Hope you can help. Thanks:-D

Read only

Former Member
0 Likes
678

Hi,

DATA : BEGIN OF I_DISPLAY OCCURS 0,

REC(400),

END OF I_DISPLAY.

based on date

select StudentNo S_Course from Course Record

into i_Course Record

****if parameter

where date eq p_Date_join

****if select-options.

where date in s_Date_join.

-


select StudentNo S_Course from Student Details

into i_Student Details

****if parameter

where date eq p_Date_join

****if select-options.

where date in s_Date_join.

-


select StudentNo S_Mark S_Subject

from Student_results

into i_Student_results

****if parameter

where date eq p_Date_join

****if select-options.

where date in s_Date_join.

*********************************

DATA : FNAME(255) TYPE C VALUE '/data/sapdata/eu_ums/astdetails'.

CONSTANTS : C_COMMA TYPE C VALUE ','.

********Fields to insert

I_FINAL-StudentNo = 'StudentNo.

I_FINAL-S_Course = 'S_Course'.

*

INSERT I_FINAL INDEX 1.

CLEAR I_FINAL.

*

LOOP AT I_FINAL.

CONCATENATE

I_FINAL-DOCNUM

I_FINAL-STATXT

into I_DISPLAY-REC SEPARATED BY C_COMMA.

APPEND I_DISPLAY.

CLEAR I_DISPLAY.

ENDLOOP.

OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.

LOOP AT I_DISPLAY.

TRANSFER I_DISPLAY TO FNAME.

ENDLOOP.

CLOSE DATASET FNAME.

Do this for all tables.

Don't forget to reward if useful

Read only

0 Likes
678

Hi,

Can provide the sample how to download the data to Presentation server which enable user to browse the directory location based on muralikrishna kaipha coding.

Thanks.

Read only

Former Member
0 Likes
678

Hi,

Above mensioned code is example code.Based on that change your code.