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: 

internal tables in WS_download

Former Member
0 Kudos

HI

i have defined 2 internal tables one for invoice header details

and another for line item details.(both have different details) now i have to download this data to text file in this format

invno1 text....

line1 text...

line2 text..

...

invno2 text..

line1....

line2...

how to do this? if i use ws_download for 2 tables seperately i am getting following o/p.

invno1 text...

invno2 text....

line1 text...

line2 text....

line1 text....

line2 text...

any one plz help me...

4 REPLIES 4

Former Member
0 Kudos

Hi Sravanthi,

Create a final internal table with the excat download strucutre and move the corresponding header and item data into it then only we will able to download the data in the required format.

say ur final internal table it_final

loop at header.

mpve-coressponding header to it_final.

loop at item where field1 = header-field1 .(field1 refres to invoice number)

mpve-coressponding item to it_final.

append it_final.

endloop.

endloop.

now call the download function with the it_final internal table

former_member156446
Active Contributor
0 Kudos

call ws_download twice for two diff tables.

or ise diff file names... that will not mess up

Former Member
0 Kudos

Hi,

Use GUI_DOWNLOAD as follows:

call 'GUI_DOWNLOAD'

APPEND = space

tables:

DATA_TAB = header.

call 'GUI_DOWNLOAD'

APPEND = 'A'

tables:

DATA_TAB = item.

call 'GUI_DOWNLOAD'

APPEND = 'A'.

tables:

DATA_TAB = header.

call 'GUI_DOWNLOAD'

APPEND = 'A'

tables:

DATA_TAB = item.

This gives proper result.

former_member386202
Active Contributor
0 Kudos

Hi,

Create only one internal table and use GUI_DOWNLOAD FM to download the data .

Regards,

PRashant