2009 Jul 10 11:47 AM
Dear expert,
do you know if a function to convert CSV into SAP with the opportunity to use background execution exists?
Thank you in advance for you collaboration.
Warm regards,
Fuffo
Try to use this one...
Here itab is ur internal table of same format as the .csv file is having
background processing
OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE l_message.
IF sy-subrc = 0.
DO.
READ DATASET l_file INTO gs_tab.
IF sy-subrc <> 0.
CLOSE DATASET l_file.
EXIT.
ENDIF.
APPEND gs_file TO gt_file.
APPEND gs_tab TO gt_tab.
ENDDO.
ELSE.
IF sy-subrc <> 0.
MESSAGE e000 WITH text-012.
g_exit = '1'.
EXIT.
ENDIF.
ENDIF.
2009 Jul 10 11:52 AM
Hi,
<li>It is not possible to download data to presentation server in background. So no such function modules.
<li>To convert CSV to SAP . There is one function module TEXT_CONVERT_CSV_TO_SAP.
Thanks
Venkat.O
2009 Jul 10 11:53 AM
If you want to upload a CSV file from front end and load into SAP in Back ground mode, Then 'GUI_*' functions will not work as it won't support B/G execution.
Alternatively, You can always upload a file( Using CG3Z) in AL11 and your program can make use of the file in B/G mode.
This can be done using OPEN DATA SET, TRANSFER, CLOSE DATASET.
Thank,
Raj
2009 Jul 13 7:40 AM
Try to use this one...
Here itab is ur internal table of same format as the .csv file is having
background processing
OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE l_message.
IF sy-subrc = 0.
DO.
READ DATASET l_file INTO gs_tab.
IF sy-subrc <> 0.
CLOSE DATASET l_file.
EXIT.
ENDIF.
APPEND gs_file TO gt_file.
APPEND gs_tab TO gt_tab.
ENDDO.
ELSE.
IF sy-subrc <> 0.
MESSAGE e000 WITH text-012.
g_exit = '1'.
EXIT.
ENDIF.
ENDIF.
2009 Jul 15 7:09 AM
any update....
if problem is solved please close this thread...
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |