Background job only sends 1 spooljob of report in gr55 ?

in gr55 we want to run a report in the background and send it by email to the user.
we noticed that by running in forground we get like 10 pages of output but as we schedule it in sm37 with the same variant that the user only receives 1 page. I noticed that the report is seperated in several spooljobs and 1 of the spooljobs contains the result received.
is it possible to combine it into 1 spooljob or to sent more than 1 attachment into the mail with sm37 ?
I try to combine it in the printersettings for the report but that doesn't work ?
any other options ?
kind regards
Arthur de Smidt

Hello,
If a job is defined by transaction SM36, the print format parameters will only be taken into account, if they are saved as user specific print parameters of the batch user. If no user specific print format
is defined,  the ALV standard logic will be processed adjusting the print format to the actual line size of the report.
For example, the list line size is about 132 characters, the widest available format of the chosen printer will be selected X_65_132.
The problem would be solved by defining a device type which is no format assigned to print, or by defining user specific print format parameters for the batch user, who creates the jobs in SM36 (see
SAP note 1179399, item 6).
Regards,
David

Similar Messages

  • Background job not showing full output of Report

    Dear Experts
    we have created zpgm for stad report and try to take output as mail to particular user for future analysis bcaz stad gives only 2 days report only we need keep report for months together so when we run job in foreground it shows proper output but when same thing when we run from background it shows only some part of report in mail (we are unable to get full output through background job )
    we send mail through spool receipts we have created folder and maintain user for getting mails through so15 distribution list
    we need some input to come out of this major issue
    if there is any other workaround let me know
    Regards

    Hello,
    If a job is defined by transaction SM36, the print format parameters will only be taken into account, if they are saved as user specific print parameters of the batch user. If no user specific print format
    is defined,  the ALV standard logic will be processed adjusting the print format to the actual line size of the report.
    For example, the list line size is about 132 characters, the widest available format of the chosen printer will be selected X_65_132.
    The problem would be solved by defining a device type which is no format assigned to print, or by defining user specific print format parameters for the batch user, who creates the jobs in SM36 (see
    SAP note 1179399, item 6).
    Regards,
    David

  • Schedule report MM60 as background job and send out in Excel format

    Hi there,
    I would like to schedule a background job for report MM60, then send to the user in Excel format.
    I know that we can enter the recipient in the job setting(SM36) but the report is send in HMTL format.
    Is it possible to send in Excel format?
    Thanks,
    Janice

    Hi,
    I think it's not possible from SM36 you better get help from ABAPer to get the require output.
    Also visit below thread for same issue:
    mail, output of spool as an excel attachment
    Regards;

  • Normal Background jobs in Sender System

    Hi,
    Is that the normal daily operation jobs should be stopped in Sender system during the TDMS migration process.
    Will this make TDMS migration process faster?
    In our sender system the problem is not the availability of batch process but I am trying to analyze that if we stop the normal daily operational jobs then can the data selection will be faster...
    I think Yes !
    What are your comments?
    thanks !
    Regards,
    Santosh

    It depends what those background jobs are doing. If they are heavily loading the database (reading and writing) it can be faster if you stop them.
    Markus

  • Changing layout at runtime, executing background job and sending mail inXLS

    Hi
    When i execute my program in foregroung by manually changing value of s_job = 'X' in debugging mode it is sending the correct XLS file via mail with all the data , whereas  when i execute my program in backgroud mode it sends incomlete XLS file via mail, it has only first 2 records in any layout........can anybody please help in this regard....
    program is as follows...
    REPORT ZPMACR01_MD_MRP_100.
    *& Report :  ZPMACR01_MD_MRP_100
    TABLES : MARA, MARC, MAKT, MBEW,MARD.
    MAIL data declarations
    TABLES : adr6 , sscrfields.
    DATA: BEGIN OF mbody OCCURS 0,
          message(100),
          END OF mbody.
    DATA: BEGIN OF addresses OCCURS 0,
          addresses(100),
          END Of addresses.
    FIELD-SYMBOLS: <f> type ANY,
                   <tab> TYPE STANDARD TABLE,
                   <wa> type ANY.
    DATA: count TYPE i value 0,
          col_1 TYPE i.
    DATA: new_table TYPE REF TO data, "pointer to dynamic table
          new_line  TYPE REF TO data. "pointer to work area of dynamic table
    DATA: s_job TYPE c.
    DATA: i_data_out_text TYPE string OCCURS 0 WITH HEADER LINE.
    DATA: message TYPE string OCCURS 0 WITH HEADER LINE.
    DATA:  it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
           WITH HEADER LINE.
    DATA:  BEGIN OF it_attach OCCURS 0,
             line(2650) TYPE c,
           END OF it_attach.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_hex LIKE solix OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    ALV data declarations
    TYPE-POOLS: SLIS.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           IT_FIELDCAT2 TYPE LVC_T_FCAT,
           IT_FIELDCAT_FIN TYPE LVC_T_FCAT,
           IT_FIELDCAT3 TYPE SLIS_T_FIELDCAT_ALV,
           itab1 TYPE SLIS_T_FIELDCAT_ALV,
           W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
           W_REPID TYPE SY-REPID,
           IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: is_fieldcat LIKE LINE OF it_fieldcat.
    DATA: is_fieldcat2 LIKE LINE OF it_fieldcat2,
    Is_FIELDCAT3 LIKE LINE OF it_fieldcat3.
    Data: variant type  DISVARIANT,
          v_size LIKE sy-tabix.
    ALV Data
    DATA:
           i_sort TYPE slis_t_sortinfo_alv,
           v_lvc_title   TYPE lvc_title,
           v_repid       LIKE sy-repid,
           c_user_command TYPE slis_formname  VALUE 'ALV_USER_COMMAND',
           gt_list_top_of_page TYPE slis_t_listheader,
           gt_list_end_of_list TYPE slis_t_listheader,
           gs_layout TYPE slis_layout_alv,
           gt_events      TYPE slis_t_event,
           gs_events      type slis_alv_event,
           gt_print       TYPE slis_print_alv,
           g_top_of_page  TYPE slis_formname VALUE 'TOP_OF_PAGE'.
    Selection Parameters
    SELECTION-SCREEN BEGIN OF BLOCK B1.
    SELECT-OPTIONS : SO_MATNR FOR MARA-MATNR OBLIGATORY.
    SELECT-OPTIONS : SO_WERKS FOR MARC-WERKS.
    SELECT-OPTIONS : SO_SPRAS FOR MAKT-SPRAS.
    SELECT-OPTIONS : SO_BWKEY FOR MBEW-BWKEY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
    PARAMETERS: p_email TYPE somlreci1-receiver
                                      default '[email protected]'.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-002.
    PARAMETERS : SO_LAY TYPE DISVARIANT-VARIANT DEFAULT '/DEFAULT'.
    SELECTION-SCREEN END OF BLOCK B3.
    DATA Declarations.
    Data : BEGIN OF ITab OCCURS 0,
           manr type mara-matnr,
           end of ITAB.
    data : BEGIN OF IT_TABLE OCCURS 0,
           MATNR TYPE MARA-MATNR,
           MATKL TYPE MARA-MATKL,
           MEINS TYPE MARA-MEINS,
           MTART TYPE MARA-MTART,
           AHDIS TYPE MARC-AHDIS,
           AUSDT TYPE MARC-AUSDT,
           AUTRU TYPE MARC-AUTRU,
           BESKZ TYPE MARC-BESKZ,
           BSTFE TYPE MARC-BSTFE,
           BSTMA TYPE MARC-BSTMA,
           BSTMI TYPE MARC-BSTMI,
           BSTRF TYPE MARC-BSTRF,
           BWSCL TYPE MARC-BWSCL,
           DIBER TYPE MARC-DIBER,
           DISGR TYPE MARC-DISGR,
           DISLS TYPE MARC-DISLS,
           DISMM TYPE MARC-DISMM,
           DISPO TYPE MARC-DISPO,
           DISPR TYPE MARC-DISPR,
           DZEIT TYPE MARC-DZEIT,
           EISBE TYPE MARC-EISBE,
           EISLO TYPE MARC-EISLO,
           EKGRP TYPE MARC-EKGRP,
           FHORI TYPE MARC-FHORI,
           FXHOR TYPE MARC-FXHOR,
           KAUTB TYPE MARC-KAUTB,
           KORDB TYPE MARC-KORDB,
           KZAUS TYPE MARC-KZAUS,
           LFGJA TYPE MARC-LFGJA,
           LFMON TYPE MARC-LFMON,
           LGRAD TYPE MARC-LGRAD,
           LVORM TYPE MARC-LVORM,
           MABST TYPE MARC-MABST,
           MINBE TYPE MARC-MINBE,
           MMSTA TYPE MARC-MMSTA,
           MMSTD TYPE MARC-MMSTD,
           MRPPP TYPE MARC-MRPPP,
           MTVFP TYPE MARC-MTVFP,
           NFMAT TYPE MARC-NFMAT,
           PERKZ TYPE MARC-PERKZ,
           PLIFZ TYPE MARC-PLIFZ,
           PLVAR TYPE MARC-PLVAR,
           PSTAT TYPE MARC-PSTAT,
           QZGTP TYPE MARC-QZGTP,
           RGEKZ TYPE MARC-RGEKZ,
           RWPRO TYPE MARC-RWPRO,
           SBDKZ TYPE MARC-SBDKZ,
           SCHGT TYPE MARC-SCHGT,
           SHFLG TYPE MARC-SHFLG,
           SHPRO TYPE MARC-SHPRO,
           SHZET TYPE MARC-SHZET,
           SOBSL TYPE MARC-SOBSL,
           STRGR TYPE MARC-STRGR,
           TRAME TYPE MARC-TRAME,
           UEETK TYPE MARC-UEETK,
           UEETO TYPE MARC-UEETO,
           UMLMC TYPE MARC-UMLMC,
           UNETO TYPE MARC-UNETO,
           USEQU TYPE MARC-USEQU,
           VINT1 TYPE MARC-VINT1,
           VINT2 TYPE MARC-VINT2,
           VRBDT TYPE MARC-VRBDT,
           VRBFK TYPE MARC-VRBFK,
           VRBMT TYPE MARC-VRBMT,
           VRBWK TYPE MARC-VRBWK,
           VRMOD TYPE MARC-VRMOD,
           WEBAZ TYPE MARC-WEBAZ,
           WERKS TYPE MARC-WERKS,
           WZEIT TYPE MARC-WZEIT,
          DISKZ TYPE MARD-DISKZ,
          LBSTF TYPE MARD-LBSTF,
          LGORT TYPE MARD-LGORT,
          LMINB TYPE MARD-LMINB,
          LSOBS TYPE MARD-LSOBS,
           MAKTX TYPE MAKT-MAKTX,
           END OF IT_TABLE.
    DATA: BEGIN OF IT_MARD OCCURS 0,
           MATNR TYPE MARA-MATNR,
           MATKL TYPE MARA-MATKL,
           MEINS TYPE MARA-MEINS,
           MTART TYPE MARA-MTART,
           DISKZ TYPE MARD-DISKZ,
           LBSTF TYPE MARD-LBSTF,
           LGORT TYPE MARD-LGORT,
           LMINB TYPE MARD-LMINB,
           LSOBS TYPE MARD-LSOBS,
          MAKTX TYPE MAKT-MAKTX,
           END OF IT_MARD.
    DATA: BEGIN OF IT_MBEW OCCURS 0,
           MATNR TYPE MBEW-MATNR,
           BKLAS TYPE MBEW-BKLAS,
           SALK3 TYPE MBEW-SALK3,
           PEINH TYPE MBEW-PEINH,
           STPRS TYPE MBEW-STPRS,
           VERPR TYPE MBEW-VERPR,
           VPRSV TYPE MBEW-VPRSV,
           END OF IT_MBEW.
    data : BEGIN OF IT_FINAL0 occurs 0,
           MATNR LIKE MARA-MATNR,
           MATKL LIKE MARA-MATKL,
           MEINS LIKE MARA-MEINS,
           MTART LIKE MARA-MTART,
           AHDIS LIKE MARC-AHDIS,
           AUSDT LIKE MARC-AUSDT,
           AUTRU LIKE MARC-AUTRU,
           BESKZ LIKE MARC-BESKZ,
           BSTFE LIKE MARC-BSTFE,
           BSTMA LIKE MARC-BSTMA,
           BSTMI LIKE MARC-BSTMI,
           BSTRF LIKE MARC-BSTRF,
           BWSCL LIKE MARC-BWSCL,
           DIBER LIKE MARC-DIBER,
           DISGR LIKE MARC-DISGR,
           DISLS LIKE MARC-DISLS,
           DISMM LIKE MARC-DISMM,
           DISPO LIKE MARC-DISPO,
           DISPR LIKE MARC-DISPR,
           DZEIT LIKE MARC-DZEIT,
           EISBE LIKE MARC-EISBE,
           EISLO LIKE MARC-EISLO,
           EKGRP LIKE MARC-EKGRP,
           FHORI LIKE MARC-FHORI,
           FXHOR LIKE MARC-FXHOR,
           KAUTB LIKE MARC-KAUTB,
           KORDB LIKE MARC-KORDB,
           KZAUS LIKE MARC-KZAUS,
           LFGJA LIKE MARC-LFGJA,
           LFMON LIKE MARC-LFMON,
           LGRAD LIKE MARC-LGRAD,
           LVORM LIKE MARC-LVORM,
           MABST LIKE MARC-MABST,
           MINBE LIKE MARC-MINBE,
           MMSTA LIKE MARC-MMSTA,
           MMSTD LIKE MARC-MMSTD,
           MRPPP LIKE MARC-MRPPP,
           MTVFP LIKE MARC-MTVFP,
           NFMAT LIKE MARC-NFMAT,
           PERKZ LIKE MARC-PERKZ,
           PLIFZ LIKE MARC-PLIFZ,
           PLVAR LIKE MARC-PLVAR,
           PSTAT LIKE MARC-PSTAT,
           QZGTP LIKE MARC-QZGTP,
           RGEKZ LIKE MARC-RGEKZ,
           RWPRO LIKE MARC-RWPRO,
           SBDKZ LIKE MARC-SBDKZ,
           SCHGT LIKE MARC-SCHGT,
           SHFLG LIKE MARC-SHFLG,
           SHPRO LIKE MARC-SHPRO,
           SHZET LIKE MARC-SHZET,
           SOBSL LIKE MARC-SOBSL,
           STRGR LIKE MARC-STRGR,
           TRAME LIKE MARC-TRAME,
           UEETK LIKE MARC-UEETK,
           UEETO LIKE MARC-UEETO,
           UMLMC LIKE MARC-UMLMC,
           UNETO LIKE MARC-UNETO,
           USEQU LIKE MARC-USEQU,
           VINT1 LIKE MARC-VINT1,
           VINT2 LIKE MARC-VINT2,
           VRBDT LIKE MARC-VRBDT,
           VRBFK LIKE MARC-VRBFK,
           VRBMT LIKE MARC-VRBMT,
           VRBWK LIKE MARC-VRBWK,
           VRMOD LIKE MARC-VRMOD,
           WEBAZ LIKE MARC-WEBAZ,
           WERKS LIKE MARC-WERKS,
           WZEIT LIKE MARC-WZEIT,
           DISKZ LIKE MARD-DISKZ,
           LBSTF LIKE MARD-LBSTF,
           LGORT LIKE MARD-LGORT,
           LMINB LIKE MARD-LMINB,
           LSOBS LIKE MARD-LSOBS,
           MAKTX LIKE MAKT-MAKTX,
           END OF IT_FINAL0.
    data : BEGIN OF IT_FINAL occurs 0,
           MATNR LIKE MARA-MATNR,
           MATKL LIKE MARA-MATKL,
           MEINS LIKE MARA-MEINS,
           MTART LIKE MARA-MTART,
           AHDIS LIKE MARC-AHDIS,
           AUSDT LIKE MARC-AUSDT,
           AUTRU LIKE MARC-AUTRU,
           BESKZ LIKE MARC-BESKZ,
           BSTFE LIKE MARC-BSTFE,
           BSTMA LIKE MARC-BSTMA,
           BSTMI LIKE MARC-BSTMI,
           BSTRF LIKE MARC-BSTRF,
           BWSCL LIKE MARC-BWSCL,
           DIBER LIKE MARC-DIBER,
           DISGR LIKE MARC-DISGR,
           DISLS LIKE MARC-DISLS,
           DISMM LIKE MARC-DISMM,
           DISPO LIKE MARC-DISPO,
           DISPR LIKE MARC-DISPR,
           DZEIT LIKE MARC-DZEIT,
           EISBE LIKE MARC-EISBE,
           EISLO LIKE MARC-EISLO,
           EKGRP LIKE MARC-EKGRP,
           FHORI LIKE MARC-FHORI,
           FXHOR LIKE MARC-FXHOR,
           KAUTB LIKE MARC-KAUTB,
           KORDB LIKE MARC-KORDB,
           KZAUS LIKE MARC-KZAUS,
           LFGJA LIKE MARC-LFGJA,
           LFMON LIKE MARC-LFMON,
           LGRAD LIKE MARC-LGRAD,
           LVORM LIKE MARC-LVORM,
           MABST LIKE MARC-MABST,
           MINBE LIKE MARC-MINBE,
           MMSTA LIKE MARC-MMSTA,
           MMSTD LIKE MARC-MMSTD,
           MRPPP LIKE MARC-MRPPP,
           MTVFP LIKE MARC-MTVFP,
           NFMAT LIKE MARC-NFMAT,
           PERKZ LIKE MARC-PERKZ,
           PLIFZ LIKE MARC-PLIFZ,
           PLVAR LIKE MARC-PLVAR,
           PSTAT LIKE MARC-PSTAT,
           QZGTP LIKE MARC-QZGTP,
           RGEKZ LIKE MARC-RGEKZ,
           RWPRO LIKE MARC-RWPRO,
           SBDKZ LIKE MARC-SBDKZ,
           SCHGT LIKE MARC-SCHGT,
           SHFLG LIKE MARC-SHFLG,
           SHPRO LIKE MARC-SHPRO,
           SHZET LIKE MARC-SHZET,
           SOBSL LIKE MARC-SOBSL,
           STRGR LIKE MARC-STRGR,
           TRAME LIKE MARC-TRAME,
           UEETK LIKE MARC-UEETK,
           UEETO LIKE MARC-UEETO,
           UMLMC LIKE MARC-UMLMC,
           UNETO LIKE MARC-UNETO,
           USEQU LIKE MARC-USEQU,
           VINT1 LIKE MARC-VINT1,
           VINT2 LIKE MARC-VINT2,
           VRBDT LIKE MARC-VRBDT,
           VRBFK LIKE MARC-VRBFK,
           VRBMT LIKE MARC-VRBMT,
           VRBWK LIKE MARC-VRBWK,
           VRMOD LIKE MARC-VRMOD,
           WEBAZ LIKE MARC-WEBAZ,
           WERKS LIKE MARC-WERKS,
           WZEIT LIKE MARC-WZEIT,
           DISKZ LIKE MARD-DISKZ,
           LBSTF LIKE MARD-LBSTF,
           LGORT LIKE MARD-LGORT,
           LMINB LIKE MARD-LMINB,
           LSOBS LIKE MARD-LSOBS,
           MAKTX LIKE MAKT-MAKTX,
           BKLAS LIKE MBEW-BKLAS,
           SALK3 LIKE MBEW-SALK3,
           PEINH LIKE MBEW-PEINH,
           STPRS LIKE MBEW-STPRS,
           VERPR LIKE MBEW-VERPR,
           VPRSV LIKE MBEW-VPRSV,
           ZXPRS LIKE MBEW-STPRS,
           END OF IT_FINAL.
    data : BEGIN OF IT_display occurs 0,
           matnr LIKE MARA-MATNR,
           maktx LIKE MAKT-MAKTX,
           meins LIKE MARA-MEINS,
           werks LIKE MARC-WERKS,
           dispo LIKE MARC-DISPO,
           dismm LIKE MARC-DISMM,
           plifz LIKE MARC-PLIFZ,
           webaz LIKE MARC-WEBAZ,
           minbe LIKE MARC-MINBE,
         shzet LIKE MARC-SHZET,
         eisbe LIKE MARC-EISBE,
         disls LIKE MARC-DISLS,
         bstmi LIKE MARC-BSTMI,
         bstma LIKE MARC-BSTMA,
         bstfe LIKE MARC-BSTFE,
         ZXPRS LIKE MBEW-STPRS,
         peinh LIKE MBEW-PEINH,
         salk3 LIKE MBEW-SALK3,
           end of it_display.
    ALV Layout Variant
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_lay.
      PERFORM get_alv_layout_values.
    SELECTION SCREEN.
    AT SELECTION-SCREEN.
      IF ( sscrfields-ucomm = 'SJOB' OR
      sy-batch = 'X' ).
        s_job = 'X'.
      ENDIF.
    select single matnr into itab from mara where matnr in so_matnr.
    if sy-subrc <> 0.
    message e001(zpal).
    endif.
    START-OF-SELECTION.
      IF SO_LAY <> ' '.
        VARIANT-REPORT = 'ZPMACR01_MD_MRP_100'.
        VARIANT-VARIANT = SO_LAY.
    else.
    VARIANT-VARIANT = '/DEFAULT'.
      ENDIF.
    INITIALIZATION.
      W_REPID = SY-REPID.
    START-OF-SELECTION.
    IF SO_LAY <> ' '.
        VARIANT-REPORT  = w_repid.
        VARIANT-VARIANT = SO_LAY.
    else.
    VARIANT-VARIANT = '/DEFAULT'.
    ENDIF.
      SELECT
      MARA~MATNR
      MARA~MATKL
      MARA~MEINS
      MARA~MTART
      MARC~AHDIS
      MARC~AUSDT
      MARC~AUTRU
      MARC~BESKZ
      MARC~BSTFE
      MARC~BSTMA
      MARC~BSTMI
      MARC~BSTRF
      MARC~BWSCL
      MARC~DIBER
      MARC~DISGR
      MARC~DISLS
      MARC~DISMM
      MARC~DISPO
      MARC~DISPR
      MARC~DZEIT
      MARC~EISBE
      MARC~EISLO
      MARC~EKGRP
      MARC~FHORI
      MARC~FXHOR
      MARC~KAUTB
      MARC~KORDB
      MARC~KZAUS
      MARC~LFGJA
      MARC~LFMON
      MARC~LGRAD
      MARC~LVORM
      MARC~MABST
      MARC~MINBE
      MARC~MMSTA
      MARC~MMSTD
      MARC~MRPPP
      MARC~MTVFP
      MARC~NFMAT
      MARC~PERKZ
      MARC~PLIFZ
      MARC~PLVAR
      MARC~PSTAT
      MARC~QZGTP
      MARC~RGEKZ
      MARC~RWPRO
      MARC~SBDKZ
      MARC~SCHGT
      MARC~SHFLG
      MARC~SHPRO
      MARC~SHZET
      MARC~SOBSL
      MARC~STRGR
      MARC~TRAME
      MARC~UEETK
      MARC~UEETO
      MARC~UMLMC
      MARC~UNETO
      MARC~USEQU
      MARC~VINT1
      MARC~VINT2
      MARC~VRBDT
      MARC~VRBFK
      MARC~VRBMT
      MARC~VRBWK
      MARC~VRMOD
      MARC~WEBAZ
      MARC~WERKS
      MARC~WZEIT
    MARD~DISKZ
    MARD~LBSTF
    MARD~LGORT
    MARD~LMINB
    MARD~LSOBS
      MAKT~MAKTX
    INTO TABLE IT_TABLE
    FROM MARA INNER JOIN MARC ON MARAMATNR = MARCMATNR
    INNER JOIN MAKT ON MARAMATNR = MAKTMATNR
    WHERE MARA~MATNR IN SO_MATNR
           AND MARC~WERKS IN SO_WERKS
           AND MAKT~SPRAS IN SO_SPRAS.
      SELECT
      MARA~MATNR
      MARA~MATKL
      MARA~MEINS
      MARA~MTART
      MARD~DISKZ
      MARD~LBSTF
      MARD~LGORT
      MARD~LMINB
      MARD~LSOBS
      INTO TABLE IT_mard
       FROM MARA INNER JOIN MARD ON MARAMATNR = MARDMATNR
                WHERE  MARA~MATNR IN SO_MATNR
                      and mard~werks in SO_WERKS.
      SELECT MATNR BKLAS SALK3 PEINH STPRS VERPR VPRSV
      INTO TABLE IT_MBEW FROM MBEW FOR ALL ENTRIES IN IT_TABLE WHERE MATNR =
      IT_TABLE-MATNR AND BWKEY IN SO_BWKEY.
      LOOP AT IT_TABLE.
       MOVE-CORRESPONDING IT_TABLE TO IT_FINAL0.
        READ TABLE IT_MARD WITH KEY MATNR = IT_TABLE-MATNR.
        IF SY-SUBRC = 0 .
         MOVE-CORRESPONDING IT_MARD TO IT_FINAL0.
        ENDIF.
         APPEND IT_FINAL0.
         CLEAR IT_FINAL0.
      ENDLOOP.
    LOOP AT IT_FINAL0.
        READ TABLE IT_MBEW WITH KEY MATNR = IT_final0-MATNR.
        IF SY-SUBRC = 0 .
         MOVE-CORRESPONDING IT_MBEW TO IT_FINAL.
         IF IT_MBEW-VPRSV = 'S'.
          MOVE IT_MBEW-STPRS TO IT_FINAL-ZXPRS.
         ELSE.
          MOVE IT_MBEW-VERPR TO IT_FINAL-ZXPRS.
         ENDIF.
        ENDIF.
        MOVE-CORRESPONDING IT_FINAL0 TO IT_FINAL.
        APPEND IT_FINAL.
        CLEAR IT_FINAL.
    ENDLOOP.
    Default Layout
      LOOP AT IT_FINAL.
        Read table it_final with key matnr = SO_matnr.
        Move it_final-MATNR to it_display-MATNR.
        Move it_final-MAKTX to it_display-MAKTX.
        Move it_final-MEINS to it_display-MEINS.
        Move it_final-WERKS to it_display-WERKS.
        Move it_final-DISPO to it_display-DISPO.
        Move it_final-DISMM to it_display-DISMM.
        Move it_final-PLIFZ to it_display-PLIFZ.
        Move it_final-WEBAZ to it_display-WEBAZ.
        Move it_final-MINBE to it_display-MINBE.
        Move it_final-SHZET to it_display-SHZET.
        Move it_final-EISBE to it_display-EISBE.
        Move it_final-DISLS to it_display-DISLS.
        Move it_final-BSTMI to it_display-BSTMI.
        Move it_final-BSTMA to it_display-BSTMA.
        Move it_final-BSTFE to it_display-BSTFE.
        MOVE it_final-ZXPRS to it_display-ZXPRS.
        Move it_final-PEINH to it_display-PEINH.
        Move it_final-SALK3 to it_display-SALK3.
        Append it_display.
      endloop.
      data: v_data type c value ' '.
      if it_display is initial.
        v_data = ' '.
      else.
        v_data = 'X'.
      endif.
    END-OF-SELECTION.
    END-OF-SELECTION.
      if s_job = 'X'.
        perform execute_back.
      else.
        perform execute_fore.
      endif.
          FORM execute_fore                                             *
    Form execute_fore.
    *&      Form REUSE_ALV_FIELDCATALOG_MERGE
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         I_PROGRAM_NAME               = W_REPID
         I_INTERNAL_TABNAME           = 'IT_FINAL'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
         I_INCLNAME                   = W_REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = IT_FIELDCAT
       EXCEPTIONS
         INCONSISTENT_INTERFACE       = 1
         PROGRAM_ERROR                = 2
         OTHERS                       = 3
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    *IF SO_LAY <> ' '.
    VARIANT-VARIANT = SO_LAY.
    *endif.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
                       I_INTERFACE_CHECK                 = ' '
                       I_BYPASSING_BUFFER                =
                       I_BUFFER_ACTIVE                   = ' '
                         I_CALLBACK_PROGRAM                = W_REPID
                       I_CALLBACK_PF_STATUS_SET          = ' '
                       I_CALLBACK_USER_COMMAND           = ' '
                       I_CALLBACK_TOP_OF_PAGE            = ' '
                       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
                       I_CALLBACK_HTML_END_OF_LIST       = ' '
                       I_STRUCTURE_NAME                  =
                       I_BACKGROUND_ID                   = ' '
                       I_GRID_TITLE                      =
                       I_GRID_SETTINGS                   =
                       IS_LAYOUT                         = IT_LAYOUT
                         IT_FIELDCAT                       = IT_FIELDCAT[]
                       IT_EXCLUDING                      =
                       IT_SPECIAL_GROUPS                 =
                       IT_SORT                           =
                       IT_FILTER                         =
                       IS_SEL_HIDE                       =
                       I_DEFAULT                         = 'X'
                         I_SAVE                            = 'X'
                         IS_VARIANT                        = VARIANT
                       IT_EVENTS                         =
                       IT_EVENT_EXIT                     =
                       IS_PRINT                          =
                       IS_REPREP_ID                      =
                       I_SCREEN_START_COLUMN             = 0
                       I_SCREEN_START_LINE               = 0
                       I_SCREEN_END_COLUMN               = 0
                       I_SCREEN_END_LINE                 = 0
                       IT_ALV_GRAPHICS                   =
                       IT_ADD_FIELDCAT                   =
                       IT_HYPERLINK                      =
                       I_HTML_HEIGHT_TOP                 =
                       I_HTML_HEIGHT_END                 =
                       IT_EXCEPT_QINFO                   =
                     IMPORTING
                       E_EXIT_CAUSED_BY_CALLER           =
                       ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_FINAL
       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.
          FORM execute_back                                             *
    FORM execute_back.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         I_PROGRAM_NAME               = W_REPID
         I_INTERNAL_TABNAME           = 'IT_FINAL'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
         I_INCLNAME                   = W_REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = IT_FIELDCAT
       EXCEPTIONS
         INCONSISTENT_INTERFACE       = 1
         PROGRAM_ERROR                = 2
         OTHERS                       = 3
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = W_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         =
         IT_FIELDCAT                       = it_fieldcat[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
         I_SAVE                            = 'X'
         IS_VARIANT                        = variant
        IT_EVENTS                         = gt_events[]
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = it_final
    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.
    form top_of_page.
    CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
       IMPORTING
        ES_LAYOUT                 =
         ET_FIELDCAT               = IT_FIELDCAT3[]
        ET_SORT                   =
        ET_FILTER                 =
        ES_GRID_SCROLL            =
         ES_VARIANT                = VARIANT
        ET_MARKED_COLUMNS         =
        ET_FILTERED_ENTRIES       =
        ET_FIELDCAT_BACKEND       =
        ES_PRINT                  =
       EXCEPTIONS
         NO_INFOS                  = 1
         PROGRAM_ERROR             = 2
         OTHERS                    = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    clear count.
    LOOP AT IT_FIELDCAT3 into is_fieldcat3 where no_out eq space.
    *move-corresponding is_fieldcat3 to is_fieldcat2.
    move: is_fieldcat3-fieldname to is_fieldcat2-fieldname,
          is_fieldcat3-ref_fieldname to is_fieldcat2-ref_field,
          is_fieldcat3-ref_tabname to is_fieldcat2-ref_table,
          is_fieldcat3-seltext_l to is_fieldcat2-coltext,
          is_fieldcat3-no_out to is_fieldcat2-no_out,
          is_fieldcat3-col_pos to is_fieldcat2-col_pos.
    *move:
         is_fieldcat3-row_pos to is_fieldcat2-row_pos,
         is_fieldcat3-col_pos to is_fieldcat2-col_pos,
         is_fieldcat3-fieldname to is_fieldcat2-fieldname,
         is_fieldcat3-tabname   to is_fieldcat2-tabname,
         is_fieldcat3-outputlen to is_fieldcat2-outputlen,
         is_fieldcat3-no_out    to is_fieldcat2-no_out,
         is_fieldcat3-seltext_l to is_fieldcat2-coltext,
         is_fieldcat3-ref_fieldname to is_fieldcat2-ref_field,
         is_fieldcat3-ref_tabname to is_fieldcat2-ref_table,
         is_fieldcat3-DDIC_OUTPUTLEN to is_fieldcat2-DD_OUTLEN,
         is_fieldcat3-datatype to is_fieldcat2-datatype,
         is_fieldcat3-inttype to is_fieldcat2-inttype,
         is_fieldcat3-INTLEN to is_fieldcat2-INTLEN.
    APPEND IS_FIELDCAT2 TO IT_FIELDCAT2.
    *count = count + 1.
    ENDLOOP.
    loop at it_fieldcat2 into is_fieldcat2.
      if is_fieldcat2-no_out = 'X'.
       delete it_fieldcat2 index sy-tabix.
      else.
       count = count + 1.
      endif.
    endloop.
    describe table it_fieldcat2 lines count.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fieldcat2[]
        IMPORTING
          ep_table        = new_table.
      ASSIGN new_table->* TO <tab>.
      CREATE DATA new_line LIKE LINE OF <tab>.
      ASSIGN new_line->* TO <wa>.
    *-- Perform to build table for attachment data
      PERFORM build_xls_data_table.
    *-- Perform to populate  e-mail message
      PERFORM populate_email_message_body.
    *-- Perform to send mail
      PERFORM send_file_as_email_attachment.
    *-- Perform to Instruct mail send program for SAPCONNECT to send email.
      PERFORM initiate_mail_execute_program.
    ENDFORM.
    *&      Form  build_xls_data_table
    form build_xls_data_table.
      data: char_var(30) type C,
            num_var(10) type n.
      CONSTANTS: con_cret TYPE x VALUE '0D',  "NEW LINE
                  tabchar TYPE x VALUE '09'.   "tab
      loop at it_fieldcat2 into is_fieldcat2.
        concatenate it_attach is_fieldcat2-coltext
        into it_attach separated by tabchar.
      endloop.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      CLEAR it_attach.
       field-symbols: <t> type ANY.
      LOOP AT it_final.
      col_1 = 1.
       do count times.
       Assign component col_1 of structure <wa> to <f>.
       read table it_fieldcat2 into is_fieldcat2 with key col_pos = col_1.
       loop at it_fieldcat into is_fieldcat.
       if is_fieldcat-fieldname = is_fieldcat2-fieldname.
        assign component is_fieldcat-col_pos of structure it_final to <t>.
        exit.
       endif.
       endloop.
       <f> = <t>.
       clear <t>.
       col_1 = col_1 + 1.
       enddo.
       append <wa> to <tab>.
       endloop.
      loop at <tab> into <wa>.
      col_1 = 1.
      do count times.
       Assign component col_1 of structure <wa> to <f>.
       move <f> to char_var.
       concatenate it_attach char_var
       into it_attach separated by tabchar.
       col_1 = col_1 + 1.
      enddo.
       CONCATENATE con_cret it_attach INTO it_attach.
       APPEND it_attach.
       CLEAR it_attach.
      endloop.
    ENDFORM.
    FORM send_file_as_email_attachment.
      DATA:
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ.
      ld_email = p_email.
      ld_mtitle = text-003.
      ld_format = 'XLS'.
      ld_attdescription  = ' '.
      ld_attfilename = 'DATA'.
      ld_sender_address = ' '.
      ld_sender_address_type = ' '.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
    ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      LOOP AT it_attach.
        MOVE it_attach(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+255(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+510(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+765(235) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+765(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+1020(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+1275(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+1530(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+1785(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+2040(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+2295(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+2550(100) TO t_hex.
        APPEND t_hex.
      ENDLOOP.
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_hex LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data       = w_doc_data
                put_in_outbox       = 'X'
                sender_address      = ld_sender_address
                sender_address_type = ld_sender_address_type
          IMPORTING
               sent_to_all         = w_sent_all
           TABLES
                packing_list        = t_packing_list
                contents_txt        = it_message
                contents_hex        = t_hex
                receivers           = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ld_error = sy-subrc.
    LOOP AT t_receivers.
       ld_receiver = t_receivers-retrn_code.
    ENDLOOP.
    ENDFORM. "SEND_FILE_AS_EMAIL_ATTACHMENT
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    FORM populate_email_message_body.
      REFRESH it_message.
      it_message = text-004.
      APPEND  it_message.
      CONCATENATE SY-DATUM 'to' SY-DATUM INTO it_message SEPARATED BY
      space.
      APPEND  it_message.
    ENDFORM.                    " POPULATE_EMAIL_MESSAGE_BODY
    *&      Form  get_alv_layout_values
    FORM get_alv_layout_values.
      variant-report = w_repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant    = variant
                i_save        = 'A'
           IMPORTING
                es_variant    = variant
           EXCEPTIONS
                not_found     = 1
                program_error = 2
                OTHERS        = 3.
      CHECK sy-subrc = 0.
      so_lay = variant-variant.
    ENDFORM.                    " get_alv_layout_values

    Hi Arpit,
    Take a look at the documentation of FM 'SO_DOCUMENT_SEND_API1' for parameter PACKING_LIST. I think you should set t_packing_list-head_num to a different value than 0 for the second attachment.
    Regards,
    John.

  • Background job for sending Fax

    Hi,
      I want to know, if there is any standard program which can be scheduled in the background to send FAX.
    Currently I am manually resending the FAX using transaction SOST.
    Cheers,
    Sugopa

    Hi Sugopa,
    Define a job for RSCONN01 and set up a variant for the program with MODE = 'FAX'.
    Please reward and close the post if resolved.
    Thanks,
    Srinivas

  • Only send those records in report where expression is True

    Hi,
    I have created a formula with two formula variables on Dates. The expression in formula is Solved Date < Due Date.
    This results in report showing 1 and 0 (1 where expression is true and 0 where expression is false)
    But in BEx query designer is there any way to send only those records in report where expression is 1 (true)
    Thanks
    Ahmad

    Hi Ahmad,
    You can suppress zeros changing the query properties in rows/columns tab. If you select effect on rows, it doesn't show 0 values in the report. This will work if you have only that KF in your query, if there are any other KFs and you still don't want to show other rows then you can use conditions as seshu has mentioned.
    Regards
    Yasemin...

  • Background Job get Cancelled when executing the report. Reason?

    Hi All,
    I have scheduled a Back ground Job and executed Immediately.
    when checking transacion SM37 the job get canceled.
    How to find out the problem for the Job Cancellation.
    Regards,
    Viji

    hi
    After scheduling back ground job ( give a time laps of 2 min )
    then go to sm37 ( at this moment , the job is not yet started) .
    select ur job in sm 37 and when job starts processing , type JDBG as the command and press enter.
    Now it will go to the debugging screen, where u will find system program . Now set a break point at the stements used in ur program from the debugging screen itself.( menu - breakpoint- breakpoint at - statement ) and press F8 .
    Now you can start debug ur code.
    Revrt back if any issues.
    Regards,
    Naveen

  • Spool list for Background job

    Dear all ,
    The background job is already scheduled daily (PR NOT PROCESSED BY PURCHASING) , isn't possible to check the list of users is assigned in the spool list recipiant, I have checked spool list , but its shows only one id ....
    how to check the list of Spool users ...any alternate option ?
    Kindly advise
    Regards

    Hi ,
    I have created a distribution list and i have included  the email ids also .
    any other activation is required for Distribution list ?
    how the background job is sending a report to Distribution list or i have to assign a distribution list to Background job .
    Kindly suggest
    Regards

  • Send Vendor Balance confirmations report output (F.18) to External email ID

    Dear Friends.
    I have following requirement
    Our Client requirement is to send Vendor Balance confirmations report output (Tcode F.18) to external email ID of vendor.
    So please guide accordingly.
    I have done BASIS Settings for SMTP (Tcode SCOT, RZ10) and Through SAP office using BASIS consultant and i can able to send sample test mail to external email ID through SAP Office (tcode SO00)
    I will be thankful if anyone gives me exact solution.
    Thanks & Regards
    Suyog

    Hi,
    You can craete Background Job and send Mail.
    e.g.
    Goto->SM36->JOBWIZARD ( Create the Job and specify the Spool List Recipients ).
    After Creating the job.
    Again SM36->Start Condition ( You can create here when to send the mail ).
    And Release it.
    Be sure that your BASIS guy has done the required settings for Outgoing Mail.
    Please check in SCOT.
    Affable
    Arbind
    Edited by: Arbind Prasad on Jan 23, 2010 3:07 PM

  • Background Job Scheduling

    Hi,
      I am scheduling a report to run in background.
    In this report it is creating background jobs automatically for different company codes.
    It submits the 1st background job and waits until it finishes.
    Then 2nd job starts in background and continues with other jobs.
    At end it finishes all the jobs and closes.
    Now my problem is.
    1.       Whether is it possible for us to submit all the jobs at 1 time. And execute at same time. Ie., 1st, 2nd job will start at same time.
    2.       If possible how can we do that.
    What I have written is
    loop at companycode.
    Create job name.
    call fun 'Job_Open'.
    submit xxxx user sy-uname via job job_name numer job_count
    to sap-spool
    spool parameters l_spool_parameter
    without spool dynpro
    with companycode
    with ......
    and return.
    endloop.
    Please help ASAP, urgent.

    hi praveen,
    Job Scheduling Explained
    Definition
    Before any background processing can actually begin, background jobs must be defined and scheduled. The scheduled time for when a job runs is one part of the job’s definition. There are several ways to schedule jobs:
    From Transaction SM36 (Define Background Job)
    With the "start program in the background" option of either Transaction SA38 (ABAP: Execute Program) or Transaction SE38 (the ABAP editor)
    Through the background processing system’s own programming interface. (Many SAP applications use the internal programming interface to schedule long-running reports for background processing.)
    Through an external interface.
    Scheduling Background Jobs   
    Use
    You can define and schedule background jobs in two ways from the Job Overview:
    ·         Directly from Transaction SM36. This is best for users already familiar with background job scheduling.
    ·         The Job Scheduling Wizard. This is best for users unfamiliar with SAP background job scheduling. To use the Job Wizard, start from Transaction SM36, and either select Goto ® Wizard version or simply use the Job Wizard button.
    Procedure
           1.      Call Transaction SM36 or choose CCMS ® Jobs ® Definition.
           2.      Assign a job name. Decide on a name for the job you are defining and enter it in the Job Name field.
           3.      Set the job’s priority, or “Job Class”:
    ·         High priority:      Class A
    ·         Medium priority: Class B
    ·         Low priority: Class C
           4.      In the Target server field, indicate whether to use system load balancing.
    ·         For the system to use system load balancing to automatically select the most efficient application server to use at the moment, leave this field empty.
    ·         To use a particular application server to run the job, enter a specific target server.
           5.      If spool requests generated by this job are to be sent to someone as email, specify the email address. Choose the Spool list recipient button.
           6.      Define when the job is to start by choosing Start Condition and completing the appropriate selections. If the job is to repeat, or be periodic, check the box at the bottom of this screen.
           7.      Define the job’s steps by choosing Step, then specify the ABAP program, external command, or external program to be used for each step.
           8.      Save the fully defined job to submit it to the background processing system.
           9.      When you need to modify, reschedule, or otherwise manipulate a job after you've scheduled it the first time, you'll manage jobs from the Job Overview.
    Note: Release the job so that it can run. No job, even those scheduled for immediate processing, can run without first being released.
    Specifying Job Start Conditions
    Use
    When scheduling a background job (either from Transaction SM36, Define Background Job or CCMS ® Jobs ® Definition), you must specify conditions that will trigger the job to start.
    Procedure
    Choose the Start condition button at the top of the Define Background Job screen.
    Choose the button at the top of the Start Time screen for the type of start condition you want to use (Immediate, Date/Time, After job, After event, or At operation mode) and complete the start time definition in the screen that appears.
    For the job to repeat, check the Periodic job box at the bottom of the Start Time screen and choose the Period values button below it to define the frequency of repetition (hourly, daily, weekly, monthly, or another specific time-related period). Then choose the Save button in the Period values screen to accept the periodicity and return to the Start Time screen.
    Once you’ve completed specifying the job start conditions, choose the Save button at the bottom of the Start Time screen to return to the Define Background Job screen.
    No job can be started until it is released, including jobs scheduled to start immediately. Since releasing jobs can be done only by a system administrator from the job management screen (Transaction SM37) or by other users who have been granted the appropriate Authorizations for Background Processing, no unauthorized user can start a job without explicit permission
    Managing Jobs from the Job Overview
    Use
    The Job Overview, or Job Maintenance, screen is the single, central area for completing a wide range of tasks related to monitoring and managing jobs, including defining jobs; scheduling, rescheduling, and copying existing jobs; rescheduling and editing jobs and job steps; repeating a job; debugging an active job; reviewing information about a job; canceling a job's release status; canceling and deleting jobs; comparing the specifications of several jobs; checking the status of jobs; reviewing job logs; and releasing a job so it can run.
    Procedures
    To display the Job Overview screen, choose CCMS ® Jobs ® Maintenance or call Transaction SM37. Before entering the Job Overview screen, the system first displays the Select Background Jobs screen. You'll need to complete this Job Selection screen to define the criteria for the jobs you want to manage. Once you've selected jobs to manage, you can choose from a wide range of management tasks:
    To copy a single existing job, choose Job ® Copy.
    To reschedule or edit job steps or attributes of a single job, choose Job ® Change. A job step is an independent unit of work within a background job. Each job step can execute an ABAP or external program. Other variants or authorizations may be used for each job step. The system allows you to display ABAP programs and variants. You can scan a program for syntax errors. You can also display the authorizations for an authorized user of an ABAP job step.
    To repeat a single job, choose Job ® Repeat scheduling.
    To debug an active job, choose Job ® Capture: active job. Only a single selection is allowed. If an active job seems to be running incorrectly (e.g., running for an excessively long time), you can interrupt and analyze it in debugging mode in a background process, and then either release it again or stop it altogether.
    You will be able to capture a background job only if you are logged on to the SAP server on which the job is running. To find server information in the Job Overview, select and mark the job, then choose Job ® Job details.
    To review information about a job, choose Job ® Job details. Details displayed can include:
    current job status
    periodicity, or the repetition interval
    other jobs linked to the current job, either as previous or subsequent jobs
    defined job steps
    spool requests generated by the current job
    To cancel a job's "Released" status, select the job or jobs from the Job Overview list and choose Job ® Release -> Scheduled.
    To cancel a job from running but keep the job definition available, select the job or jobs from the Job Overview list and choose Job ® Cancel active job.
    To delete a job entirely, select the job or jobs from the Job Overview list and choose Job ® Delete. Jobs with the status of Ready or Running cannot be deleted.
    To compare the specifications of more than one job, select the jobs from the Job Overview list and choose Job ® Compare jobs.
    To check the status of jobs, select the job or jobs from the Overview Job list and choose Job ® Check status. This allows you to either change the job status back to Planned or cancel the job altogether. This is especially useful when a job has malfunctioned.
    To review job logs, select a job or jobs with the status Completed or Canceled from the Job Overview list and
    regards
    karthik
    reward me points if helpfull

  • How to submit a program after completion of a background job

    Hi Experts,
    I have a small issue. In my report program i am calling one transaction using call transaction it will trigger a background job. After completion of this background job i need to submit another program, Because the background job updating few values, using this value only the second program functionality will works.
    Currently when i execute my report its calling 1st program and triggering the background job. Once the job started again the program triggering the next program. Here after competion of the background job only this program should submit next program. Anyone kindly suggest some clue.
        CALL TRANSACTION 'ZSAPRCK60' USING    zbdcdata
                                OPTIONS  FROM g_s_options
                                MESSAGES INTO msg_tab.
    SUBMIT SAPRCK10    VIA SELECTION-SCREEN
                        WITH kalaid = p-kalaid
                        WITH kaladat = sy-datum
                        WITH PARALLEL = 'X'
                        WITH SERVNUM = '10'
                        WITH backgr = 'X'
                        AND RETURN.
    Mohana

    Hi,
    There is one function module there which gives you the job status .. if the job is finished then the value will be 'F'.I don't exactly remember the FM but then you can search with BDLSTATUS or BDSTATUS in SE37..
    do.
    call fm BD****STATUS
    IF STATUS (IMPORT PARAMTER) eq 'F'.
    exit.
    endif.
    enddo.
    Regards,
    Nagaraj

  • Problem in Background Job Scheduling in GRC 5.3

    Dear All,
    I am configuring GRC RAR 5.3 SP11. While scheduling background jobs, only one job is running at a time. If I am scheduling Management report for one client of system (XYZCLNT300) and another job for User, Role and Profile synchronization- Full Sync for other client of the same system (XYZCLNT400).
    So, only one job is running at one time and other job remains in Ready state. I have done following Config in GRC System:
    1) GRC system has 2 server nodes.
    2) Each Server node has 3 background job workers and 5 web service workers.
    While Running 2 job at sametime, one is in Running status and other is in Ready Status. But that time only 2 background job workers are occupied one from each node while others are in IDLE state.
    I am wondering if I have free background job workers then why other job is in Ready Status. Is there nay parameter that needs to be changed to run multiple background jobs in parallel ?
    Please suggest.
    Thanks
    Sunny

    Hi,
    As per SAP Note 1371501 - Multiple Batch Risk Analysis at a time, we cannot run multiple batch risk analysis at a time.
    Batch Risk analysis will run only on server0 node.
    Thanks
    Sunny

  • Only sending the first 16 pages of spool out of full 145

    Hi gurus,
        We got problem with sending e mail (spool recipients). After completion of a back ground job, the job should send the a pdf report to the mail address specified. But out of 145 pages it is sending only 16 pages (2MB) of data. Can any one help or guide me to fix this problem.
    Regards,
    S.Manu

    Hi,
    As per the Ref thread i can manage the step 1 and 2  in the Note 329537, can any one help me in step 3.... what exactly i need to do in SE37. do i need to save the changes after calling the function module ?
    Regards,
    S.Manu

  • BackGround Job's Spool Request is having "Waiting" "Frontend unavailable"

    Hello Friends,
    I am facing one problem related to Spool Request, which is generated through Scheduled Background Jobs (scheduled by funcional people).
    The Background Job is having status "completed" when analyzing it. But, its associated Spool Request is showing "waiting" Status, with "Frontend unavailable" as Status Text.
    Here is the brief status of that Spool Request.
    28448     1      300 USER1 00:00 LP01 X_65_80      Frontend unavailable
    in Detail:
    Description          Value
    Status:              Frontend unavailable
    Last event:
    Message:             Request on hold
    Date:                01.07.2009
    Time:                00:00:27
    Job status:          On hold
    Error class:         Delayed
    Area:                Data transfer
    Printout:            Not printed
    The Setting of LP01 O/Device is as followed:
    Output Device        LP01
    Device Type        SWIN SWIN  : Windows printing via SAPlpd
    Device Class      Standard Printer
    Host Spool Access Method       F F: Printing on Front End Computer
    Host printer                     __DEFAULT
    Moreover, the SAP User USER1 is allocated LP01 as Output Device with "Output Immediately" & "Delete After Output" checked status.
    Some Background Jobs are showing the same status for this LP01.
    I have a doubt on allocated O/P Device LP01.
    Any Clue for this issue ?
    Regards,
    Bhavik G. Shroff

    Hello Markus,
    Here , in our Landscape , there is not Print Server. All are taking prints through, Networked Printer and their local connected Printers.
    Can i configure "send to SAP Spooler for now" instead of "Print Immediately "in the Print Specification of those Background Jobs ?
    Moreover, Some Background jobs are sending E-Mails with the processed Reports as an Attachments. They are showing sometime unexpected behavior, in sending emails,  although there is no relation is with this Printing related issue.
    When i am looking into "Overview of Send Orders" of SCOT, some Background Jobs are showing success for sending emails, and some are not showing success, even though All the recipients are same for the scheduled Background Jobs which are running on same time.
    Regards,
    Bhavik G. Shroff

Maybe you are looking for

  • Livid with Apple - It just doesn't work. EVER

    Hi Guys, As the title suggests I am beyond aggrevated with Apple. But in the interest of healthy blood pressure and actually solving the problem; I will now continue with the problem at hand. I have through the years provided support for clients who

  • Content-length problem

    After upgraded into 8.1sp2, i met a new problem: <BEA-101083> <Connection failure. java.net.ProtocolException: Didn't meet stated Content-Length, wrote: '36648' bytes instead of stated: '36878' bytes <BEA-101104> <Servlet execution in servlet context

  • Changing default schema

    Hi: I would like to know if there is a way to change the default schema a user references. For example, I login as user "bill" with a schema associated with that user. But I want to reference the tables in someone else's schema, maybe user joe's sche

  • Enabling spell check for another language (Portuguese)

    I am trying to figure out how to spell check in another language. Specifically European Portuguese. Is this a browser issue or can it be resolved within the system of my laptop? Thanks

  • Flash won't run on server but runs in test environment

    I created a flv file from a mov file inserted it into a htm page. In the test environment it work (testing from Dreamweaver). I load it on a 2003 windows server (checked the Mime Type already) in a subdirectory off the root and it doesn't work. Below