cancel
Showing results for 
Search instead for 
Did you mean: 

Pass a global value in sapscript

former_member184551
Contributor
0 Kudos

Hi Guys

I have defined a global variable in the print program.

I want to pass the value of page (sapscript current page) to this variable in a text element of the script.

If i simply do like this

&gv_page& = &page&

it gives me an error, how can i achieve this?

Thanks

PS: &page& has value and &gv_page& and page are compatible variables.

Accepted Solutions (1)

Accepted Solutions (1)

naimesh_patel
Active Contributor
0 Kudos

Try like this:


/:  DEFINE &GV_PAGE& := &PAGE&     

Regards,

Naimesh Patel

former_member184551
Contributor
0 Kudos

HI

thanx for the reply

I tried define but its not working.

Answers (3)

Answers (3)

Former Member
0 Kudos

you have to write a perform statement to achieve this

Former Member
0 Kudos

Hi Sameeer,

i think you can go for PERFORM Routines ? Let me know it it is not working.

narin_nandivada3
Active Contributor
0 Kudos

Hi,

You can use Perform Statment and send that to the driver program.


In script
/ : PERFORM send_pageno IN PROGRAM <prog>
/: USING &PAGE&

/: ENDPERFORM.

In driver program <prog> define the FORM as shown below..

DATA:
   Pageno type i.

FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.

READ TABLE IN_TAB WITH KEY u2018PAGEu2019
CHECK SY-SUBRC = 0.
pageno = in_tab-value.

ENDFORM.

Check this link for HELP on PERFORM if necessary

http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

Hope this would solve your issue.

Good luck

Narin