Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Background function to convert CSV

Former Member
0 Likes
697

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

4 REPLIES 4
Read only

venkat_o
Active Contributor
0 Likes
640

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

Read only

Former Member
0 Likes
640

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

Read only

RahulKeshav
Active Contributor
0 Likes
640

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.

Read only

RahulKeshav
Active Contributor
0 Likes
640

any update....

if problem is solved please close this thread...