cancel
Showing results for 
Search instead for 
Did you mean: 

Check a value existence in a global variable in SAP BODS

saurav123
Explorer

In script , i want to check value '1' in a global variable ($GV_VAR) and the value of $GV_VAR is 1,2,3

if ('1' in ($GV_VAR))

PRINT('PASS');

ELSE

PRINT('FAIL');

There is no syntax error but i am not getting 'pass' as result, where am i going wrong ? is there any alternate method ?

rajiv_deshpande
Explorer
0 Kudos

Please mark it as answered

rajiv_deshpande
Explorer
0 Kudos

Hello

Mark this as Answered.

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

rajiv_deshpande
Explorer

Hello Saurav

Try this

Declare $GV_VAR as VARCHAR 10

$GV_VAR = '1,2,3';

if(index($GV_VAR,'1',1)>0)

print('PASS')

else

print('FAIL');

saurav123
Explorer
0 Kudos

thanks a lot .. it resolved my issue ...

Answers (0)