‎2010 May 12 1:47 PM
Hi Experts,
I WANT TO KNOW THE LOGIC TO POPULATE HEADER DATA AND ITEM DATA INTO SAME INTERNAL TABLE AND AGAIN DOWNLOAD THE SAME TO EXCEL FILE .Output file should be displayed like this format
Header1 rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
Item1 : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Item2 : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Header2: rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
Item1 : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Thanks
Moderator message: Please do not use all upper case in the future.
Edited by: Thomas Zloch on May 12, 2010 3:10 PM
‎2010 May 12 1:56 PM
Hello,
If you could populate the internal table as such with your logic, you can directly use it to download instead of complicating the scenario with multiple calls to the download FM
Vikranth
‎2010 May 12 2:01 PM
Hi,
Header data is in t_header table
Item data is in t_item table
how can we display in XLS file like this
Header1 rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
Item1 : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Item2 : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Header2: rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
Item1 : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Thanks
‎2010 May 12 2:19 PM
You could use text fields, adjusting the length of each field to the max length of either the header or item (whichever is greater for that field), and write to each field using left or right justification depending on what you need.
‎2010 May 12 2:30 PM
Is there any specific logic you are using to group the header and item records?
‎2010 May 12 7:14 PM
hi,
for example there are 3 internal tables it_header, it_items and it_final.
here it_final having all the header and item fields
first populate the it_header, it_items data.
then
loop at it_items.
read table it_header key xyz_key = it_items-xyz_key.
if sy-subrc = 0.
here move all the header field to the it_final like below
it_final-x = it_header-x.
endif.
here move all the item fields to the it_final like below
it_final-x = it_itemsr-x.
append it_final.
clear it_final.
endloop.
NOW IT_FINAL WILL HAVE ALL THE HEADER AND ITEM DATA
‎2010 May 12 7:20 PM
Hi,
for example we have 3 internal tables
1> it_header 2>it_items 3>it_final (which contains all the header and item fields)
once it_header it_items are filled
loop at it_items.
read table it_header with key xyz = it_item-xyz.
if sy-subrc = 0.
here move all the header fields to it_final like below.
it_final -xfield = it_header-xfield.
endif.
here move all the item fields to it_final like below.
it_final -yfield = it_item-yfield.
append it_final.
clear it_final.
endloop.
now header and item fileds will be fillled in it_item