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

Define a variable

Former Member
0 Likes
1,702

Hi Friends,

How to define a variable in the form (SAP Scripts).

Which text element shall I use.

Thanx in advance,

Venu

9 REPLIES 9
Read only

Former Member
0 Likes
884

Hi venu

Check this link

this contains a simple example

http://www.thespot4sap.com/articles/SAPscript_Introduction.asp

Regards sandeep

Reward points appriciated

Read only

Former Member
0 Likes
884

Hi,

generally we define variables in the program that calls the form(script) and use it in ths cript.

like

data:var(10) type c. //in the call program(se38)

var = 'variable'.

&var& //use in script

Regards,

Sowjanya.

Read only

Former Member
0 Likes
884

/: DEFINE &symbol_name& = 'value'

Read only

0 Likes
884

Hi,

I want to define a variable for the field vbrk <b>fikmg</b>, Can you please tell me how to define.

Thanx in advance.

Venu

Read only

0 Likes
884

&vbrk-fkimg& ?

What is your requirement? What do you want to print?

Message was edited by: Tomasz Kozerski

Read only

0 Likes
884

Using this field I have to do some calculations and print it on the layout, pls tell me how to do it.

Thanx n advance,

Venu

Read only

0 Likes
884

U can do that in the print program..why do you need to it in the script ???

Read only

Former Member
0 Likes
884

Hi,

you can define text element in window as

/E EH1

/: DEFINE &NEW_PG& = 'X'

Regards

amole

Read only

Clemenss
Active Contributor
0 Likes
884

Venu,

all variables and structures defined globally in the print program are available without any further steps in SAPSCRIPT forms.

All additionally needed variables are defined simply by use. You can set values by using DEFINE statemwnt or by using Sapscript perform. If you did not use perform before, look at documentation for the statement!

But note that only the variables global in print program carry all the characteristics for display, i.e. 1000 or decimal separator.

All 'pure' Sapscript variables are pure text. So if you need formatted output from a PERFORM subroutine, use write to ... in the ABAP form and pass the result to Sapscript.

Hope it helps,

Clemens