‎2008 Apr 03 1:43 AM
Sample code to output internal table data to a specified server drive/folder (not local drive)?
Thanks and We will give you reward points!
‎2008 Apr 03 2:10 AM
Hello,
Here you can find useful information about download data [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0901cba-f49e-2910-748c-d7ce4c0c4c1c]
And in this blog from Thomas Jung there's a good example using ABAP OO and with Unicode support [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1932] [original link is broken] [original link is broken] [original link is broken];
Regards,
‎2008 Apr 03 1:55 AM
Hi Kevin
Here is a very basic example. Remember to change the server directory to your own server name and path.
REPORT ZBRADTEST.
DATA: DATAHEAD(1000).
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS: P_OFILE LIKE RLGRAP-FILENAME
DEFAULT '
SERVERNAME\SAPdwnld\Testfile.txt'.
SELECTION-SCREEN END OF BLOCK B1.
*Open Download File for Writing
OPEN DATASET P_OFILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC = 0.
*Write to download file
DATAHEAD+0 = 'Material No.'.
DATAHEAD+18 = 'Description'.
DATAHEAD+58 = 'Old Material No.'.
DATAHEAD+76 = 'Bin Loc.'.
DATAHEAD+86 = 'WH'.
DATAHEAD+96 = 'Price'.
DATAHEAD+102 = 'P.Unt'.
DATAHEAD+107 = 'Ext Matl Group'.
DATAHEAD+125 = 'Available Stk'.
DATAHEAD+138 = '.'.
TRANSFER DATAHEAD TO P_OFILE.
CLEAR DATAHEAD.
LOOP AT ITAB.
DATAHEAD+0 = ITAB-FIELD1.
DATAHEAD+18 = ITAB-FIELD2.
TRANSFER DATAHEAD TO P_OFILE.
ENDLOOP.
*Close Download File
CLOSE DATASET P_OFILE.
ENDIF.
Edited by: Brad Gorlicki on Apr 3, 2008 2:55 AM
‎2008 Apr 03 2:10 AM
Hello,
Here you can find useful information about download data [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0901cba-f49e-2910-748c-d7ce4c0c4c1c]
And in this blog from Thomas Jung there's a good example using ABAP OO and with Unicode support [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1932] [original link is broken] [original link is broken] [original link is broken];
Regards,