Action monitoring through program RSPPFPROCESS - background job

Dear SAP CRM Experts,
I'm working with SAP CRM 2007 - Interaction Centre
I've configured actions which have to trigger mails when SLA deadlines are reached
I've scheduled a job from the program RSPPFPROCESS, with a variant.
If I launch the variant manually, I'm able to find the right actions related to the various transactions I'd previously created; otherwise, if I schedule the job, no mails are triggered.
What should I do?
Can anybody help me?
Thanks a lot,
Andrea

The fact is that there is a strange behaviour of the system:
lets suppose that I'm creating a ticket from the GUI.
I manually change the date which correspond to the duedate in the starting condition of the action, inserting a date in the past.
I press Enter.
No action are processed, although the Processing Time has been set in customizing as "Immediately".
Now if I click on the Tab "Actions" (or if I click on the button Save) the action is triggered and the corresponding e-mail is sent.
Any idea?
Thanks in advance,
Andrea
P.S. P O I N T S will be re war ded

Similar Messages

  • Failed to Run OLE Excel program in background JOB (SM36)

    Please help.
    I have write a program to use OLE to create a Excel file.
    The program can run successful in front end workstation. However, when I run the program in background job by SM36.
    The statement "CREATE OBJECT EXCEL 'EXCEL.APPLICATION'" return with error "SY-SUBRC = 2".
    How can I solve it ?
    Can OLE Excel be run on background job ?
    Thanks so much,
    Mark

    Hi Mark:
    Your need is a very common one. I also was asked to generate an Excel in Background.
    It is not possible to work with OLE in background mode.
    The reason is: In background mode there is no presentation server. OLE is executed in presentation server.
    Below I paste the code I wrote to solve my problem.
    This class sends a mail with an excel attached. The Excel content will be the internal table you pass to the class. But the Excel is not binary, it is a plain text file, separated by tabulators. Anyway, when you open it with Excel, the columns are properly shown.
    Sorry. Comments are in spanish, I don't have time to translate it.
    I kindly ask to everybody which want to use it to keep my name in the code.
    * Autor: Jordi Escoda, 30/10/2008.
    * Descripción: Esta clase genera un correo electrónico destinado a
    *  una persona, adjuntando el contenido de una tabla interna como
    *  Excel (campos separados por tabuladores).
    *  La virtud de esta clase es su sencillez de utilización. Para lanzar
    *  el mail con el excel adjunto basta con declarar la tabla interna,
    *  llenarla, colocar el asunto del mensaje, el destinatario, el nombre
    *  del excel adjunto, y pasar la tabla interna.
    * Ejemplo de utilización:
    *  DATA: lc_mail TYPE REF TO cl_mail_builder_xls_attach.
    *  DATA: lt_anla TYPE STANDARD TABLE OF anla.
    *    SELECT * INTO TABLE lt_anla  FROM anla.
    *    CREATE OBJECT lc_mail.
    *    CALL METHOD lc_mail->set_subject( 'Excel adjunto' ).
    *    CALL METHOD lc_mail->set_recipient( 'XXX@XXXDOTCOM' ).
    *    CALL METHOD lc_mail->set_attach_filename( 'ANLA' ).
    *    APPEND 'Cuerpo del mensaje' TO  lt_body.
    *    APPEND 'Saludos cordiales' TO  lt_body.
    *    CALL METHOD lc_mail->set_bodytext( lt_body ).
    *    CALL METHOD lc_mail->set_attach_table( lt_anla ).
    *    CALL METHOD lc_mail->send( ).
    *       CLASS cl_mail_builder_xls_attach DEFINITION
    CLASS cl_mail_builder_xls_attach DEFINITION.
      PUBLIC SECTION.
        METHODS: set_subject
                               IMPORTING im_subject TYPE so_obj_des,
                 set_bodytext
                               IMPORTING im_body TYPE bcsy_text,
                 set_recipient
                               IMPORTING im_recipient TYPE ad_smtpadr,
                 set_attach_table
                               IMPORTING im_table TYPE ANY TABLE,
                 set_attach_filename
                               IMPORTING im_attach_name TYPE sood-objdes,
                 send.
      PRIVATE SECTION.
        CONSTANTS:
          c_tab  TYPE c VALUE cl_bcs_convert=>gc_tab,
          c_crlf TYPE c VALUE cl_bcs_convert=>gc_crlf,
          c_singlequote TYPE c VALUE '.
        DATA: l_recipient_addr TYPE ad_smtpadr.
        DATA: send_request   TYPE REF TO cl_bcs,
              document       TYPE REF TO cl_document_bcs,
              recipient      TYPE REF TO if_recipient_bcs,
              bcs_exception  TYPE REF TO cx_bcs.
        DATA: binary_content TYPE solix_tab,
              size           TYPE so_obj_len.
        DATA: l_string TYPE string,
              l_body_text TYPE bcsy_text,
              l_subject TYPE so_obj_des,
              l_attach_name TYPE sood-objdes.
        METHODS: create_binary_content,
                 get_dataelement_medium_text
                        IMPORTING im_table_name TYPE tabname
                                  im_field_name TYPE fieldname
                        EXPORTING ex_medium_text TYPE scrtext_m.
    ENDCLASS.                    "cl_mail_builder_xls_attach DEFINITION
    *       CLASS cl_mail_builder_xls_attach IMPLEMENTATION
    CLASS cl_mail_builder_xls_attach IMPLEMENTATION.
      METHOD set_bodytext.
        l_body_text[] = im_body[].
      ENDMETHOD.                    "add_bodytext
      METHOD set_subject.
        l_subject = im_subject.
      ENDMETHOD.                    "add_subject
      METHOD set_attach_filename.
        l_attach_name = im_attach_name.
      ENDMETHOD.                    "add_subject
      METHOD set_recipient.
        l_recipient_addr = im_recipient.
      ENDMETHOD.                    "add_subject
      METHOD set_attach_table.
    *   Rellena en un string el contenido de la tabla interna recibida
        DATA: ref_to_struct  TYPE REF TO cl_abap_structdescr.
        DATA: my_like TYPE fieldname,
              nombretabla TYPE tabname,
              nombrecampo TYPE fieldname,
              texto_mediano TYPE scrtext_m.
        DATA: l_idx TYPE i,
              l_valorcampo(16) TYPE c,
              l_long TYPE i.
        FIELD-SYMBOLS: <fs_linea> TYPE ANY,
                       <fs_campo> TYPE ANY.
        FIELD-SYMBOLS: <comp_descr> TYPE abap_compdescr.
        CHECK NOT im_table[] IS INITIAL.
    *   Línea con los nombres de las columnas.
        CLEAR l_string.
        LOOP AT im_table ASSIGNING <fs_linea>.
    *     Toma los atributos del componente
          ref_to_struct  =
                     cl_abap_structdescr=>describe_by_data( <fs_linea> ).
          LOOP AT ref_to_struct->components ASSIGNING <comp_descr>.
            ASSIGN COMPONENT <comp_descr>-name
                                OF STRUCTURE <fs_linea> TO <fs_campo>.
    *       Obtenemos el origen de donde proviene (like). Ej:BKPF-BUDAT
            DESCRIBE FIELD <fs_campo> HELP-ID my_like.
            SPLIT my_like AT '-' INTO nombretabla nombrecampo.
            CALL METHOD get_dataelement_medium_text
              EXPORTING
                im_table_name  = nombretabla
                im_field_name  = nombrecampo
              IMPORTING
                ex_medium_text = texto_mediano.
            IF texto_mediano IS INITIAL.
              CONCATENATE l_string <comp_descr>-name INTO l_string.
            ELSE.
              CONCATENATE l_string texto_mediano INTO l_string.
            ENDIF.
            AT LAST.
              CONCATENATE l_string c_crlf INTO l_string.
              EXIT.
            ENDAT.
            CONCATENATE l_string c_tab INTO l_string.
          ENDLOOP.
          EXIT.
        ENDLOOP.
    *   Contenido de la tabla
        LOOP AT im_table ASSIGNING <fs_linea>.
    *     Toma los atributos del componente
          ref_to_struct  =
                     cl_abap_structdescr=>describe_by_data( <fs_linea> ).
          LOOP AT ref_to_struct->components ASSIGNING <comp_descr>.
    *       Asignamos el componente ue tratamos, para obtener
    *       el valor del mismo
            ASSIGN COMPONENT <comp_descr>-name OF STRUCTURE <fs_linea>
                                            TO <fs_campo>.
            CASE <comp_descr>-type_kind.
              WHEN 'P'. "Packed Number
    *           Convierte a caracter
                WRITE <fs_campo> TO l_valorcampo.
                CONCATENATE l_string l_valorcampo INTO l_string.
              WHEN OTHERS.
                l_long = STRLEN( <fs_campo> ).
                IF l_long > 11 AND <fs_campo> CO ' 0123456789'.
    *             El Excel muestra un número tal como 190000000006
    *             en formato 1,9E+11.
    *             Para eviarlo, los números de más de 11 dígitos los
    *             concatenamos con comillas simples.
                  CONCATENATE l_string c_singlequote
                              <fs_campo> c_singlequote INTO l_string.
                ELSE.
                  CONCATENATE l_string <fs_campo> INTO l_string.
                ENDIF.
            ENDCASE.
            AT LAST.
    *         Añade CRLF
              CONCATENATE l_string c_crlf INTO l_string.
              EXIT.
            ENDAT.
    *       Añade tabulador
            CONCATENATE l_string c_tab INTO l_string.
          ENDLOOP.
        ENDLOOP.
        create_binary_content( ).
      ENDMETHOD.                    "set_attach_table
      METHOD create_binary_content.
        DATA: l_size TYPE so_obj_len.
    *   convert the text string into UTF-16LE binary data including
    *   byte-order-mark. Mircosoft Excel prefers these settings
    *   all this is done by new class cl_bcs_convert (see note 1151257)
        TRY.
            cl_bcs_convert=>string_to_solix(
              EXPORTING
                iv_string   = l_string
                iv_codepage = '4103'  "suitable for MS Excel, leave empty
                iv_add_bom  = 'X'     "for other doc types
              IMPORTING
                et_solix  = binary_content
                ev_size   = size ).
          CATCH cx_bcs.
            MESSAGE e445(so).
        ENDTRY.
      ENDMETHOD.                    "create_binary_content
      METHOD send.
        DATA: l_sent_to_all TYPE os_boolean.
        TRY.
    *       create persistent send request
            send_request = cl_bcs=>create_persistent( ).
    *       create and set document with attachment
    *       create document object
            document = cl_document_bcs=>create_document(
              i_type    = 'RAW'
              i_text    = l_body_text
              i_subject = l_subject ).
    *       add the spread sheet as attachment to document object
            document->add_attachment(
              i_attachment_type    = 'xls'
              i_attachment_subject = l_attach_name
              i_attachment_size    = size
              i_att_content_hex    = binary_content ).
    *       add document object to send request
            send_request->set_document( document ).
    *       add recipient (e-mail address)
            recipient =
               cl_cam_address_bcs=>create_internet_address(
                                          l_recipient_addr ).
    *       add recipient object to send request
            send_request->add_recipient( recipient ).
    *       send document
            l_sent_to_all = send_request->send(
                                 i_with_error_screen = 'X' ).
            COMMIT WORK.
            IF l_sent_to_all IS INITIAL.
              MESSAGE i500(sbcoms) WITH l_recipient_addr.
            ELSE.
              MESSAGE s022(so).
            ENDIF.
          CATCH cx_bcs INTO bcs_exception.
            MESSAGE i865(so) WITH bcs_exception->error_type.
        ENDTRY.
      ENDMETHOD.                    "lcl_mail_xls_attachment
      METHOD get_dataelement_medium_text.
        DATA: lt_fld_info TYPE STANDARD TABLE OF dfies,
          wa_fld_info TYPE dfies.
    *   Busca en el diccionario los datos del campo
        CALL FUNCTION 'DDIF_FIELDINFO_GET'
          EXPORTING
            tabname        = im_table_name
            fieldname      = im_field_name
            langu          = sy-langu
          TABLES
            dfies_tab      = lt_fld_info
          EXCEPTIONS
            not_found      = 1
            internal_error = 2
            OTHERS         = 3.
        CLEAR ex_medium_text.
        IF sy-subrc = 0.
          READ TABLE lt_fld_info INDEX 1 INTO wa_fld_info.
    *     Si lo ha podido tomar del diccionario...
          IF NOT wa_fld_info-scrtext_m IS INITIAL.
    *       Toma el nombre del nombre de campo del diccionario
            ex_medium_text = wa_fld_info-scrtext_m.
          ENDIF.
        ENDIF.
      ENDMETHOD.                    "get_dataelement_medium_text
    ENDCLASS.                    "cl_mail_builder_xls_attach IMPLEMENTATION

  • It has an error when run a program in background job

    Dear Expert,
    we have a program
    when run it in background,it has a error "Error during import of clipboard contents" but when run it normally(run in front workbench se38 or run the t-code),everything is ok.i've used typingJDBG in the command box to debuge the background job,there has no error.
    whould you like to tell me what had happen? thanks a lot!
    addition: the program used a function ALSM_EXCEL_TO_INTERNAL_TABLE
    Thanks & Regards,
    Kerry
    Edited by: Kerry Wang on Aug 24, 2009 2:12 PM
    Edited by: Kerry Wang on Aug 24, 2009 2:14 PM
    Edited by: Kerry Wang on Aug 24, 2009 2:14 PM

    Hi,
      You cannot use FMs to get data directly from the presentation server when program is executed in the backgroud.
    Check the thread : GUI_DOWNLOAD
    Regards,
    Himanshu

  • Program for Background Job for COGI

    Does anyone know what is the Program name for creating background job to run COGI? I'm using CORUAFFW to create variants and run the program but its not working as I guess it isonly generating the report but not deleting the records if inventory is added.
    Thanks
    Mama
    Edited by: Amit Raichura on Mar 21, 2008 1:31 AM

    Amit,
    Use Program "CORUAFWP" to schedule background job to post COGI error records if the error is corrected, as in your case stock is corrected.
    Regards,
    Prasobh

  • Program in background Jobs

    HI
    Can anybody please let me know how to find out the program scheduled in a job, as either the job may not be run for long time or not even scheduled?
    Thanks in advance

    HI sameer
    Did u tried
    transaction  <b>SM36</b> for defining background jobs
    and <b>SM37</b> for displaying all background jobs that you want
    Regards Rk
    Message was edited by:
            Rk Pasupuleti

  • How to run the program in background job,program should run in 3 days.

    Dear Gurus,
    i have a program , that program should run approximately 3 days to get the result.
    i scheduled this program as a background job.
    how can i run sto5 t-code for this same program.
    i that case how we can trace the output.
    Experts please help me out.
    Thank u very much.
    Regards
    sudheer

    Hello Sudheer,
    The trace can be set on background jobs by using ST12 transaction. Please make sure that the trace is activated for only few minutes in production environment.
    Contact your basis team to activate trace on background job and the transaction used is ST12.
    Thanks

  • Alert monitor for long running background jobs

    Hello,
    I have to configure an alert moniter for long running background jobs which are running more than 20000 secs using rule based. I have created a rule based MTE and assigend MTE class CCMS_GET_MTE_BY_CLASS to virtual node but i dont find a node to specify the time.
    could any one guide me how can i do this.
    Thanks,
    Kasi

    Hi *,
    I think the missing bit is where to set the maximum runtime. The runtime is set in the collection method and not the MTE class.
    process:  rz20 --> SAP CCMS Technical Expert Monitors --> All Contexts on local application server --> background --> long-running jobs. Click on 'Jobs over Runtime Limits' then properties, click the methods tab then double click 'CCMS_LONGRUNNING_JOB_COLLECT', in the parameters tab you can then set the maximum runtime.
    If you need to monitor specific jobs, follow the process (http://help.sap.com/saphelp_nw70/helpdata/en/1d/ab3207b610e3408fff44d6b1de15e6/content.htm) to create the rule based monitor, then follow this process to set the runtime.
    Hope this helps.
    Regards,
    Riyaan.
    Edited by: Riyaan Mahri on Oct 22, 2009 5:07 PM
    Edited by: Riyaan Mahri on Oct 22, 2009 5:08 PM

  • Program for background jobs...

    Hi
    I know that when i create any info structure; a program is also created in background viz used while creating background jobs...<b>but i dont know where can i view them</b>? This program is used while creating a background jobs in SM36.......Please correct me if i am wrong
    Suppose i have created info structure S999; then in that case from where to locate that program which must have been created in background?
    Rgds

    Hi,
    While executing the info structure, in the initial screen, click <b>system</b> in the menu bar and click <b>status</b>. in the popping menu you can find the program associated with the info structure.

  • Handle submit program for background jobs in RFC FM to send email in ITS

    Hi all
    I am facing a problem in ITS, i.e. I have called a RFC Function Module on the page load event of one of the HTML template. In that FM I have used <b>submit program</b>. This RFC FM is working fine in background i.e. it is sending pdf as email to a particular email address
    but in the frontend it is not responding.
    I wanted to ask whether we can handle submit <program-name> in background job from ITS
    <b>If you are unable to understand the problem i can share with you my code as well.</b>
    Thanks
    Ekta Tuli

    Hi Tobias
    The Function Module <b>ZV_FUNC_CCK_EMAIL_PDF</b> is used to generate the email with pdf as attachement. it is generating email at backend but not in frontend.
    thanks
    ekta
    please find the code below for the FM
    FUNCTION zv_func_cck_email_pdf.
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(CONTRACT) LIKE  VBAP-VBELN
    *"     VALUE(EMAIL) LIKE  ADR6-SMTP_ADDR
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  CHAR4
    data: i_vbak like vbak .
      DATA: v_cont(10) TYPE c.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = contract
        IMPORTING
          output = v_cont.
    DATA: z_element(30)         TYPE c.
    DATA: gv_fb_addr_get_selection  LIKE addr1_sel.
    DATA:  BEGIN OF mtab_contract OCCURS 0, "sap field
        ordno(10),                                              "vbeln (10)
        terr(6),
        vkorg     LIKE vbak-vkorg,
        vkgrp     LIKE knvv-vkgrp,
        repname(35),
        repmailbox(10),
        gueen(10),                          "expires dated -same as valid to
        kunnr(10),
        name1(35),                                              "name1(35)
        stras(35),                                              "stras(35)
        pstlz(10),                                              "pstlz(10)
        ort01(35),                          "ort01(35) city
        regio(3),                                               "regio(3)
        kunnr2(10),
        name2(35),                                              "NUM?(35)
        stras2(35),                                             "stras(35)
        pstlz2(10),                                             "pstlz(10)
        ort012(35),                          "ort01(35) city
        regio2(3),                                              "regio(3)
        kit1     LIKE vbap-matnr,     " currently 41315
        kit1-qty(6),  " like vbap-zmeng,
        kit2     LIKE vbap-matnr,     " currently 41316
        kit2-qty(6),  "  like vbap-zmeng,
        kit3     LIKE vbap-matnr,     " currently 41317
        kit3-qty(6),  "  like vbap-zmeng,
        kit4     LIKE vbap-matnr,     " currently 91869US
        kit4-qty(6),  "  like vbap-zmeng,
        med1     LIKE vbap-matnr,     " currently 7408cp
        med1-qty(6),  "  like vbap-zmeng,
        med2     LIKE vbap-matnr,     " currently 0211CP
        med2-qty(6),  "  like vbap-zmeng,
        med3     LIKE vbap-matnr,     " currently 0578CP
        med3-qty(6),  "  like vbap-zmeng,
        med4     LIKE vbap-matnr,     " currently 0068CP
        med4-qty(6),  "  like vbap-zmeng,
        med5     LIKE vbap-matnr,     " currently 0069CP
        med5-qty(6),  "  like vbap-zmeng,
        med6     LIKE vbap-matnr,     " currently other
        dis6     LIKE makt-maktx,     " currently other
        med6-qty(6),  "  like vbap-zmeng,
        med7     LIKE vbap-matnr,     " currently other
        dis7     LIKE makt-maktx,     " currently other
        med7-qty(6),  "  like vbap-zmeng,
        med8     LIKE vbap-matnr,     " currently other
        dis8     LIKE makt-maktx,     " currently other
        med8-qty(6),  "  like vbap-zmeng,
        med9     LIKE vbap-matnr,     " currently other
        dis9     LIKE makt-maktx,     " currently other
        med9-qty(6),  "  like vbap-zmeng,
        med10    LIKE vbap-matnr,     " currently other
        dis10    LIKE makt-maktx,     " currently other
        med10-qty(6),  "  like vbap-zmeng,
      END OF mtab_contract.
    DATA:  BEGIN OF mtab_material OCCURS 0,
              ordno(10),
              matnr LIKE vbap-matnr,
              qty  LIKE vbap-zmeng,
           END OF mtab_material.
    DATA: w-mm(4) VALUE ' MM '.
    *SELECT-OPTIONS: s_vkorg FOR vbak-vkorg,
    *                s_vkgrp FOR knvv-vkgrp,    "Sales Group
    *                s_terr  FOR knvp-kunn2.    "Territory Code
    *PARAMETERS:     p_parvw LIKE vbpa-parvw MEMORY ID par OBLIGATORY,    "Partner ID
    **                   DEFAULT 'Z1'.
    *                p_vbeln LIKE vbak-vbeln MEMORY ID aun,
    *                p_email LIKE adr6-smtp_addr MEMORY ID email. "Sales Document #
    *SELECT-OPTIONS: "s_vbeln FOR vbak-vbeln MEMORY ID aun, "Sales Document #
    *                s_guebg FOR vbak-guebg,    "Valid-From Date
    *                s_gueen FOR vbak-gueen,    "Valid-To Date
    *                s_ship  FOR vbpa-kunnr,    "Ship-to customer
    *            s_bstzd FOR vbak-bstzd MEMORY ID bst ."DEFAULT 'CCK'.    "P.O. # Supplement
    DATA: i_otf TYPE STANDARD TABLE OF itcoo,
          i_content_txt TYPE table of solisti1, "Content
          i_content_bin TYPE solix_tab, "Content
          i_content_bin1 TYPE solix_tab, "Content
          i_objhead TYPE soli_tab,
          w_pdf TYPE solisti1, "For PDF
          w_res TYPE itcpp, "SAPscript output
          w_otf TYPE itcoo, "For OTF
          w_transfer_bin TYPE sx_boolean, "Content
          prog(60).
    data : t_obj_bin type standard table of solisti1.
    DATA: w_arc_params LIKE arc_params,
          w_pri_params LIKE pri_params.
    *DATA: lcl_cls TYPE REF TO cl_gui_frontend_services.
    CONSTANTS : c_x TYPE c VALUE 'X', "X
                c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
                c_otf TYPE sx_format VALUE 'OTF', "OTF
                c_pdf TYPE sx_format VALUE 'PDF', "PDF
                c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
                c_bin TYPE char10 VALUE 'BIN'. "BIN
    DATA:       v_name TYPE string ."Downloading File Name
    DATA: v_len_in TYPE so_obj_len,
          v_tempdir(50) TYPE c,
          v_size TYPE i.
    DATA : x_pdf_bag_tline TYPE  rcl_bag_tline,
           v_pdf_fsize TYPE i,
           objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE,
           objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
           objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
           objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
           reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE,
           doc_chng LIKE sodocchgi1,
           tab_lines LIKE sy-tabix.
    DATA : v_pnum LIKE usr21-persnumber,
           v_anum LIKE usr21-addrnumber,
           smtp_addr LIKE adr6-smtp_addr.
    DATA: v_path TYPE  string,
          v_code TYPE i.
    DATA : wa_obj_txt TYPE solisti1.
    DATA : t_obj_txt TYPE STANDARD TABLE OF solisti1.
    DATA : t_rec_list TYPE STANDARD TABLE OF  somlreci1.
    DATA : t_obj_pack TYPE STANDARD TABLE OF sopcklsti1.
    DATA : wa_document_data TYPE sodocchgi1. "Mail data
    DATA : wa_rec_list TYPE somlreci1.
    DATA: reciever TYPE sadrud.    "Email address of the receiver
    DATA : wa_obj_pack TYPE sopcklsti1.
    DATA: v_lines(10) TYPE n.
    DATA: binfilesize TYPE i.
    DATA : wa_obj_header TYPE solisti1.
    DATA : t_obj_header TYPE STANDARD TABLE OF solisti1.
    DATA : obj_id TYPE sofolenti1-object_id. "To send a file as attatchment
    data: pdftab type table of tline with header line.
    data : flag_sent_to_all type sonv-flag.
    *START-OF-SELECTION.
    *  IF lcl_cls IS INITIAL.
    *    CREATE OBJECT lcl_cls.
    *  ENDIF.
      CLEAR i_vbak.
      SELECT  * FROM vbak into i_vbak
                      WHERE
    *                    guebg IN s_guebg AND          "Valid-From Date
    *                    gueen IN s_gueen AND          "Valid-To Date
    *                    vkorg IN s_vkorg AND
                        vbeln = v_cont AND
    *                   AUART = 'LP  ' AND  "Converts to 'CO  ' Scheduling A
                        auart = 'KM  ' AND  "Converts to 'CQ  ' Qty contract
    *                   VBTYP = 'E' AND     "sales doc cat?              JM
                        vbtyp = 'G' ."AND     "sales doc cat              "JM
    *                    bstzd IN s_bstzd.
        mtab_contract-kunnr = i_vbak-kunnr.
        mtab_contract-ordno = i_vbak-vbeln.
        mtab_contract-vkorg = i_vbak-vkorg.
        WRITE i_vbak-gueen TO mtab_contract-gueen.                "CHG014419
        APPEND mtab_contract.
      ENDSELECT.
      LOOP AT mtab_contract.
    *    PERFORM get_contract.     "CO sales orders line items
    ******Get Contract*********
    * SELECT SINGLE kunnr            "partner
    *    INTO vbpa-kunnr
    *    FROM vbpa
    *   WHERE vbeln EQ  mtab_contract-ordno
    *     AND posnr EQ '000000'
    *     AND parvw EQ 'WE'               "Ship-To's
    *     AND kunnr IN s_ship.           "Ship-To ID added 04/01/99
    *  IF sy-subrc EQ 0 .
    *    MOVE vbpa-kunnr TO mtab_contract-kunnr2.
    *    MODIFY             mtab_contract.
    *  ELSE.
    *    EXIT.
    *  ENDIF.
      CLEAR knvp.
      SELECT SINGLE kunn2            "territory
             INTO   knvp-kunn2
             FROM   knvp
             WHERE  kunnr  EQ mtab_contract-kunnr2
             AND    vkorg  EQ mtab_contract-vkorg
             AND    parvw  EQ 'Z6'.
    *         AND    kunn2  IN s_terr .
      IF sy-subrc EQ 0 .
        MOVE knvp-kunn2 TO mtab_contract-terr.
        MODIFY             mtab_contract.
      ELSE.
        EXIT.
      ENDIF.
      CLEAR kna1.     "get rep name and mail box
      SELECT SINGLE name2 FROM kna1 INTO (kna1-name2)
        WHERE kunnr = knvp-kunn2.
      IF sy-subrc EQ 0 .
        SPLIT kna1-name2 AT w-mm INTO mtab_contract-repname
        mtab_contract-repmailbox.
        mtab_contract-repmailbox+3 = mtab_contract-repmailbox.
        mtab_contract-repmailbox(3) = 'MM'.
        MODIFY             mtab_contract.
      ENDIF.
      CLEAR knvv.
      SELECT SINGLE vkgrp
             INTO   knvv-vkgrp
             FROM   knvv
             WHERE  kunnr EQ knvp-kunn2
             AND    vkorg EQ mtab_contract-vkorg.
    *         AND    vkgrp IN s_vkgrp.
      IF sy-subrc EQ 0 .
        MOVE knvv-vkgrp TO mtab_contract-vkgrp.
        MODIFY             mtab_contract.
      ELSE.
        EXIT.
      ENDIF.
      mtab_contract-med1-qty = '_______'.
      mtab_contract-med2-qty = '_______'.
      mtab_contract-med3-qty = '_______'.
      mtab_contract-med4-qty = '_______'.
      mtab_contract-med5-qty = '_______'.
      mtab_contract-med6-qty = '_______'.
      mtab_contract-med7-qty = '_______'.
      mtab_contract-med8-qty = '_______'.
      mtab_contract-med9-qty = '_______'.
      mtab_contract-med10-qty = '_______'.                           "JM
      mtab_contract-kit1-qty = '____'.
      mtab_contract-kit2-qty = '____'.
      mtab_contract-kit3-qty = '____'.
      mtab_contract-kit4-qty = '____'.
      mtab_contract-dis6 = 'OTHER  _____________________'.              "JM
      mtab_contract-dis7 = 'OTHER  _____________________'.              "JM
      mtab_contract-dis8 = 'OTHER  _____________________'.              "JM
      mtab_contract-dis9 = 'OTHER  _____________________'.              "JM
      mtab_contract-dis10 = 'OTHER  _____________________'.             "JM
    *  SELECT  * FROM VBAP WHERE VBELN = MTAB_CONTRACT-ORDNO.
    *     IF VBAP-MATNR = '7408CP'.
    *       MTAB_CONTRACT-MED1 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR = '0211CP'.
    *       MTAB_CONTRACT-MED2 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '91865US'.
    *       MTAB_CONTRACT-MED3 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '0578CP'.
    *       MTAB_CONTRACT-MED4 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '0068CP'.
    *       MTAB_CONTRACT-MED5 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '0069CP'.
    *       MTAB_CONTRACT-MED6 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '92055CP'.                          "JM
    *       MTAB_CONTRACT-MED7 = VBAP-MATNR.                       "JM
    *     ELSEIF VBAP-MATNR =  '90799CP'.                          "JM
    *       MTAB_CONTRACT-MED8 = VBAP-MATNR.                       "JM
    *     ELSEIF VBAP-MATNR = '41315'.
    *       MTAB_CONTRACT-KIT1 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR = '41316'.
    *       MTAB_CONTRACT-KIT2 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR = '41317'.
    *       MTAB_CONTRACT-KIT3 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR = '91869US'.
    *       MTAB_CONTRACT-KIT4 = VBAP-MATNR.
    *     ELSE.
    *       SELECT SINGLE MAKTX INTO MAKT-MAKTX
    *                           FROM MAKT WHERE MATNR = VBAP-MATNR.
    *     ENDIF.
    *     MODIFY MTAB_CONTRACT.
    *   ENDSELECT.
      MODIFY mtab_contract.
    *    IF.
    **        mtab_contract-terr IN s_terr AND
    **       mtab_contract-kunnr2 IN s_ship AND
    **       mtab_contract-vkgrp IN s_vkgrp.
    **      PERFORM get_address.
    *    ELSE.
    *      DELETE mtab_contract INDEX sy-tabix.
    *    ENDIF.
      ENDLOOP.
      SORT mtab_contract BY terr.
    *  PERFORM set_print_option.
    *  Print defaults should be immed and delete after print...
      itcpo-tdimmed  = ' '.
      itcpo-tddelete = 'X'.
      itcpo-tdnewid  = 'X'.
      itcpo-tdcopies = 1.
      itcpo-tdnoprev = 'X'.
      itcpo-tdgetotf = 'X'.
      itcpo-tddest  = 'LOCL'.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination            = 'LOCL'
          no_dialog              = 'X'
        IMPORTING
          out_archive_parameters = w_arc_params
          out_parameters         = w_pri_params.
    *exit if cancel chosen*
      IF sy-subrc NE 0.
        EXIT.
      ENDIF.
      sadr-regio = 'CA'.
      sadr-pstlz = '92620'.
      LOOP AT mtab_contract.
    *    PERFORM check-for-values.
    IF mtab_contract-ordno = space.
        mtab_contract-ordno = '___________'.
      ENDIF.
      IF mtab_contract-terr = space.
        mtab_contract-terr = '______'.
      ENDIF.
      IF mtab_contract-repname = space.
        mtab_contract-repname = '___________________________________'.
      ENDIF.
      IF mtab_contract-repmailbox = space.
        mtab_contract-repmailbox = '__________'.
      ENDIF.
      IF mtab_contract-kunnr = space.
        mtab_contract-kunnr = '__________'.
      ENDIF.
      IF mtab_contract-name1 = space.
        mtab_contract-name1 = '___________________________________'.
      ENDIF.
      IF mtab_contract-stras = space.
        mtab_contract-stras = '___________________________________'.
      ENDIF.
      IF mtab_contract-pstlz = space.
        mtab_contract-pstlz = '__________'.
      ENDIF.
      IF mtab_contract-ort01 = space.
        mtab_contract-ort01 = '___________________________________'.
      ENDIF.
      IF mtab_contract-regio = space.
        mtab_contract-regio = '___'.
      ENDIF.
      IF mtab_contract-kunnr2 = space.
        mtab_contract-kunnr2 = '__________'.
      ENDIF.
      IF mtab_contract-name2 = space.
        mtab_contract-name2 = '___________________________________'.
      ENDIF.
      IF mtab_contract-stras2 = space.
        mtab_contract-stras2 = '___________________________________'.
      ENDIF.
      IF mtab_contract-pstlz2 = space.
        mtab_contract-pstlz2 = '__________'.
      ENDIF.
      IF mtab_contract-ort012 = space.
        mtab_contract-ort012 = '___________________________________'.
      ENDIF.
      IF mtab_contract-regio2 = space.
        mtab_contract-regio2 = '___'.
      ENDIF.
    *    PERFORM open_form.
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          dialog   = ' '
          form     = 'ZREV_CCK_AGREMT'
          language = sy-langu
          OPTIONS  = itcpo
        EXCEPTIONS
          canceled = 1
          device   = 2
          form     = 3
          OPTIONS  = 4
          unclosed = 5
          OTHERS   = 6.
      IF sy-subrc <> 0.
        MESSAGE e000(zz) WITH 'Open Form Error. ' sy-subrc.
      ENDIF.
        z_element = 'MAIN'.
    *    PERFORM write_form.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element   = z_element
        EXCEPTIONS
          element   = 1
          function  = 2
          type      = 3
          unopened  = 4
          unstarted = 5
          window    = 6
          OTHERS    = 7.
    *    PERFORM close_form.
    CALL FUNCTION 'CLOSE_FORM'
        IMPORTING
          RESULT   = w_res
        TABLES
          otfdata  = i_otf
        EXCEPTIONS
          unopened = 1
          OTHERS   = 2.
      IF sy-subrc <> 0.
        MESSAGE e000(zz) WITH 'Close Form Error. ' sy-subrc.
      ENDIF.
    *&---Convert OTF data to PDF data.
      call function 'CONVERT_OTF'
       exporting
         format                      = 'PDF'
       importing
         bin_filesize                = binfilesize
        tables
          otf                         = i_otf
          lines                       = pdftab[].
    data : name LIKE  RLGRAP-FILENAME.
      CONCATENATE 'C:Temp' mtab_contract-ordno '.pdf' INTO v_name.
    *CALL FUNCTION 'DOWNLOAD'
    * EXPORTING
    *      bin_filesize = v_size
    *      filename     = name
    *      filetype     = 'BIN'
    *  TABLES
    *    data_tab                      = pdftab[].
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
    *       BIN_FILESIZE                    =
            filename                        = v_name
           FILETYPE                        = 'BIN'
          tables
            data_tab                        = pdftab[].
    * Downloading the PDF File
    *  CALL METHOD lcl_cls->gui_download
    *    EXPORTING
    *      bin_filesize = v_size
    *      filename     = v_name
    *      filetype     = c_bin
    *    CHANGING
    *      data_tab     = pdftab[].
      CALL METHOD cl_gui_cfw=>flush.
    **Send PDF as Email.
    *  wa_obj_txt-line = 'CCK Contract Agreement'.
      APPEND wa_obj_txt TO t_obj_txt.
      CLEAR wa_obj_txt.
      wa_obj_txt-line = 'Please find attatched PDF document for Contract'.
      APPEND wa_obj_txt TO t_obj_txt.
      CLEAR wa_obj_txt.
      DESCRIBE TABLE t_obj_txt LINES tab_lines.
    **Prepare document data
      wa_document_data-obj_name = 'CCK Contract Agreement'.
      wa_document_data-obj_descr = 'CCK Contract Agreement'.
      wa_document_data-obj_langu = sy-langu.
      wa_document_data-proc_type = 'R'.
      wa_document_data-proc_name = 'CCK'.
      wa_document_data-priority  = c_x.
      wa_document_data-obj_prio  = c_x.
    **Receiving list
      wa_rec_list-receiver = sy-uname.
      wa_rec_list-rec_type = 'B'.
      wa_rec_list-com_type = 'INT'.
      wa_rec_list-notif_del = c_x.
      APPEND wa_rec_list TO t_rec_list.
      CLEAR wa_rec_list.
      wa_rec_list-receiver = '[email protected]'."p_email.
      reciever = wa_rec_list-receiver.
      wa_rec_list-rec_type = 'U'.
      wa_rec_list-com_type = 'INT'.
      wa_rec_list-notif_del = c_x.
      APPEND wa_rec_list TO t_rec_list.
      CLEAR wa_rec_list.
    *Object packet
      CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
        EXPORTING
          line_width_src                    = 134
          line_width_dst                    = 255
         TABLES
           content_in                        = pdftab[]
           content_out                       = t_obj_bin
        EXCEPTIONS
          err_line_width_src_too_long       = 1
          err_line_width_dst_too_long       = 2
          err_conv_failed                   = 3
          OTHERS                            = 4
      IF sy-subrc <> 0.
      ENDIF.
      DESCRIBE TABLE t_obj_bin LINES v_lines.
      CLEAR wa_obj_pack-transf_bin .
      wa_obj_pack-head_start = 1.
      wa_obj_pack-head_num = 0.
      wa_obj_pack-body_start = 1.
      wa_obj_pack-body_num = tab_lines.
      wa_obj_pack-doc_type = 'RAW'.
      wa_obj_pack-doc_size = tab_lines * 255.
      APPEND wa_obj_pack TO t_obj_pack.
      CLEAR wa_obj_pack.
      wa_obj_pack-transf_bin = 'X'.
      wa_obj_pack-head_start = 1.
      wa_obj_pack-head_num = 0.
      wa_obj_pack-body_start = 1.
      wa_obj_pack-body_num = v_lines.
      wa_obj_pack-doc_type = 'PDF'.
      wa_obj_pack-obj_name = 'ATTATCHMENT'.
      wa_obj_pack-obj_descr = mtab_contract-ordno.
      wa_obj_pack-doc_size = binfilesize.
      APPEND wa_obj_pack TO t_obj_pack .
      CLEAR wa_obj_pack.
    **Object header
      wa_obj_header-line = 'PDF'.
      APPEND wa_obj_header TO t_obj_header.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_document_data
          put_in_outbox              = c_x
          commit_work                = c_x
        IMPORTING
          sent_to_all                = flag_sent_to_all
          new_object_id              = obj_id
        TABLES
          packing_list               = t_obj_pack
          object_header              = t_obj_header
          contents_bin               = t_obj_bin
          contents_txt               = t_obj_txt
          receivers                  = t_rec_list
        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.
      else.
      return = 'true'.
      ENDIF.
    ENDFUNCTION.
           <b> Flow Editor</b>
    <flow>
         <state name="Start">
              <module name="<b>ZV_FUNC_CCK_EMAIL_PDF</b>" type="RFC" stateful="1">
                   <inputmapping source="Contract" target="CONTRACT"/>
                   <inputmapping source="email" target="EMAIL"/>
              </module>
              <module name="ZV_FUNC_CCK_VALIDATE_SHIPTO" type="RFC" stateful="1">
                   <inputmapping source="SHIP_TO" target="KUNNR"/>
                   <inputmapping source="USERNAME" target="USER"/>
                   <outputmapping source="CITY" target="CITY"/>
                   <outputmapping source="NAME" target="NAME"/>
                   <outputmapping source="POSTAL" target="POSTAL"/>
                   <outputmapping source="REGION" target="REGION"/>
                   <outputmapping source="RETURN" target="RETURN"/>
                   <outputmapping source="SD_CITY" target="SD_CITY"/>
                   <outputmapping source="SD_NAME" target="SD_NAME"/>
                   <outputmapping source="SD_POSTAL" target="SD_POSTAL"/>
                   <outputmapping source="SD_REGION" target="SD_REGION"/>
                   <outputmapping source="SD_STREET" target="SD_STREET"/>
                   <outputmapping source="SOLDTO" target="SOLDTO"/>
                   <outputmapping source="STREET" target="STREET"/>
              </module>
         </state>
         <event name="onLoad" next_state="Start"/>
         <event name="Check2" next_template="ZV_CCO_CONFIRMED_ORDER"/>
    </flow>

  • Submit program in background job

    Hi all.
    Somehow I'm not able of using the following source code within a program executed within a scheduled job:
    SUBMIT RFEBKA00 USING SELECTION-SET 'VAR1'.
    The above program is the transaction FF_5.
    Does any one

    try to code in the below mentioned ...
    use BATCH = 'X' option.
    submit rfebka00 USING SELECTION-SET 'VAR1'
      with batch  = 'X' AND RETURN

  • CCMS Monitor to Pager for Failed Background Jobs

    Hello Experts,
    I am currently leveraging Central CCMS monitoring to alert us via email whenever a background job fails in production using the MTE Class R3BPServerSpecAbortedJobs.
    I am trying to find a way that I can tweak the monitor to alert me ONLY when specific background jobs fail.
    We want this alert to notify the oncall pager only when a handful of critical jobs fail. Does anyone know how I can delimit this MTE?
    For example, we will be creating jobs that begin with Z_ALERT* that I will tie to an auto-react method that will email a pager.
    Thanks in advance.
    Bill

    Hi Sundara.
    From following link, you can download step by step setup information.
    So please check following documents.
    http://www.service.sap.com/bpm
    =>Media Library=>Technical Information
    =>1. Business Process Monitoring - Setup Roadmap
    =>2. Setup Guide - Business Process Monitoring
    Before you start setup, I recommend you to check
    SAP Notes 521820 to ensure whether you already fulfill
    prerequestions.
    Basically what you have to do is following.
    1. Describe your business process under following area.
       (T-CD DSWP =>Solution Landscape =>Solution landscape maintenance)
    2. Setup BPMon session.
       (T-CD DSWP =>Operation Setup => Solution Monitoring =>
        Business Process Monitoring)
       in BPMon session, select job monitoring. And define background
       job that you want to monitor.
       In BPMon job monitoring, you can monitor, cancel, delay, duration,
       unexpected parallelization, also job log and so on.
    I hope this information help you.
    Best Regards
    Keiji Mishima

  • Background job monitoring - alert from second failure

    Hi All,
    There is a need for configure monitoring for background jobs.
    I have been enabled background job monitoring via SE16 and background job is visible in RZ20.
    The problem is that we want to have a critical alert from second failure of certain job, not from first failure.
    Seems that I need to create a new method and assigne it to background job in RZ20?
    Is there a documentation how to create own method? or is there a another way to implement this monitor?
    Best Regards,
    Jani Mäki

    Hi,
    Do you want to monitor second failure on a day?
    Do you know the schedule of second job run?
    If yes to these questions, you can try to monitor using BPM in solution manager.
    Feel Free to revert back.
    -=-Ragu

  • Background job Problem

    Hi,
    I scheduled a Program for background job running for every 10 minutes.
    When i go to SM37  I am seeing all the background jobs, it is creating a newline for every 10 min in the list.
    my problem is , Is there any settings to change for showing only one job that means over writing the old job and show the latest job.
    Thanks in advance,
    fractal

    Assuming that intention is to monitor jobs that are either failed or active, you can deselect rest of the radio buttons at the selection screen so as to see failed / active jobs.
    Other than this, I dont think there is any solution / way to do this.

  • Will BDC work in Background job

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

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

  • Force Dialog in ATP when run in Background Job

    Hi gurus,
    Can we set the ATP to always show even if in Background Job? I have a requirement to run a program in background job and set the confirmed qty to 0. In foreground the process is ok (the ATP screen shows up so my BDC is correct). But when I run the program in background, I have an error in my BDC because the screen for the ATP does not show up.
    Best regards,
    Andre
    Edited by: Andre Reforma on Jun 5, 2009 9:28 AM

    chdir("..") Err#13 EACCES [file_dac_search]
    I suspect that an underlying mount point has improper file access.
    Unmount the ZFS filesystem (either /zones or /zones/test) and check the perms on the directory that it's mounted on.
    Darren

Maybe you are looking for

  • Unable to print to my Oki C3200 via Airport Express

    Hi I wish to print wirelessly via Airport Express using my Oki C3200 printer. I have followed all the recommended install procedures. I am using a Windows Vista Home Premium 32 bit PC, have configured the printer with Bonjour for Windows, and still c

  • [LIST] Can I upgrade to 8.1? Compatible models and possible fixes

    Before you start The list of models is alphabetically sorted. So it should be easy to find the model you are looking for. It may be a mix of desktops/laptops/tablets. Windows 8 to Windows 8.1 upgrade from Windows Store http://windows.microsoft.com/en

  • Split pdf file

    Anyone know how to split a pdf with automator or applescript.. I want to be able to get one file out of every 2. page of the original file. Like this.. Original pdf file may contain 10 pages.. I want the result to be 5 files with two pages in each fi

  • Trigger IsDefined with a hyperlink or javascript

    Is there a way to trigger a <cfif IsDefined ('')> using a hyperlink or at the end of a javacript block. I am attempting to trigger a code block using a hyperlink on the page. When clicked the onclick triggers a confirmation pop up box that sets the r

  • DI need a serial number selection stratergy when invoicing

    (this is part of a single thread but since it had two diffrent questions I have brocken it to two) part of my add-on creates an invoice based on a order. When it hits any item managed by serial numbers I need to, offer the user a list of available se