cancel
Showing results for 
Search instead for 
Did you mean: 

Web, SAVE, Javascript, 'onclick' executes not more than one event

Former Member
0 Kudos

Dear all,

In the BPS Web Interface I would like to integrate a copy function with the SAVE Function under one button or link. I tried to implement an How-To document (planning sequence behind SAVE Button) but that did not work.

I found on SAP Developer Network a reply by Steve Scheidig on the same kind of issue where he suggested to use Javascript in a HTML subcomponent of the Web Interface. I don't have much knowlegde of Javascript but with the code he suggested and by looking on the Internet I made the following code:

<i><script language="JavaScript" type="text/javascript">

function sequence1() {bspSubmit('MakeFinalJava');bspSubmit('SaveButton1');}

</SCRIPT>

<div style="position:absolute; top:0px; left:12px; width:140px">

<a href="#" onclick="javascript:sequence1();" class="sapBtnStd" OnMouseOver="javascript:window.status = 'Save Data'; return true;" title="">

<nobr>Save Project Data</nobr>

</a></div></i>

The issue is that only one of the two functions (Or MakeFinalJava or SaveButton1) is executed. And always only the second in row (in this example SaveButton1). The first one seems to be overwritten by the second. First I had them separated, but because of this issue I put them in a function (sequence1()). But that also does not work.

Does anyone of you know how to solve this with Javascript?

Regard,

Robert Meyer

Message was edited by: Robert Meyer

Message was edited by: Robert Meyer

Accepted Solutions (1)

Accepted Solutions (1)

former_member93896
Active Contributor
0 Kudos

Hello Robert,

forget about the JavaScript solution. It does not work.

The right way on implementing is described in the how-to document. Why is it not working for you? Do you get any errors?

Regards

Marc

SAP NetWeaver RIG

Former Member
0 Kudos

Hello Marc,

I built a new application class called ZCL_GLOBAL_SEQUENCE.

In the Web Interface builder on the highest level I changed application class CL_UPWB_BSP_APPL into the new created one ZCL_GLOBAL_SEQUENCE.

Further, I put the button with the desired planning function on 'hidden' and I changed the component name into one with the _SAVE extension.

Once running the Web Interface in Internet Explorer I get the message 'Internal Error' (with a green light) in the message tray (error message UPBW002).

Further, when I push the Save button, the data is saved but the desired planning function is not executed before the save. I get the messages: 1) Internal error (green light), 2) Data saved 3) Internal error (green light).

I don't know what the problem is. Do you have any idea?

Regards,

Robert

Answers (2)

Answers (2)

Former Member
0 Kudos

You have to use the global sequences in the BPS_WB.the global sequences contain the function you want to run before save then you create the function pushbutton and then assign the global sequences to the pushbutton.

Former Member
0 Kudos

Hi Robert,

We have implemented the How to paper and it work for us, did you created the global planning sequence and put the planning sequences in your function pushbutton at BPS_WB?

Former Member
0 Kudos

Hello JW,

You don't have to use a global planning sequence, right? We used 'Global Sequence' in our name for the application class but that's because you first execute a function (or planning sequence) and then use the SAVE function. Maybe that name is misleading.

I have created a button that executes a single function. This button has the extension '_SAVE' and is hidden. With the use of the new created application class this should work.

Regards,

Robert