Abap program to maintain variants in RSRPARAMETRIZA

Hi,
SAP provided an ABAP example to maintain 3.5 variants in NW04s
Report Z_MASS_VARIANT_MAINTENANCE is available in the next u2018how tou2019 document.
[http://www.sapadvisors.com/resources/HowtoInformationBroadcasting.pdf]
This is only helpfull if you use 3.5 workbooks.
7.0 workbook variants are not save in RSRVARIANT anymore. 7.0 variants are saved in table-field RSRPARAMETRIZA-STRING (xml field with selection values).
I need to develop a program to maintain this variants. Can anybody save me some time and send me similar abap program for 7.0 workbooks ?
Thanks,
Pedro

Hi,
Bruno is right about class CL_RSR_PARA.
This is an abap example is used to maintain 'ZRT_M4M_Q0016' Query variants. In this case variant BC_SALST001 is updated.
If you need to update different report variant you have to change the 'form create_variant'.
In this variant I'm updating:
- 0S_MAT: empty
- 0S_MATGR: 5300-5399
- ZMM_STA2: Z0;ZZ
*& Program to mass update BEx Variants within SAP Netwever 2004s
REPORT Z_MASS_FR_BROADCAST_0003 .
constants: C_PARAMNM type RSPARAMNM value 'BC_SALST001'.
---> TYPE DEFININTIONS --->
NOTE: Ripped from class CL_RSR_PARA
TYPES: BEGIN OF t_sx_int_var_value,
         vnam   TYPE rszvnam,
         data_prov TYPE string,
         range   TYPE STANDARD TABLE OF rrrange  WITH DEFAULT KEY
                                                 INITIAL SIZE 1,
   END OF  t_sx_int_var_value.
TYPES: t_tx_int_var_value TYPE STANDARD TABLE OF t_sx_int_var_value
                               WITH DEFAULT KEY
                               INITIAL SIZE 1.
<- TYPE DEFININTIONS <-
DATA: l_s_rsrparametriza type rsrparametriza.
DATA: l_s_range type rrrange.
DATA: l_s_sx_int_var_value type t_sx_int_var_value.
DATA: r_tsx_values type t_tx_int_var_value.
perform create_variant.
l_s_rsrparametriza-paramnm = c_paramnm.
l_s_rsrparametriza-objvers = 'A'.
l_s_rsrparametriza-parentcomponent = '1'.
l_s_rsrparametriza-workbookid = ''.
l_s_rsrparametriza-eltuid = 'ZRT_M4M_Q0016'.
l_s_rsrparametriza-plnfuncnm = ''.
l_s_rsrparametriza-template = ''.
l_s_rsrparametriza-planningseqeunce = ''.
l_s_rsrparametriza-version = ''.
l_s_rsrparametriza-personal = ''.
l_s_rsrparametriza-owner = sy-uname.
CALL TRANSFORMATION
  id
  SOURCE page = r_tsx_values
  RESULT XML l_s_rsrparametriza-content.
get time stamp field l_s_rsrparametriza-timestmp.
l_s_rsrparametriza-conttimestmp = ''. " fix
*For security reasons I just change existing variants field.
update rsrparametriza
   set content = l_s_rsrparametriza-content
where PARAMNM eq c_paramnm
   and OBJVERS eq 'A'.
If sy-subrc eq '0'.
  Write: 'Update sucessfull'.
else.
  Write: 'No update: Probably variant does not exist'.
endif.
form create_variant.
*0S_MAT
  clear l_s_sx_int_var_value.
  l_s_sx_int_var_value-vnam = '0S_MAT'.
  l_s_sx_int_var_value-data_prov = 'DP_4'.
  " no selections
  append l_s_sx_int_var_value to r_tsx_values.
*0S_MATGR
  clear l_s_sx_int_var_value.
  l_s_sx_int_var_value-vnam = '0S_MATGR'.
  l_s_sx_int_var_value-data_prov = 'DP_4'.
  clear l_s_range.
  l_s_range-sign = 'E'.
  l_s_range-opt = 'BT'.
  l_s_range-low = '5300'.
  l_s_range-high = '5399'.
  append l_s_range to l_s_sx_int_var_value-range.
  append l_s_sx_int_var_value to r_tsx_values.
*ZMM_STA2
  clear l_s_sx_int_var_value.
  l_s_sx_int_var_value-vnam = 'ZMM_STA2'.
  l_s_sx_int_var_value-data_prov = 'DP_4'.
  clear l_s_range.
  l_s_range-sign = 'I'.
  l_s_range-opt = 'EQ'.
  l_s_range-low = 'ZO'.
  l_s_range-high = ''.
  append l_s_range to l_s_sx_int_var_value-range.
  l_s_range-low = 'ZZ'.
  append l_s_range to l_s_sx_int_var_value-range.
  append l_s_sx_int_var_value to r_tsx_values.
That's all
Pedro

Similar Messages

  • ABAP program to update webtemplate variables - RSRPARAMETRIZA-CONTENT

    Hello all,
    Looks like webtemplates variants are saved in database table RSRVARIANT under table-field RSRPARAMETRIZA-CONTENT (xml field with selection values).
    I need to develop a program to maintain this variants. Can anybody send me similar abap program for webtemplates?
    Thanks.

    Hi P V,
    Need really your input..Could you please share the program to update the variants?
    thanks

  • Add a dinamic variant in an ABAP  program

    Hi all,
    I want to run an ABAP program in a process chain. The problem is that the input parameters should be dynamic. When you run the program you have to put one date.
    When you ran the process chain you have to put one day before today in the record. The problem is that I can’t add a ABAP program in the variant. I would like to use this program several times, so in each case the input parameters is different (not always the days before)
    Can someone help me?
    Thanks in advance.

    Hi Pablo,
       Goto perticular ABAP program and provide varian name and click on Variant Attributes -->> Selection variables -->> and click on tranfic lights for D(Dynamic Date Calculation).
       Here you change values dynamically for Date variables only.
    Hope it Helps
    Srini

  • ABAP program created in one system want to trigger from other system

    Hello,
    I have created ABAP program in ECC server internally it is using function module to update table.This ABAP program has 2 variants.
    I wnat to trigger this ABAP program from BW . How to idenfied an abap program which is return in system1 into other system2.So that it can be executed from BI.
    Thanks.

    There are ways to do this.
    Create an RFC in R/3 system (Tcode: se37 or read forums for sample). Create an event in sm62 (choose customer event) - then schedule your R/3 program (with whatever variant you want) in R/3 to trigger it when the event raised.
    Within the RFC (R/3), you need to trigger the event -
    Raise event to execute background jobs running under this event id
    w_eventid type btceventid value 'ZCUSTOMEVENT'.
        call function 'BP_EVENT_RAISE'
          exporting
            eventid                = w_eventid
          exceptions
            bad_eventid            = 1
            eventid_does_not_exist = 2
            eventid_missing        = 3
            raise_failed           = 4
            others                 = 5.
        if sy-subrc <> 0.
        endif.
    in BW - Create a program - Call the RFC (created in R/3). You can even add this to your process chains.
    CALL FUNCTION 'Z_RFC_IN_R3'
          DESTINATION p_dest
          IMPORTING
          XYZ = XYZ
          TABLES
          IT_X = IT_X
    p_dest being your R3 destination (this is RFC maintained in sm59 for your R3 client)....
    Good luck. Quite a bit of work but works perfect.

  • How to trigger an ABAP program in a Process chain

    Hello Forum,
    1. In a process chain, if a program fails, how can we re-run it?
    2. If the process preceeding the ABAP program fails, how can we start the program?
    3. If an Infospoke fails in a process chain, how can we trigger that?
    Thank you,
    Its my pleasure to assign points,
    raj

    Hi,
    1. U have to first check whats the reason for the failure. check in the monitor screen details button, the error message will be displayed, check the error, correct it. and to proceed with further right click on the subsequent process use Repeat option , the loads will get continue.
    2. same here, if it fails check the reason, sometimes if two parallel process trying to access the same program Lock may occur, stop one process, once its done start the second process, use the transaction code SA38>select ur ABAP program, the corresponding variant->this is for running the ABAP program in the backgroud..if u want to run direct means Select the Process types Under the general services u find an ABAP program
    3. same here too u should find the reason why it fails, and rectify the error, and use the repaet option to proceed with further.

  • Is there any way to run abap program in dialog process with process chain?

    Hi.
    I just want to run custom abap program in every 30min.
    so I made process chain and connect abap program.
    but it returns NOTHING when background running.
    the program has ABSOLUETLY no problem when it's running DIALOG process.
    custom program is modified from sap standard program for my use.
    so complicated and hard to read that I cann't figure out what's problem in backgound job and even hard to debug in background process.
    is there any way to run abap program in dialog process in every 30 min.?
    or call BSP page or call function.
    any solution will be helpful that excuting PROGRAM or FUNCTION or BSP PAGE in schedule job and should running dialog process.
    thanks.
    Lee.

    Hi,
    did you try using sm36 transaction?
    1Give these values in Gereral data
    Create one sample job "SAMPLE JOB"
    Priority "A"
    Execu target - Your application server
    2Click start conditon
    schedule according to ur requirements.
    3.Click Step button
    Give your ABAP program name.
    fill variants if it has any variants.
    if it is useful assign points
    Regard,
    Senthil Kumar.P

  • Calling an ABAP program in PC

    Hi,
    We have a ABAP program variant in our process chain which excutes an ABAP program. The problem is before the actual process of the ABAP program completes the variant is changing to green and triggering the subsequent process. I need to trigger the following process only when my actual program gets completed.
    Can any one suggest a way out.
    Sanjai

    Hi Sanjai,
        Check out what your ABAP program is doing. It is really odd that though the job called for invoking the ABAP program is not finished ... the next process is starting. If my understanding is wrong please correct me here.
       How can you say that the next process is starting before the current process finishes?
    Best regards,
    Kazmi

  • Passing of parameters to custom abap program

    I need to be able to have some parameters i submit off a script and pass then to SAP
    The abap that is run is a custom abap and takes 3 parameters.
    I add a new parameter in the script definition I_LAUFD
    with the value for the parameter i want to pass the custom abap.
    When i submit the job i recieve
    <unknown>: argument I_LAUFD not found
    use the following name=value pairs
    ABAP_RUN
    ABAP_RUN_PRINT etc etc
    I want to submit a parameter to cutom abap how do i go about it? is is possible?
    Thanks in advance
    Joe

    Parameters for ABAP programs are most of the time passed to the ABAP program using a VARIANT. In transaction SE38 you can check which parameters can be set on the VARIANT for your custom ABAP program.
    If you need to set these parameters dynamically before the job starts, you can submit a job to change these values for you from CPS and then start the ABAP program in the next step.
    Which version of CPS are you using?

  • How to maintain variant in table RSRPARAMETRIZA?

    Dear Experts,
    I have to maintain variant in table RSRPARAMETRIZA via ABAP Program. Some thread in SDN advice the class CL_RSR_PARA but I don't know how to use this class to update the field "Content of Variant" in table RSRPARAMETRIZA.
    Please tell me the class or function that can update the variant?
    Thank you,
    Zilla D.

    Hello Narendar,
    Check the following link:
    http://help.sap.com/saphelp_erp2005/helpdata/en/45/adee2396f711d1b46b0000e8a52bed/frameset.htm
    Also, a table control wizard in Screen Painter(SE51) exists, which takes you step by step through the Table Control generation and also creates code, so you can start using the Table Control right away.
    You can either specify a database table, or use an internal table from program.
    If you want to use internal table, it needs to be predefined in your program, before you start creating the table control.
    Reward if helpful.

  • 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

  • From which table could i get all the Variants of a specific ABAP program?

    Hi,
    From which table could i get all the Variants name which belong to a specific ABAP program?
    Thanks.

    Hi,
    Check the table starting with TVAR*.
    Regards,
    Atish

  • From which table could i get all the Variants of a ABAP program?

    Hi,
    From which table could i get all the Variants name which belong to a specific ABAP program?
    Thanks.

    Hi Hoo,
    You can get the variants of a ABAB Program from table <b>VARID</b>. Give the report name to the VARID-REPORT field and you will the list of variants for this report under field VARID-VARIANT and VARID-ENAME is the user who created the variant.
    Otherwise, You can use the function module RM_GET_VARIANTS_4_REPORT_USER to get the variants of a report
    Thanks,
    Vinay

  • Abap program variant error in process chain

    Hi experts,
    I need your help one more time...
    In our process chain, we run the program RSIMPCUST to bring currency and units from the source system to BW. We have created a variant to run this program and call it in the process chain. One of the variant's parameter is the logical system, which was configured as our DEV system.
    When we transport this process chain to QA and run it, the variant continues to refer the DEV logical system, and not the QA logical system as it should.
    any ideas?
    Thanks!
    Thiago Braga

    Values in variants are not converted.  You can use the same variant in your ABAP program, but you need to change the value in the parameter for logical system in each system you transport the change to.  The only alternative is to create a logical system name in SM59 that is the same in all your BW systems but it refers to the local R/3 system.
    In other words, you will have two logical systems in your BWD system pointing to your R/3 Dev.  Let's call them R3DCLNT100 and R3SYSTEM, where R3DCLNT100 is also the source system (in RSA1).  You can use R3SYSTEM in your variant for your ABAP program.  In your BWQ (test system), you will have two logical systems also, R3QCLNT100 and R3SYSTEM, where R3QCLNT100 is also your source system.
    Does this help.

  • ABAP program to take input parameter from variant, execute KSB1 and export

    Hi Friends,
    My client asking  change request in CO
    The Change request is "ABAP program to take input parameter from variant, execute KSB1 and export the output into an excel sheet and park the document in a designated location"
    Pls let me know  actually i am a FICO consultant what i can do in this change request
    Thanks,
    Santi

    Hi
    First I dont you would need to create a ABAP to generate the report in Excel.
    You can look at this option. Execute the report Go to->Change Layout, Click on the view option, On the Preferred View Select Microsoft Excel, Save the layout, provide a layout name with /XYZ.
    Now when you want to execute KSB1 with excel, just execute KSB1 with /XYZ layout, it would open in Excel, export to which ever location you want.
    Or just simply save the report as Excel using the Excel button on the tool bar.
    Regards,
    Suraj

  • What is variant in ABAP Program Process Block in Process Chain?

    I wrote an ABAP program:
    REPORT ZTEST,
    PARAMETERS:  PROC(80) TYPE C.
    I can test this PORGRAM from SE38, it shows me a pop-up screen for PROC and I can enter a value and execute.
    Now I want to call this  program ZTEST from a process chain. In Process Chain Selected a Process u201CABAP Programu201D. It asks me program name and Program variant, I entered Program Name as ZTEST and
    Program variant as a character string HELLO.
    When I execute Porcess Chain, ABAP Program errors saying that variant HELLO not found.
    What is Program variant in ABAP Program Process in Process Chain?
    Thanks,

    Dont get confused here.
    Variant name is not which you are pasing to the program.
    You enter some values inside the variant and you specify the program to take the input from the variant.
    Suppose you have to pass 10 parameters to a program.
    user1 creates a variant " hello1" which contains his own selection for the 10 values
    user2 creates another variant "hello2" which contain his own set of selecion values.
    When we use this program in PC, you can use the variant user1 or user2 as per our requirement.
    please check if you are giving variant as input or the proc value.
    Hope this helps,
    Sri....

Maybe you are looking for

  • How to share iTunes library between accounts

    Lots of various ways have been sugested but none kinda work the easy way i was looking for. So, here's what i did and it works great... so far. (sorry if this is a repeat of something somebody has already said, if so I didn't find it): 1- moved the i

  • No Windows machines in Finder/Shared - but lots of clues

    Like many, I am having problems on my home LAN getting Windows PCs to show up automatically in Finder/Shared. I've scoured these boards & many others looking for the solution but I'm still frustrated. My current thinking is that this must somehow be

  • Invisible pen drive

    Hi all, I have a 2Gb kingston pen drive that used to be seen normally by my imac. But something happened after one operation of file transfer: the transfer window froze, the transfer stopped and now my pen drive is no longer recognized by the compute

  • Pdf.js breaks pdf functionality with no recourse

    I came into work today and lo and behold, after the obligatory but unwanted and unnecessary monthly update from FireFox, PDF files are behaving very differently: not rendering, freezing up, not returning search results, etc. So after spending a half

  • Hard reset official belle on N8, how do I install ...

    After I upgraded to Belle and installed all my apps (Nokia Maps, Communicator, whatsapp...) I had less than 40mb on my C: and my N8 stopped multi-tasking, seriously, I couldnt use more than 1 app at a time! anyway, I ended up doing a hard rest, and g