Variant Creation for Background mode

hi
I am trying to create variants which will run the background jobs for CFM1 transaction with materials having 6000 records every time.
Can you tell me how to create variants for a particular transaction A using some other program B.
if I have 24000 records I want 4 different variants with 6000 records each for CFM1
All helpful answers will be rewarded

hi ,
you can categorize ur data for putting into different variants and create 4 different variant names. use the fm 'RS_CREATE_VARIANT' for creating variants in ur program B. use the following code in ur program..
      DATA : ls_variantdesc TYPE varid.
      DATA : lt_varianttext TYPE TABLE OF varit ,
             wa_varianttext TYPE varit.
      DATA : tt_reportparam TYPE TABLE OF  rsparams,
             wa_reportparam TYPE rsparams.
  DATA: jobcnt TYPE tbtcjob-jobcount,
        jobnam TYPE tbtcjob-jobname VALUE 'ZMIGO_RESERVE105'.
*Variant parameters
      wa_reportparam-selname = 'S_WERKS'.
      wa_reportparam-kind    = 'P'.
      wa_reportparam-low     = mseg_wa-werks.
      APPEND wa_reportparam TO tt_reportparam.
      wa_reportparam-selname = 'S_MATNR'.
      wa_reportparam-kind    = 'P'.
      wa_reportparam-low     = mseg_wa-matnr.
      APPEND wa_reportparam TO tt_reportparam.
      wa_reportparam-selname = 'S_BWTAR'.
      wa_reportparam-kind    = 'P'.
      wa_reportparam-low     = mseg_wa-bwtar.
      APPEND wa_reportparam TO tt_reportparam.
      wa_reportparam-selname = 'S_ERFMG'.
      wa_reportparam-kind    = 'P'.
      wa_reportparam-low     = mseg_wa-erfmg.
      APPEND wa_reportparam TO tt_reportparam.
      wa_reportparam-selname = 'S_LGORT'.
      wa_reportparam-kind    = 'P'.
      wa_reportparam-low     = mseg_wa-lgort.
      APPEND wa_reportparam TO tt_reportparam.
      wa_reportparam-selname = 'S_WEMPF'.
      wa_reportparam-kind    = 'P'.
      wa_reportparam-low     = mseg_wa-lfbnr.
      APPEND wa_reportparam TO tt_reportparam.
      wa_reportparam-selname = 'S_BDTER'.
      wa_reportparam-kind    = 'P'.
      wa_reportparam-low     = sy-datum.
      APPEND wa_reportparam TO tt_reportparam.
      CLEAR ls_variantdesc.
      ls_variantdesc-mandt   = sy-mandt.                   
      ls_variantdesc-report  = 'ZMIGO_RESERVE105'.
      ls_variantdesc-variant = 'VARIANT'.
      ls_variantdesc-ename   = sy-uname.
      ls_variantdesc-edat    = sy-datum.
      ls_variantdesc-etime   = sy-uzeit.
      REFRESH lt_varianttext.
      CLEAR wa_varianttext.
      wa_varianttext-mandt    = sy-mandt.                  
      wa_varianttext-langu    = sy-langu.
      wa_varianttext-report   = 'ZMIGO_RESERVE105'.
      wa_varianttext-variant  = 'VARIANT'.
      APPEND wa_varianttext TO lt_varianttext.
*Create Variant
      CALL FUNCTION 'RS_CREATE_VARIANT'
        EXPORTING
          curr_report               = 'ZMIGO_RESERVE105'
          curr_variant              = 'VARIANT'
          vari_desc                 = ls_variantdesc
        TABLES
          vari_contents             = tt_reportparam
          vari_text                 = lt_varianttext
        EXCEPTIONS
          illegal_report_or_variant = 1
          illegal_variantname       = 2
          not_authorized            = 3
          not_executed              = 4
          report_not_existent       = 5
          report_not_supplied       = 6
          variant_exists            = 7
          variant_locked            = 8
          OTHERS                    = 9.
      IF sy-subrc EQ 7.
If variant with same name already exists, change variant
        CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
          EXPORTING
            curr_report               = 'ZMIGO_RESERVE105'
            curr_variant              = 'VARIANT'
            vari_desc                 = ls_variantdesc
          TABLES
            vari_contents             = tt_reportparam
          EXCEPTIONS
            illegal_report_or_variant = 1
            illegal_variantname       = 2
            not_authorized            = 3
            not_executed              = 4
            report_not_existent       = 5
            report_not_supplied       = 6
            variant_doesnt_exist      = 7
            variant_locked            = 8
            selections_no_match       = 9
            OTHERS                    = 10.
      ELSEIF sy-subrc NE 0.
        MESSAGE s999(ymigo) WITH 'Cannot create/change variant for'
        sy-uname.
      ENDIF.
*Schedule background job
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname   = jobnam
          sdlstrtdt = sy-datum
          sdlstrttm = sy-uzeit
        IMPORTING
          jobcount  = jobcnt.
      CALL FUNCTION 'JOB_SUBMIT'
        EXPORTING
          authcknam = sy-uname
          jobcount  = jobcnt
          jobname   = jobnam
          report    = 'ZMIGO_RESERVE105'
          variant   = 'VARIANT'.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount  = jobcnt
          jobname   = jobnam
          strtimmed = 'X'.
      COMMIT WORK AND WAIT.
for job name, u can give your transactions program name.

Similar Messages

  • Variant Creation for the Back Ground Jobs

    Hi experts
    1) What are the settings we need to consider in the Variant Creation for generating CVC's, Planning Area Initialization, Calculate Proportional Factors and Loading planning area.
    2)I believe  Process flow to create process chain:
    Generate CVC's-->Planning Area Intialization>Load Planning Area Vesrion--
    >Calculate Proportional Factors
    Please correct if the process flow is not right.
    3) Is it require to check the adjust time series for generating CVC's for every time?
    4) How to generate the proportional factors for all the products in the single job?I assume that  need to create a single selection ID which has all Characteristic values and assign this while creating the Proportional factors.Please correct me if i am wrong.
    Please give your valuable opinions on the above queries
    Thanks in advance
    Edited by: Mani4690 on Mar 4, 2009 9:37 PM

    Hi,
    Below are the answers to your queries.
    1) What are the settings we need to consider in the Variant Creation for generating CVC's, Planning Area Initialization, Calculate Proportional Factors and Loading planning area.
    While creating CVC's (t-code /n/sapapo/mc62)select your MPOS, goto create characteristic combinations, then enter Target mpos, say generate in background, tick against all fields in action selection, and then save as variant. During planning area initialisation(/n/sapapo/msdp_admin), select your planning area, right click and say create time series objects and then enter planning version, start and end dates and execute job in background.  While calculating proportional factors (/n/sapapo/mc8v), enter ur planning area & infocube and then save as a variant.  For loading data from infocube to planning area (tcode /n/sapapo/tscube), select the infocube, planning version, planning area, planning versin, periods, tick mark in results log, key figure assignments, if you have any selection criteria enter, and then save as variant.
    2) 2)I believe Process flow to create process chain:
    Generate CVC's-->Planning Area Intialization>Load Planning Area Vesrion--
    >Calculate Proportional Factors
    Please correct if the process flow is not right.
    Correct
    3) ) Is it require to check the adjust time series for generating CVC's for every time?
    Yes, it is required.
    4) How to generate the proportional factors for all the products in the single job?I assume that need to create a single selection ID which has all Characteristic values and assign this while creating the Proportional factors.Please correct me if i am wrong.
    if you use mc8v t-code and provide planning area & infocube, it will ask for version name and dates, once u enter this info, proportional factors will get created.
    Regards
    R. Senthil Mareeswaran.

  • AFAB dynamic variant creation for Posting period.

    HI,
    Business Requirement :
    Business want to run AFAB transaction code every month automatically with schedule job.
    system should pick present month period in posting period field.
    i checked in variant creation  against posting period there is no dynamic " D " in selection variable column.
    how can i fix this.

    Hi Jani,
    Check with abaper if TVARV table can Help you in this case, or create a z program from AFAB. And add date field to it, and schedule job based on that,
    I think TVARV table will be a better approach.
    Another point to consider here would be that dep should be run once business is ready to do so, and has its own hick ups in business if corrections are required to be made after executing AFAB by job
    Regards
    Pankaj B.

  • Error during Variant Creation for a report

    hi,
    i'm trying to schedule a background job for the report MEREP_DISTRIBUTOR. it requires me to create a variant. i go to SA38 Transaction and try creating a variant.
    <b>"Maintain Variant: Report MEREP_DISTRIBUTOR, Variant Distributor" </b>Screen.
    When i give simulate, i get this error.
    <b>Simulate --> No Mobile ID found.</b>
    Can you help me solve this issue?
    Thanks and Regards
    Arun
    PS: Answers will be Rewarded.
    Message was edited by: Arun Kumar Ravi

    > Login in to your webconsole, under the
    > 'Administration' tab, press 'Add entry' button; which
    > will allow you to assign the componen to a user.
    at this point, i get a message  "Selected component type cannot be assigned\n"
    but when i see what components have been assigned,
      On All Devices    MI_ADMIN   ZMI0_EX1   01   Deployment with Next Synchronization    With Role Assignment    2005-12-29   19:14:23  
    ZMI0_EX1 - MCD Name.
    01 Version
    MI_ADMIN - User name.
    the above statement was a result of role sync from the ABAP server side.
    So, what's next?
    Regards,
    arun.
    Message was edited by: Arun Kumar Ravi

  • How can I get spool result for background mode AFAB

    Dear experts,
    Could you help me? My users run AFAB without run that in test mode. Therefore sometimes I have a difference in ledger (main book) and FI-AA. I am wanting to write coat for AFAB where I am runing programme in test mode and then run that in workering mode. AFAB run in background.
    How can I get result first (test) run from spool? Could you tell me any solutions for that problem?
    Thanks and Best Regards

    You can create one warpper program which can submit the report in the background job with option to send the output to MEMORY. You can use the JOB_OPEN and JOB_CLOSE FMs to schedule a background job.
    Than you can use the FM 'LIST_FROM_MEMORY'  to get the results from the memory.
    Like:
    DATA list_tab TYPE TABLE OF abaplist.
    SUBMIT report EXPORTING LIST TO MEMORY
                  AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc = 0.
      CALL FUNCTION 'WRITE_LIST'
        TABLES
          listobject = list_tab.
    ENDIF.
    Regards,
    Naimesh Patel

  • Error in BIM when running in background mode

    Hi,
    I am facing an error when running a BIM in sm35.
    The BIM runs fine with my userid in all three modes( foreground,display error mode, background mode)....but fails when the functional person is testing in background mode. The BIM runs fine in all other modes.
    It gives the message when running in background mode
    "No batch input data for screen SAPLMGMW 4008"
    What should I check or do to correct it.
    Please help.
    Regards
    Rashi

    The BIM runs fine in Foreground mode and in Display error mode even for the functional..It is giving error only for Background mode.
    I also did the following
    1.   Created the BIM in my id and tried running( in background) it using the other id ...it was successful
    2.   Created the BIM in other id and ran ( in background) using my id....it failed.
    I will check again for authorisations also.
    Regards,
    Rashi

  • Mass BMP upload in background mode

    Hello all,
    I have to upload 20 Gb of BMP images to SE78 with background mode via coding. I wrote a code about this and it works in foreground mode but it gives error in background mode becouse i adressed my local drive for the source of these images . So should i put these images in the folders of AL11 for background mode? How should i do it? Any ideas?
    Thanks..

    HI..,
    u cannot upload a presentation server file in BACKGROUND processing mode.. because it doesnt know where to go for that file....
    The solution for this problem is... save this file in Application server and upload from application server into the program..
    this is the standard procedure for background processing....
    TO save a file in Application server we use OPEN DATASET ... TRANSFER ... and CLOSE DATASET.. commands..
    regards,
    sai ramesh

  • Create Quality Management view for a Material in background mode

    I want to know if there is a way to create a Quality Management View (Quality Management tab) on Material Master (material already extended to plant ) in background mode.
    The requirement is to add inspection setup data for a material extended to a particular plant in background. I tried using 'BAPI_MATINSPCTRL_SAVEREPLICA' to add the data and it works perfect as required. Now the problem is this BAPI is creating the inspection setup data only for the material which has QM tab in MM02 for e.g. I manually created the inspection setup for a Material from MM01 and then deleted it , now the BAPI works fine for this material because when I created an inspection setup from MM01 it created the QM tab and after i deleted the entry the tab was still there with no entry in inspection setup.
    I want to create inspection setup for a material which does not have QM tab.
    I have to create everything is background mode. BDC is one option which I am list interested in.
    Thank you for helping in advance.

    Thank you for looking into my issue. I have to do the inspection setup in background without using any front end transaction.

  • Creation of event for background processing

    Hi,
    I need to create a event for background job. in which the job has to be created based on variant in one user exit via sm36 and i have to trigger the same in other user exit.
    thanks in advance
    shiva

    Try using the Function module "BP_JOB_CREATE" .
    rgds
    anver

  • Region Monitoring iOS 7 : didEnterRegion method is not calling when app is killed by user or by OS in iOS 7 only. It is working fine when it is in background. and the same code is working fine with iOS 6 for both app in suspended mode and background mode.

    Region Monitoring iOS 7 : didEnterRegion method is not calling when app is killed by user or by OS in iOS 7 only. It is working fine when it is in background. and the same code is working fine with iOS 6 for both app in suspended mode and background mode. What changes I have to made to work great in iOS 7 also.

    I rewrote code for debugging purpose and tried to catch error using GetLastError();  method,
    but it only printed 0. Below is code snippet; I think Create() throw an exception
    and code goes to catch block. 
    LONG ConnectTS(CString strIP, UINT n_Port)
    try{
              ErrorLog(0,0,"ConnectTS is calling Create [is going to call]","");
              if(!Create())
    // Exception Line
    n_Err = GetLastError();
    return NET_INIT;
    catch(...)
                       DWORD errorCode = GetLastError();
                       CString errorMessage
                       errorMessage.Format("%lu",errorCode);
                       ErrorLog (0, 0, "Image
    System", (LPTSTR)(LPCTSTR)errorMessage);
                       return  IS_ERR_WINDOWS;
    Output: -
    ConnectTS is calling Create [is going to call]
    Image System
    0

  • Creation ESSUsers in background mode

    Hi Experts!
    I try to setup automatic creation ESSUsers (User ID is employee personal number) in HR system, transaction hruser in background mode, in manual mode everything is ok, but in background mode result isnu2019t so good.
    Thanks in advance
    Dmitriy

    Hi
    We too have tried this without much success....eventually we carry this out from the front end on a weekly basis as part of our production support activity.
    We have tried to run the same in background with all authorization without success.......and eventually run the same from Frontend.
    all the best

  • Variants for background jobs

    You need to schedule and automate batch jobs in an organisation. There will be multiple variants and multiple steps within same batch jobs. The variants are date dependent and needs to change every day. You need to automatically change the variants every day and schedule the jobs. Also check for the failures in the jobs. Apart from that Once the jobs in one server example : R/3 server ends the jobs in BW servers should be triggered automatically. Explain all steps with proper T codes and also provide a dry run example. Also provide all the table used for the variants purpose.
    Please help on this,thanks
    Narendra

    Hi Narendra,
    The background jobs are scheduled depending on the requirement with specific variants which are both date specific and even specific sometimes. These variants are created for the programs or reports which are run in the background job ,These variants are stored in VARID table for client specific variants and
    VARID_CI for client independent. For most of the times all these jobs are maintained in some job scheduling tools so that they automatically inform about job failures and processes can be automated.In our organisation we use UC4 for background job schedulign and it controls the process as you are looking for.
    Please award points accordingly
    With Regards,
    Junaid
    Message was edited by:
            muhammed junaid

  • Regarding Variants for Background jobs

    Hi Folks
    Can you please let me know the procedure how we can create the variants for Background jobs.
    Points are assured for correct answers.
    Regards,
    kumar

    Hi Sree Ram,
    Check this info.
    If you have any selection screen parameters for your program you need to enter the values for those fields in runtime. So, if you schedule your program in background to execute then there is no one to do this job. Here comes the concept of Variant.
    With variant you define what are the selection field values in the runtime. During runtime the program picks this values and runs the program.
    When you execute your program which has selection fields, you enter the values and then you click on 'GO TO ' tab and 'SAVE AS VARIANT'.
    When you schedule your program in background, give this variant also. Then it will run automatically.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • T.code for Variant creation

    Hello Gurus,
    What is the T.code for variant creation
    regards
    sapmm

    Dear sapmm99,
    In my understanding the default values that should be automatically reflected for the input parameters for executing any report is
    referred as a variant.
    Say for Eg,executing report MB52,in case if I execute the report several times with the same input,i can save the input parameters
    and create that as a variant and in future i can call this variant to reduce the work load and execute the report.
    For eg: enter the plant 1000,material type as FERT,some material group and click on the save icon and the system asks to enter
    the variant name and the meaning and then select the check boxes for protect variant and click on copy screen assignment.
    If i want to protect the entered input parameters i can select the check boxes for the same and save and come out.
    Next time when i execute the same report MB52 and if I need some default values to get copied,i can get the variant by clicking on
    get variant or else Shift+F5 and select the saved variant.
    Check the same for the reports like ME5A.
    Check and revert.
    Regards
    Mangalraj.S

  • Firefox will run reasonably fast - for a while, I do have quite a few tabs open, They start out in background mode, but as soon as I access them it slows

    My problem is Firefox will run reasonably fast - for a while, I do have quite a few tabs open, They start out in background mode, but as soon as I access them (to view or download from them) even if I close them as I go, FF will start to slow down and it isnt long before FF drops to a crawl sometimes taking MINUTES to answer a click on the file menu (example) no fancy benchmarks needed.
    Having to restart FF and hoping your tabs come back for a temp. speedboost is NOT acceptable.
    I have to restart at least 3-5x a day - anyone else think this is stupid?
    I have 6 gigs ram, XP 32 only uses about 3.5 of it, 2.33ghz core duo, plenty of drive space.

    I understand that after using Firefox for a while there are some issues with speed. [[Firefox is slow - How to make it faster]]

Maybe you are looking for

  • CS4: Why can I only print JPEGS?

    I have just installed an Epson 7900 printer, but I cannot get a printer dialogue (File > Print >) to come up with a PSD or TIFF opened in CS4. Oddly, it only opens with a JPEG! With a PSD or TIFF I get the message "To perform printer-related function

  • How to get variable from subpanel

    Hi, May I know how to get the variable from the subpanel VI? Please see my VI, when I start the test in any of the subpanel, I can't get any variable in the "Get All Control Values Variant" indicator. Is there any wrong? Thanks. Solved! Go to Solutio

  • Deleteing Rows in a block

    I am using Forms 6i. I have a data block that automatically generates values for certain items. It will create insert the items into the rows of the canvas. The user can then enter the date in any number of the existing colums. This is my pl/sql for

  • Appointments made on iPhone aren't syncing to iCal on my computer

    I am having trouble with appointments I make in my iCal on my iPhone not syncing and showing up in the iCal on my computer. 

  • Scanner on Officejet 5610 not working

    HI, Before I go out and buy a new machine I want to check to see if there is anything that can be done to fix what is happening to my HP Officejet 5610 All-in-one. The problem: scanned documents come out as a black page with white horizontal lines ab