cancel
Showing results for 
Search instead for 
Did you mean: 

Release locks after SAVE or REFRESH in Web Planning

Former Member
0 Kudos

Hi All,

If one has a variable selector where planners can select the profit centre they plan against, it seems that as they change the chosen centre(i.e. select a new profit centre), the system does not release the locks of the old centre, and the locks are only released when the user exits the web page.....?

So even though they may no longer be planning against centre X, nobody else can access this centre until they log out...

Does anyone know how to force a release of the locks once the center (say centre X) is no longer the active centre in the variable selector (which is flagged as 'user restriction required').........?

Thanks and regards,

Rael

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

What I did for one of my project is to use the FM to release lock and put it behind a button in WIB. It worked fine and we never identified a problem with that.

Regards

Anthony

Former Member
0 Kudos

Thanks Anthony,

That is exactly what I have done. Linked a FM to a button which executes each time a user navigates away from a profit centre - thereby releasing the centres locks...

Regards,

Rael

Former Member
0 Kudos

Hello Rael,

I have the same problem - and tried FM 'API_SEMBPS_REFRESH'

but afterwards the layout was not available anymore!

Can you tell me please which FM you used.

Thanks

Steffen

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Michael,

The solution I proposed was for HTML specific layouts, not Excel OWC, so Gregor's correct warnings don't apply in this instance.

As for trying to save for one user at a time, besides the more complicated ABAP route, you could try to create your planning solution using user defined variable lists in the Planning Levels.

This means that on calling the 'save' or 'refresh', only those centres/materials (or whatever you have set up) for the user who is logged on going to be saved....

Good luck.

Rael

0 Kudos

Hello,

just some remarks on usage of BPS API functions save and refresh: These function where designed for batch processing with planning functions (mass data). Refresh destroys all internal detail applications with state. This means e.g. that in a planning folder you will kill manual planning -> dump. In a Web Interface with the OWC you will also kill manual planning since the backend has a state in this case (this explains the 'there is not instance of the planning processor' message). Without the OWC the call of save, refresh might work.

Regards,

Gregor

Former Member
0 Kudos

Hi,

Gregor makes an excellent point. I have a similar situation where I want to release locks when I navigate to a new page. However I cannot use the save / refresh API's because they save for all users. So if multiple users are in planning it will save and refresh for all. Does anyone know of a way to just save and refresh for 1 user????

Thanks,

Mike.

Former Member
0 Kudos

Hi Shashi,

Right, in order to release the locks on each change in a BPS variable selector, you could do something like the following:

1.Create a text component (HTML=true) and insert the following functions. Probably best to place this component somewhere near the top of your page.


<script type="text/javascript">
//FUNCTION TO POPULATE CUSTOM DROPDOWN BOXES  **
function copyoptions (bpsvariable,custombox){
//declere the relevant option boxes
        var x = document.getElementById(bpsvariable);
        var selecteditem = (x.options[x.selectedIndex].value);
        var y = document.getElementById(custombox);
    
    //foreach existing option in the 'from' box
    	for (i = 0; i < x.length; i++){
    	if (y<i> !='') {
        y.options.length = (i+1); 
        y.options<i>.value = x.options<i>.value;
    	y.options<i>.text = x.options<i>.text;
    	}
    	}
    
    //set the selected value to the same value as selected in the BPS variable
     	y.options.value = selecteditem;
    	}

//FUNCTION SETS THE BPS VARIABLE TO THE SELECTION MADE IN THE CUSTOM //BOX AND THEN EXECUTES THE REFRESH BUTTON
	function setoption(bpsvariable,custombox,refreshbutton){
	var x=document.getElementById(custombox);
	var selecteditem = (x.options[x.selectedIndex].value);
	var y=document.getElementById(bpsvariable);
	y.options.value = selecteditem;

//now call the save and refresh to release old locks
	document.all(refreshbutton).click();
	}

</script>

2.Now create another text component (HTML=true) and place it just after the BPS variable selector relevant for this example (i.e. profit centre in my case).

Insert the following code, but change the capitals in my example to fit your example, i.e. your variable technical name, any name you like for the custom dropdown, and finally a technical name of a function pushbutton you have set up that links to a sequence in BPS0 to run a save and refresh as previously discussed in this SDN thread.


**THE CUSTOM DROPDOWN**
<select class="urDdlWhl" onchange="setoption('BPS_VARIABLE_NAME','CUSTOM_DROPDOWN_NAME','REFRESH_BUTTON');" id="CUSTOM_DROPDOWN_NAME" ct="DropDownListBox" name=" CUSTOM_DROPDOWN_NAME"></select>

**A BUTTON LINKED TO A COPY FUNCTION TO POPULATE THE CUSTOM BOX ABOVE**
<input type="button" value="" id="copytocustombox" onclick="copyoptions('BPS_VARIABLE_NAME','CUSTOM_DROPDOWN_NAME')">

<script type="text/javascript">

//AUTOMATICALLY ‘CLICK’ THE ABOVE BUTTON TO POPULATE CUSTOM BOX**
document.getElementById('copytocustombox').click();

//HIDE THE BPS VARIABLE SELECTOR AND THE FUNCTION BUTTON**
document.getElementById("BPS_VARIABLE_NAME").style.display="none";
document.getElementById("copytocustombox").style.display="none";

</script>

Good luck,

Rael

Former Member
0 Kudos

Hi Shashi,

The solution includes creating a custom html dropdown box, copying the contents of the BPS web variable selector contents into the custom dropdown, and then attaching ones own 'onchange' event attribute to the custom dropdown.

In this way you can then call a function, or in this case a function with the sequence to 'SAVE' and 'REFRESH' on each change in the custom dropdown, i.e., each time the user changes the profit centre selection (i.e. my business case).....

The solution requires a good knowledge of javascripting, and to be honest I would not recommend you use this unless you feel fairly confident on the javascript side.

Your options might be to try and use the BSP extentions, i.e., use the ABAP in the web inteface classes to call your save and refresh on each change in the BPS web variable selectors.

If you do want to go the javascript route, let me know and I will try to write up the whole thing for you....

Regards,

Rael

Former Member
0 Kudos

Hi Rael,

Thanks a lot and we would like to go in the Javascript route.

Our case is to get the locks released, once we navigate away from a page to the next page. We have some pages in our interface, where variables are shared and in some no sharing at all, completely new variables.

Also, like in your case, within the same page, when we switch to a new 'Material Group', we want the locks to be released for the previous material group that the user have planned.

Thanks,

- Shashi

shashi.paleti@wrigley.com

Former Member
0 Kudos

Hi Guys,

Sorry, but I have not received the same error message you have both mentioned. So i don't know whats going on there.

As for my solution, it was on BW3.5 (BW BPS), and what I ended up doing was to have a planning sequence that called API_SEMBPS_POST (save) and then called API_SEMBPS_REFRESH (refresh) on each change in my selectors.

So on each change in a web selector, the variables are reset using the 'save' and then the locks dropped using the 'refresh'.....

Good luck,

Rael

Former Member
0 Kudos

Hi Rael,

Thanks for your reply.

When you say on each change in my selectors, are you calling these APIs Sequence in the variable exit for profit center, or do you have a button, that has to be clicked by the planner to execute the Sequence.

Also, on what kind of planning level, you have written your planning functions that calls POST and REFRESH.

Thanks,

- Shashi

Former Member
0 Kudos

Hi Steffen,

I did use 'API_SEMBPS_REFRESH' to solve my problem.

Does your layout use variable selectors in the header..?

...and are you sure that 'on refreshing' you are not simply setting the variable values back to, for example, not assigned (#), or some other value which is causing the problem with your layouts...?

Good luck,

Rael

Former Member
0 Kudos

Hello Rael,

the characteristics changed by the variable (user selection required) is part of the layout header.

The problem is at the moment a server roundtrip starts e.g. pressing save the following message occurs:

"There is no instance of the planning processor for handle 446710F7CCBD3C7BE1000000C3D93BA4 "

Best regards

Steffen

Former Member
0 Kudos

Hi Steffen,

We are having the same issue. "There is no instance ..." message comes once locks are refreshed using API.

Hi Rael,

We are on SEM 4.0. I hope the version is not different between us. We are just wondering how is it working for you?

Thanks,

- Shashi