Will BDC work in Background job

I have written the BDC program and i want to  scheduled the program in Background job in the late night and see the result of processed records as a ALV report.Is it possible to run BDC as Background job..........

TYPE-POOLS: SLIS.
DATA : PRDAT(8).
DATA : WF_ORG(30).
DATA   PERNR    TYPE STANDARD TABLE OF KOMV_INDEX
                     WITH HEADER LINE INITIAL SIZE 50.
DATA  MOD VALUE 'N'.                                         "E
DATA: MASK(64) VALUE
',Tab Delimited Text Files(.txt),.txt,All Files(.),..'.
DATA:  WF_DATE1(10) TYPE C,
       WF_TIME(10) TYPE C.
DATA: AUART LIKE VBAK-AUART .  "VALUE 'ZQT'.
DATA: WF_SNO TYPE I .
DATA XTP LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.
Internal table for reading file
DATA: BEGIN OF XFILE OCCURS 0,
       RESWK LIKE EKKO-RESWK,
       EKORG LIKE EKKO-EKORG,
       EKGRP LIKE EKKO-EKGRP,
       BUKRS LIKE EKKO-BUKRS,
       MATNR  LIKE EKPO-MATNR,
       MENGE LIKE EKPO-MENGE,
       MEINS LIKE EKPO-MEINS,
       RECPLT LIKE EKPO-WERKS,
       BWTAR LIKE EKPO-BWTAR,
       END OF XFILE.
Invalid customers listing file
*data: xout_err like xout occurs 0 with header line.
DATA: BEGIN OF XOUT_ERR OCCURS 0,
        KUNNR LIKE KNA1-KUNNR,
        WERKS LIKE VBAP-WERKS,         "Plant
      END OF XOUT_ERR.
Internal Table for Error in file
DATA: BEGIN OF XERR OCCURS 0,
      INDEX LIKE SY-TABIX,
      MSG(132),
      END OF XERR.
DATA: BEGIN OF BDCDATA OCCURS 0.
        INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
DATA BEGIN OF MSGCOLL OCCURS 10.
        INCLUDE STRUCTURE BDCMSGCOLL.
DATA END OF MSGCOLL.
Internal table for writing final report
DATA: BEGIN OF XOUT OCCURS 0,
          SERIAL_NO        TYPE I,
          RECPLT LIKE EKPO-WERKS,
          MATNR  LIKE EKPO-MATNR,
          KBETR LIKE  KOMV-KBETR,
          KPEIN  LIKE KOMV-KPEIN,
          KMEIN LIKE KOMV-KMEIN,
          MAKTX LIKE MAKT-MAKTX,
          REMARKS(30),
          DATE(10) TYPE C,
        END OF XOUT.
*****Structures For ALV**********************************************
DATA : L_VARIANT LIKE DISVARIANT,
       WF_VARIANT LIKE DISVARIANT.
DATA:  WF_REPORT LIKE SY-REPID.
DATA: WF_EVENTS TYPE SLIS_T_EVENT .
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: GT_FIELDCATALL TYPE SLIS_T_FIELDCAT_ALV.
DATA: LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: G_REPID LIKE SY-REPID.
DATA: IT_SORT  TYPE SLIS_T_SORTINFO_ALV .
DATA: GS_LAYOUTALL TYPE SLIS_LAYOUT_ALV.
DATA: GT_EVENTS   TYPE SLIS_T_EVENT.
DATA: GT_EVENTSALL   TYPE SLIS_T_EVENT.
DATA: GS_KEYINFO  TYPE SLIS_KEYINFO_ALV.
DATA: G_TABNAME_HEADER TYPE SLIS_TABNAME.
DATA: G_TABNAME_ITEM   TYPE SLIS_TABNAME.
DATA  ST_SORT  TYPE SLIS_SORTINFO_ALV  .
DATA: S_LIST_TOPOFPAGE TYPE SLIS_LISTHEADER.
DATA: IST_LIST_TOPOFPAGE TYPE SLIS_T_LISTHEADER .
DATA: WF_EVENT TYPE SLIS_ALV_EVENT.
CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
*****Selection Screen************************************************
***Selection Screen
SELECTION-SCREEN SKIP 3.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: FILENAME LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
*******Initialization Events******************************************
INITIALIZATION.
Read the column heading from textpool
  REFRESH XTP.
  READ TEXTPOOL SY-REPID INTO XTP LANGUAGE SY-LANGU.
*******AT SELECTION SCREEN Events*************************************
AT SELECTION-SCREEN .
  WF_REPORT = SY-REPID.
  L_VARIANT = WF_REPORT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME  = SYST-CPROG
      DYNPRO_NUMBER = SYST-DYNNR
      FIELD_NAME    = ' '
    IMPORTING
      FILE_NAME     = FILENAME.
*******Start Of Selection Events**************************************
START-OF-SELECTION.
  WF_SNO = 1.
  WF_REPORT = SY-REPID.
  WRITE SY-DATUM TO WF_DATE1.
  WRITE SY-UZEIT TO WF_TIME.
Upload the file into XFILE
  CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      FILENAME                = FILENAME
      FILETYPE                = 'DAT'
    TABLES
      DATA_TAB                = XFILE
    EXCEPTIONS
      CONVERSION_ERROR        = 1
      FILE_OPEN_ERROR         = 2
      FILE_READ_ERROR         = 3
      INVALID_TABLE_WIDTH     = 4
      INVALID_TYPE            = 5
      NO_BATCH                = 6
      UNKNOWN_ERROR           = 7
      GUI_REFUSE_FILETRANSFER = 8
      OTHERS                  = 9.
  LOOP AT XFILE.
    REFRESH PERNR.
    CLEAR PERNR.
    PERFORM CALL_ME21N.
   IMPORT PERNR FROM MEMORY ID 'PERNR'.
    FREE MEMORY ID 'PERNR'.
    READ TABLE PERNR WITH KEY KSCHL = 'ZASV'.
    IF SY-SUBRC = 0.
      XOUT-KBETR      =  PERNR-KBETR.
      XOUT-KPEIN   =  PERNR-KPEIN.
      XOUT-KMEIN  = PERNR-KMEIN.
      XOUT-RECPLT = XFILE-RECPLT.
      XOUT-MATNR =  XFILE-MATNR.
      XOUT-SERIAL_NO = WF_SNO.
     XOUT-DATE = WF_DATE1.
     CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
       EXPORTING
         INPUT         = XOUT-MATNR
      IMPORTING
        OUTPUT        = XOUT-MATNR
SELECT SINGLE MAKTX INTO XOUT-MAKTX FROM MAKT
                          WHERE MATNR = XOUT-MATNR.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
*INPUT         = XOUT-MATNR
                     IMPORTING
OUTPUT        = XOUT-MATNR  .
      CLEAR PERNR.
      APPEND XOUT.
      ELSE.
      XOUT-KBETR      = ''.
      XOUT-KPEIN   =  ''.
      XOUT-KMEIN  = ''.
      XOUT-RECPLT = XFILE-RECPLT.
      XOUT-MATNR =  XFILE-MATNR.
      XOUT-SERIAL_NO = WF_SNO.
      XOUT-REMARKS = 'ERROR'.
      XOUT-DATE = WF_DATE1.
       APPEND XOUT.
    ENDIF.
    CLEAR XFILE.
    WF_SNO = WF_SNO + 1.
  ENDLOOP.
DELETE XOUT WHERE MATNR = ''.
  PERFORM WRITE_OUTPUT.
*&      Form  CALL_ME21N
FORM CALL_ME21N.
  DATA : DATE(10).
  REFRESH BDCDATA.
  CLEAR BDCDATA.
  CLEAR DATE.
     CONCATENATE SY-DATUM6(2) SY-DATUM4(2)
                               SY-DATUM+0(4) INTO  PRDAT.
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=MEDOCTYPE'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'MEPO_TOPLINE-BSART'.
PERFORM BDC_FIELD       USING 'MEPO_TOPLINE-BSART'
                              'UB'.
PERFORM BDC_FIELD       USING 'MEPO_TOPLINE-BEDAT'
                             '25.07.2007'.
PRDAT.
PERFORM BDC_FIELD       USING 'DYN_6000-LIST'
                              '                                      1'.
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '/00'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'MEPO_TOPLINE-SUPERFIELD'.
PERFORM BDC_FIELD       USING 'MEPO_TOPLINE-BSART'
                              'UB'.
PERFORM BDC_FIELD       USING 'MEPO_TOPLINE-SUPERFIELD'
                               XFILE-RESWK.
PERFORM BDC_FIELD       USING 'MEPO_TOPLINE-BEDAT'
PRDAT.
PERFORM BDC_FIELD       USING 'MEPO1222-EKORG'
                             '1000'.
XFILE-EKORG.
PERFORM BDC_FIELD       USING 'MEPO1222-EKGRP'
                              'STO'.
PERFORM BDC_FIELD       USING 'MEPO1222-BUKRS'
                             '1000'.
XFILE-BUKRS.
PERFORM BDC_FIELD       USING 'DYN_6000-LIST'
                              '                                      1'
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=MEV4001BUTTON'.
*perform bdc_field       using 'BDC_CURSOR'
                             'MEPO_TOPLINE-SUPERFIELD'.
*perform bdc_field       using 'MEPO_TOPLINE-BSART'
                             'UB'.
*perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                             '2100 EOL RMT'.
*perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                             '25.07.2007'.
*perform bdc_field       using 'MEPO1222-EKORG'
                             '1000'.
*perform bdc_field       using 'MEPO1222-EKGRP'
                             'STO'.
*perform bdc_field       using 'MEPO1222-BUKRS'
                             '1000'.
*perform bdc_field       using 'DYN_6000-LIST'
                             '                                      1'
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '/00'.
*perform bdc_field       using 'MEPO_TOPLINE-BSART'
                             'UB'.
*perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                             '2100 EOL RMT'.
*perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                             '25.07.2007'.
*perform bdc_field       using 'MEPO1222-EKORG'
                             '1000'.
*perform bdc_field       using 'MEPO1222-EKGRP'
                             'STO'.
*perform bdc_field       using 'MEPO1222-BUKRS'
                             '1000'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'MEPO1211-MEINS(01)'.
PERFORM BDC_FIELD       USING 'MEPO1211-EMATN(01)'
                             '3000'.
XFILE-MATNR.
WF_ORG = XFILE-MENGE.
CONDENSE WF_ORG .
PERFORM BDC_FIELD       USING 'MEPO1211-MENGE(01)'
WF_ORG.
PERFORM BDC_FIELD       USING 'MEPO1211-MEINS(01)'
                             'l'.
XFILE-MEINS.
PERFORM BDC_FIELD       USING 'MEPO1211-NAME1(01)'
                             '4102'.
XFILE-RECPLT.
*perform bdc_field       using 'DYN_6000-LIST'
                             '                                      1'
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '/00'.
*perform bdc_field       using 'MEPO_TOPLINE-BSART'
                             'UB'.
*perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                             '2100 EOL RMT'.
*perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                             '25.07.2007'.
*perform bdc_field       using 'MEPO1222-EKORG'
                             '1000'.
*perform bdc_field       using 'MEPO1222-EKGRP'
                             'STO'.
*perform bdc_field       using 'MEPO1222-BUKRS'
                             '1000'.
*perform bdc_field       using 'BDC_CURSOR'
                             'MEPO1211-NAME1(01)'.
*perform bdc_field       using 'MEPO1211-NAME1(01)'
                             '4102'.
*perform bdc_field       using 'DYN_6000-LIST'
                             '                                      1'
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '/00'.
*perform bdc_field       using 'MEPO_TOPLINE-BSART'
                             'UB'.
*perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                             '2100 EOL RMT'.
*perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                             '25.07.2007'.
*perform bdc_field       using 'MEPO1222-EKORG'
                             '1000'.
*perform bdc_field       using 'MEPO1222-EKGRP'
                             'STO'.
*perform bdc_field       using 'MEPO1222-BUKRS'
                             '1000'.
*perform bdc_field       using 'DYN_6000-LIST'
                             '                                      1'
*perform bdc_field       using 'BDC_CURSOR'
                             'MEPO1313-BWTAR'.
*perform bdc_field       using 'MEPO1313-UEBTO'
                             '10.0'.
*perform bdc_field       using 'MEPO1313-MAHN1'
                             '10'.
*perform bdc_field       using 'MEPO1313-MAHN2'
                             '20'.
*perform bdc_field       using 'MEPO1313-MAHN3'
                             '30'.
PERFORM BDC_FIELD       USING 'MEPO1313-BWTAR'
                             'OWN_D'.
XFILE-BWTAR.
*perform bdc_field       using 'MEPO1313-IPRKZ'
                             'D'.
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=TABIDT8'.
*perform bdc_field       using 'MEPO_TOPLINE-BSART'
                             'UB'.
*perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                             '2100 EOL RMT'.
*perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                             '25.07.2007'.
*perform bdc_field       using 'MEPO1222-EKORG'
                             '1000'.
*perform bdc_field       using 'MEPO1222-EKGRP'
                             'STO'.
*perform bdc_field       using 'MEPO1222-BUKRS'
                             '1000'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'MEPO1211-EEIND(01)'.
*perform bdc_field       using 'DYN_6000-LIST'
                             '                                      1'.
*perform bdc_field       using 'MEPO1313-UEBTO'
                             '10.0'.
*perform bdc_field       using 'MEPO1313-MAHN1'
                             '10'.
*perform bdc_field       using 'MEPO1313-MAHN2'
                             '20'.
*perform bdc_field       using 'MEPO1313-MAHN3'
                             '30'.
PERFORM BDC_FIELD       USING 'MEPO1313-BWTAR'
                             'OWN_D'.
XFILE-BWTAR.
*perform bdc_field       using 'MEPO1313-IPRKZ'
                             'D'.
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=V69A_KONY'.
*perform bdc_field       using 'MEPO_TOPLINE-BSART'
                             'UB'.
*perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                             '2100 EOL RMT'.
*perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                             '25.07.2007'.
*perform bdc_field       using 'DYN_6000-LIST'
                             '                                      1'.
*perform bdc_field       using 'BDC_CURSOR'
                             'KOMV-KSCHL(01)'.
PERFORM BDC_DYNPRO      USING 'SAPMSSY0' '0120'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              '05/04'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=PICK'.
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=MESAVE'.
*perform bdc_field       using 'MEPO_TOPLINE-BSART'
                             'UB'.
*perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                             '2100 EOL RMT'.
*perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                             '25.07.2007'.
PERFORM BDC_FIELD       USING 'DYN_6000-LIST'
                              '                                      1'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'KOMV-KSCHL(01)'.
PERFORM BDC_DYNPRO      USING 'SAPLSPO2' '0101'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=CANC'.
PERFORM BDC_DYNPRO      USING 'SAPLMEGUI' '0014'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=MELEAV'.
*perform bdc_field       using 'MEPO_TOPLINE-BSART'
                             'UB'.
*perform bdc_field       using 'MEPO_TOPLINE-SUPERFIELD'
                             '2100 EOL RMT'.
*perform bdc_field       using 'MEPO_TOPLINE-BEDAT'
                             '25.07.2007'.
PERFORM BDC_FIELD       USING 'DYN_6000-LIST'
                              '                                      1'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'KOMV-KSCHL(01)'.
PERFORM BDC_DYNPRO      USING 'SAPLSPO1' '0100'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=NO'.
  CALL TRANSACTION 'ME21N' USING BDCDATA MODE MOD
                          MESSAGES INTO MSGCOLL.
ENDFORM.                                                    " CALL_VA21
FORM BDC_DYNPRO USING  PROGRAM DYNPRO.
  CLEAR BDCDATA.
  BDCDATA-PROGRAM = PROGRAM.
  BDCDATA-DYNPRO  = DYNPRO.
  BDCDATA-DYNBEGIN = 'X'.
  APPEND BDCDATA.
ENDFORM.                               " BDC_DYNPRO
FORM BDC_FIELD USING FNAM FVAL.
  CLEAR BDCDATA.
  BDCDATA-FNAM = FNAM.
  BDCDATA-FVAL = FVAL.
  APPEND BDCDATA.
ENDFORM.                               " BDC_FIELD
FORM FIELDCAT_INIT USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
  DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
  DATA POS TYPE I VALUE 0.
  POS = POS + 1.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-COL_POS      = POS.
  LS_FIELDCAT-TABNAME      = 'XOUT'.
  LS_FIELDCAT-FIELDNAME    = 'SERIAL_NO'.
  LS_FIELDCAT-SELTEXT_M    = 'Sr No'.
  LS_FIELDCAT-EMPHASIZE    = 'C410'.
  LS_FIELDCAT-OUTPUTLEN    = '4'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  POS = POS + 1.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-COL_POS      = POS.
  LS_FIELDCAT-TABNAME      = 'XOUT'.
  LS_FIELDCAT-FIELDNAME    = ' RECPLT'.
  LS_FIELDCAT-SELTEXT_M    = 'RECEVIENG PLANT'.
  LS_FIELDCAT-HOTSPOT      = 'X'.
  LS_FIELDCAT-EMPHASIZE    = 'C410'.
  LS_FIELDCAT-OUTPUTLEN    = '15'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  POS = POS + 1.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-COL_POS      = POS.
  LS_FIELDCAT-TABNAME      = 'XOUT'.
  LS_FIELDCAT-FIELDNAME    = 'MATNR'.
  LS_FIELDCAT-SELTEXT_M    = 'Material Code'.
  LS_FIELDCAT-HOTSPOT      = 'X'.
  LS_FIELDCAT-EMPHASIZE    = 'C410'.
  LS_FIELDCAT-OUTPUTLEN    = '15'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  POS = POS + 1.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-COL_POS      = POS.
  LS_FIELDCAT-TABNAME      = 'XOUT'.
  LS_FIELDCAT-FIELDNAME    = 'MAKTX'.
  LS_FIELDCAT-SELTEXT_M    = 'Mat Description'.
  LS_FIELDCAT-EMPHASIZE    = 'C410'.
  LS_FIELDCAT-OUTPUTLEN    = '15'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  POS = POS + 1.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-COL_POS      = POS.
  LS_FIELDCAT-TABNAME      = 'XOUT'.
  LS_FIELDCAT-FIELDNAME    = 'KBETR'.
  LS_FIELDCAT-SELTEXT_M    = 'GAQ'.
  LS_FIELDCAT-EMPHASIZE    = 'C410'.
  LS_FIELDCAT-OUTPUTLEN    = '15'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  POS = POS + 1.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-COL_POS      = POS.
  LS_FIELDCAT-TABNAME      = 'XOUT'.
  LS_FIELDCAT-FIELDNAME    = 'KPEIN'.
  LS_FIELDCAT-SELTEXT_M    = 'Per'.
  LS_FIELDCAT-EMPHASIZE    = 'C410'.
  LS_FIELDCAT-OUTPUTLEN    = '15'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  POS = POS + 1.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-COL_POS      = POS.
  LS_FIELDCAT-TABNAME      = 'XOUT'.
  LS_FIELDCAT-FIELDNAME    = 'KMEIN'.
  LS_FIELDCAT-SELTEXT_M    = 'UNit'.
  LS_FIELDCAT-EMPHASIZE    = 'C410'.
  LS_FIELDCAT-OUTPUTLEN    = '15'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  POS = POS + 1.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-COL_POS      = POS.
  LS_FIELDCAT-TABNAME      = 'XOUT'.
  LS_FIELDCAT-FIELDNAME    = 'DATE'.
  LS_FIELDCAT-SELTEXT_M    = 'DATE'.
  LS_FIELDCAT-EMPHASIZE    = 'C410'.
  LS_FIELDCAT-OUTPUTLEN    = '15'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  POS = POS + 1.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-COL_POS      = POS.
  LS_FIELDCAT-TABNAME      = 'XOUT'.
  LS_FIELDCAT-FIELDNAME    = 'REMARKS'.
  LS_FIELDCAT-SELTEXT_M    = 'REMARKS'.
  LS_FIELDCAT-EMPHASIZE    = 'C410'.
  LS_FIELDCAT-OUTPUTLEN    = '15'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
ENDFORM.                    " fieldcat_init
*&      Form  layout
FORM LAYOUT .
  LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
  LAYOUT-ZEBRA = 'X'.
ENDFORM.                    "layout
**&      Form  write_alv_grid
FORM WRITE_ALV_GRID.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = WF_REPORT
      I_BACKGROUND_ID    = 'ESSARLOGO'
      IS_LAYOUT          = LAYOUT
      IT_FIELDCAT        = GT_FIELDCAT[]
      IT_SORT            = IT_SORT
      I_SAVE             = 'A'
      IS_VARIANT         = WF_VARIANT
      IT_EVENTS          = WF_EVENTS
    TABLES
      T_OUTTAB           = XOUT
    EXCEPTIONS
      PROGRAM_ERROR      = 1
      OTHERS             = 2.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " write_alv_grid
*&      Form  top-of-page
FORM TOP_OF_PAGE.
***This function for heading
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = IST_LIST_TOPOFPAGE.
   I_LOGO                   =
   I_END_OF_LIST_GRID       =
ENDFORM.                    "heading
**&      Form  write_output
FORM WRITE_OUTPUT .
***To get the events
  PERFORM CREATE_EVENT USING WF_EVENTS.
***Heading for grid
  PERFORM WRITE_TOPOFPAGE USING IST_LIST_TOPOFPAGE .
  PERFORM FIELDCAT_INIT  USING GT_FIELDCAT[].
  PERFORM LAYOUT.
***Display the ALV
  PERFORM WRITE_ALV_GRID.
ENDFORM.                    " write_output
*&      Form  write_topofpage
FORM WRITE_TOPOFPAGE USING L_IT_LIST_TOPOFPAGE
                     TYPE  SLIS_T_LISTHEADER.
  CLEAR S_LIST_TOPOFPAGE.
  S_LIST_TOPOFPAGE-TYP  = 'H'.
  S_LIST_TOPOFPAGE-INFO = TEXT-012  .
  APPEND S_LIST_TOPOFPAGE TO L_IT_LIST_TOPOFPAGE.
  CLEAR S_LIST_TOPOFPAGE.
  S_LIST_TOPOFPAGE-TYP  = 'S'.
  S_LIST_TOPOFPAGE-KEY = TEXT-013 .
  S_LIST_TOPOFPAGE-INFO = SY-UNAME.
  APPEND S_LIST_TOPOFPAGE TO L_IT_LIST_TOPOFPAGE.
  S_LIST_TOPOFPAGE-KEY = TEXT-014 .
  S_LIST_TOPOFPAGE-INFO = WF_DATE1  .
  APPEND S_LIST_TOPOFPAGE TO L_IT_LIST_TOPOFPAGE.
  S_LIST_TOPOFPAGE-KEY = TEXT-015 .
  S_LIST_TOPOFPAGE-INFO = WF_TIME  .
  APPEND S_LIST_TOPOFPAGE TO L_IT_LIST_TOPOFPAGE.
ENDFORM.                    " write_topofpage
*&      Form  CREATE_EVENT
FORM CREATE_EVENT USING L_EVENTS TYPE SLIS_T_EVENT.
*This  Function is to get the events
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      I_LIST_TYPE     = 0
    IMPORTING
      ET_EVENTS       = WF_EVENTS
    EXCEPTIONS
      LIST_TYPE_WRONG = 1
      OTHERS          = 2.
  READ TABLE WF_EVENTS  INTO WF_EVENT WITH KEY NAME =
SLIS_EV_TOP_OF_PAGE.
  IF SY-SUBRC = 0.
    MOVE FORMNAME_TOP_OF_PAGE TO WF_EVENT-FORM.
    APPEND WF_EVENT TO WF_EVENTS.
  ENDIF.
ENDFORM.                    " eventsENDFORM.                    " events                           .
iam manually scheduled program in the Background
through menu  -
> program -
> F9.

Similar Messages

  • Program works but background job for that program fails....

    I have a requirement where I have to collect the details of the purchase order and put the details in XML file format and FTP the XML file to an external third party FTP Server.
    To realize this I developed a report program which follows following logic.
    1)     First I collected the PO details by calling the BAPI BAPI_PO_GETDETAIL1.
    2)     Then using the following link "/people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
    I converted these PO details to the XML file format that the third party people accept.
           In the code I used u201CCALL METHOD cl_gui_frontend_services=>gui_downloadu201D and in this process first the XML file is generated and is getting stored on my deskytop.
    3)     Then I called HTTP_SCRAMBLE, FTP_CONNECT, FTP_COMMAND , FTP_DISCONNECT and RFC_CONNECTION_CLOSE.
    This works perfectly well and each time I execute the report the file is getting FTPu2019ed to the third party FTP server.
    Now I tried to schedule a batch job for this and the batch job fails with follwing errors
    02/25/2009 15:08:47 Error in Control Framework
    Message Class  = FES         
    Message Number = 022  
    Message Type   = E
    02/25/2009 15:08:47 Job cancelled after system exception ERROR_MESSAGE 
    Message Class  = 00        
    Message Number = 564  
    Message Type   = A                
    Can some one tell me what is going wrong. My report works perfect in front end but fails if I try to schedule a background job for it in SM36.
    Can you please tell me whatz going wrong with batch job? Any Help is highly appreciated.
    Regards,
    JEssica SAm

    Robert...Thanks for the reply...
    I am using follwing code
    l_xml_size = l_ostream->get_num_written_raw( ).
        CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            bin_filesize = l_xml_size
            filename     = FILEPATH
            filetype     = 'BIN'
          CHANGING
            data_tab     = l_xml_table
          EXCEPTIONS
            OTHERS       = 24.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    Now what changes should i make..where should i store my XML file then instead of my desktop?
    and whih Function Module should i Use..

  • MDVP only working as background job

    Hello,
    I was working on the ATP check when i discovered the only way to actually perform this check correctly was to execute it as a background job. When executing online, the stock is just not committed (even with full confirmation logic set on in the MRP group).
    It only works fine from the planned order.
    Isn't it possible to run MDVP online ??
    Any enlightements on this topic appreciated.
    Olivier

    Hi,
    You can run the availability check in background with program RLD05000. You have to create variant and schedule this program in batch from SM36 transaction, Out out you can check in spool.
    If helps rewards your points.
    Regards
    TAJUDDIN

  • BDC is not working as background job

    Dear Expert,
    I have developed a program which contain BDC of FB75 with mode 'E' . I have Schedule this program as background by FM 'JOB OPEN' , Submit statement and 'JOB CLOSE'. My problem is when i run this program as background BDC is not working.
    What is the solution of this problem?
    Thanks
    Avadhesh

    Hi Avadhesh,
      if FB75 is doing a commit work, then, your batch job will finish with error at the time of BDC execution.
      Try to add the option parameter type CTU_PARAMS to the CALL TRANSACTION with field RACOMMIT = 'X'.
    DATA opt TYPE ctu_params.
    opt-RACOMMIT = 'X'.
    CALL TRANSACTION 'FB75' USING bdcdata_tab OPTIONS FROM opt.
    Regards.

  • TEXT_CONVERT_XLS_TO_SAP in background job schedule giving error

    Hi Experts,
    I used TEXT_CONVERT_XLS_TO_SAP to upload excel data. it is working fine in forground.
    As large volume of data is there, I sheduled it in back ground using SM 36/ SM37.
    data is not getting uploaded. I closed the excel file...still it is not getting uploaded. internal table contains no data.
    Can any one help me on this....
    Regards,
    apuri

    Hi kiran,
    he function modulw which u r using is GUI function module.
    Gui function module will not work in background jobs.
    Thanks,

  • GUI_CREATE_DIRECTORY will it works in back ground job

    Hi All,
    Could any body say, the FM GUI_CREATE_DIRECTORY will works in BACKGROUND Job.
    Thanks in advance,
    srinivas,

    You can create an external command via SM69 which you can then invoke through function module SXPG_COMMAND_EXECUTE
    For NT you'd need something like the following:
    Operating system command                             
    cmd                                                                               
    Parameters for operating system command              
    /c mkdir
    $/SAPGLOBALHOST/\?   
    Have fun,
    Mark
    Kudos to Pete Devereux and Pete White

  • Run ALV in Background JOB (DUMP)

    HI Experts,
    Before post  i have already  look at this forum and tried many solutions , im on  SAPGUI 7.20 and already creatde a doc container... so nothing has work yet...
    Im trying to run a alv report in a  scheduled JOB...!!
    Below the Dump Description and My source code...!
    Many Thanks for any help..!!!!
    DUMP.
    Short text
        Exception condition "CNTL_ERROR" raised.
    What happened?
        The current ABAP/4 program encountered an unexpected
        situation.
    What can you do?
        Note down which actions and inputs caused the error.
        To process the problem further, contact you SAP system
        administrator.
        Using Transaction ST22 for ABAP Dump Analysis, you can look
        at and manage termination messages, and you can also
        keep them for a long time.
    Error analysis
        A RAISE statement in the program "CL_GUI_CONTROL================CP" raised the
         exception
        condition "CNTL_ERROR".
        Since the exception was not intercepted by a superior
        program, processing was terminated.
        Short description of exception condition:
        For detailed documentation of the exception condition, use
        Transaction SE37 (Function Library). You can take the called
        function module from the display of active calls.
    How to correct the error
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
    SOURCE CODE:
    DATA: gro_doc_container     TYPE REF TO cl_gui_docking_container,
            w_off                 TYPE  INT4.
      IF w_1c_container IS INITIAL.
      CALL METHOD cl_gui_alv_grid=>offline
       RECEIVING e_offline = w_off.
    IF NOT w_off is initial.
        CREATE OBJECT w_1obj_alv
                 EXPORTING i_parent = gro_doc_container .
      else.
          CREATE OBJECT w_1c_container
            EXPORTING
              container_name = c_1alv.
          CREATE OBJECT w_1obj_alv
            EXPORTING
              i_parent = w_1c_container.
        ENDIF.
        CREATE OBJECT w_event_receiver.
        SET HANDLER: w_event_receiver->handle_data_changed FOR w_1obj_alv,
                     w_event_receiver->handle_toolbar FOR w_1obj_alv,
                     w_event_receiver->handle_user_command FOR w_1obj_alv.
        CALL METHOD w_1obj_alv->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_modified.
        CALL METHOD w_1obj_alv->set_table_for_first_display
          EXPORTING
            i_save               = c_a
            is_layout            = e_1layout
            is_variant           = e_1variant
            it_toolbar_excluding = is_1func
            i_structure_name     = c_1strucs1
          CHANGING
            it_outtab            = is_1pant
            it_fieldcatalog      = is_1fcat[].

    HI ,
    The ALV grid will not work in background. You need to check sy-batch (for background processing ) and write a seperate code .
    The better way of doing is to use SALV factory methods - It works both in background and foreground modes.
    Remember It will work on ECC and it doesnot support editable ALV directly.
    For Demo program  SALV_DEMO* and F4
    Hope this brings clarity and neccassary help to you.

  • Sending of email triggered in a background job ends with error.

    Hello all,
    I have created a API which triggers mail to a distribution list using class CL_BCS. When i execute this API in foreground it works fine and the mails are triggered.
    However i am calling this API in a report which will scheduled as a  background job in my application and this job executes for some 5 to 6 hours and after that i trigger the mail. However at this point the job gets cancelled due to an abort message raised in
    one of the CL_BCS methods.
    The method is cl_cam_address_bcs=>create_internet_address which is called in my API and internally this calls many other methods. The abort meessage is thrown from the method instantiate_imp_class of class CL_EXIT_MASTER.
    The ST22 log reads like this:
    Runtime Errors:  LOAD_SWITCHSTATES_MISMATCH
    Short text:  Current switch statuses are incompatible with program switch statuses.
    What happened?
        The current switch statuses that are read for the execution of the
        program "CL_IM_CVI_ADDRESS_UPD_IMPL====CP" are incompatible with the switch
         statuses with which the
        program "CL_IM_CVI_ADDRESS_UPD_IMPL====CP" was generated at the time
         20090902114544.
    Any advice would be greatly helpful.
    Warm Regards,
    Naveen M

    Hi!
    How you determine sender (method set_sender) ? if you use current user, when it runs on background use a backgorund user and it maybe can not determine an email.
    Try force a sender (harcode your user for test when sy-batch eq 'X')
    If it works, you need to determine the user to be used on jobs to solve this problem.
    I hope it helps
    Regards!!!!

  • Inbound IDoc creating background job even for trigger immediately setup

    All,
    I have a very serious problem in our production system.
    Scenario:
    Vendor is chagend in system A (Outbound) and the same is interfaced to System B (Inbound) and i am using trigger immediately option, but still I am seeing a background job is created for 'RBDAPP01' and creating the spool request. The issue is I am sending 1000 of idocs and the spool number is increasing daily in system B.
    So, can any one explain me why the background job is getting triggered even though I set the partner profile settings as 'Trigger Immediately'.
    The above issue is not happening in our quality system it simply updagtes vendor information in system B with out creating any background job. Please note that the same settings are maintained in both the systems.
    Your immediate inputs are really valuable for me.
    Regards,
    Suman

    This is an performance issue on the receiving system. In case the system does not have enough resources to process the IDoc immediately it will always schedule a background job to ensure the processing of data.
    You need to check whether the system has enough work processes available during the time when 1000 of IDocs are received or send the IDocs in packages with some time in between.
    Regards,
    Kai

  • ABAP program to run in Background job

    Hi,
    We have a custumized program (SO Creation) calling some functions (like: WS_QUERY, WS_UPLOAD, WS_DOWNLOAD, CREATE_TEXT and CALL TRANSACTION VA01) and can only run thru dialog process (foreground).  Is it possible to convert it to something that can run thru background job?
    Please help.
    Thanks.

    Hi Deo ,
    Unfortunately cl_gui_frontend_services will not work in background.
    Please have a look at following information about cl_gui_frontend_services :
    The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
    File functions
    Directory functions
    Registry
    Environment
    Write to / read from clipboard
    Upload / download files
    Execute programs / open documents
    Query functions, such as Windows directory, Windows version, and so on
    Standard dialogs (open, save, directory selection)
    To Use this, you should be bit familier with OO ABAP Concepts. So I will suggest you to go through with OO concepts of ABAP. It will be of great help to you.
    Regards,
    Nikhil

  • E-Mail for background Job

    Hi All,
    We need to schedule a Job in background in every 30 min or 1 hr, which will monitor all the other Jobs running in background.
    If any job is running more than 30000 sec, it should trigger an email.
    Please guide me how to achieve this( i'm ABAPer).
    Regards
    VEnk@

    see the following t.code may be it will use
    SWWCLEAR_INSERT
    Workflow: Background Job 'SWWCLEAR';
    Workflow: Hintergrundjob 'SWWCLEAR';
    Workflow : job arr.-plan 'SWWCLEAR';
    Workflow: achtergrondjob 'SWWCLEAR'
    Workflow: Background Job 'SWWCLEAR'
    SWWCOND_INSERT
    Workflow: Background Job 'SWWCOND';
    Workflow: Batchjob 'SWWCOND';
    Workflow : job batch 'SWWCOND';
    Workflow: achtergrondjob 'SWWCOND'
    Workflow: Background Job 'SWWCOND'
    SWWD
    Maintain Work Item Error Monitoring;
    Workitem-Fehlerüberwachung pflegen;
    Gérer surveillance erreurs WI;
    Workitem-foutbewaking verzorgen
    Maintain Work Item Error Monitoring
    Edited by: Krupaji on Feb 17, 2010 12:45 PM

  • Sending output to a printer in a background job

    I did a quick search on this issue and found a few suggestions.  One suggestion was to use something like this:
    SUBMIT RSFLFIND ... TO SAP-SPOOL DESTINATION 'LT50'.
    I looked at the SAP help for SUBMIT and it was quite helpful however it raised a few questions.  The program that am writing will be run in the background.  I want to create a simple report that will print at several different printers when it is done.  Looking at the help section (specifically this part):
    "The SUBMIT statement accesses an executable program rep. The executable program is executed as described under Calling Executable Reports.
    The program name rep can either be specified directly or as the content of a character-like data object name. The data object name must contain the name of the program to be accessed in block capitals. If the program specified in name is not found, an irretrievable exception is generated.
    The selscreen_options additions can be used to determine the selection screen for the program accessed and to supply it with values.
    The list_options additions allow you to influence the output medium and the page size in the basic list for the program accessed.
    You can schedule the program for background processing by specifying job_options. "
    It seems like I would create a simple program like this:
    DATA: number TYPE tbtcjob-jobcount,
          name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
          print_parameters TYPE pri_params.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc = 0.
      SUBMIT submitable TO SAP-SPOOL
                        SPOOL DESTINATION 'LT50'.
                        VIA JOB name NUMBER number
                        AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = number
            jobname              = name
            strtimmed            = 'X'
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5
            job_notex            = 6
            lock_failed          = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    ENDIF.
    That will then call the background job and the output will go to the print spool.  I have a few reservations about this.  The print spool will not be determined until the background job.  The background job creates sales orders and the material group, in the sales order, determines the printer that the final report will go to.  Also, if this is the way to do it, do I just do simple write statements in the background job?

    Hi,
    Please try this ... perhaps it may help.
    SUBMIT submitable TO SAP-SPOOL
                      SPOOL DESTINATION 'LT50'.
                      IMMEDIATELY 'X'           "Add here
                      VIA JOB name NUMBER number
                      AND RETURN.
    OR
    SUBMIT submitable TO SAP-SPOOL
                      SPOOL DESTINATION 'LT50'.
                      IMMEDIATELY 'X'           "Add here
                      WITHOUT SPOOL DYNPRO      "Add here
                      VIA JOB name NUMBER number
                      AND RETURN.
    Regards,
    Ferry Lianto

  • Schedule a background job for a program using ABAP code.

    Hi,
    I have to write a program to schedule a background job for another program.
    Need your help to understand how we can achieve this functionality.Any example of an abap code would be of great help.
    Need it urgently.
    Thanks in advance.
    Sandeep.

    Hi Sandeep,
    Here is the demo program regarding the BDC For the background job.
    report zprprbdc1
           no standard page heading line-size 255.
    include bdcrecx1.
    parameters: dataset(132) lower case.
    ***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
    *   If it is nessesary to change the data section use the rules:
    *   1.) Each definition of a field exists of two lines
    *   2.) The first line shows exactly the comment
    *       '* data element: ' followed with the data element
    *       which describes the field.
    *       If you don't have a data element use the
    *       comment without a data element name
    *   3.) The second line shows the fieldname of the
    *       structure, the fieldname must consist of
    *       a fieldname and optional the character '_' and
    *       three numbers and the field length in brackets
    *   4.) Each field must be type C.
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    ***data: begin of itab occurs 0 ,
    ***       matnr(20) type c,
    ***       mbrsh(30) type c,
    ***       mtart(30) type c,
    ***       kzsel(20) type c,
    ***       maktx(40) type c,
    ***       meins(5) type c,
    ***       end of itab.
    data: begin of record occurs 0,
    * data element: MATNR
            matnr_001(018),
    * data element: MBRSH
            mbrsh_002(001),
    * data element: MTART
            mtart_003(004),
    * data element: XFELD
            kzsel_01_004(001),
    * data element: MAKTX
            maktx_005(040),
    * data element: MEINS
            meins_006(003),
    * data element: MTPOS_MARA
            mtpos_mara_007(004),
          end of record.
    *** End generated data section ***
    start-of-selection.
    *perform open_dataset using dataset.
    perform open_group.
    **do.
    **read dataset dataset into record.
    **if sy-subrc <> 0. exit. endif.
    call function 'GUI_UPLOAD'
      exporting
        filename                      = 'c:\jitu\bdc\10002.txt'
       filetype                      = 'ASC'
       has_field_separator           = 'x'
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      tables
        data_tab                      = record
    * EXCEPTIONS
    *   FILE_OPEN_ERROR               = 1
    *   FILE_READ_ERROR               = 2
    *   NO_BATCH                      = 3
    *   GUI_REFUSE_FILETRANSFER       = 4
    *   INVALID_TYPE                  = 5
    *   NO_AUTHORITY                  = 6
    *   UNKNOWN_ERROR                 = 7
    *   BAD_DATA_FORMAT               = 8
    *   HEADER_NOT_ALLOWED            = 9
    *   SEPARATOR_NOT_ALLOWED         = 10
    *   HEADER_TOO_LONG               = 11
    *   UNKNOWN_DP_ERROR              = 12
    *   ACCESS_DENIED                 = 13
    *   DP_OUT_OF_MEMORY              = 14
    *   DISK_FULL                     = 15
    *   DP_TIMEOUT                    = 16
    *   OTHERS                        = 17
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    loop at record .
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  record-matnr_001.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  record-mbrsh_002.
    perform bdc_field       using 'RMMG1-MTART'
                                  record-mtart_003.
    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)'
                                  record-kzsel_01_004.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx_005.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins_006.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                  record-mtpos_mara_007.
    perform bdc_transaction using 'MM01'.
    **enddo.
    endloop.
    perform close_group.
    *perform close_dataset using dataset.
    &*****************Reward point if helpful************&

  • Workflow not working in Background Processing

    Hi All,
    I am relatively new to Workflow.  Currently, I am creating Deliveries (preferably in background) once a Sales Order is created.  I am using an ABAP Class as the object method to submit the sales order number to the delivery processing method (which just submits basic information to standard SAP transaction VL04).  I found that if the execution of the delivery creation task is not in Background Processing (the user manually kicks off the Delivery creation in SBWP) the workflow works as expected and creates the deliveries.  However, if the Background Processing is checked, the workflow does not process and does not create a delivery.  Is there any specific reason as to why the workflow will not work in background?
    Any help you can give would be greatly appreciated.  Thanks.
    John

    Hi,
    John
    See to process a Back ground task, there should be a proper parameter flow.
    Please look at the import parameters in the method you are using to process the back ground task..
    If proper import parameters are passed then the task will work
    This should help..
    Thanks,
    Shanky

  • Background job SWFSLSDLEX cannot be scheduled (error )"

    Hi All ,
    i got the following error ,
    when i try to customize the SWU3 " Schedule background job for dead line monitoring ".
    The error is :
    "Work item -: Background job SWFSLSDLEX cannot be scheduled (error )"
    And the Error log says :
    Refer to your workflow system administrator.
    The specified error number should indicate possible reasons for the error. It is possible that the system is in an inconsistent state. The scheduled start of the specified background job must be compared with the minimum date/time of all work items in table SWWDHMIN. It may be necessary to delete the scheduled background job by hand and reschedule it by calling report RSWWDHEX.
    Apparently i dont see any table SWWDHMIN.
    Thanks!
    Richard A

    The issue is solved by adding start profile and instance profile to operation modes.
    Many thanks to my BASIS Guys for solving it !
    Richard  A

Maybe you are looking for