cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

MustafaBensan
Active Contributor
0 Kudos

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.

TammyPowlas
Active Contributor
0 Kudos

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