2009 Oct 23 8:20 AM
Hello Expert,
i want to write a program in which if i execute program data should store in the file.
The file structure is :
PNT 01FPMGERIMSGER00000001A20091023TEAMLEADER -Header file
PNT 01FPMGERIMSGER001BFPMPOR000010 0010000 M012345678 20091025--- Records
PNT 01FPMGERIMSGER001BFPMPOR000010 0010000 M012345678 20091025----Records
PNT 01FPMGERIMSGER00000001ZOO12222888888888 - Trial file
So hw i can make this in internal table and download to file.
Thanks and regards,
Zubera
Hello Expert,
i want to write a program in which if i execute program data should store in the file.
The file structure is :
PNT 01FPMGERIMSGER00000001A20091023TEAMLEADER -Header file
PNT 01FPMGERIMSGER001BFPMPOR000010 0010000 M012345678 20091025--- Records
PNT 01FPMGERIMSGER001BFPMPOR000010 0010000 M012345678 20091025----Records
PNT 01FPMGERIMSGER00000001ZOO12222888888888 - Trial file
So hw i can make this in internal table and download to file.
Thanks and regards,
Zubera
2009 Oct 23 8:36 AM
Search the forum and the wiki for download. There are tons of examples.
2009 Oct 23 8:46 AM
hi,
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
Edited by: RAHUL SHARMA on Oct 23, 2009 3:46 AM
Edited by: RAHUL SHARMA on Oct 23, 2009 3:47 AM
Edited by: Rob Burbank on Oct 23, 2009 9:33 AM
2009 Oct 23 10:52 AM
Thanks for your quick reply.
i am facing problem first i have to write header data and line item data.
first i have to populate header data to file( all the field is constant ), line item and than file trialer record.
i want to know only one internal table can i use or more than one internal table and how to populate header and item data to file.
Thanks and regards,
Zubera
2009 Oct 23 10:59 AM
Hi,
You could use both the options. You could either decalre a single internal and populate all the header, item and trailier records to it and use GUI_DOWNLOAD.
Else use a seperate internal table for header and specify it in the header import parameter of the FM gui_download with the item and trailer records in a separate internal table
Vikranth
2009 Oct 23 11:06 AM
Best way to this is to loop at internal table.
move your data to a char variable of your desired length in which you think your whole work area can be accommodated. Then transfer this variable to the file path.
Keep your header and trailer records already written to a char type variable (as described above).
In the above loop statement use AT FIRST to write the Header and use AT LAST to write the Trailer.
For Example:
Loop at itab into wa .
at first.
transfer v_header to v_filepath(with filename).
end at.
v_char(4) = wa-1.
v_char+4(4) = wa-2.
.
.
.
transfer v_char to v_filepath(with filename).
at last.
transfer v_trailer to v_filepath(with filename).
endat.
endloop