Job with multiple variant

Dear Friends,
I have some jobs which has many variants. So it possible to create a job with multiple variants or only option is to create job chain.
Please suggest.
Thanks in advance.
Regards,
Jiggi

Hi,
You can submit the same job with different variant, but that is your runtime.
Limitation is that you can't migrate all these runtime jobs.
It is better you create different jobs with different variants, so that you have frexibility to run them independently, monitor and troubleshoot them, also migrate them to next environment (QA or PRD). And you can still create a job chain using all these independent jobs if require.
Only creating Job Chain would be useful only if you want to run them in parallel or in sequence. (Not if you want to run them independently).
Hope this help.
regards,
Sunil Rohit

Similar Messages

  • Schedule a Job with multiple steps via ABAP Program

    Hi Friends,
    I want to create a report(Ex: ZREP) that will run another program(Ex: ZPGM) in background. What I need to do is, when I execute the report ZREP it should run the ZPGM automatically in background. This background execution should happen through JOB with multiple steps.
    Why i am mentioned steps is, i have 1000 records in ZTABLE and need to execute 100 records each in one step and need to proecess in ZPGM with selection parameters. So in my case my job should create with 10 steps and need to execute in sequential manner.
    FYI, In the ZREP selection screen i need to enter the records count/ interval to derive the job steps.
    Please guide how to go ahead? Thanks in advance for all the help.
    Regards,
    Raghu.

    Hi Raghu,
    You can try the following pieces of code:
    Loop at gt_table.   "This table contains 100 records previously appended
    w_jobname = c_job_emision   "Job Name.
        CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            jobname          = w_jobname
          IMPORTING
            jobcount         = w_jobacount
          EXCEPTIONS
            cant_create_job  = 1
            invalid_job_data = 2
            jobname_missing  = 3
            OTHERS           = 4.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    * Perform or create T_SELTAB with parameters options
    PERFORM Create_seltab_table.
    *Call second program.
    SUBMIT ZREP WITH  SELECTION-TABLE t_seltab AND RETURN.
    *Close Job.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = w_jobacount
            jobname              = w_jobname
            strtimmed            = c_x  "Immediate Start
         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 ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    ENDLOOP.
    Hope this helps.
    Regards
    Ernesto
    PS: Raymond Giuseppi was faster.
    Edited by: Ernesto Caballero on Mar 10, 2010 1:57 PM

  • Job with multiple event schedules

    Is it possible to create a job with multiple schedules? Can you have multiple schedule names?
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'my_new_job2',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN SALES_PKG.UPDATE_SALES_SUMMARY; END;',
    schedule_name => 'my_saved_schedule, my_saved_schedule2'); <------------------ like this?
    END;
    thanks.

    I am using oracle 10g and have installed the file arrival package. I want my job to run when multiple files arrive. I have created the file arrival event schedules. I know i can create chain event steps to respond, but my chain has to be running for the steps to respond to the events. I want the chain (or rather the job that starts the chain) to kick off when 2 or more files arrive.
    thanks.

  • Schedule Jobs with multiple steps via ABAP Program

    Hi,
    I need to schedule multiple programs via background jobs on a daily basis. Since all these jobs are to be run as a single job, the various programs have to be run as steps in a major job.
    I am however not very clear on how this can be done via an ABAP program ( the idea of a program is that various parameters to be passed to each program in the step can be entered dynamically rather than via variants).
    I am using the JOB_OPEN and JOB_CLOSE functions and submitting the programs with selection screen parameters dynamically passed to create a job. I need to do this for various programs as a job step (WITHOUT Variants being defined).
    Can anyone suggest any ideas for this? I have tried out JOB_SUBMIT Function but am not very confident I know what exactly it is for as it asks for a variant.
    Thanks very much,
    Preet

    Hi Preet,
    just to be sure: you know, that variants can be dynamical, too?
    It's quite usual to assign dynamical current date, but it's also possible to add / subtract value and even define own functionality.
    Maybe it's easier to implement a dynamical selection and handle static jobs.
    If you try to plan a job (online or with JOB_SUBMIT), you have to use variants - you can create (or change) them dynamical in beforehand. Only SE38, F8, F9 is creating a temporary variant, so that no saved variant is necessary.
    But if you end up creating variants dynamical, you can change one existing variant, too. Then you can use a static job definition (with periodical starting rule).
    So: have a look, if dynamic variants are enough, otherwise change variants per job.
    Regards,
    Christian

  • Table name for background job with report, variant and step user id list.

    Hello All,
    I need to generate the list of scheduled backgroung job with the list of Report Name, Variant, Step User Id called. Please any one tell the SAP Table name from which I can get these data.
    Thanks in Advance,
    Amit

    Hi Rohit,
    Thanks for your reply. But from TBTCO, i can't find program/report name and variant. Just the list of background job i can see.
    Regards,
    Amit

  • Job with dynamic variant

    Hello everybody,
      Could somebody help me to run a job with a dynamic variant (for instance a report with the changes for the last N days).
      I read things about SAP_StoreVariant and RedwoodScript but I'm not able to perform the job...
      Thanks for your help.

    Go through this link...
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/802cfc454211d189710000e8322d00/frameset.htm
    In this page
    ABAP Workbench tools -->
                      VARIANTS  -->
                            VARIABLE VALUES IN VARIANTS.
    Hope this helps u a lot...
    reward if it helps u...
    sai ramesh.

  • Job with Multiple Schedule of same time & only one is executed, Why

    Hi ALL,
    I've Created a package to notify report in email  as excel, which is using a path to render report and save it as excel.
    This package was need to be schedule every first day of month and on every Friday even at morning 7 AM.
    So logically these are two events.
    But if we see on 1 May 2015 we have Friday and plus first day of month
    So technically this should fail.
    either for IO operation for render &
    storing data over same location with same file name.
    To replicate this i created two three schedule
    Below is the job history, job is invoked by only one schedule
    Question-
    1) Why one one schedule execute?
    2) why "sched2" only , it could be "sched3" only or "DentalOperationStackAndRank-Sched1" Only?
    Another this i result into error if different job executing same package at same schedule.
    FYI- package is deployed at database level
    HS

    Hi HS,
    As described in this
    article, more than one job can run on the same schedule, and more than one schedule can apply to the same job.
    And I make a test about your scenario, when configuring a SQL Server job with three schedules that reference same dates and times, my job behaves as yours that only one schedule is executed, but the job is invoked by schedule2 or schedule 3 in my environment.
    It is a normal behavior of SQL Server job in my opinion. For more details about such scenario, you can track the job following this
    blog.
    However, when I configure three jobs that run on the same schedule, everything works well and the three jobs all run successfully.
     I recommend you configure three different jobs that execute same package at same schedule .
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • Defining Job with multiple steps

    This is a general question on SM36.
    I have 4 programs that need to run as part of a job. I do not want this as a periodic job because these 4 steps needs to be done by the user when needed.
    I defined a job and created 4 steps and saved. system showed the job is scheduled and then I released it. All the 4 steps ran successfully.
    Now if I want to run again the same job, system is prompting me to create the steps again. I do not want to do that every time i want to run the job. how can I save this 4 steps under a job and just call the job name to schedule immediately on demand/when needed?

    Swathi,
    Create the job, leave the job with a status of  'scheduled' (no start conditions).
    When the user wishes to run the job:  SM37 > select your job; then Job > repeat scheduling. The user will have to determine the trigger; presumably it will be 'Immediate'; however, any of the normal selections are possible.
    This activity will start a copy of your scheduled job.  Your job remains with a status of scheduled.
    Since it is so easy for a user to make a mistake and inadvertently release your job, you might want to create a backup copy.  SM37 > select your job; then Job > copy.  This will give you a screen where you can create a copy of your job, but with a new name, such as <yourjobname>_BAK.
    Best Regards,
    DB49

  • Creating a background job with out Variant.

    Hi Experts,
    I'm developed one ALV report which is not having any selection-screen and Variant.
    We can execute the program in fore ground but the user wants to be run in back ground and he wants to be created a spool requet for that report.
    My Question is ...the above requirement is possible or not.
    if your answer is yes then
    How to create a variant for a report which is not having any selection-screen?
    Can we creat a spool request manually ..means with in the report only through coding?
    Thank you ,
    Venky.

    try this one...
    you can submit your report in background and create spool...
    An ALV report can be executed in background.. but if its an ALV Grid then spool will contain ALV list output. You can directly select execute in background even if you dont have any parameter on selection screen. or try below code...... if you want to create a spool from the report itself.....
    I hope its useful
    DATA: number           TYPE tbtcjob-jobcount,
          name             TYPE tbtcjob-jobname VALUE 'JOB_TEST',
          print_parameters TYPE pri_params.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc = 0.
      SUBMIT report TO SAP-SPOOL
                        SPOOL PARAMETERS print_parameters
                        WITHOUT SPOOL DYNPRO
                        VIA JOB name NUMBER number
                        AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = number
            jobname              = name
            strtimmed            = 'X'
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5
            job_notex            = 6
            lock_failed          = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    ENDIF.

  • Scheduling a job with different variants

    i have a program to be run daily for three company codes and different materials. If i give all the three company codes at a time then the program is taking a lot of time and giving a run time error 'time limit exceeded' .Can i create variants for that program and make it run sequentially with all the variants.

    hi Deepthi,
    Yes you can do that .. i even suggest to modify your select statements to reduce the processing time .
    Refer
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
    Regards,
    Santosh
    Message was edited by:
            Santosh Kumar Patha

  • Identify origin of job with multiple instances running

    Hello,
    I have this scenario.
    There is a job (JOBA) that has 2 steps. 
    The first step executes Home ZProg 'A' which will use data that is unique to this run. It will create some TVARV information related to this run. (job name and number)
    The second step executes SAP Prog B (RFEBKA00), which will submit a different Job (RFEBKA00-EL BANK STATEM), which, at a point, executes SAP Prog C (RFEBBU00).  This program will call User Exit ZXF01U01, which will read the TVARV table and use the information written by ZProgr 'A' .
    This would not be complicated at all, except for one issue:
    There could be more than one JOBA running concurrently, so the User exit somehow needs to identify if the current call of the User exit is coming from the correct JOBA.
    I hope that you can help me tosolve this problem.
    Thanks!

    I forgot to say that all these jobs run with just one Batch ID (00BATCH). 
    Having said that, I think that I got a solution.
    I think that by using a different Batch Id (00BATCH01) in JOBA and accessing table TBTCO from the user exit I can identify if the UE is being executed from the correct job, since the batch user id will be propagated when the new job is submitted.
    I think I can work with this option.
    If anybody knows of a different way.  Please go ahead and let me know.
    Thanks.

  • Scheduling a job with multiple output formats.

    Urgent!!
    Basically while scheduling a job in BI Publisher we specify an output format. It can be PDF, CSV, HTML or so… Is there a way to specify more than one output format while scheduling a job.
    Thanks in advance.
    Ashok

    you have to re-publish them.
    for a run, you can have only one output .

  • Problem to run ABAP job with VARIANT in Redwood

    Hi,
    I am new to SAP, Redwood and this forum so if this topic has been covered earlier I apologize.
    My problem is that I have a SAP job with a VARIANT in SAP that I want to have working in Redwood.
    I import the job with RSI_IMPORT_ABAP_PROGRAMS and the variant with RSI_IMPORT_VARIANTS. At this
    stage I am relatively sure I was able to run the job once by submit RSI_ABAP_RUN with variant.
    I use the RSI_GENERATE_VARIANT to generate the VAREDIT script to be able to change the parameters
    for the ABAP job. Modify the parameters, run the VAREDIT script.
    When I now try to run the RSI_ABAP_RUN with the variant I enters values for instance, client, jobclass,
    ABAP program (from dropdown list), ABAP variant (from dropdown list), Job name (get filled automatically)
    then tries to goto "next" or "submit" I get a popup window.
    Error
    Enter a valid value for the ABAP_VARIANT_NAME.
    I am still able to run the job in SAP with VARIANT and in background.
    Does anyone have any ideas?

    Hi Henrik,
    One of the parameter checks apparently is failing, and in some special cases the issue may be with another (related) parameter.
    Can you tell me exactly which version you are using (6.0.2.x or maybe 7.0.x.y) ?
    You can find this in the view JCS_PRODUCT_COMPONENT_VERSION or by running the RW_SHOW_INSTALLED_COMPONENTS script. I would need to know the repository and the rsi version.
    Have you tried entering a (different) jobname manually ? And if the client number you use below 100, does it have leading zeros or not ?
    Anton.

  • Job creation with variable variant parameters

    Hi,
    Is it possible from a FM to start a job using a program where one sends the selection screen parameters with?
    As the called FM calls the program with different parameteres each time.
    If it is possible can someone please assist by giving an exsample?
    Thanks in advance.
    Best regards

    Hi,
    Check this eg.
    This program will submit an another program in background mode as a job.
    REPORT  ZACE1031_ROUTING_CONV_TRG NO STANDARD PAGE HEADING
                                    LINE-COUNT 255(1)
                                    LINE-SIZE 255.
    TYPES: BEGIN OF x_mat,
           werks TYPE mast-werks,
           matnr TYPE mast-matnr,
           stlal TYPE mast-stlal,
           stlnr TYPE mast-stlnr,
           stlan TYPE mast-stlan,
           END OF x_mat.
    DATA:  v_params    TYPE pri_params,
           v_jobname   TYPE tbtcjob-jobname,
           v_jobcount  TYPE tbtcjob-jobcount VALUE 1,
           v_stringlen TYPE i VALUE 0,
           v_msg_string(50) TYPE c,
           v_prog(30)  TYPE c,
           c_cross(1)  TYPE c VALUE 'X',
           c_01(2)     TYPE c VALUE '01',
           c_trg(1)    TYPE c VALUE 'X'.                "CCT51576
    DATA : it_mat TYPE TABLE OF x_mat,
           wa_mat type x_mat.
    DATA : v_werks TYPE mast-werks,
           v_pre_werks TYPE mast-werks.
    RANGES: r_matnr FOR mara-matnr.
    TABLES : mkal,mast.
    SELECTION-SCREEN BEGIN OF BLOCK matnr
                              WITH FRAME TITLE text-001.
    SELECT-OPTIONS : so_matnr FOR mast-matnr.
    SELECTION-SCREEN END OF BLOCK matnr.
    SELECTION-SCREEN BEGIN OF BLOCK plant
                              WITH FRAME TITLE text-002.
    SELECT-OPTIONS : so_werks FOR mast-werks OBLIGATORY .
    SELECTION-SCREEN SKIP.
    PARAMETERS     : p_date TYPE datuv OBLIGATORY.                        "CCT51576
    SELECTION-SCREEN END OF BLOCK plant.
    INITIALIZATION.                                                        "CCT51576
    CONCATENATE sy-datum+0(4) c_01 c_01 INTO p_date.
    AT SELECTION-SCREEN.
    START-OF-SELECTION.
      SELECT bwerks bmatnr  bstlnr bstlal b~stlan
      INTO CORRESPONDING FIELDS OF TABLE it_mat
      FROM mara AS a
      INNER JOIN mast AS b
      ON bmatnr = amatnr
      WHERE a~matnr IN so_matnr
      AND b~werks IN so_werks
      AND  ( a~mtart = 'FD')
    AND b~stlan = 1.        "CCT53428
      AND b~stlan IN (1,2).    "CCT53428
      IF sy-subrc = 0.
       SORT it_mat by werks matnr.                                  "CCT53428
       DELETE ADJACENT DUPLICATES FROM it_mat COMPARING werks matnr."CCT53428
      SORT it_mat BY matnr werks stlan stlal  ASCENDING.                  "CCT53428
      DELETE ADJACENT DUPLICATES FROM it_mat COMPARING matnr werks stlan. "CCT53428
      SORT it_mat BY matnr werks stlan DESCENDING.                        "CCT53428
      DELETE ADJACENT DUPLICATES FROM it_mat COMPARING matnr werks.       "CCT53428
        SORT it_mat BY werks.
        LOOP AT it_mat into wa_mat.
          CLEAR : r_matnr.
          r_matnr-sign = 'I'.
          r_matnr-option = 'EQ'.
          r_matnr-low = wa_mat-matnr.
          APPEND r_matnr.
          AT END OF werks.
            CLEAR v_werks.
            v_werks = wa_mat-werks.
            CLEAR v_jobname.
            CONCATENATE 'WWACSD12' '_' v_werks INTO v_jobname.
            PERFORM f_open_job USING v_jobname.
            PERFORM f_submit_job.
            PERFORM f_job_close.
            REFRESH r_matnr.
          ENDAT.
        ENDLOOP.
      ELSE.
        WRITE / text-017.
      ENDIF.
    *&      Form  f_open_job
    Form to open the job with the particular job name
    FORM f_open_job USING v_jobname TYPE any.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname  = v_jobname
        IMPORTING
          jobcount = v_jobcount
        EXCEPTIONS
          OTHERS   = 8.
      IF sy-subrc NE 0.
        WRITE: /3 v_werks,
                11 text-008, v_jobname.
      ENDIF.
    ENDFORM.                                                    " f_open_job
    *&      Form  f_submit_job
    Form to submit the program (ZACC0014_COST_COLLECTORS_BDC) as job
    FORM f_submit_job.
      v_prog = text-016.
      SUBMIT (v_prog) WITH so_matnr IN r_matnr
                      WITH p_werks EQ v_werks
                      WITH p_date   EQ p_date                 "CCT51576
                      WITH ck_trg   EQ c_trg
                      TO SAP-SPOOL
                      SPOOL PARAMETERS v_params
                      WITHOUT SPOOL DYNPRO
                      USER sy-uname VIA JOB v_jobname NUMBER v_jobcount
                      AND RETURN.
      IF sy-subrc > 4.
        WRITE: /3 v_werks,
                11 text-009, v_jobname.
      ENDIF.
    ENDFORM.                    " f_submit_job
    *&      Form  f_job_close
    Form to close the job
    FORM f_job_close.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = v_jobcount
          jobname              = v_jobname
          strtimmed            = 'X'  "start immediately
        EXCEPTIONS
          cant_start_immediate = 1.
    Process various error conditions
      CASE sy-subrc.
        WHEN 0.
          MOVE v_jobname TO v_msg_string.
          CONDENSE v_msg_string.
          v_stringlen = STRLEN( v_msg_string ).
          WRITE ' created.' TO v_msg_string+v_stringlen.
          WRITE :/3 v_werks,
                  11 v_msg_string.
        WHEN OTHERS.
          MOVE v_jobname TO v_msg_string.
          CONDENSE v_msg_string.
          v_stringlen = STRLEN( v_msg_string ).
          WRITE 'create failed.' TO v_msg_string+v_stringlen.
          WRITE :/3 v_werks,
                  11 v_msg_string.
      ENDCASE.
    ENDFORM.                                   "f_job_close

  • APD using Query with multiple structures as a data source

    All,
    I want to set up an automatic process which executes a query and exports it to a shared drive as a csv file. I have tried various options , when I try to use APD to set up the extract, I get an error and this is because the query that I am trying to use has Strucutres in both rows and columns. Hence, I am unable to use this option. I tried RSCRM_BAPI, It works well, but there is an issue with scheduling this in Process chain. I created an event and scheduled this as a job to trigger after "event" as per SAP instructions, but the job does not exist and it is not possible to trigger it through the Process chain unless the variables are hard coded in the query which I do not want to do.
    Can any one tell me if there is a way to deal with APD using Query with multiple structures?
    Would really appreciate if some one can give me the right solution...
    Thanks

    Hi Tanu ,
    APD is an option but its not very good with large amount of data or hiearachies or if you have attributes in you query structure .
    One more option for this requirement is use of report program using function module RRW3_GET_QUERY_VIEW_DATA .
    This will work fine with multiple structure etc .
    There are some overheads with this FM  ex: if amount of data is too much then program will give dump .Solution for that is we call the FM in LOOP by diving amount of data need to be fetched .ex:  we can read data quarter wise.
    For using this function module what you can do is write an ABAP program (At SE38 ) .which will call this FM and then write the output into a flat file which you can save at application server (AL11) .From there other system can read it .
    To automate this whole process you can further add all the report programs into a process chain (RSPC) which can be schedule as per requirement .
    To pass input parameters you can use variants that will pass the values to the report .
    Check thi link for sample code :
    [http://www.tricktresor.de/content/index.php?navID=696&aID=496]
    Hope this will be helpful .
    Regards,
    Jaya Tiwari

Maybe you are looking for