Skip to Content
0

How to use a MOD function in SAP design studio Script?

Jan 10, 2017 at 07:56 AM

304

avatar image

Hi Experts,

I am trying to achieve the below condition in sap design studio script .

Let take i have a variable "test". I have a condition like this

if (test MOD 4)==0{

Textbox.settext("Divisible");

}

else{

extbox.settext(" Not Divisible");

}

the above MOD function is throughing error .i used "%" this also.

Please help me.

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

2 Answers

Tammy Powlas
Jan 10, 2017 at 10:35 AM
0

Checking the SAP Help at http://help.sap.com/businessobject/product_guides/AAD16/en/ds_16SP04_user_en.pdf - the MOD function is not supported. You will need to calculate it manually - a good sample to start with is Victor's reply in this thread https://archive.sap.com/discussions/thread/3602479

Share
10 |10000 characters needed characters left characters exceeded
Mustafa Bensan Jan 11, 2017 at 12:27 AM
0

Hi Jose,

You can simply define your own Mod function as a re-usable Global Script Function as follows:

You can call it as follows: GLOBAL_SCRIPTS_1.MOD(7, 3);

In this example the result would be 1.

Regards,

Mustafa.


modfunction.png (102.1 kB)
Share
10 |10000 characters needed characters left characters exceeded