Upload tab delimited file in background
hi
can somebody tell me how to upload data from a tab delimited file in background.
i have tried function module ws_upload but it raises exception when run in background
hi
you can not use ws_upload to work in background
Instead
Use opendataset and Transfter .
Hope this will help.
Regards
Abaper
You will have to use OPEN DATASET DSN and
READ DATASET DSN INTO LONGSTRING.
Then SPLIT LONGSTRING AT delimiter INTO FLD1 FLD2 FLD3 etc....
Thanx a lot it worked
Hi Monica
Can you please post the code that uploads a file from background into an arbitrary internal table. I have the same problem and I have been struggling on it for 1 day.
Precisely I want to have a generic form routine that can read a given dataset and upload it into a internal table similar to what ws_upload does in foreground.
Thanks
Julie
Hi Wolfgang/Two Abapers
Can you please help me on this. I need to upload a delimited file from the server into a arbitrary internal table.
Thanks
Julie
hi
the code i have written is not very generic. i am enclosing it, if it helps you
DATA: x(1) TYPE x VALUE '09'.
DATA:BEGIN OF itab1 OCCURS 10,
rec(62) TYPE c,
END OF itab1.
OPEN DATASET '/usr/sap/text.txt' IN TEXT MODE.
*READ the file "/usr/sap/text.txt".
DO.
READ DATASET '/usr/sap/text.txt INTO ITAB1.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
SPLIT ITAB1-REC AT X INTO ITAB-fld1 ITAB-fld2 ITAB-fld3.
APPEND ITAB.
ENDDO.