Application Development 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: 

Uploading Data Into CRM Using a Batch Job

Former Member
0 Kudos

Hi,

How can I automate the procedure of uploading data from a flat text file (product data) into CRM using the function module GUI_UPLOAD?

Thanks,

Rachita.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

GUI_UPLOAD, like the name says, uses the SAPGUI to upload the data to the server, and in a batch job, you don't have the connection to a SAPGUI. So you should use following kind of coding:

DATA MSG(100).

OPEN DATASET "FILENAM" FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE

MSG.

IF sy-subrc = 0.

DO.

READ DATASET "FILENAM" INTO [Your internal table].

IF sy-subrc <> 0.

EXIT.

ENDIF.

APPEND [Your internal table]P_DATA.

ENDDO.

ENDIF.

Reward points if found helpfull...

Cheers,

Siva.

1 REPLY 1

Former Member
0 Kudos

Hi,

GUI_UPLOAD, like the name says, uses the SAPGUI to upload the data to the server, and in a batch job, you don't have the connection to a SAPGUI. So you should use following kind of coding:

DATA MSG(100).

OPEN DATASET "FILENAM" FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE

MSG.

IF sy-subrc = 0.

DO.

READ DATASET "FILENAM" INTO [Your internal table].

IF sy-subrc <> 0.

EXIT.

ENDIF.

APPEND [Your internal table]P_DATA.

ENDDO.

ENDIF.

Reward points if found helpfull...

Cheers,

Siva.