Skip to Content
0

Planning data not saved if Planning sequence has errors.

Dec 14, 2016 at 04:47 PM

522

avatar image
Former Member

Hi,

In Design Studio 1.6 we have a button raising a planning sequence and save data.

In the planning sequence we do some checks (eg amount negative) and in that case we raise an error message. I would like to prevent the command save to be run if some errors occurs in the planning sequence. How could I achieve this in DS ?

thanks in advance

Mat

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Tammy Powlas
Dec 14, 2016 at 05:55 PM
0

Please see blog https://blogs.sap.com/2014/05/29/planning-in-ds-13-using-different-script-methods-for-planning/ - in theory you could place some IF statements to check for these conditions and show application alerts.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 14, 2016 at 06:07 PM
0

Hi FR ALTI,

For planning through design studio, you must have planning functions with predefined code that does writing data to your cube and more.

Those functions will call the ABAP codes written in it in BW.

So if you have added the code to check data as first step and terminate it with error if negative there is no need to define a sequence.

Or if you have the check as separate function in BW, you can add a if..else in code and call the write function in planning only when the check is successfull.

Thanks,

Poovarasan

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 14, 2016 at 06:31 PM
0

Hi

Thanks for your answer. I don't think it will solve my issue. And I do not want to have abap function as planning sequence does the job.

My planning sequence has three steps :

- calculate depreciation

- Check that no negavite amounts have been input

- calculate currency conversion

If I use it as is in Design Studio, data are saved even if the second step is in error. That's why I was looking for a way to retrieve messages and prevent from saving in case of error messages. We did that in Analysis for office the following way (VB) :

Sub Depreciation()

Dim lResult As Long Dim

lResult1 As Variant lResult = Application.Run("SAPExecutePlanningSequence", "PS_1")

lResult1 = Application.Run("SAPListOfMessages", "ERROR")

If IsArray(lResult1)

Then If UBound(lResult1) > 0 Then 'MsgBox ("Planning Function ended with error")

Exit Sub

End If

End If

lResult = Application.Run("SAPExecuteCommand", "PlanDataSave")

End Sub

Mat

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 26, 2017 at 01:37 PM
0

Hi,

I tested the following code behind a button and it worked.

PS_1.execute();

if ((PS_5.execute()== false)) {

APPLICATION.alert("error in PS"); }

else{ Planning.save();

APPLICATION.alert("Data saved"); }

Share
10 |10000 characters needed characters left characters exceeded