Blocked deliveries when we execute vl10b job

Dear friends;
When we create deliveries by vl10b job. We have problems with blocked
materials. We can't create complete deliveries if some article of this
deliveries are being modified.
I will explain the situation with an exemple:
Error Sequence:
1. Create Purchase Order1 (PO1)
        Material 1
        Material 2
        Material 3
2. Update material 2 with MM42 transaction (like MM02 but it is an retail transaction).
3. Generating deliveries with the VL10b transaction. We create deliveries with two materials
                               DLV1
                                       material1
                                       material3
because the second material is locked. We need to create this deliveries without checking if an article it is being modified.
We don't use ATP.
We manage a great volume of deliveries per day and these locks
materials have a great impact in the depot orders preparation, because
this orders are not prepared completly.
We don't understand why in the process creation of deliveries check
when an article ins being modified. ¿It is possible skip this
validation?.
We are preparing the depot orders to customers inneficiently due it.
Thanks in advanced.

Dear friends;
When we create deliveries by vl10b job. We have problems with blocked
materials. We can't create complete deliveries if some article of this
deliveries are being modified.
I will explain the situation with an exemple:
Error Sequence:
1. Create Purchase Order1 (PO1)
        Material 1
        Material 2
        Material 3
2. Update material 2 with MM42 transaction (like MM02 but it is an retail transaction).
3. Generating deliveries with the VL10b transaction. We create deliveries with two materials
                               DLV1
                                       material1
                                       material3
because the second material is locked. We need to create this deliveries without checking if an article it is being modified.
We don't use ATP.
We manage a great volume of deliveries per day and these locks
materials have a great impact in the depot orders preparation, because
this orders are not prepared completly.
We don't understand why in the process creation of deliveries check
when an article ins being modified. ¿It is possible skip this
validation?.
We are preparing the depot orders to customers inneficiently due it.
Thanks in advanced.

Similar Messages

  • Could not execute the job

    Hi,
    when i execute the job a a window appear with the massage" ERROR: could not execute the job .Error returned was 1
         MESSAGE is : Could not open command file...
    And i can't find from where it comes any suggestion?

    When today i execute the job i had this list of error
    13860    15384    REP-100109        27/05/2014 08:22:10       |Session TF_SGFA
    13860    15384    REP-100109        27/05/2014 08:22:10       Cannot save <History info> into the repository. Additional database information: <SQL submitted to ODBC data source
    13860    15384    REP-100109        27/05/2014 08:22:10       <SIGSIRDDB01\SQLSIRDBD> resulted in error <[Microsoft][ODBC SQL Server Driver][SQL Server]Could not allocate space for object
    13860    15384    REP-100109        27/05/2014 08:22:10       'dbo.AL_HISTORY_INFO' in database 'DS_REP' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded
    13860    15384    REP-100109        27/05/2014 08:22:10       files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files
    13860    15384    REP-100109        27/05/2014 08:22:10       in the filegroup.>. The SQL submitted is <INSERT INTO "AL_HISTORY_INFO" ("OBJECT_KEY", "NAME", "VALUE", "NORM_NAME",
    13860    15384    REP-100109        27/05/2014 08:22:10       "NORM_VALUE") VALUES (430, N'TRACE_LOG_INFO',
    13860    15384    REP-100109        27/05/2014 08:22:10                N'F:\SAPDS/log/JobServDS/sigsirddb01_sqlsirdbd_ds_rep_dsuser/trace_05_27_2014_08_22_09_10__3a4327b0_92c8_4abe_ac24_96d49123242a.
    13860    15384    REP-100109        27/05/2014 08:22:10       txt', N'TRACE_LOG_INFO',
    13860    15384    REP-100109        27/05/2014 08:22:10                N'F:\SAPDS/LOG/JOBSERVDS/SIGSIRDDB01_SQLSIRDBD_DS_REP_DSUSER/TRACE_05_27_2014_08_22_09_10__3A4327B0_92C8_4ABE_AC24_96D49123242A.
    13860    15384    REP-100109        27/05/2014 08:22:10       TXT') >.>.
    13860    15384    REP-100112        27/05/2014 08:22:10       |Session TF_SGFA
    13860    15384    REP-100112        27/05/2014 08:22:10       Cannot save <History info> for repository object <>. Additional database information: <Cannot save <History info> into the
    13860    15384    REP-100112        27/05/2014 08:22:10       repository. Additional database information: <SQL submitted to ODBC data source <SIGSIRDDB01\SQLSIRDBD> resulted in error
    13860    15384    REP-100112        27/05/2014 08:22:10       <[Microsoft][ODBC SQL Server Driver][SQL Server]Could not allocate space for object 'dbo.AL_HISTORY_INFO' in database 'DS_REP'
    13860    15384    REP-100112        27/05/2014 08:22:10       because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup,
    13860    15384    REP-100112        27/05/2014 08:22:10       adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.>. The SQL submitted is
    13860    15384    REP-100112        27/05/2014 08:22:10       <INSERT INTO "AL_HISTORY_INFO" ("OBJECT_KEY", "NAME", "VALUE", "NORM_NAME", "NORM_VALUE") VALUES (430, N'TRACE_LOG_INFO',
    13860    15384    REP-100112        27/05/2014 08:22:10                N'F:\SAPDS/log/JobServDS/sigsirddb01_sqlsirdbd_ds_rep_dsuser/trace_05_27_2014_08_22_09_10__3a4327b0_92c8_4abe_ac24_96d49123242a.
    13860    15384    REP-100112        27/05/2014 08:22:10       txt', N'TRACE_LOG_INFO',
    13860    15384    REP-100112        27/05/2014 08:22:10                N'F:\SAPDS/LOG/JOBSERVDS/SIGSIRDDB01_SQLSIRDBD_DS_REP_DSUSER/TRACE_05_27_2014_08_22_09_10__3A4327B0_92C8_4ABE_AC24_96D49123242A.
    13860    15384    REP-100112        27/05/2014 08:22:10       TXT') >.>.>.
    13860    15384    REP-100112        27/05/2014 08:22:10       |Session TF_SGFA
    13860    15384    REP-100112        27/05/2014 08:22:10       Cannot save <History info> for repository object <>. Additional database information: <Cannot save <History info> into the
    13860    15384    REP-100112        27/05/2014 08:22:10       repository. Additional database information: <SQL submitted to ODBC data source <SIGSIRDDB01\SQLSIRDBD> resulted in error
    13860    15384    REP-100112        27/05/2014 08:22:10       <[Microsoft][ODBC SQL Server Driver][SQL Server]Could not allocate space for object 'dbo.AL_HISTORY_INFO' in database 'DS_REP'
    13860    15384    REP-100112        27/05/2014 08:22:10       because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup,
    13860    15384    REP-100112        27/05/2014 08:22:10       adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.>. The SQL submitted is
    13860    15384    REP-100112        27/05/2014 08:22:10       <INSERT INTO "AL_HISTORY_INFO" ("OBJECT_KEY", "NAME", "VALUE", "NORM_NAME", "NORM_VALUE") VALUES (430, N'TRACE_LOG_INFO',
    13860    15384    REP-100112        27/05/2014 08:22:10                N'F:\SAPDS/log/JobServDS/sigsirddb01_sqlsirdbd_ds_rep_dsuser/trace_05_27_2014_08_22_09_10__3a4327b0_92c8_4abe_ac24_96d49123242a.
    13860    15384    REP-100112        27/05/2014 08:22:10       txt', N'TRACE_LOG_INFO',
    13860    15384    REP-100112        27/05/2014 08:22:10                N'F:\SAPDS/LOG/JOBSERVDS/SIGSIRDDB01_SQLSIRDBD_DS_REP_DSUSER/TRACE_05_27_2014_08_22_09_10__3A4327B0_92C8_4ABE_AC24_96D49123242A.
    13860    15384    REP-100112        27/05/2014 08:22:10       TXT') >.>.>.
    and thank u.
    Sincerly

  • Re: Error when executing the Job.

    Hi,
    I am trying to Migrate data from SAP to MySQL. When I try to execute the JOB, it gives me the following error:
    1. 3964     1660     DBS-070401     6/29/2010 4:37:23 PM     |Dataflow DF_Sales_Headers|Loader Query_sales_headers
    2. 3964     1660     DBS-070401     6/29/2010 4:37:23 PM     ODBC data source <MyODBC> error message for operation   <SQLExecute>: <[MySQL][ODBC 3.51
    3. 3964     1660     DBS-070401     6/29/2010 4:37:23 PM     Driver][mysqld-5.0.34-enterprise-nt]Duplicate entry '0010000000' for key 1>.
    4. 3964     1660     RUN-051005     6/29/2010 4:37:23 PM     |Dataflow DF_Sales_Headers|Loader Query_sales_header     Execution of <Regular Load Operations> for target <sales_headers> failed. Possible causes: (1) Error in the SQL syntax; (2) Database connection is broken; (3) Database related errors such as transaction log is full, etc.; (4) The user defined in the datastore has insufficient privileges to execute the SQL. If the error is for preload or postload operation, or if it is for egular load operation and load triggers are defined, please check the SQL. Otherwise, for (3) and (4), please contact your local DBA.
    [Note: But when I validate the DataFlow before Executing, it does not show any error msgs.]
    This is pretty simple Batch Job, with one source Table and a Target table. I have used Query for mapping the columns.
    I am Pretty much new to BODI, so please bare with me, if the question seems silly.
    Any kind of help is appreciated. Thank You!!

    Hi all,
    Sorry for any inconvenience. I found out that, my Job has already executed and also populated the data. But, somehow, i missed that and was trying to re-execute it.
    But then again, I am trying to execute another job and has another peculiar problem.[This time, Have checked everything before posting].
    Following is the Error Message:
    5412     6600     R3C-151001     6/29/2010 6:13:35 PM     |Dataflow DF_Sales_Item Error calling R/3 to get table data: <RFC Error: Key: RFC_ERROR_SYSTEM_FAILURE Status: Error in ASSIGN assignment in program SAPLSDTX >.
    I am not sure why, as i have checked all the connections and i dont see any problems.
    Any kind of help is appreciated.
    Thank You!!
    Edited by: Ragini_sri on Jun 30, 2010 5:35 PM

  • SSIS ETL does not pick the file from Share point when it execute through SQL Agent job

    I have created one SSIS packages, which pick the file from the Share point document library. its work successfully, once it execute through the VS project application. 
    But when i create a job in SQL Server Agent for this package then it does not pick the file and job getting fail. 
    Just for more update, SQL Server has been install in Cluster mode and using BIDS 2012 with SQl Server 2012.

    Hi PriyankGupta,
    SQL Server Integration Services is not cluster awareness, and does not support failover from one cluster node to another. So, in your clustered environment, make sure SSIS is installed on each node in the cluster. In other word, SSIS must be installed on
    the server where the SQL Server Agent job is created. 
    If you use any third party task/component or drivers, make sure they are installed on the SQL Server Agent job server. Besides, also pay attention to the protection level of the package as well as 32-bit or 64-bit runtime mode of the package. For more information,
    please see:
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/e13c137c-1535-4475-8c2f-c7e6e7d125fc/how-do-i-troubleshoot-ssis-packages-failed-execution-in-a-sql-agent-job 
    If the issue persists, please post the error message in the job history for further analysis.
    Regards,
    Mike Yin
    TechNet Community Support

  • Why the job is deleted when I execute it???

    I create this job and when I execute it the job is deleted. What happens????
    DECLARE
    X NUMBER;
    BEGIN
    SYS.DBMS_JOB.SUBMIT
    ( job => X
    ,what => 'USER1.PKG_TOOLS.MAIN_CUSTOMERS;'
    ,next_date => to_date('27/04/2005 08:30:00','dd/mm/yyyy hh24:mi:ss')
    ,interval => 'TRUNC(SYSDATE+1)+8.50/24+DECODE(TO_CHAR(SYSDATE,''DY'',''NLS_DATE_LANGUAGE=AMERICAN''),''FRI'',48/24)'
    ,no_parse => TRUE
    SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
    END;
    commit;
    Thanks!

    You forgot the default section in the decode, try this:
    DECLARE
      X NUMBER;
    BEGIN
      SYS.DBMS_JOB.SUBMIT
      ( job => X
       ,what => 'USER1.PKG_TOOLS.MAIN_CUSTOMERS;'
       ,next_date => to_date('27/04/2005 08:30:00','dd/mm/yyyy hh24:mi:ss')
       ,interval => 'TRUNC(SYSDATE+1)+8.50/24+DECODE(TO_CHAR(SYSDATE,''DY'',''NLS_DATE_LANGUAGE=AMERICAN''),''FRI'',48/24, 24/24)'
       ,no_parse => TRUE
      SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
    END;
    /

  • Why my system hanged when i execute this block

    when i execute this query , why my oracle stop reponding
    and after some time start an ifinite output...
    declare
    v_nextval varchar2(10);
    cursor c6 is
    (select seq_a.nextval from dual);
    begin
    open c6;
    loop
    fetch c6 into v_nextval ;
    exit when v_nextval <= 10;
    dbms_output.put_line(v_nextval);
    end loop;
    close c6;
    end;
    kinkly take a look on this
    thanks

    Maybe something like this.
    >
    suppose in my table col A
    have last inserted value 258
    i have migrated database from sql server 2005 to oracle 10g
    where sequences currval is not initailized and last value is 1
    now i m creating a new sequence but i do not want to mention Startwith 258
    so how to do
    >
    SQL> select 'create sequence sequence_' || chr(level + 64)  || ' start with 1 ; ' from dual
      2  connect by level <= 2;
    'CREATESEQUENCESEQUENCE_'||CHR(LEVEL+64)||'ST
    create sequence sequence_A start with 1 ;
    create sequence sequence_B start with 1 ;
    SQL> create sequence sequence_A start with 1 ;
    Sequence created.
    SQL> create sequence sequence_B start with 1 ;
    Sequence created.
    SQL> create table table_A
      2  (
      3   sno number
      4  )
      5  /
    Table created.
    SQL>
    SQL> insert into table_a
      2  select level from dual connect by level <= 10;
    10 rows created.
    SQL>
    SQL> create table table_b
      2  (
      3   sno number
      4  )
      5  /
    Table created.
    SQL>
    SQL>
    SQL> insert into table_b
      2  select level from dual connect by level <= 20;
    20 rows created.
    SQL> with mapping_table
      2  as
      3  (
      4   select 'sequence_a' sequence_name, 'table_a' tname, 'sno' column_name from dual
      5   union all
      6   select 'sequence_b', 'table_b', 'sno' from dual
      7  ),
      8  max_value_table
      9  as
    10  (
    11   SELECT
    12       sequence_name,
    13       to_number(
    14         extractvalue(
    15           xmltype(
    16    DBMS_XMLGEN.getxml('select max(' || column_name || ') c from '||tname))
    17           ,'/ROWSET/ROW/C')) max_value
    18  FROM mapping_table
    19  )
    20  select * from max_value_table;
    SEQUENCE_N  MAX_VALUE
    sequence_a         10
    sequence_b         20
      1* select * from user_sequences where sequence_name in ('SEQUENCE_A','SEQUENCE_B')
    SQL> /
    SEQUENCE_NAME                   MIN_VALUE  MAX_VALUE INCREMENT_BY C O CACHE_SIZE LAST_NUMBER
    SEQUENCE_A                              1 1.0000E+27            1 N N         20           1
    SEQUENCE_B                              1 1.0000E+27            1 N N         20           1
    SQL> with mapping_table
      2  as
      3  (
      4   select 'sequence_a' sequence_name, 'table_a' tname, 'sno' column_name from dual
      5   union all
      6   select 'sequence_b', 'table_b', 'sno' from dual
      7  ),
      8  max_value_table
      9  as
    10  (
    11   SELECT
    12       sequence_name,
    13       to_number(
    14         extractvalue(
    15           xmltype(
    16    DBMS_XMLGEN.getxml('select max(' || column_name || ') c from '||tname))
    17           ,'/ROWSET/ROW/C')) max_value
    18  FROM mapping_table
    19  ) ,
    20  sequence_collation
    21  as
    22  (
    23   select us.sequence_name, us.increment_by, mvt.max_value from user_sequences us, max_value_Table mvt
    24   where
    25       us.sequence_name = upper(mvt.sequence_name)
    26  ),
    27  sequence_exec_order
    28  as
    29  (
    30  select 1 execution_sequence, 'alter sequence ' || sequence_name || ' increment by ' || max_value || ';' text from sequence_collation
    31  union all
    32  select 2, 'select ' || sequence_name || '.nextval from dual ; ' from sequence_collation
    33  union all
    34  select 3, 'alter sequence ' || sequence_name || ' increment by ' || increment_by || ' ;' from sequence_collation
    35  )
    36  select text from sequence_exec_order order by execution_sequence
    37  /
    TEXT
    alter sequence SEQUENCE_A increment by 10;
    alter sequence SEQUENCE_B increment by 20;
    select SEQUENCE_A.nextval from dual ;
    select SEQUENCE_B.nextval from dual ;
    alter sequence SEQUENCE_A increment by 1 ;
    alter sequence SEQUENCE_B increment by 1 ;
    6 rows selected.
    SQL> alter sequence SEQUENCE_A increment by 10;
    Sequence altered.
    SQL> alter sequence SEQUENCE_B increment by 20;
    Sequence altered.
    SQL> select SEQUENCE_A.nextval from dual ;
       NEXTVAL
            10
    SQL> select SEQUENCE_B.nextval from dual ;
       NEXTVAL
            20
    SQL> alter sequence SEQUENCE_A increment by 1 ;
    Sequence altered.
    SQL> alter sequence SEQUENCE_B increment by 1 ;
    Sequence altered.
    SQL> select * from user_sequences where sequence_name in ('SEQUENCE_A','SEQUENCE_B')
      2  /
    SEQUENCE_NAME                   MIN_VALUE  MAX_VALUE INCREMENT_BY C O CACHE_SIZE LAST_NUMBER
    SEQUENCE_A                              1 1.0000E+27            1 N N         20          11
    SEQUENCE_B                              1 1.0000E+27            1 N N         20          21Regards
    Raj
    P.S : dbms_xmlgen query from the old posts in this forum.....

  • Problem when I execute program SCM in background

    Hi experts,
        I am with problem when I execute a program (SCM) in background. I inserted a new field (estoque_seg(10)) and the process stopped at execute in background.When I call transaction and press F8, works but for this, I need jump the consistence  IF sy-batch IS INITIAL....Dont has any bath imput, only functions. Any idea?
    Follow below the code:
    Estrutura para tabela ENTRADA
    DATA: BEGIN OF st_entrada,
            matnr(40)            TYPE c,
            werks(20)            TYPE c,
            ponto_abas(10)       TYPE c,
            estoque_max(10)      TYPE c,
            cobertura(10)        TYPE c,
            estoque_seg(10)      TYPE c, " Erlon Lourenço 20/01/2011
          END OF st_entrada.
    Estrutura para tabela de LOG
    *TYPES: BEGIN OF st_saida,
           pernr(8)             TYPE c ,
           date(10)             TYPE c,
           er_contribuition(15) TYPE c,
           tax(15)              TYPE c,
           msg_erro(80)         TYPE c,
         END OF st_saida.
    Tabela para obter descricao da mensagem
    *DATA: ti_saida TYPE STANDARD TABLE OF st_saida WITH HEADER LINE
                                                  INITIAL SIZE 0.
    Tabela que recebera o arquivo texto
    DATA: BEGIN OF ti_entrada OCCURS 0.
            INCLUDE STRUCTURE st_entrada.
    DATA: END OF ti_entrada.
    DATA: BEGIN OF it_matid OCCURS 0,
      matnr TYPE /sapapo/matkey-matnr,
      matid TYPE /sapapo/matkey-matid,
    END OF it_matid.
    DATA: BEGIN OF it_locid OCCURS 0,
      locno TYPE /sapapo/loc-locno,
      locid TYPE /sapapo/loc-locid,
    END OF it_locid.
    DATA: BEGIN OF it_matlotsz OCCURS 0,
      target_dur TYPE /sapapo/matlotsz-target_dur,
      END OF it_matlotsz.
    DATA:        wa_matloc       LIKE /sapapo/matloc   OCCURS  0 WITH HEADER LINE,
                 wa_matlsim      LIKE /sapapo/matlsim  OCCURS  0 WITH HEADER LINE,
                 wa_matlotsz     LIKE /sapapo/matlotsz OCCURS  0 WITH HEADER LINE.
    Variáveis Globais
    DATA: v_tabix   TYPE sy-tabix,
          v_vrsioid TYPE /sapapo/apo01-vrsioid,
          v_tam     TYPE i.
        Select-Options & Parameters
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:  p_versao    TYPE /sapapo/apo01-vrsioex OBLIGATORY DEFAULT '000',
                 p_abas  AS CHECKBOX  ,
                 p_est   AS CHECKBOX  ,
                 p_cober AS CHECKBOX  ,
                 p_estsg AS CHECKBOX.   " ERLON LOURENCO - 20/01/2012 - Estoque Segurança
    SELECTION-SCREEN END OF BLOCK b1.
        Start-of-Selection
    START-OF-SELECTION.
      PERFORM consiste.
      PERFORM f_upload.
      PERFORM f_processa_batch.
      PERFORM f_saida_dados.
      MESSAGE i000 WITH 'Processo encerrado com Sucesso'.
    END-OF-SELECTION.
    *&      Form  F_UPLOAD
          text
    -->  p1        text
    <--  p2        text
    FORM f_upload .
      DATA: lc_file TYPE string.
      TYPES: BEGIN OF st_ent,
                cam(80),
             END OF st_ent.
      DATA: ti_ent TYPE STANDARD TABLE OF st_ent WITH HEADER LINE
                                                  INITIAL SIZE 0.
      RANGES: r_file       FOR zget0001-field_content.
      r_file[] = zbs_constantes=>obter( i_bukrs = space i_field = 'FILE' i_process = 'PONTO-REAB' ).
      READ TABLE r_file INDEX 1.
      lc_file = r_file-low.
      CLEAR: ti_entrada,
             ti_entrada[],
             ti_ent,
             ti_ent[].
    abrir arquivo para leitura
      OPEN DATASET lc_file FOR INPUT  IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
        MESSAGE i000 WITH text-e01.
        STOP.
      ENDIF.
    Leitura de arquivos
      DO.
        READ DATASET lc_file INTO ti_ent.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND ti_ent.
      ENDDO.
    Fechamento do arquivo
      CLOSE DATASET lc_file.
      LOOP AT ti_ent.
        SPLIT ti_ent AT ';' INTO ti_entrada-matnr ti_entrada-werks ti_entrada-ponto_abas ti_entrada-estoque_max ti_entrada-cobertura ti_entrada-estoque_seg.
        APPEND ti_entrada.
      ENDLOOP.
    ENDFORM.                    " F_UPLOAD
    *&      Form  F_PROCESSA_BATCH
          text
    -->  p1        text
    <--  p2        text
    FORM f_processa_batch .
      LOOP AT ti_entrada.
        v_tabix = sy-tabix.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-matnr
          IMPORTING
            output = ti_entrada-matnr.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-ponto_abas
          IMPORTING
            output = ti_entrada-ponto_abas.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-estoque_max
          IMPORTING
            output = ti_entrada-estoque_max.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-cobertura
          IMPORTING
            output = ti_entrada-cobertura.
    IA - ERLON LOURENCO - 20/01/2012
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-estoque_seg
          IMPORTING
            output = ti_entrada-estoque_seg.
    FA - ERLON LOURENCO - 20/01/2012
        MODIFY ti_entrada INDEX v_tabix.
      ENDLOOP.
      CLEAR: it_matid,
             it_matid[],
             it_locid,
             it_locid[],
             wa_matlsim,
             wa_matlsim[],
             wa_matloc,
             wa_matloc[].
      SELECT matnr matid INTO TABLE it_matid FROM /sapapo/matkey
      FOR ALL ENTRIES IN ti_entrada WHERE matnr = ti_entrada-matnr.
      SELECT locno locid INTO TABLE it_locid FROM /sapapo/loc
      FOR ALL ENTRIES IN ti_entrada WHERE locno = ti_entrada-werks.
      IF p_versao = '000'.
        LOOP AT ti_entrada.
          READ TABLE it_matid WITH KEY matnr = ti_entrada-matnr.
          IF sy-subrc = 0 .
            READ TABLE it_locid WITH KEY locno = ti_entrada-werks.
            IF sy-subrc = 0.
              SELECT SINGLE * INTO wa_matloc FROM /sapapo/matloc WHERE matid = it_matid-matid  AND
                                                                       locid = it_locid-locid.
              IF sy-subrc = 0.
                IF p_abas = 'X'.
                  wa_matloc-reord    = ti_entrada-ponto_abas.
                ENDIF.
                IF p_est = 'X'.
                  wa_matloc-maxstock = ti_entrada-estoque_max.
                ENDIF.
                " IA - Erlon Lourenço - 23/01/2012
                if p_estsg = 'X'.
                  wa_matloc-safty    = ti_entrada-estoque_seg.     " Erlon Lourenço - 23/01/2012
                endif.
                "FA - Erlon Lourenço - 23/01/2012
                IF p_abas  = 'X'   OR
                   p_est   = 'X'   OR
                   p_estsg = 'X'.      " Erlon Lourenço - 23/01/2012
                  APPEND wa_matloc TO wa_matloc.
                ENDIF.
                SELECT SINGLE * INTO wa_matlotsz FROM /sapapo/matlotsz WHERE lszid = wa_matloc-lszid.
                IF sy-subrc = 0.
                  IF p_cober = 'X'.
                    wa_matlotsz-target_dur = ti_entrada-cobertura.
                    APPEND wa_matlotsz TO wa_matlotsz.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDLOOP.   " LOOP AT ti_entrada.
      ELSE.
    Verifica versáo para saber se preenche a tabela wa_matlsim
        SELECT SINGLE vrsioid INTO v_vrsioid FROM /sapapo/apo01 WHERE vrsioex = p_versao.
        IF sy-subrc = 0.
          SELECT * INTO TABLE wa_matlsim FROM /sapapo/matlsim WHERE simid = v_vrsioid.
          IF wa_matlsim[] IS NOT INITIAL.
            LOOP AT ti_entrada.
              READ TABLE it_matid WITH KEY matnr = ti_entrada-matnr.
              IF sy-subrc = 0 .
                READ TABLE it_locid WITH KEY locno = ti_entrada-werks.
                IF sy-subrc = 0.
                  READ TABLE wa_matlsim WITH KEY matid = wa_matloc-matid
                                                 locid = wa_matloc-locid.
                  IF sy-subrc = 0.
                    wa_matlsim-reord    = ti_entrada-ponto_abas.
                    wa_matlsim-maxstock = ti_entrada-estoque_max.
                    wa_matlsim-safty    = ti_entrada-estoque_seg.     " Erlon Lourenço - 23/01/2012
                    MODIFY wa_matlsim INDEX v_tabix.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDLOOP.  " LOOP AT ti_entrada.
          ENDIF.     " IF wa_matlsim[] IS NOT INITIAL.
        ENDIF.     " IF sy-subrc = 0. 1º
      ENDIF.     "IF p_versao = '000'
    Funcáo que atualiza campos nas bases de dados.
      CALL FUNCTION '/SAPAPO/DM_PRODUCTS_POST'
        EXPORTING
          iv_vb         = 'U'
        TABLES
          it_matloc     = wa_matloc
          it_matlsim    = wa_matlsim
          it_matlotsz   = wa_matlotsz
        EXCEPTIONS
          not_qualified = 1
          insert_failed = 2
          update_failed = 3
          OTHERS        = 4.
      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.                    " F_PROCESSA_BATCH
      FORM  BDC_DYNPRO
    *&      Form  F_SAIDA_DADOS
          text
    -->  p1        text
    <--  p2        text
    FORM f_saida_dados .
    IF ti_saida[] IS NOT INITIAL.
       DATA: lc_file TYPE string.
       lc_file = p_erros.
       CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
      BIN_FILESIZE                    =
           filename                        = lc_file
      FILETYPE                        = 'ASC'
         TABLES
           data_tab                        = ti_saida
      FIELDNAMES                      =
        EXCEPTIONS
          file_write_error                = 1
          no_batch                        = 2
          gui_refuse_filetransfer         = 3
          invalid_type                    = 4
          no_authority                    = 5
          unknown_error                   = 6
          header_not_allowed              = 7
          separator_not_allowed           = 8
          filesize_not_allowed            = 9
          header_too_long                 = 10
          dp_error_create                 = 11
          dp_error_send                   = 12
          dp_error_write                  = 13
          unknown_dp_error                = 14
          access_denied                   = 15
          dp_out_of_memory                = 16
          disk_full                       = 17
          dp_timeout                      = 18
          file_not_found                  = 19
          dataprovider_exception          = 20
          control_flush_error             = 21
          OTHERS                          = 22
       IF sy-subrc <> 0.
         MESSAGE i005 WITH 'Error to unload file !'.
         STOP.
       ENDIF.
    ENDIF.
    ENDFORM.                    " F_SAIDA_DADOS
    *&      Form  CONSISTE
          text
    -->  p1        text
    <--  p2        text
    FORM consiste .
      IF p_abas  IS INITIAL  AND
         p_est   IS INITIAL  AND
         p_cober IS INITIAL AND
         p_estsg IS INITIAL.   " ERLON LOURENCO - 20/01/2012 - Estoque Segurança
        MESSAGE i000 WITH text-e03.
        STOP.
      ENDIF.
      IF sy-batch IS INITIAL.
        MESSAGE i000 WITH text-e02.
        STOP.
      ENDIF.
    Best regards,
    Erlon Lourenço
    Edited by: Erlon Louren on Jan 27, 2012 11:09 AM

    Hi Raja,
                Check weather there are  any enhancements to the datasource.If yes once check the code in CMOD.Seems there is some discrepency in that.
    Regards
    Karthik

  • Error on auto execute of job 1032656.. Where i can get the details?

    ORA-12012: error on auto execute of job 1032656
    ORA-04063: ORA-04063: package body "ORACLE_OCM.MGMT_DB_LL_METRICS" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "ORACLE_OCM.MGMT_DB_LL_METRICS"
    ORA-06512: at line 1
    ORA-1580 signalled during: alter database backup controlfile to 'backup_control_file.ctl'..
    Hi All,
    I am getting the above error in my alert log.
    When i check in my dba_jobs there were only two jobs having job column 1 & 21.
    Where i can see the job 1032656 and its details ?
    Regards
    Arun

    Hi Arun,
    This is due to invalid objects in ORACLE_OCM schema.
    Please read metalink note id:
    Invalid Objects After Revoking EXECUTE Privilege From PUBLIC [ID 797706.1]
    Symptoms
    OEM recommends that EXECUTE privilege being revoked from PUBLIC. After revoking the privilege, the following errors appeared in alert log:
    ORA-12012: error on auto execute of job 66171
    ORA-04063: package body "ORACLE_OCM.MGMT_DB_LL_METRICS" has errors
    ORA-06508: PL/SQL: could not find program unit being called: ORACLE_OCM.MGMT_DB_LL_METRICS"
    ORA-06512: at line 1 has errors .
    Also, the below query returns invalid rows count (approximately 46 rows)
    SQL> select object_name, owner, object_type, status from dba_objects where status = 'INVALID';
    Owners of invalid objects are ORACLE_OCM and WMSYS
    *Cause*
    At the time of installation of the database, Oracle execute scripts that test to see if PUBLIC access is granted to all of the routines that ORACLE_OCM and WMSYS need access to. If PUBLIC access is NOT available, Oracle scripts grant specific access rights. However, If EXECUTE privilege is revoked from PUBLIC after installation, then those specific access rights needs to be granted manually.
    *Solution*
    You will need to grant execute on UTL_FILE and DBMS_SCHEDULER to ORACLE_OCM and WMSYS. The below action plan should solve the issue:
    SQL> grant execute on UTL_FILE to oracle_ocm;
    SQL> grant execute on DBMS_SCHEDULER to oracle_ocm;
    SQL> grant execute on UTL_FILE to wmsys;
    SQL> grant execute on DBMS_SCHEDULER to wmsys;
    SQL> shutdown immediate;
    SQL> startup restrict;
    SQL> @utlrp.sql /* $ORACLE_HOME/rdbms/admin/@utlrp.sql */
    SQL> shutdown immediate;
    SQL> startup;
    Regards
    Rajesh

  • Duplicate deliveries getting created by batch job against STO

    Hi Experts,
    I am facing one issue where duplicate deliveries are getting created by batch job against Intercopmany STO.
    Scenario is PO having one line item with ordered qty of 8000kg.
    Through batch job, two deliveries got created on same day for PO line item.
    One delivery got created for 8000kg and another delivery has got created for 7000Kg. So user has deleted second delivery of 7000kg.
    Next day again the delivery got created for 8000kg for the same PO line item through batch job.
    I am wondering how the duplicate deliveries are getting created by batch job for PO even though it has no open items.
    All deliveries got created through batch job only as cross checked the user name in delivery.
    Kindly help to fix the issue.

    Hi Amit
    I assume you are talking about outbound deliveries.  In this case it would be worth checking the customer master record for the receiving plant.  In the sales area data there is a shipping tab which contains several settings used to control delivery creation for customers.
    It is possible to control how the system behaves when you have a stock shortage and restrict the number of partial deliveries.  This might help you control this situation and might be the cause.
    Regards
    Robyn

  • How to block a page (from a business job searching website) from appearing on my screen without me searching for it?

    How to block a page (from a business job searching website) from appearing on my screen without me searching for it?

    Look under:
    System preferences > Network > WiFi > ( Advanced ) > DNS
    System Preferences > Network > Ethernet > ( Advanced ) > DNS
    There should be two or more IP addresses there.
    Those addresses should be EXACTLY the ones your current ISP provided when you signed up for service. They do not start with 85 or 86 -- those are hacker sites.
    If you are in the US, you could also use OpenDNS:
    208.67.222.222
    208.67.220.220

  • 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.

  • Error while executing the Job for Objects :null  Batch Risk Analysis

    Hi All,
    We've recently upgraded Virsa to version  5.3_14 .  I'm encountering a problem when executing the Batch Risk Analysis job for users, roles and profiles.  The job does not complete for some objects and it seems to be sporadic and shows this error: -
    Background Job History: job id=395, status=2, message=Error while executing the Job for Object(s) :ABROWN:null                                                                               
    I've attached the log for your review.
    Thanks in advance for your help.                                                                               
    Linda Lewis                                                                               
    Feb 9, 2011 1:47:53 PM com.virsa.cc.xsys.meng.ObjAuthMatcher <init>
    FINEST: ObjAuthMatcher constructed: 4ms, #singles=2141, #ranges=0, #super=0
    Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.riskanalysis.AnalysisEngine riskAnalysis
    WARNING:  Job ID:395 : Failed to run Risk Analysis
    java.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1019)
    at com.virsa.cc.xsys.util.RuleLoader.getPermRule(RuleLoader.java:573)
    at com.virsa.cc.xsys.riskanalysis.AnalysisEngine.performActPermAnalysis(AnalysisEngine.java:1609)
    at com.virsa.cc.xsys.riskanalysis.AnalysisEngine.riskAnalysis(AnalysisEngine.java:321)
    at com.virsa.cc.xsys.bg.BatchRiskAnalysis.performBatchRiskAnalysis(BatchRiskAnalysis.java:1166)
    at com.virsa.cc.xsys.bg.BatchRiskAnalysis.performBatchSyncAndAnalysis(BatchRiskAnalysis.java:1464)
    at com.virsa.cc.xsys.bg.BgJob.runJob(BgJob.java:560)
    at com.virsa.cc.xsys.bg.BgJob.run(BgJob.java:363)
    at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.scheduleJob(AnalysisDaemonBgJob.java:375)
    at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.start(AnalysisDaemonBgJob.java:92)
    at com.virsa.cc.comp.BgJobInvokerView.wdDoModifyView(BgJobInvokerView.java:444)
    at com.virsa.cc.comp.wdp.InternalBgJobInvokerView.wdDoModifyView(InternalBgJobInvokerView.java:1236)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
    at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
    at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
    at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
    at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
    at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:332)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253)
    at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(AccessController.java:207)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.util.Lock lock
    FINEST: Lock:1004
    Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.util.Lock unlock
    FINEST: Unlock:1004
    Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.bg.BatchRiskAnalysis performBatchRiskAnalysis
    WARNING: Error: while executing BatchRiskAnalysis for JobId=395 and object(s):ABROWN: Skipping error to continue with next object: null Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.bg.BgJob updateJobHistory
    FINEST: --- @@@@@@@@@@@ Updating the Job History -
    2@@Msg is Error while executing the Job for Object(s) :ABROWN:null
    Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.bg.dao.BgJobHistoryDAO insert
    INFO: -
    Background Job History: job id=395, status=2, message=Error while executing the Job for Object(s) :ABROWN:null
    Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.util.Lock lock
    FINEST: Lock:1004
    Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.util.Lock unlock
    FINEST: Unlock:1004
    Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.bg.BatchRiskAnalysis performBatchRiskAnalysis
    INFO: --- BKG User Permission Analysis (System: P20:020) completed ---  elapsed time: 4522 ms
    Feb 9, 2011 1:47:54 PM com.virsa.cc.xsys.util.Lock lock
    Edited by: Linda Lewis on Feb 9, 2011 9:08 PM

    Hi,
    Was a solution found for this error?
    Thanks,
    Glen

  • Get a connection error when running a BODS job

    Hi All,
    I have BODS system setup in my environment. There are quite some jobs that run everyday. The jobs have stopped running since the last days. The jobs arn't failing, but they do not run.
    When I try to Execute a job, I get the error "Connection Refused: connection". When I Test the connection from BODS to CMS, it is working fine. Also, from the BODS/BO server I am able to connect/ping to the DataStore servers. My Datastores are SQL servers and ECC also.
    I do not know what is the resolution for the issue.
    Thanks,
    Amrita

    Hi Manoj,
    We recognized the issue was at the OS level, in the "Data Services"-OS Service.
    The BODS jobs are running fine now.
    Thanks,
    Amrita

  • Error while executing the Job:Cannot assign NULL to host variable 1

    Hello!
    I have the following issue:
    Error while executing the Job:Cannot assign NULL to host variable 1. setNull() can only be used if the corresponding column is nullable. The statement is "INSERT INTO "VIRSA_... (see log for details)
    Note 1362138 - Rule generation - null pointer exception virsa_cc_rtmap  doesn't me. After uploading files of ZCC_DOWNLOAD_SAPOBJ and ZCC_DOWNLOAD_DESC I got the same problem during job running...
    How can I find out where is the problem?

    Hi
    That looks like your fields are disabled but they could still be causing the problem edited ( nah - talking rubbish as you've put dummy " " in there) edited - the 'null' error caused many background jobs to fail but, once we had the evidence to show the space (somebody had pressed enter instead of delete/backspace to clear the entry) it stopped the problem - just a bit of learning on the job which we all go through for the GRC chaps in KL.
    A " " would be valid but a    (I know you can't see it but it's there wouldn't be      )
    edited.When you did an edit/replace did it say it had replaced anything please?edited
    The word doc option does sound good!
    Cheers
    David
    Edited by: David Berry on Nov 4, 2010 7:33 PM

  • From Time to Time error while executing RMAN Job

    Hi everybody,
    i have a strange problem. From time to time i recieve following error when executing a Job from Grid Control (Enterprise Manager).
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-04004: Fehler aus Recovery-Katalog-Datenbank: ORA-12170: TNS: Connect Timeout aufgetreten
    After that error the Job uses the Control File of the Database so the job runs. The strange thing for me is, that sometimes the jobs runs without problems and sometimes it gaves the error shown above.
    For clarifying. Grid Control runs on a Unix (Sun Solaris) Machine and the target Database runs on a Windows Server in a DMZ. I tried to find out what the problem is but neither on the windows server nor on the firewall side there are any problems.
    So can anybody help me finding out what the problem is?
    Any help would be appreciated.
    Greetings

    Hi sunny,
    i have tried the tnsping several times. There is no problem with this. The tnsping works without problems and in an appropriate time.
    When i issue the command on our unix machine it shows the following:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = srvxyz)(PORT = 1521))) (CONNECT_DATA = (SID = db1) (SERVICE_NAME = db1)))
    OK (10 msec)
    And when issue it on the Windows Server the follwoing output is shown:
    TNS Ping Utility for 64-bit Windows: Version 10.2.0.4.0 - Production on 26-APR-2011 10:35:45
    Copyright (c) 1997, 2007, Oracle. All rights reserved.
    Parameterdateien benutzt:
    O:\ORACLE\product\10.2.0\network\admin\sqlnet.ora
    Adapter TNSNAMES zur Auflösung des Alias benutzt
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = tcp.world)(PROTOCOL = TCP)(Host = SRVXYZ)(Port = 1521))) (CONNECT_DATA = (SID = db1)))
    OK (0 ms)
    So any other ideas??

Maybe you are looking for