12-16-2006 1:23 AM
Hi ,
actually i have uploaded data in to internal table i want to load that into application server table in to specfic path , i have never used this before so please find me steps urgent please
thanks
sridhar
12-16-2006 1:29 AM
12-16-2006 5:50 AM
WS_upload is used to upload a file to application server.
If u want to pass a internal table contents ,u need not to pass the exporting parameter instead of that u can ve tables parameter.in that u ve to give ur internal table name
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME =wsfile
FILETYPE = 'DAT'
TABLES
DATA_TAB = plant
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
IF SY-SUBRC <> 0.
WRITE: / 'Error Uploading', wsfile, SY-SUBRC.
STOP.
ENDIF.
12-16-2006 6:31 AM
DATA : FNAME TYPE STRING VALUE 'TEST1.TXT'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\VD.TXT'
tables
data_tab = IT_VENDOR.
Now ur datas will be available in internal table.
Using opendataset & transfer we will transfer it to application server as given below.
OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT IT_VENDOR INTO WA_VENDOR.
TRANSFER WA_VENDOR TO FNAME.
ENDLOOP.
CLOSE DATASET FNAME.
Now goto AL11 & see ur datas will be stored with name test1.txt.
12-16-2006 8:09 AM
if you have values for the file in the internal table , use this syntax.
OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT ITAB INTO WA.
TRANSFER WA TO FILENAME.
ENDLOOP.
CLOSE DATASET FNAME.
HERE FILENAME IS THE NAME OF THE FILE TO BE CREATED IN YOUR APPLICATION SERVER WITH PATH.
ITAB IS THE INTERNAL TABLE WHICH CONTAINS THE VALUE FOR THE FILE.
THE ABOVE SYNTAX WILL AUTOMATICALLY CREATES FILE IN YOUR APPLICATION SERVER
12-16-2006 3:25 PM
hi , i have never declared a workarea that is wa , then what is wa in the loop you are specifying ,
sridhar
12-16-2006 3:26 PM
hi , i have never declared a workarea that is wa , then what is wa in the loop you are specifying ,
sridhar
12-16-2006 4:25 PM
Hope this solve your problem,
If you are trying to download your internal table data to file in application server; then try the below,
* If you have a internal table with header line use this
* Say DATA: I_TAB LIKE TABLE OF <TABLE> WITH HEADER LINE>.
OPEN DATASET <FILENAME> FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC EQ 0.
LOOP AT I_TAB.
TRANSFER I_TAB TO <FILENAME>.
ENDLOOP.
CLOSE DATASET <FILENAME>.
ENDIF.
* If you have a internal table without header line use this
* Say DATA: I_TAB TYPE TABLE OF <TABLE>,
* W_TAB TYPE <TABLE>.
OPEN DATASET <FILENAME> FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC EQ 0.
LOOP AT I_TAB INTO W_TAB.
TRANSFER W_TAB TO <FILENAME>.
ENDLOOP.
CLOSE DATASET <FILENAME>.
ENDIF.
Regards
Kathirvel
12-16-2006 4:28 PM
Hi,
Check this link to learn more about working with work areas:
http://help.sap.com/saphelp_erp2004/helpdata/en/fc/eb36a1358411d1829f0000e829fbfe/content.htm