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

Uploading Data Into CRM Using a Batch Job

Former Member
0 Likes
625

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
Read only

Former Member
0 Likes
596

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.

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 REPLY 1
Read only

Former Member
0 Likes
597

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.