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

BDC Call Transaction method in background

Former Member
0 Likes
5,606

Dear Experts,

I have created a BDC for T-code FF32 using Call Transaction method and User wants to execute the BDC in the background. I need to know that is it possible to execute a BDC created using Call Transaction method in Background through SM36.

Thanks and Regards,

Mahesh

Dear Experts,

I have created a BDC for T-code FF32 using Call Transaction method and User wants to execute the BDC in the background. I need to know that is it possible to execute a BDC created using Call Transaction method in Background through SM36.

Thanks and Regards,

Mahesh

8 REPLIES 8
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,769

Perform some search on Creating Batch Input Sessions and report RSBDCSUB.

Alternative, create a Z-report with parameters similar to the CALL TRANSACTION statement, usage of NO-DISPLAY parameters allow usage of almost any type of parameters.

Regards,

Raymond

Read only

Former Member
0 Likes
2,769

Hi Mahesh,

use coding like this.

data: opt type ctu_params.

opt-updmode = 'E'.

call transaction <tcode> using <bdc_data_tab> options from <opt>

Kind Regards

Robert

Read only

former_member209120
Active Contributor
0 Likes
2,769

Hi Mahesh ,

You can try this way to run BDC in Call Transaction method in Background through SM36.

TYPES : BEGIN OF TY_FILE,

        MBRSH TYPE MARA-MBRSH,

        MTART TYPE MARA-MTART,

        MAKTX TYPE MAKT-MAKTX,

        MEINS TYPE MARA-MEINS,

        END OF TY_FILE.

DATA : I_FILE TYPE TABLE OF TY_FILE .

DATA : WA_FILE TYPE TY_FILE .

DATA : LV_MSG TYPE STRING .

**********************BDC DATA DECLARARATIONS

DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.

DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

BREAK-POINT .

CALL FUNCTION 'GUI_UPLOAD'

  EXPORTING

    FILENAME            = 'C:\MARADATA.TXT'                    " Give File Path (File MARADATA.TXT should maintain in this path)

    FILETYPE            = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

  TABLES

    DATA_TAB            = I_FILE.

LOOP AT I_FILE INTO WA_FILE .

  perform bdc_dynpro      using 'SAPLMGMM' '0060'.

  perform bdc_field       using 'BDC_CURSOR'

                                'RMMG1-MTART'.

  perform bdc_field       using 'BDC_OKCODE'

                                '=AUSW'.

  perform bdc_field       using 'RMMG1-MBRSH'

WA_FILE-MBRSH.

  perform bdc_field       using 'RMMG1-MTART'

                                WA_FILE-MTART.

  perform bdc_dynpro      using 'SAPLMGMM' '0070'.

  perform bdc_field       using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

  perform bdc_field       using 'BDC_OKCODE'

                                '=ENTR'.

  perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'

                                'X'.

  perform bdc_dynpro      using 'SAPLMGMM' '4004'.

  perform bdc_field       using 'BDC_OKCODE'

                                '=BU'.

  perform bdc_field       using 'MAKT-MAKTX'

                                 WA_FILE-MAKTX.

  perform bdc_field       using 'BDC_CURSOR'

                                'MARA-MEINS'.

  perform bdc_field       using 'MARA-MEINS'

                                WA_FILE-MEINS.

  perform bdc_field       using 'MARA-MTPOS_MARA'

                                'NORM'.

  CALL TRANSACTION 'MM01'

      USING bdcdata

      UPDATE 'A'

      MODE 'N'                                   " 'N' BDC in a background job.

      MESSAGES INTO MESSTAB .

  If SY-SUBRC = 0.

    Perform display_success_rec.

  Else .

    Perform display_error_rec.

  Endif.

  CLEAR WA_FILE .

  REFRESH  BDCDATA.

  CLEAR BDCDATA.

  REFRESH MESSTAB .

  CLEAR MESSTAB.

ENDLOOP .

Read only

koolspy_ultimate
Active Contributor
0 Likes
2,769

Hi,

     I also depends on the inputs for your bdc. Are you using external file to upload from presentation server? if so then your bdc will not work. For this to work you need to use datasets.

Regards,

Madhumahesh.

Read only

0 Likes
2,769

Thanks for all the replies..

@Madhumahesh:- I m not using any flat file.. Simply data will be fetched from the Ztable and as per that                            data BDC will execute.

Read only

0 Likes
2,769

Hi,

Then you can use mode 'N' in your call transaction (also advised by above members) and run your bdc in background.

Regards,

Madhumahesh.

Read only

Former Member
0 Likes
2,769

Hi,

In SM36 you can schedule the program by placing MODE 'N' in call transaction stmt. Are you facing any problem in scheduling ?


Read only

former_member219762
Contributor
0 Likes
2,769

Hi,

    You can run call transaction in background by set mode "N". First create a report program with call transaction and create back ground job with this program in sm36.

If you have any selection screen or controls(alv grid----) in your transaction it will give erorr.