Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sapscript compare b/t string & number

Former Member
0 Kudos
653

Hi,

In sapscript, I write the below comparison but it doesn't understand:

<b>IF &PAGE& = &SAPSCRIPT-FORMPAGES&.</b>

with &PAGE& is of type character & &SAPSCRIPT-FORMPAGES& is an interger.

Can someone show me how to convert (date type) either of the above 2 values to make my comparison working?

Thanks!

10 REPLIES 10
Read only

Former Member
0 Kudos
520

Hi Timy,

Use IF &SY-PAGNO& = &SAPSCRIPT-FORMPAGES&.

Regards,

Satish

Read only

0 Kudos
520

Hi,

Thanks for your reply, but &SY-PAGNO& always returns 0.

Read only

0 Kudos
520

If you are trying to access current page number in &PAGE&, than you can use the

/: IF &TTXSY-PAGE& = &SAPSCRIPT-FORMPAGES&

Regards,

Naimesh Patel

Read only

0 Kudos
520

Hi,

Thanks for your reply but &TTXSY-PAGE& returns nothing.

The &PAGE& is already have the correct value but it is in string (character) instead of integer.

Read only

Former Member
0 Kudos
520

Timy,

Try this

&SYST-CPAGE& = &SAPSCRIPT-FORMPAGES&.

Regards,

Satish

Read only

0 Kudos
520

Satish,

&SYST-CPAGE& always returns 0 too. The value of &PAGE& is correct but it is in character (string) instead of integer.

I think what I have to do is to convert either of these 2 values to another corresponding type to make it comparable. But I don't know how.

Thanks anyway.

Read only

0 Kudos
520

Hi Timy,

Check this post, you have answer

Reward Points if this helps,

Satish

Read only

0 Kudos
520

Oh I got it, just compare like below:

/: IF &TTXSY-PAGE& = &SAPSCRIPT-FORMPAGES<b>(C)</b>&

Read only

0 Kudos
520

I think you can also do in this way

&PAGE& = &SAPSCRIPT-JOBPAGES&

Read only

Former Member
0 Kudos
520

The solution is very simple, as:

IF &PAGE& = &SAPSCRIPT-FORMPAGES(C)&.

Thanks for all reponders anyway!