Running job along with variant programatically

Hai,
I have to run a report (which have selection screen) through job from the module pool program.
that is the user will click on a button which triggers the execution of the report in back ground.
this report have a selection screen.I am creating the variant programatically & I have to use the same varinat in the job.But when I checked the job_open fm , it is not taking any input parametrs for variant.
please note creating the variant & job before the execution of the module pool program is not possible because I have to ceate the variant with the values from the module pool screen & I need to use the job
because the foreground process takes huge amount of time hence going for back ground.
can any one please tell how to cretae a job with varinat programatically?
creating a job with out variant is possible through job_open but I want to create a job with variant so that I can run the repor from module pool.
please give your ideas.
Regards,
Bhaskar.

Hello,
after the function JOB_OPEN you could use the submit_statment.
submit <Reportname> user <user> via job <jobname> number <jobnumber> using selection-set <variant>.
the jobname and jobnumber you would get from the JOB_OPEN-Function.
At last there would be a call function JOB_CLOSE or JOB_SUBMIT.
Regards Wolfgang

Similar Messages

  • Background Job assigment with variant in SM37 , for Textfile uploading

    Dear all,
    Im using the BAPI_PO_CHANGE to update the existing schedule dates in Purchase Orders,
    for this the po's , item, schedules, delivery dates(Need to update) from a Textfile into the internal table
    and passing that data to bapi function module, it works fi9 in foreground and the output is a classical report
    with Corresponding messages through RETURN.
    i need the same to run in background with a variant, but after assigning the background job in SM36,
    i found that the job assigned got CANCELLED in SM37.
    I hope everything is clear, so kindly revert back with solution.
    Regards,
    Niranjan.G

    Hi,
    You should understand that background job will be executed in application server and there will be no gui or access to presentation server available.
    You should upload your file to application server through tcode CG3Z.
    See F1 help for OPEN DATASET / Search SCN for sample codes for OPEN DATASET.
    You should change the code so that it can be run in both modes using the system variable SY-BATCH.
    If it is space use GUI_UPLOAD, if it is X use OPEN DATASET.
    Regards
    Karthik D

  • Background Job Scheduling with variants in IS - Public sector

    Hi,
    We run auto write off using scheduled job activity (SM37 -Program : RFKK_MA_SCHEDULER). There is an variant containing Main Transactions that needs to be included / excluded for write off.
    The variant values are changed / updated with additional main transactions and when we run the batch jobs the new variant values are not getting picked or used. If we run the program independently i.e FP04M and use the variant, the new variant values are being handled.
    I am not sure what is missing in the SM37 background job that is defined though the variant values are runtime parameters and should have automatically be used after it undergoes modification in the next job exeuction.
    Kindly provide your feedback.
    Thanks & Regards
    Bala
    P.S. : I Have posted this query in IS forum too.

    Hi,
    You should understand that background job will be executed in application server and there will be no gui or access to presentation server available.
    You should upload your file to application server through tcode CG3Z.
    See F1 help for OPEN DATASET / Search SCN for sample codes for OPEN DATASET.
    You should change the code so that it can be run in both modes using the system variable SY-BATCH.
    If it is space use GUI_UPLOAD, if it is X use OPEN DATASET.
    Regards
    Karthik D

  • How to give the Submit along with Variant

    Dear Freinds,
               Iam using the Submit program with variant  in my custom program . When iam exucting my custom program it is directly opening the program with the variant . ie. just like we execute a program and select varaint.
    it is not happening what i want ,it has to schedule the program with the varaint (i.e. what ever fields have been slected in that varaint) and when i go and see in SM37 . The job should get schedule, this was
    happening when iam sending one are two parameters in retrun of the submit without me using VAriant.
    please help me where iam going wrong.
    Not working Scenario (when iam using Variant)
    SUBMIT rptqta00
       WITH pnpbegda =  sy-datum                                 "'20081201'
       WITH pnpendda =   lv_date                                 "'20091130'
       VIA SELECTION-SCREEN USING SELECTION-SET 'NEW'
       VIA JOB lv_job_name NUMBER lv_job_nr
         AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = lv_job_nr
            jobname              = lv_job_name
            strtimmed            = 'X'
          IMPORTING
            job_was_released     = lv_job_released
          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 syst-subrc NE 0.
          MESSAGE i162(00) WITH
          'An error occured while closing the background job.'.
          STOP.
        ENDIF.
    working perfectly  with the below scenario
      SUBMIT rptqta00
    WITH pnpbegda =  sy-datum                               "'20081201'
    WITH pnpendda =   lv_date                                 "'20091130'
    with pnppernr = '99002235'
    WITH pnpbukrs  EQ 'C091'
    WITH dis_new = 'X'
       VIA JOB lv_job_name NUMBER lv_job_nr AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = lv_job_nr
            jobname              = lv_job_name
            strtimmed            = 'X'
          IMPORTING
            job_was_released     = lv_job_released
          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 syst-subrc NE 0.
          MESSAGE i162(00) WITH
          'An error occured while closing the background job.'.
          STOP.
        ENDIF.
    now my question is what i have to do in the case of VAriant so that it acts exactly as the below parameters.
    My problem why iam going to varaint is in the standard program  rptqta00  i have a button Like TESTRUn ,Batchinput,Direct etc.............. this iam not able to pass the OK code along WITH  in the     Submit syntax.... i dont know how to pass in the case of Button's  along with Submit ,,,,,,,,,however iam able to do for radio buttons .
    could any one tell me why the variant when iam using is taking me directly to the program instead it is not returning
    secondly if iam passing each parameters in the submit program how can i pass the BUTTON value ( which is having tick option for either TESTRUN ,Batchinput,Direct )
    Please could any one help.
    regards
    divya

    Dear Freinds,
                  I found the solution , i have used the ok code of the button while passing into submit program it is working . Thanks once agian
    regards
    divay.

  • How to run the program with variant automatically

    Hi experts,
    I want to know how can I run the program with a variant automatically without defining any transactions or jobs. I want my program to run with a variant automatically, when I press F8.

    Try doing this way...
    First Create a Sel Screen varient, 'ZTEST123' in this case
    Report ZTEST.
    parameters:
      w_kunnr type kna1-kunnr,
      w_flag type c no-display.
    start-of-selection.
    if w_flag eq ' '.
      submit ZTEST USING SELECTION-SET 'ZTEST123' with w_flag eq 'X'.
    endif.
    end-of-selection.
      write:  w_kunnr.
    Thanks.

  • Creation of sales order with Variant configuration info

    Hi friends,
       I am creating sales order along with Variant configuration data. We have 3 level BOM structure.
    I am using BAPI_SALESORDER_CREATEFROMDAT2 and filling in ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_PART_OF ORDER_CFGS_VALUE, ORDER_CFGS_REFINST
    tables exactly the same way BAPISDORDER_GETDETAILEDLIST FM returns.
    Sales order is being created with no variant configuration information.(Not in the header level atleast)
      Can any one help me on this.
    Thanks
    Seshagiri

    Updating Variant Configuration data for SO item became little tricky for us in an ongoing implementation. After spending some hours investigating the correct combination of data to pass, we were able to post the document correctly. As no detailed documentation is available online for this scenario, I hope this post will help community for similar requirements. J
    For updating Variant configuration (VC) data for Sales order item, we need to populate below tables of standard FM or BAPI (e.g. SD_SALESDOCUMENT_CREATE).
    Normally the standard FM or BAPI does not return any error messages in case configuration data is not updated successfully.
    ·         SALES_SCHEDULES_IN: The required date field should be populated with appropriate value (REQ_DATE).
    ·         SALES_ITEMS_IN: Field PO_ITM_NO should be populated with appropriate value.
    ·         SALES_CFGS_REF Table:
    1.       This table should have 1 record per item.
    2.       Combination of CONFIG_ID and ROOT_ID should be unique across line items.
    POSEX
    000010
    CONFIG_ID
    000001
    ROOT_ID
    00000001
    SCE
    1
    COMPLETE
    T
    CONSISTENT
    T
    CBASE_ID_TYPE
    G
    ·         SALES_CFGS_INST:
    1.       This table should have 1 record per item.
    2.       Combination of CONFIG_ID and INST_ID should be unique across line items.
    CONFIG_ID
    000001
    INST_ID
    00000001
    OBJ_TYPE
    MARA
    CLASS_TYPE
    300
    OBJ_KEY
    MATNR value
    QUANTITY
    Quantity value
    QUANTITY_UNIT
    Quantity Unit
    COMPLETE
    T
    CONSISTENT
    T
    OBJECT_GUID
    MATNR value
    PERSIST_ID_TYPE
    G
    ·         SALES_CFGS_VALUE:
    1.       Combination of CONFIG_ID and INST_ID should be unique across line items.
    2.       We can have multiple characteristics for a material. In that case appropriate records should be inserted in this table. Note that CONFIG_ID and INST_ID should be same for all the rows you insert in this table for multiple characteristics for a material.
    3.       The characteristic value should be in SAP internal format.
    CONFIG_ID
    000001
    INST_ID
    00000001
    CHARC
    Material characteristics
    VALUE
    Material characteristics value
    ·         SALES_CFGS_VK:
    1.       Combination of CONFIG_ID and INST_ID should be unique across line items.
    2.       We can have multiple characteristics for a material. In that case appropriate records should be inserted in this table. Note that CONFIG_ID and INST_ID should be same for all the rows you insert in this table for multiple characteristics for a material.
    CONFIG_ID
    000001
    INST_ID
    00000001
    VKEY
    Material characteristics

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

  • How to create a job thru ABAP program for calling a program with variant???

    Hello experts,
    can u give me step wise procedure to create jobs for  a program with a variant name thru ABAP???
    Also, can a transaction can be scheduled as a job to run in background with a variant name???
    Edited by: SAP USER on Jul 22, 2008 6:08 AM

    Hi,
    To create a job through ABAP program you can do the following.
    Go to Menu bar.
    In there, go to   SYTSTEM> SERVICES> JOBS--> DEFINE JOB.
    Then give the JOB NAME and CLASS in the screen that comes up.
    This is how we schedule a program.
    Now, to create a variant for a program -
    First activate your program in SE38. Then execute it .
    Now, click on SAVE button. It will open up  the variant creation screen. Give the details there like variant name and value for the fields. Save and come back.
    Hope this helps.
    Regards,
    Hari Kiran

  • Running job with a specific background ID...

    I have a program and a background ID created. I want to run that job in background immediately using that background ID defined by basis. How can I do that ?
    Regards,
    Rajesh.

    Hi,
    YOu can create a separate program with Input parameters as job id.
    Now submit the program using SUBMIT statement along with Job id, jobname which are created.
    Usually, we will be creating job id using JOB_OPEN function module, and then will be submitting a background job using SUBMIT statement and finally closing the job using JOB_CLOSE function module.
    Regards,
    AShok

  • How does one continue to use Mail on the early MacBook Pro, Model 1,1, that is not upgradable to Lion?  I have been running iCloud on my iPhone (OS5) and iMac (Lion) along with the MacBook Pro (OS Version 10.6.8)

    How does one continue to use Mail on the early MacBook Pro, Model 1,1, that is not upgradable to Lion?  I have been running iCloud on my iPhone (OS5) and iMac (Lion) along with the MacBook Pro (OS Version 10.6.8) since November until now.  Mail will no longer download on the MacBook Pro and keeps asking for my password.

    Mail should still be usable with your machine - but you'll need to update the settings to conform to the requirements of your system. Check with your ISP (like ATT, etc.) for the settings that will work with your Mail. Once you've updated this, you should be able to email like before.
    For example, my ISP required that I go to Mail Preferences/Accounts and make sure the details conform to your email settings.
    I have no idea of what your ISP is or what the settings might be, but this is likely the source of the problem.

  • Hii Can anyone tell me is there any possibility of giving some due payment like bonus or offcycle after its termination is done along with the payroll run and posting.

    Hii Can anyone tell me is there any possibility of giving some due payment like bonus or offcycle once employee termination is done along with the payroll run and posting.
    Thanx

    One Possibility is by making manual entry for that employee from FI side..  (this will give you soln..) Take the help of FI consultant...
    Another possibility is in IT0003 "Payroll Status".. You can opt mention next month date "Run Payroll up to" & execute Off cycle payroll for that employee...
    Just try this hope this may sort your issue....
    If it still it doesn't give you soln.. You may need to reverse the posting of that employee & change employment status.. Run Bonus & finally terminate the employee & do the posting..

  • [note] running multiple audio apps along with runescape

    Hello everyone
    For those battling with their java hogging the audio device *and for those who waste their time with runescape *included* *
    Install PulseAudio and follow their instruction, be sure to READ ( and more if you are like me that can't survive without listening to music).
    After installing and testing everything go to console type in:
    $ padsp opera
    Note I use opera, although I'm pretty sure most of you use firefox. Don't bother though, firefox 3.5 will hang on, been looking on how to fix it but not close enough.
    if you run
    $ pavucontrol
    you should be able to see all the applications that uses audio routed onto it and be able to manipulate the volume of each one
    Alright going back to the 'dadsp opera' step, go to runescape.org or whatever site that contains java mini games or application that uses audio, run it and you should be able to get it working. In the 'pavucontrol' it'd be marked as "OSS Emulation"
    Along with this, be sure to check on libflashsupport-pulse (using 32 bit one personally)
    Sorry if this wasn't the section, wanted to post this since it wasn't anywhere. I'd hope it be helpful to others
    Cheers

    Ok, fixed it!  Sorry if I wasted anyone's time.  I converted the struggling clips from aac to mp3 and now everything's good.

  • How to Run std program with a specific variant for specific user?

    Hi guys
    We have a std program which will be run by different users in the company. Now the requirement is to make sure that each user runs the report with a specific varaint. Can we control this if yes how?
    one options we thought about was to create a transaction in SE93 and define the program to run with a predefined varaint and assign the new custom tcode to the user profile. But we have many different users and we will end up with creating many transactions which we would like to avoid. Is there any other option to control the std program such that each user can run the program only with a pre-defined varaint and the one which only the user is suppoed to run. thanks in advance.

    We have a std program which will be run by different users in the company. Now the requirement is to make sure that each user runs the report with a specific varaint. Can we control this if yes how
    you can do this..
    You can create a Custom table
    userid     keyfield
    program  keyfield
    variant    keyfield
    programdesc
    Make the table Maintaintable(usnig table maintenance )
    Now create another Program
    It takes input of the Program name( using selection screen)
    LOGIC
    in side that place a logic ,
    Based on the user name  and program name Get the variant name from above table
    Now Submit the program with the variant you have selected above.
    Use Variant Addition when you use SUBMIT
    So now program executed based on user variant.
    Now you create a Transaction for this program.
    When use Runs the Transaction , user needs to input the Program name which he wants to execute.
    and Output will be shown based on the variants
    Regards
    Vijay Babu Dudla

  • Firefox freezes (along with any other program I might have running) a minute or two after I have started my session. After a minute or so, it's O.K.

    Firefox freezes (along with any other program I might have running) a minute or two after I have started my session. After a minute or so, it's O.K. I have disabled all off my extensions and the problem still persists.

    Hello Meg, the phone allowed me to stay on long enough to download a new app but then shut down the app centre and returned to the home screen.
    Was there a specific "fix App" for this?

  • Running ATI Radeon x1900 XT along with NVIDIA GeForce 8800 GT Possible?

    Can I run the ATI Radeon x1900 XT along with NVIDIA GeForce 8800 GT together in my mac pro?

    The X1900 would have to go in double wide slot, you would have to run one or both at 8x.
    I think something like ATI 2600 might make more sense. The 8800GT is listed as discontinued (have a thread or two about it being EOL). So unless you have the 8800GT may not be an option anyway.
    The 4870 + 2600 combo would be best I can think of for us with 1st gen now.
    This assumes you simply need to drive 3 monitors. And don't want to wait and see if the Nvidia eVGA GTX 285 (doubtful) will support 1st gen EFI32's.

Maybe you are looking for

  • Date/ TIme in user profile settings

    Hi Abappers, The date/time format changed in transaction SU01->own data-> defaults, is captured in which table fields???

  • I would like to know wich citation manager is better to use with papers 5.5.2

    Hi, I've tried to use Sente and Papers as citation managers with Pages, but none of them seems to work with Pages 5.5.2. Is there a free or non expensive citation manager for Pages 5.5.2. If not, which version of Pages do I have to use to work with P

  • Not able to connect to SQL 2005

    All, I am not able start WLI domain with weblogic XA drivers to sql 2005. It fails during startup. I was able to create weblogic XA data source on another weblogic instance( NOT WLI) after it was up and running. I was able to select from XA datasourc

  • How to remove words which consist of max 2 letters?

    Hi everybody, Is it possible to remove words from string which consist of max 2 letters using REGEXP_REPLACE? For example string is 'aa bbb cc dddd' and result should be ' bbb dddd' (3 spaces) or 'bbb dddd' (1 space). It does not matter which one of

  • IPad2 and BT mobile broadband

    I've bben given this info from BT:- Enter the settings by accessing SETTINGS - GENERAL - NETWORK - CELLULAR DATA GPRS APN - btmobile.bt.com User - bt Password - bt   MMS settings APN - btmobile.bt.com User - bt Password - bt MMSC: http://mms.bt.com/s