cancel
Showing results for 
Search instead for 
Did you mean: 

Planning data not saved if Planning sequence has errors.

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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"); }

Former Member
0 Kudos

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

former_member265529
Contributor
0 Kudos

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

TammyPowlas
Active Contributor
0 Kudos

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.