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: 

BDC in background

Former Member
0 Kudos
131

Hi Everyone,

My bdc program is for transaction 'CG3Y' [for downloading file from application server to presentation server]. Report is working fine in foreground but no file is getting created when I run in background. I need to submit my bdc program for background processing. Could u please help me out....

My code :

DATA : i_bdcdata TYPE TABLE OF bdcdata

WITH HEADER LINE,

i_message TYPE TABLE OF bdcmsgcoll WITH HEADER LINE.

DATA : options LIKE ctu_params.

PARAMETERS : s_date TYPE sy-datum.

REFRESH : i_bdcdata[].

CLEAR : i_bdcdata.

PERFORM f0100_bdc.

CLEAR options .

options-dismode = 'E'.

options-updmode = 'S'.

options-cattmode = ' '.

options-defsize = ' '.

options-racommit = 'X'.

options-nobinpt = 'X'.

options-nobiend = ' '.

CALL TRANSACTION 'CG3Y' USING i_bdcdata OPTIONS FROM options

MESSAGES INTO i_message.

&----


*& Form f0100_bdc

&----


  • text

----


FORM f0100_bdc .

PERFORM bdc_dynpro USING 'SAPLC13Z' '1010'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RCGFILETR-FTFRONT'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=EEXO'.

PERFORM bdc_field USING 'RCGFILETR-FTAPPL'

'/usr/sap/tmp/SAP_Mails_20070326_104143'

& '.XLS'.

PERFORM bdc_field USING 'RCGFILETR-FTFRONT'

'C:\Documents and Settings\vepakom\Desk'

& 'top\priya.XLS'.

PERFORM bdc_field USING 'RCGFILETR-FTFTYPE'

'BIN'.

PERFORM bdc_dynpro USING 'SAPLC13Z' '1010'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/EECAN'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RCGFILETR-FTAPPL'.

PERFORM bdc_field USING 'RCGFILETR-FTAPPL'

'/usr/sap/tmp/SAP_Mails_20070326_104143'

& '.XLS'.

PERFORM bdc_field USING 'RCGFILETR-FTFRONT'

'C:\Documents and Settings\vepakom\Desk'

& 'top\priya.XLS'.

PERFORM bdc_field USING 'RCGFILETR-FTFTYPE'

'ASC'.

*perform bdc_transaction using 'CG3Y'.

ENDFORM. " f0100_bdc

&----


*& Form bdc_dynpro

&----


  • text

----


FORM bdc_dynpro USING program

dynpro.

CLEAR i_bdcdata.

i_bdcdata-program = program.

i_bdcdata-dynpro = dynpro.

i_bdcdata-dynbegin = 'X'.

APPEND i_bdcdata.

ENDFORM. " bdc_dynpro

&----


*& Form bdc_field

&----


  • BDC Field

----


FORM bdc_field USING fnam fval.

CLEAR i_bdcdata.

i_bdcdata-fnam = fnam.

i_bdcdata-fval = fval.

APPEND i_bdcdata.

ENDFORM. " bdc_field

-Satya Priya

1 REPLY 1

Former Member
0 Kudos
73

Hi Priya,

You can't download a file to presentation server by running a progarm in the background because if you run in the background the system will not be able to find the path for where to download in the presentation server.

Regards.

Hairsh.