Clear BPS variables values

I wrote an ABAP program to clear BPS variables values defined for the user.
      DATA:
      lr_variable TYPE REF TO cl_sem_variable.
* Get variable instance
      CALL METHOD cl_sem_variable=>get_instance
        EXPORTING
          i_area       = I_AREA
          i_variable   = 'ZPVDEP' "z_v_var
        RECEIVING
          rr_variable  = lr_variable
        EXCEPTIONS
          not_existing = 1
          OTHERS     = 2.
      IF sy-subrc <> 0.
* do s.th., eg send a message
        EXIT.
      ENDIF.
* delete the restrictions
      CALL METHOD lr_variable->set_user_restriction
        EXPORTING
          i_user   = sy-uname
          i_delete = 'X'
        EXCEPTIONS
          failed   = 1
          OTHERS   = 2.
In BPS0:
1. i restrict the variable with some values
2. execute planning function to clear the variable values
    But the restriction remains.
3. When i do /nBPS0 the variable restriction clears
As far as i understand the problem is in buffer. How can i clear buffered values of the variable in ABAP program?
i tried to call  method CL_SEM_VARIABLE=>RESET_BUFFER.
but it doesn't work.
Thanks

Also i try such an ABAP code
      SELECT *
      FROM upc_var_cha_sel
      INTO CORRESPONDING FIELDS OF TABLE it_var_cha_sel
      WHERE    area    = I_AREA
           AND var     = ls_exitp-CHAVL
           AND varuser = sy-uname.
      IF sy-subrc = 0.
        DELETE upc_var_cha_sel FROM TABLE it_var_cha_sel.
        CALL FUNCTION 'DB_COMMIT'.
      ENDIF.
      REFRESH it_var_cha_sel.
      SELECT *
      FROM upc_var_cha_act
      INTO CORRESPONDING FIELDS OF TABLE it_var_cha_sel
      WHERE    area    = I_AREA
           AND var     = ls_exitp-CHAVL
           AND varuser = sy-uname.
      IF sy-subrc = 0.
        DELETE upc_var_cha_act FROM TABLE it_var_cha_sel.
        CALL FUNCTION 'DB_COMMIT'.
      ENDIF.
But the problem is the same
In BPS0:
1. i restrict the variable with some values
2. execute planning function to clear the variable values
But the restriction remains.
3. When i do /nBPS0 the variable restriction clears
Thanks

Similar Messages

  • How to clear the variable value in session store?

    I'll try to build form for search. There are LOV and
    search button on form. When user don't select anything then push
    search button, I'd like the report to show query everything. I
    mean the report will show like condition where id like '%'.
    And I send variable between form to report by using session
    store.
    I select nothing in LOV but value that return by LOV is
    not null. It's in stead of old value of LOV.
    Please tell me.. How to clear the variable value in
    session store? I'd like to set it to null. If you have greater
    way to do like this, please tell me.
    Thank you.

    Please suggest on this..
    Thanks.

  • How to get BW-BPS variable value into Visual Basic?

    Hello,
    Scenario:
    Time characteristic 0FISCYEAR has a variable ZVFYEAR. In layout this time characteristic is defined as DATA COLUMN. When user changes VFYEAR variable’s value i want to get the value of variable into Visual Basic and to format header for table in the layout.
    How to get BW-BPS variable value into Visual Basic?
    Could you help me?
    Thanks in advance.
    Best Regards,
    Arunas Stonys

    Hi,
    If i understand your requirments correctly ,you need to read the value of the Variable and Put it on the layout. Here is how  i would solve this,
    Read the value of the variable using an ABAP program.The logic for this would be to read the variable value and post it on the layout on a cell.You can do this by calling the ABAP program on opening the layout.this can be done using LB_EXIT_FM  T-code. Now using the  SAP delivered SAPAfterDataPut  macro, read the cell in which you have placed the variable values and assign it to the necessary values you want to on the layout.All this will be done before the layout opens.
    Hope this helps.
    regards
    Sai Vishnubhatla

  • BPS - Variable value selection

    Is there a way, where a user (e.g. admin) could make a selection for a variable from multiple values in a dropdown in a web application, and have the selection enforced for all users?
    William Lee

    Current options, whether bps0 or uploading, are a little hard to swallow for the client, especially when the application is already web-enabled. Hope your how-to paper will address this typical admin/user relationship and in essence enable on-web adminstration of variable values. Looking forward. Thanks Marc.
    William Lee

  • How to remove Variable-Values prior to transporting to prod-system?

    Hi specialists,
    I've got the following problem:
    We've got a mixed BEx-client-environment with user using BEx 3.5 as well as BEx 7.x.
    So I create workbooks with BEx-Analyzer 3.5 and transport them from the developement-system to the production-system.
    The problem: Obviously the variable-selection that I used at last in the developement-system is saved in the workbook. So let's say I tested the query in the dev-system with "DE01" as value for the company_code on the variable screen, then this value is saved in the workbook and transported to the prod-system.
    In the production-system the value is not replaced anymore by the users permitted company-code values (the variable is based on the users permissions), but the user has to remove this "DE01" manually and has to enter all his personal company-codes manually - which makes the permission-bases-variable senseless.
    Even if I clear all variable-values in the developement system (which is not possible for mandatory variables) prior to saving the workbook, the issue is the same: This time empty fields are presented in the prod-system, but the permission-based-variable isn't set correctly - the field stays empty (=exactly as it was when I saved the workbook in the dev-system).
    So, how can I clear the variable-screen-values before I save and transport the workbook to the prod-system? The only way (and it is certainly not the recommended one) i found: If I cancel the query at once after having confirmed the variable-screen and save/transport that query, then the variables seem to be really empty and the permission-based variables in the prod-system work.

    So, when user run the report in production, they will have to remove # for mandatory variables and put thier value.
    Mh - most of our reports have variables for "company_code","sales_org" (for example).
    Normaly this fields are not mandatory but optional.
    But: Normaly if the user opens such a variable-screen (for the first time) the company_code and sales_org are preset according to the users permissions for this chars.
    If I follow your description, then the variable-screen would open with "#" or "" - but wouldn't be replaced by the user's permitted values anymore :/ - hence the phone rings because the users didn't manage to restrict the variables to their permitted values.
    Maybe this is a case for an oss-message for the area BW-BEX-ET-USAB Userability Frontend....

  • Bps variable by authorization

    Dear Friends,
    I can tell a bps variable value is authorization-derived.
    How can  I know straightaway what is the authorization / object tied to this so that I can check / set the  authorization?
    Please can you give me some hints.
    regards
    H.C

    <FONT FACE = "Tahoma", Font Color = "Blue">
    Hi<br>
    In BW 3.x, you can even go to t-code SU01, Enter User ID (whose authorizations have to checked) and press the Display button at top to see User Profile.<br>
    In the next screen, you can navigate to different tabs like roles, profiles etc to get more details. If you double click on any role, system will display the specifics of that role.
    <br><br>
    Hope it helps.<br>
    Cheers Abhijit</FONT><FONT FACE = "Verdana", Font Color = "Red">
    Please assign Reward Points if I deserve them in your opinion
    </FONT>

  • How to clear variable value in BPS WIB?

    Hi Experts:
                    I want to clear variable value in BPS,and I use this function 'API_SEMBPS_VARIABLE_SET' to set its value to '#'. I got 1 question:
         After I changed this variable manually in IE, the system 'remember' this variable in this program, so the function 'API_SEMBPS_VARIABLE_SET'  didn't work. I checked the table 'UPC_VAR_CHA_ACT' and found there is not any corresponding item for the current user and value.
    Allen

    Hi Bauke,
    Actually I want to do Password Encryption functionality.
    For that I have 1 Java script file.On Java script validation I want to pass password value from client side to server side as,
    <head>
    <script type="text/javascript" language="JavaScript" src="MyJSFile.js">
    function submitForm(element)
    var me = document.getElementById(passwd);
    If(!me)
    alert('Please enter Password);
    else
    Some password logic I will do here.
    </head>
    <f:view>
    <BODY......
    <h:form id="createUserForm">
    <h:commandButton id="save" value="Save" action="saveactionMethod " onclick="submitForm(this)" />
    <h:inputSecrete id="passwd"
    value="#{createUsrFormBean.password}"/>
    </h:form>
    </body>
    </f:view>
    But the Java script code is not working.I mean If I put nothing in password textbox the alert is not firing.
    My code is wrong ?
    Thanks
    Sandip

  • Clear Flag for BPS user-specific variable values

    Hi Experts!
    I have a 'user-specific variable' settintg with the flag 'on', then the user should choose only one value. 
    But now I need execute an abap program which read all values available for this variable. For this reason, I need clear this flag with abap code, and after put on again.
    Could somebody show me a small piece of abap code for this?
    Thank you in advance!

    Hi,
    Analysis of your question:
    <i>Second line of your question "...<b>which read all values available for this variable</b>".</i>
    1) When you mean you wish to read all possible values with which the variable could be filled up, then please use the Function Module:
    UPC_CHA_VALUES_GET 
    The parameter <b>ETO_CHAVL</b> would then return all master data of the variable's characteristic
    2) When you mean you wish to read all the variable values "<b>selected from the user in the past</b>" then use the function  module
    API_SEMBPS_VARIABLE_GET_DETAIL
    Here the table <b>ETK_VARSEL_ALL</b> returns you all the values selected by user in the past. The "<b>current selected value</b>" for the user is stored in the table "ETK_VARSEL".
    Check out these How-To Documents. If these dosen't suffices, then please elaborate your requirement, for me to write a ABAP Pseudo-code.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/324de5a1-0201-0010-dc9a-a093cde87bb5">How to use Reporting Variables in BPS</a>
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/650ee690-0201-0010-4bb7-83c3e2a74039">How to variable of type Exit</a>
    Many regards.

  • Clear BPS user-specific variable values

    Hi,
    Is there a way to quicly delete all the variable values (user ID and cost center) for a user-specific variable in BPS without access to the configuration (BPS0) or do I need to write a small piece of ABAP for that ?
    Thanks
    David

    Hello David,
    You either have to access the BPS0 and delete each of the variable values or write a little ABAP program. You could include this ABAP in a planning function type Exit so the user can press a button in a web interface or planning folder to delete the settings. The coding using internal methods you need is:
    DATA:
    lr_variable TYPE REF TO cl_sem_variable.
    Get variable instance
    CALL METHOD cl_sem_variable=>get_instance
    EXPORTING
    i_area = 'name of area where the variable is defined'
    i_variable = 'name of the variable'
    RECEIVING
    rr_variable = lr_variable
    EXCEPTIONS
    not_existing = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    do s.th., eg send a message
    EXIT.
    ENDIF.
    delete the restrictions
    CALL METHOD lr_variable->set_user_restriction
    EXPORTING
    i_user = 'user name, e.g. sy-uname'
    i_delete = 'X'
    EXCEPTIONS
    failed = 1
    OTHERS = 2.
    Best regards,
    Gerd Schoeffl,
    SAP NetWeaver RIG BI

  • SEM-BPS Variable buffer clearing issue

    Hello experts,
    I have a situation where my user wants to use BPS functionality to perform direct data entry and validations. I know it's not standard, but that's not the point.
    How do I clear the variables buffer so that each time the user enters the plan layout they are requested to enter fresh variables to determine the selection combinations?
    Is there a function module?
    What tables store this info?
    Any suggestions will be appreciated. Thanks!

    I guess I'll answer my own question.
    There are two tables I've found that holds variables they are as follows:
    UPC_VAR_CHA_SEL - Variables - Selections
    UPC_VAR_CHA_ACT - Variables - Restricted Values
    A function module was created to read these tables and delete the values, based on the userid, hence causing a refresh.
    The function module needed to be executed in the planning folder on 'save'.
    This has worked fine.

  • Upload variable values to BPS

    Hi All,
    Is there any way to upload values to BPS variables?
    I know we can definetly upload some values to Bex varialbes by flat file (or) personlaization.
    Is the same can be done to BPS variables?
    Any help is greatly appreciated.
    Best Regards,
    Reddy.

    Hi,
    no. If you have static Varible Selection, and one does not want to fill the variable table in BPS0, you can create small program to update these tables:
    UPC_VAR_CHA_ACT
    UPC_VAR_CHA_SEL.
    The question is: which one is faster, manual entry in BPS0 or to create a program to update those tables?
    If you have dynamic selection of a variable (i think this is the most situation happened), it is suggested to use Var exit.
    Best Regards,
    Suan Liono

  • SEM BPS locking even after user switches to a new variable value

    Hi,
    This is locking related question & appreciate any kind of suggestion.
    Users are locking previously planned variable value even after changing to a new value which is causing another user with a  locking issue.
    I've a variable GROUP defined at planning level & included in the planning folder.
    let's say USER1 is planning for GROUP1 & saved the data after planning.
    same user has changed the variable to GROUP2 & is planning now without leaving UPSPL session.
    at this point, when USER2 tries to plan for GROUP1 & is faced with a message "USER1 is currently processing the data".
    currently, USER1 is planning for GROUP2 right? so, why it's still giving locking message (locking GROUP1).
    I even followed SAP note 635244 & created a DB table & included GROUP characteristic in to the table but of not much help.
    even after this, I still see that USER1 is locking both GROUP1 & GROUP2 in report UPC_ENQUEUE_READ.
    Appreciate if any one can share your ideas to deal this kind of issue.

    Hi Hari,
    You indicated in your 1st post, that User 1 is able to access both Group 1 and Group 2. I am assuming in your configuration, multiple users share the same values in the Group variable and they are making selections on execution of your planning application.
    If this is the case, User 1 switching to Group 2 using, e.g., a drop-down menu does not remove the lock on Group 1. Hence User 2 will get the lock message.
    You defining a table in DDIC only specifies Group as a lock relevant characteristic. It will not prevent locking in this fashion.
    The probable options could be:
    1. Consider dividing Groups amongst users, and use user-specific values for your variable;
    2. Consider additional characteristic that will separate data sets.
    The central question I would ask about this planning process, is why would different users be editing the same group at the same time? Is there a way to differentiate their planning needs? That might help in your modeling.
    Hope this helps.
    William Lee

  • Issue in BPS Variables....Please anybody reply...this is really urgent(SOS)

    <b>Hi dear friends, This is really a urgent problem and crucial Please anybody can share their ideas or atleast some inputs/ clues to clear the cobwebs in my understanding.</b>
    I am facing problem in BPS Variables.
    I created the variables 1.zqbs- employee responsible --->Userentry/default value.
    2. zconpar-- contact partner----
    > Replacement type is user exit(Function Module)
    3. zconpar-- contact partner----
    > Replacement type is user exit(Function Module)
    ZCONPAR: I am using the zqbs, planing area, characterstic name as a import parameters and i am exporting the output value to 0BP_ACTIVIT through zconpar
    ZCONPER: I am using the zqbs, planing area, characterstic name as a import parameters and i am exporting the output value to 0BP_CONTPER through the zconper.
    These two variable info objects are calling in the planning layout lead column.
    based on contact partner it should display contact persons for the contact persons we are applying the conditions(bp_reltype = bur001,bp_reldir = 2) to filter the contact persons.
    In my case i am getting 3 values for the contact partner like 1000, 2000, 3000.
    i am getting 2 values for the contact persons if i run the variables individual.
    note: if i run BPS0 its going into loop and displaying multiple data means for 1 contact partner its applying all contact persons. at final it showing records like contact persons X contact partners means it showing more unvalid records.
    how to avoid this situation.
    contact partner contact person bp_reltype bp_reldir
    1000 xxxx bur001 2
    2000 yyy bur002 2
    3000 zzz bur001 2
    it should display like this
    1000 xxx
    2000
    3000 yyy
    but it showing
    1000 xxx
    1000 yyy
    1000 zzz
    2000 xxx
    2000 yyy
    2000 zzz
    3000 xxx
    3000 yyy
    3000 zzz
    Please anybody who have even a vague idea of solution can respond to this immediately.----SOS----
    Even your smallest hint is greatly appreciated.
    Yours truly,
    your friend Bharath.

    Thanks for the reply and I would trying these consistency check out again as a background job but I have already done these checks and have not been able to find any inconsistencies in the planning area or the master planning object structure. the problem is this as I have put in the SAP message:
    "We have generated CVCs from a text file using the load work list functionality  Due to some internal formatting issues few erroneous CVC were generated. On going through the concerned notes we have come to the conclusion that we would have to delete the erroneous CVC and recreate new CVC.
    The issue that we are facing is that we are not being able to delete the erroneous CVC from the MPOS as they are not visible in the display mode. On other hand we do see the erroneous CVC in the planning book, which is not at all understandable because if there are no CVC then why are we seeing them in the planning book."
    Please let me know if this is a problem that has been faced by anybody in SCM 5.0
    Thanks

  • Buffered variable values in the web

    Hi,
    As a follow-up to my last posting on the BPS Performance on the web, we have given a list of lower cost center nodes to our users (it did not solve the problem as we still have issues performance and we logged an OSS Customer message but it is a little better).
    Is it possible to clear the last variable values a user selected from the buffer each time they open a new web application ?
    Even if the first page of my web application only includes variables selectors and my layouts are on other pages it seems to take more time to open the first page with higher nodes.
    Thanks
    David

    Hello David,
    SAP development has recently implemented a solution for "clearing" the variable i.e. setting it back to "All Values". The solution is described in SAP note 755459.
    Regards,
    Marc
    SAP NetWeaver RIG, US BI

  • Multiple BPS variables in Bex web report

    Hi Guys,
    I am trying to have a Bex report use the BPS variables in the web interface. I have managed to do so with 1 variable, but we have a number of variables.
    I have created the code below to get the result. however this doesn't seem to work.
    Can anyone help me with this issue.
    Gert van de Vreede
    <iframe
    id ="Z_WA_BPS_GRSALPR001"
    src="/sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=Z_WA_BPS_GRSALPR001"
    style="width:1200;height:300">>
    </iframe>
    <script language="JavaScript" type="text/javascript">
    function varValueConvert(dispValue){
    /* Expected formatting of variable selector: Text(Key) or Key
    If there are more than one (...) expression the first is taken.
    var keySection = dispValue.match(/\(.*?\)/);
    if (keySection){
    var keyValue = keySection[0].replace(/\(|\)/g,"");
    alert(dispValue + ' : ' + keySection + " : " +keyValue);
    return keyValue;
    } else {
    alert(dispValue);
    return dispValue;
    var frame = document.getElementById( 'Z_WA_BPS_GRSALPR001' );
    var url = '/sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=';
    var queryVar1 = '&VAR_NAME_1=0SALESORG&VAR_VALUE_EXT_1=';
    var queryVar2 = '&VAR_NAME_2=ZZHOUSE&VAR_VALUE_EXT_2=';
    var queryVar3 = '&VAR_NAME_3=ZZBRAND&VAR_VALUE_EXT_3=';
    var queryVar4 = '&VAR_NAME_4=ZZLINE&VAR_VALUE_EXT_4=';
    var queryVar5 = '&VAR_NAME_5=ZCOREC&VAR_VALUE_EXT_5=';
    var queryVar6 = '&VAR_NAME_6=ZSUBCAT&VAR_VALUE_EXT_6=';
    var queryVar7 = '&VAR_NAME_7=ZZMARCAT&VAR_VALUE_EXT_7=';
    var queryVar8 = '&VAR_NAME_8=0VERSION&VAR_VALUE_EXT_8=';
    var appl = 'Z_WA_BPS_GRSALPR001';
    var bpsVarvl1 = '<%=descr(salesorg_var/value)%>';
    var bpsVarvl2 = '<%=descr(House_var/value)%>';
    var bpsVarvl3 = '<%=descr(Brand_var/value)%>';
    var bpsVarvl4 = '<%=descr(Line_var/value)%>';
    var bpsVarvl5 = '<%=descr(Core_cat_var/value)%>';
    var bpsVarvl6 = '<%=descr(Sub_cat_var/value)%>';
    var bpsVarvl7 = '<%=descr(marcat_var/value)%>';
    var bpsVarvl8 = '<%=descr(VarvlSel7/value)%>';
    bpsVarvl1 = varValueConvert(bpsVarvl1);
    bpsVarvl2 = varValueConvert(bpsVarvl2);
    bpsVarvl3 = varValueConvert(bpsVarvl3);
    bpsVarvl4 = varValueConvert(bpsVarvl4);
    bpsVarvl5 = varValueConvert(bpsVarvl5);
    bpsVarvl6 = varValueConvert(bpsVarvl6);
    bpsVarvl7 = varValueConvert(bpsVarvl7);
    bpsVarvl8 = varValueConvert(bpsVarvl8);
    // create URL
    url = url + appl + 0SALESORG + bpsVarvl1 + ZZHOUSE + bpsVarvl2 + ZZBRAND + bpsVarvl3 + ZZLINE + bpsVarvl4 + ZCOREC + bpsVarvl5 + ZSUBCAT + bpsVarvl6 + ZZMARCAT + bpsVarvl7 + 0VERSION + bpsVarvl8;
    // remove possible white spaces
    url = url.replace(/ /,"");
    // alert('Generated URL: ' + url);
    // set source attribute of iframe to new URL
    frame.src = url;
    </script>

    Hi Gert,
    the following line is wrong:
    url = url + appl + 0SALESORG + bpsVarvl1 + ZZHOUSE +
    bpsVarvl2 + ZZBRAND + bpsVarvl3 + ZZLINE +
    bpsVarvl4 + ZCOREC + bpsVarvl5 + ZSUBCAT +
    bpsVarvl6 + ZZMARCAT + bpsVarvl7 + 0VERSION +
    bpsVarvl8;
    Try this:
    url = url + appl + '0SALESORG' + bpsVarvl1 + 'ZZHOUSE' +
    bpsVarvl2 + 'ZZBRAND' + bpsVarvl3 + 'ZZLINE' +
    bpsVarvl4 + 'ZCOREC' + bpsVarvl5 + 'ZSUBCAT' +
    bpsVarvl6 + 'ZZMARCAT' + bpsVarvl7 + '0VERSION' + bpsVarvl8;
    Regards
    Marc
    SAP NetWeaver RIG

Maybe you are looking for