Background Job pass value

Hi, I am calling a Background job in my program. I am using JOB_OPEN, JOB_SUBMIT and JOB_CLOSE FM to start a job. My need is to pass a value to the job program(job program doesnt have any selection screen values). Is their any way without creating variants each time to pass value to it.
Please advice.....

Hello,
You can first use  JOB_OPEN which returns job number. Then build ranges or parameters to use SUBMIT to call the program.
Eg: SUBMIT RM06BB20 AND RETURN
      WITH S_EKGRP IN R_EKGRP
      WITH S_EKORG IN R_EKORG
      WITH S_FLIEF IN R_FLIEF
      WITH S_KONNR IN R_KONNR
      USER sy-uname VIA JOB w_jobname
      NUMBER w_job_number.
Now use JOB_CLOSE.
Thanks,
Venu

Similar Messages

  • DP background job version value shows *to{q}ZsmfF*

    Hi,
    I am using DP background jobs in Mass processing. The Version field in the mass processing job displays value as "toZsmfF".
    I tried to change the version to 700 in transaction SAPAPO/MC8D. But the version field is disabled.
    I also tried after removing the DP background job from all the process chains where ever it was used. After that also the version field, planning book,data view are not active to change (greyed -unable to change). How can change the  version value in the DP background jobs.
    Thanks and regards
    Murugesan

    This is becasue the DP job executed without initializing the planning area for the version. Created new job with differenet name and assigned with version.

  • Pass parameter to background job from report

    Hi All,
    I have following requirement.
    I am executing a Report. At end of report I am executing an event.
    On the bases of event a background job runs.
    Problem is that, I want to pass one field data from report to background job.
    I already tested SET PARAMETER/GET PARAMETER is not working.
    Is there any way any one can suggest, without using Tables.
    Regards

    Hi,
    If you submit via job it will not be executing the program ..After SUBMIT statement the control will come to the program immediately..
    Check this example..
    DATA: p_jobcnt LIKE tbtcjob-jobcount,
          l_release(1) TYPE c.
    Open the job
    CALL FUNCTION 'JOB_OPEN'
         EXPORTING
              jobname          = 'ZMY_OBJ'
         IMPORTING
              jobcount         = p_jobcnt
         EXCEPTIONS
              cant_create_job  = 1
              invalid_job_data = 2
              jobname_missing  = 3
              OTHERS           = 4.
    Submit the job.
    SUBMIT ztest_program VIA JOB 'ZMY_OBJ' NUMBER p_jobcnt
           TO SAP-SPOOL WITHOUT SPOOL DYNPRO
           WITH destination = 'LOCL'
           WITH immediately = space
           WITH keep_in_spool = 'X' AND RETURN.
    Close the job.
    CALL FUNCTION 'JOB_CLOSE'
         EXPORTING
              jobcount             = p_jobcnt
              jobname              = 'ZMY_OBJ'
              strtimmed            = 'X'
              prdmins              = 15
         IMPORTING
              job_was_released     = l_release.
    Thanks,
    Naren

  • Pass lock to background job

    Hi,
    I'm looking for ideas.
    We have an inbound process for special messages transfered from XI system via asynchrounous call. Messages are identified by a GUID.
    The inbound process will save the messages in a database table and create background jobs for processing big messages while small messages are processed directly.
    To avoid any interference, we want to lock messages as long as they are processed. For this we have a lock object and the Enqueue/dequeue modules.
    Now my question is: How can I pass a lock to the background job (created by SUBMIT VIA JOB) and have it released there after processing is done. The Job will run in a new LUW.
    And then, if any error in background (or online) processing occurs, how to make sure all existing locks are released?
    Thanks for some good ideas on how to proceed.
    Regards,
    Clemens

    resolved - we won't do it. We'll create some kind of queue: A fully-buffered database table where we put the lock entries and remoce them when it's time to do so. This way we can integrate an activity monitor watching the objects being processed.
    Thanks for reading
    Clemens

  • Passing values to global variables while running job via management console

    Hi All,
    I have a requirement, where I have to use HANA view with input parameters as source. I am doing the same by placing the HANA query for view with input parameters, in SQL transform and assigning values to placeholders using global variables. This is working fine at the designer level.
    But where I am stuck is, it possible to pass values to global variables while running job in Management console or in a third party scheduler. Should I do any changes in the batch job to achieve the same ?
    Please help me with the same and also let me know whether my approach of using Global variables to assign values to input parameter of HANA view is right?
    Thanks,
    Deepa

    Select Batch > Batch Job Configuration > Add Schedule and Expand the Global Variables section in the Schedule Batch Job tab. You can then specify a value for all your global variables.
    Alternatively, work with control tables and assign values to the global variables in an initialisation script.

  • How to set dynamic value for field Month when running background job ?

    Dear guys,
    I have a Z* report in our company, in the selection screen there is a period field (Month and Year) and this report running in background job periodically. My Question is how i can set for Month field become dynamic follow month value of date when this report executed ?
    Example :
    When Z* report running in background on 16.04.2008, Month Value will be 04 and when running on 16.05.2008, Month Value will be 05.
    Please advice.
    Regards
    Gunawan

    Dear guys,
    I have a Z* report in our company, in the selection screen there is a period field (Month and Year) and this report running in background job periodically. My Question is how i can set for Month field become dynamic follow month value of date when this report executed ?
    Example :
    When Z* report running in background on 16.04.2008, Month Value will be 04 and when running on 16.05.2008, Month Value will be 05.
    Please advice.
    Regards
    Gunawan

  • Passing data from a background job to RFC calls in different App server

    The program i am working on can be explained in the following steps:
    Step A- We use a standard program that is executed as a background job and the standard program obtains some data for a particular scenario.
    Step B - The job(standard program) during its execution creates many RFCs executed as dialog work processes on various application servers and processes data.In the RFCs various exits are executed.
    We currently write data to database(Z table) in Step A and retreive data in exits in Step B to access the information written to DB(Z table). We want to eliminate writing to database since it consumes time.
    Is there any solution apart from writing data to database and retreiving the same.
    I am not sure if we can use ABAP memory or SAP memory to access the information in the exits since they are executed on different App servers.

    We have not been able to arrive at a solution to the below, any solutions / inputs will be rewarded.

  • Change internal table values in background job

    Hello All,
    Currently we have a report which is  running in background job.
    Because of error in one PO (error in header status), the job is getting cancelled in production.
    Is there any way, we can exclude this PO in debugging from the internal table.
    The report should run in background, the requirement is exclude the PO from internal table and the background process should run as normal after excluding that PO.
    Please advise how to do this.
    Thanks,
    Priya

    Hi All,
    Thanks for your replies.
    I found the following way to debug the background job helpful. Go to SM37, select the job name and do as shown below. Once you click Capture: Active job, debugger will open and we can analyze from there further.

  • Problems creating background job for program (job open, submit and close)

    Hi gurus,
    im trying to start a background job using the FM BP_START_DATE_EDITOR to show the start date to the job or if it's imediate. this FM it's working fine, after call it im opening a job, submiting it and call the job close FM and the job close FM creates me the job.
    The problem it's when i go to the sm37 to see the job status the job has been canceled, and the job log says that i have to give a start date to the job.
    What i dont understand it's either the job is imediate or i choose a date to start the job always gives me this error...
    Below goes my code,
    any ideas will be rewarded
      CLEAR: stdt_modify_type, stdt_output.
      CALL FUNCTION 'BP_START_DATE_EDITOR'
           EXPORTING
                stdt_dialog                    = 'Y'
                stdt_input                     = stdt_input
                stdt_opcode                    = 14
           IMPORTING
                stdt_modify_type               = stdt_modify_type
                stdt_output                    = stdt_output
           EXCEPTIONS
                fcal_id_not_defined            = 1
                incomplete_last_startdate      = 2
                incomplete_startdate           = 3
                invalid_dialog_type            = 4
                invalid_eventid                = 5
                invalid_opcode                 = 6
                invalid_opmode_name            = 7
                invalid_periodbehaviour        = 8
                invalid_predecessor_jobname    = 9
                last_startdate_in_the_past     = 10
                no_period_data_given           = 11
                no_startdate_given             = 12
                period_and_predjob_no_way      = 13
                period_too_small_for_limit     = 14
                predecessor_jobname_not_unique = 15
                startdate_interval_too_large   = 16
                startdate_in_the_past          = 17
                startdate_is_a_holiday         = 18
                startdate_out_of_fcal_range    = 19
                stdt_before_holiday_in_past    = 20
                unknown_fcal_error_occured     = 21
                no_workday_nr_given            = 22
                invalid_workday_countdir       = 23
                invalid_workday_nr             = 24
                notbefore_stdt_missing         = 25
                workday_starttime_missing      = 26
                no_eventid_given               = 27
                OTHERS                         = 28.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        MOVE 'X' TO gv_flag.
      ENDIF.
      DATA jobname LIKE tbtcjob-jobname.
      DATA jobcount LIKE tbtcjob-jobcount.
      DATA job_release LIKE  btch0000-char1.
      DATA job_imediate TYPE c.
      CLEAR: jobname, jobcount, job_release.
      CONCATENATE 'MAPAEXEC' sy-uname sy-datum
                   INTO jobname SEPARATED BY space.
      CALL FUNCTION 'JOB_OPEN'
           EXPORTING
                jobname          = jobname
           IMPORTING
                jobcount         = jobcount
           EXCEPTIONS
                cant_create_job  = 1
                invalid_job_data = 2
                jobname_missing  = 3
                OTHERS           = 4.
      IF sy-subrc <> 0.
        MESSAGE i003(zmapas).
        EXIT.
      ENDIF.
      SUBMIT z_mapa_execucao_orcamental
             VIA JOB jobname NUMBER jobcount
             WITH ano EQ ano
             WITH so_perio IN so_perio
             WITH so_date IN so_date
             WITH so_org EQ so_org
             WITH so_num IN so_num
             AND RETURN.
      IF stdt_output-startdttyp EQ 'I'.
        CLEAR job_imediate.
        job_imediate = 'X'.
      ENDIF.
      CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
                calendar_id                 = stdt_output-calendarid
                event_id                    = stdt_output-eventid
                event_param                 = stdt_output-eventparm
                event_periodic              = stdt_output-periodic  "?
                jobcount                    = jobcount
                jobname                     = jobname
                laststrtdt                  = stdt_output-laststrtdt
                laststrttm                  = stdt_output-laststrttm
                prddays                     = stdt_output-prddays  "??
                prdhours                    = stdt_output-prdhours  "?
                prdmins                     = stdt_output-prdmins  "??
                prdmonths                   = stdt_output-prdmonths
                prdweeks                    = stdt_output-prdweeks  "?
                predjob_checkstat           = stdt_output-checkstat
                pred_jobcount               = stdt_output-predjobcnt
                pred_jobname                = stdt_output-predjob
                sdlstrtdt                   = stdt_output-sdlstrtdt
                sdlstrttm                   = stdt_output-sdlstrttm
                strtimmed                   = job_imediate
                targetsystem                = stdt_output-instname
                start_on_workday_not_before = stdt_output-notbefore
                start_on_workday_nr         = stdt_output-wdayno
                workday_count_direction     = stdt_output-wdaycdir
           IMPORTING
                job_was_released            = job_release
           EXCEPTIONS
                cant_start_immediate        = 1
                invalid_startdate           = 2
                jobname_missing             = 3
                job_close_failed            = 4
                job_nosteps                 = 5
                job_notex                   = 6
                lock_failed                 = 7
                OTHERS                      = 8.
      IF sy-subrc <> 0.
        MESSAGE i003(zmapas).
        EXIT.
      ELSE.
        MESSAGE i004(zmapas) WITH jobname.
      ENDIF.
    Thanks in advance,
    Best Regards
    João Martins

    Hello João.
    In debug mode, check the value of variables you passed to parameters sdlstrtdt and sdlstrttm.
    As aditional info, I usually achieve your goal without FM BP_START_DATE_EDITOR.
    Check this code:
    CALL FUNCTION 'JOB_OPEN'
          EXPORTING
               jobname          = w_jobname
          IMPORTING
               jobcount         = w_jobcount
          EXCEPTIONS
               cant_create_job  = 1
               invalid_job_data = 2
               jobname_missing  = 3
               OTHERS           = 4.
    CHECK sy-subrc = 0.
    CLEAR seltab_wa.
    MOVE: t_jobs-param TO seltab_wa-selname,
    t_processar-line+34 TO seltab_wa-low.
    APPEND seltab_wa TO seltab.
    seltab_wa-selname = 'P_LOJA'.
    seltab_wa-low = t_processar-ficheiro+7(4).
    APPEND seltab_wa TO seltab.
    *** Submete o programa para o JOB
    SUBMIT (t_jobs-repid)
      WITH  SELECTION-TABLE seltab
      USER sy-uname
       VIA JOB w_jobname NUMBER w_jobcount
       AND RETURN.
    *** Encerra o JOB
      l_hora = sy-uzeit.
      ADD 60 TO l_hora.
    CALL FUNCTION 'JOB_CLOSE'
       EXPORTING
          jobcount           = w_jobcount
          jobname           = w_jobname
          sdlstrtdt            = sy-datum
          sdlstrttm           = l_hora
          targetserver       = w_servidor
       IMPORTING
          job_was_released     = l_liberado
       EXCEPTIONS
          cant_start_immediate = 1
          invalid_startdate    = 2
          jobname_missing      = 3
          job_close_failed     = 4
          job_nosteps          = 5
          job_notex            = 6
          lock_failed          = 7
          OTHERS               = 8.
    Regards.
    Valter Oliveira.

  • 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

  • Background Job Processing Spool Retention period

    Hi ,
    In my program i am calling another ABAP program and sumitting the same as a background job(using Job_Submit,Close etc.)
    In this case i can view the Spool generated by the called program(using sm37).
    But this spool exists for a very less period in the system.Is it possible to specify a retention period,as 90 days in my case.?
    Pls Help !!!
    Answers will be rewarded.
    Regards,
    Rohan

    hi Roahn,
    You must set print parameters before the printing process starts.
    When printing lists after creating them, the system uses the print format specified in the print parameters to split the completed list and fit it onto the print pages, truncating it if necessary.
    When printing lists while creating them, the system uses the print format to actually format the list in the program.
    Print parameters are set either interactively by the user or from within the program.
    For each print process, the spool system needs a complete and consistent set of print parameters. In ABAP, the structure PRI_PARAMS (ABAP Dictionary) represent a set of print parameters.
    When passing the print parameters interactively, the system displays a dialog box after starting the report, on which the user has to enter the most important print parameters.
    It's shown below which input field of the Print List Output dialog window conform to which PRI_PARAMS component.
    Input field----
    Retention period
    Component-------PEXPI
    Meaning----
    Number of days for which the system holds the spool request before deleting it. (Default value: 8).

  • Start background Job when another is finished (NOT with the JobSteps)

    Hi guys,
    i need your help.
    I've already searched here in forum, but i wasn't able to find a good solution.
    I have this problem.
    I have a program that create a background job with the FM FM JOB_OPEN.. SUBMIT report with parameters .. JOB_CLOSE.
    I want that if i run this report again (20 secs after for example) it does:
    - Check if there is an already running Job with the same name (means with state 'R') (This task is simply, with a select on TBTO table)
    - If it's found, it have to create a new job with the same name that starts automatically AFTER the first running job is finished (don't care about the end-state of the first job).
    I've already tried with pred_jobcount & PRED_JOBNAME parameters of the JOB_CLOSE FM but it doesen't works!
    The JOB_CLOSE, creates a job in Planned state. But when the first Job is finished, the second job(Planned) doesen't start automatically.
    In this scenario, i CANNOT use endless loops (wait until the first job is finished and then submit the second) Job-steps (one job that contains multiple steps) events (i have to start only one job after the predecessor is finished), because this report could be run many times and each job should be collected like a "stack" (only when the first job is finshed the second "registered" should be started and so on, until the aren't more planned jobs).
    <REMOVED BY MODERATOR>
    Thx a lot for your help.
    Andrea
    Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:19 PM

    Hi Veda
    i can tell u but ... some reward points are very appreciated ....
    I'm joking (of course)
    Here the question:
    I have a program (called A) that submit a new program (called B) with the JOB_OPEN .. submit JOB_CLOSE. The program B should start only if another program B (called before for example) is finished.
    Here the solution.
    I add a parameter (with no-display clausole) to the program B. In this parameter i pass to the program, the job number returned by the JOB_OPEN function. 
    When i create the JOB with the function, the "jobname" parameter is set with value 'G_DELIVERY' (Here u can change the name of the job as u want : this is the jobname that u see in SM37 transaction).
    In the start-of-selection of program B i put a "waiting" procedure like this :
    First i save a timestamp of system-date and system-time (called for example r_date and r_time)
    select from table TBTCO all the jobs called "G_DELIVERY" with jobnumber <> from the jobnumber parameter (that means exclude itselfs)  with status running ('R')  -> that have startdate /starttime less than the r_date and r_time <- (this is the key of the selection that solve the problem).
    if it is found (means there is another running job started before this one).
    wait up to 60 seconds. "for example
    repeat the selection.
    endif.
    When the job called before ends, this one programs exits from the loop and continues. If u submit more programs "B", they'll works like a stack.
    I should say to u just one thing.... I solved my problem in another way (because i've changed the logic so this problem was no more) so i didn't implemented that logic, but it should works very good.
    Try it and tell me!
    Bye
    Andrea

  • Scheduling function module execution in background jobs

    Hi,
    I have requirement where in after obtaining all the required inputs from the user we will call an function module to execute it.
    The requirement is that the execution of fm shld happen in background and a log must be created showing the user whther it was successful or if it failed with the list of errors.
    Can you kindly give some input on how to schedule the execution of function module in background job and if scheduled how to create the logs to display the success or error message.
    Warm Regards,
    Naveen M

    Hi,
    Just create a simple program where you have to call this FM.
    Pass the values to FM either by declaring some internal table of selection screen and execute the program in background.
    For Message Log, you can use structurre BDCMSGCOLL
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    After Call to FM, read from this internal table as follows
    READ TABLE MESSTAB WITH KEY MSGTYP = <Message Type>
                                            MSGNR  = <Message Number>.
    regds,
    Anil

  • Problem in Background Job. Job Completed Successfully but data not Posted

    Hi All,
    There is a problem in Background Job in Production server (600).
    The job completed successfully but data not posted.
    The same Job was working perfectly till the starting of the May month.
    but now it is not working and rebate has not been posted.
    Where to check and what to check
    Pls suggest.
    Regards,
    P Kamal

    Hi ,
    Please first check the status of the Job , ifs successfully completed then debug it (tcode JDBG) and 
    check out,  whether the values passed (might be using Import-export ,set-get parameter Ids) to the Job are getting passed properly or not. These values might not be getting passed properly.
    If it has some error in Job Log then let me know the error.
    Regards,
    Uma

  • Splitting a background job over different application servers

    I am running my program in the background and its taking long to complete. I have done some optimizations and it has greatly improved but still not running as fast as I want because its processing large amounts of data and the amount of time that I want all the data to be processed is little compared to the runtime of the program so now I want to split the background job over different application servers. Can someone tell me how do I go about doing that and example ABAP code will be greatly appreciated.
    Many thanks

    Hello, If you are interested in BANK_PP_JOBCTRL, here are some of the inputs. Its work very efficeintly, though you will have to investigate a little bit froom your end.
    With in package bank_pp_jobctrl , you will find these FM. I have mentioned the use of it as well.
    RBANK_PP_DEMO_GENERATE_DATA: To create the Business data for Parallel Processing.
    RBANK_PP_DEMO_CREATE_PACKMAN: To create Packages out of the business data.
    RBANK_PP_DEMO_START : To process data in parallel.
    RBANK_PP_DEMO_RESTART: To re-process failed records during parallel Processing.
    You will need to call above in your report program in the same sequence as shown above based on you requirement. I did used only first three.
    TO generate events you will need to execute SE38: RBANK_PP_GENERATE_APPL to create application this will create the FM with numbers as shown below.
    Events: This PPF automatically triggers various events during the execution of theStart Program. Each of this event is associated with a custom function module which contains the business logic.
    For implementing this framework, at least the below mentioned methods should be implemented .
    0205 – Create Package Templates  : This method is used to write the logic for creating packages which in turn decides the data to be processed in parallel. This function module is called in loop at the loop ends only when the exporting parameter E_FLG_NO_PACKAGE has a value ‘X’ passed back to the Parallel processing framework.
    1000 – Initialize Package :This method is the first step in processing a package. It fetches all the parameters required for the parallel processing to start. All the parameters are passed to this FM as importing parameters and it is the responsibility of this FM to save it in global parameters so that it can be utilized by Parallel processing framework.
    1100 – Selection per Range : This method is used to read data for a package. The objects selected must be buffered in global data areas of the application for later processing. The package information is stored as interval in global parameters and this information is used to select the package specific data.
    1200 – Selection for Known Object List: This method is used instead of method 1100 if it is a restart run. The objects to be processed are known already.
    1300 – Edit Objects: The processing logic to be implemented using parallel processing for the selected objects is written in this method. This function module is used to implement the business logic and
    Also, obiviously you would like to log your messages , so the framwrok provides macros to do it.
    Let me know if you need some further help as I know there is very little information provided on this.
    Regards/Ajay

Maybe you are looking for

  • Communication between J2ME MIDlet and J2SE server

    In my project I need to be able to exchange SMS messages between a J2ME MIDlet and a J2SE server? Is that possible? I tried the following: I included the CLDC, MIDP and WMA libraries in the classpath of my J2SE server and tried to use the wireless me

  • Attachment in ABAP program

    Hi Everyone, I want a program for attaching an excel sheet or word document in Tr Code qm03 . Points would be awarded for suitable answers. Its very urgent. Thanks in advance Srinivas

  • Swing GUI... Is it a bug?

    I have created one JPanel (with BorderLayout), then put second and third JPanels on it at NORTH and CENTER positions respectively, then i put JSplitPane between them, everything is ok. But when i tried to put third at SOUTH posion and another SplitPa

  • Connecting External Speakers to My Intel-based iMac

    Hello everyone, I have a 24-inch, white, Intel-based iMac. I also have a pair of wonderful sounding old Mission speakers that are not self-powered, and I was wondering if anyone knew whether the iMac's internal amp can drive them. Would I connect via

  • My quads not as good as expected

    i got my quad yesterday and set it all up,i got it standard apart from a gig of ram while its good its hardly blisteringly fast and before i box it up and send it back i was wondering if there was anything that could be done to improve performance th