Skip to Content

Multi-part conditionals in BPC Logic Script

Aug 18, 2017 at 02:34 AM


avatar image

Hi folks.

I am attempting to improve some code. I have searched around and can't seem to find exactly what I'm looking for, so thought I'd put it up here for the good of the public.

I have some logic (represented below generically by <DO SOMETHING>) which I want to perform, except for a specific pairing of ENTITY and INTERCO groupings.
Let's say: Entities with property X with Interco property Y, or Entity property Y with Interco property X.

I do not like the structure below, due to the repetition of the same code block. So...

Could we use AND (&&) and OR (||) operators to combine the conditions into a single chunk?

Alternatively, is there a way to exit the execution of script logic early? Something like a *QUIT or *EXIT, which would prevent any subsequent execution of commands upon being reached?

Do you have any suggestions for other approaches which would work?




    *IS <> Y

        <DO SOMETHING>




    *IS <> X






For further information, this is on BPC for Microsoft, 10.1.

Looking forward to hearing your responses.
Kind Regards,


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

3 Answers

Best Answer
Elliott Bajema Aug 30, 2017 at 12:31 AM

Update: After reading the help guide, which was actually quite useful, and some experimentation, it turns out that the use of *SUB()/*ENDSUB does exactly what I was asking, in terms of re-useable code blocks. This allowed me to write the core logic once and call it multiple times.

10 |10000 characters needed characters left characters exceeded
Joaquín Price Aug 22, 2017 at 02:44 PM

Hi Elliot.

For your specific example, create a property on ENTITY called "IC" (or however you want to call it) and maintain in it the INTERCO ID which the code should not apply.

Then implement the next code:




Drawback: It will only work for a single INTERCO for each ENTITY.

I haven't tried it, but I think it should work.

Best regards,


Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Joaquín,

Unfortunately my situation is indeed the case in your 'drawback' note.
I simplified it somewhat for presentation above. It is actually all entities with a certain property, which I want to match off against all intercompanies of a different property. So there are multiple possible pairings.
If you replace 'INTERCO' with 'INTERCO.PROPERTY' and ENTITY with 'ENTITY.PROPERTY' above that is the real situation we have here, so I am more concerned with the structure of the logic itself.

Kind Regards,



"(...) which I want to match off against all intercompanies of a different property. So there are multiple possible pairings."

Sorry, I don't understand that part...

And under your own definition... does this work?




Im talking in a NW scenario. I have no experience in MS installation.

Best regards,



Yes, syntax like ENTITY.PROP IS <> INTERCO.PROP should work in both MS and NW. My only concern really was about the redundancy of writing and maintaining the same block of code multiple times within one script.
After looking into it a little more I will be experimenting with INCLUDE / SUB / FUNCTION to see if that will allow me to reference a single block multiple times.

Thanks for your comments all the same.

Vadim Kalinin Aug 23, 2017 at 11:44 AM


"For further information, this is on BPC for Microsoft, 10.1."

Please remove INCORRECT tag

SAP Business Planning and Consolidation, version for SAP NetWeaver

Script logic is absolutely different between MS and NW BPC

P.S. For BPC NW you can use *ELSE for other values. Please read help.

Show 5 Share
10 |10000 characters needed characters left characters exceeded

Hi Vadim, thanks for your response.

Given the scenario posed above, do you think the code as posted is optimal? Or do you see any ways to improve it?

I am aware that there are many differences between the two platforms, but would rather have more people familiar with logic script potentially contributing to an answer that is potentially useful to everybody, rather than cutting the audience in half. The nature of the question is on structuring logic flow to avoid redundancy.

Are you suggesting that *ELSE is not available in both MS and NW versions? As far as I can see, the only reference on the matter is this post from James Lin several years ago, which does not mention *ELSE although I assume it is covered by the *WHEN/*ENDWHEN block which is available in both.

"Please read help"

What help are you referring to? To quote Vadim Kalinin from this thread:
"As far as I know, you will not find a 'proper, up-to-date, comprehensive manual'. In each SP some statements are changed. The help is not updated in time..."

Apologies if I'm missing something obvious here, but after a day or two searching through SAP Help and forums, I have not found a useful answer. Otherwise I would not be asking a new question here.


First of all - open help for BPC MS:

ELSE is supported.

Logic scripts are ABSOLUTELY different in 2 platforms (even some keywords are same) and the person with experience in BPC NW can't help you!


Thank you for pointing me to the BPC MS Help area, that is genuinely useful.

As you can see, I am already using *ELSE in the code I originally posted.
The point I am making is, although there are vast differences between the two platforms, if the helpful answer is something shared, like "Use *ELSE" , that answer could have been contributed by anybody, irrespective of platform.

It seems as though *INCLUDE can be used to condense the repeated logic above. Is it valid to use *INCLUDE for a repeated snippet in this way?


INCLUDE will simply insert a text block - useless in this case and will require extra processing!

It's better to repeat code 3 times.

Script logic is not a real programming language it's just some text processing...


Thanks - would you say the same thinking applies to

*SUB and *FUNCTION? Would you advise against using those in favour of repeating the same core logic multiple times? Is the only drawback longer processing time while it prepares the text file to run through?

Otherwise, I will experiment with all three of these and see
a) Whether they are behaving as I hope, and
b) What the performance implications are
If I find anything interesting I will report back as an answer to this thread.