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

How does Write_Form work? How to sent the value to SAP Script Variable

Former Member
0 Likes
1,616

Hello guys.

I want to use Write_Form in a report. But I am not understanding how it works. But the problem is that It doesn't show me anything in SAP Script!! In the Write_Form I can't give the Variable name that I use in SAP Script, I am giving just the Element, the WIndow and the Type.

How does the Write Form, give the value of the variable &NOTE& in SAP Script? I created an variable DATA: Note TYPE string, in the report, and I fill it before the Write_Form, but in the end in SAP Script, it isn't showing me the Value!

Does anybody have any idea?

P.s. please don't sent me the links with that shows me OPEN_FORM, WRITE_FORM, CLOSE_FORM, START_FORM, etc etc.... I have read them, and I am using them but the problem is I can't figure it out, how the value is passed to SAP Script when I don't give the variable name!!

3 REPLIES 3
Read only

Private_Member_7726
Active Contributor
0 Likes
952

Hi,

I'm not sure if and how SapScript processes strings - see if you get some output with data: note(255) type c... The value of a program symbol is limited up to a maximum of 255 characters.

cheers,

Janis

Read only

Former Member
0 Likes
952

In your print program (the program where you call the write_form), all variables that are defined are passed to the sapscript program.  They are however passed as their text equivalent.  They have the value that the had at the moment that you called write_form.

Does that help?

Neal

Read only

Former Member
0 Likes
952

Hi,

From the SAP online help; "At runtime of the print program, SAPscript can automatically access data that is defined in the controlling program. Technically speaking: SAPscript retrieves the values directly from the data fields of this program".  So, the variables are not passed to the form, the form more accurately fetches them from the program.

So, if your variable is not appearing on your form output there must be some other problem, Janis' suggestion would be a good place to start.

To verify if the SAPscript will find the variable it can be inserted into the text element using the menu option Goto -> Print Program -> Symbol definition.

Regards,

Nick