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

SAP Scripts...

Former Member
0 Likes
719

In smartforms we create a internal table and then using driver program we call that smartform and assign the smartform internal table to driver program internal table.

But in sapscripts we dont create an internal table and we just write program symbols as &itab_kunnr& and similar such symbols in text element. And then in driver program we create internal table as itab lik kna1 occurs 0 . And then we call open_form , write_form and Close_form and assign the elements to write_form under loop at itab and endloop.

So my Question is What actually happens in SAP Scripts? Does Sapscripts create internal tables?

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
700

No SAP script only knew of one record at a time, the internal table is in the driver program.

NB: If you read the source of a smartforms generated FM, it will certainly remind you of your drivers program in sap script.

Regards

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
700

No, you are simply writing out each line of the internal table one at a time to the form.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
700

Remeber you pass text element in loop in the program with write_form function module.

so we pass values in each interation and display them in the layout under that text element.

SKJ

Read only

Former Member
0 Likes
700

Hi..,

The SAP script cannot create any internal tables .....

This is the additional feature of the smartforms...

For sap script we will just pass the variable values...

IF we write a variable as w_value in script editor .. it prints it as w_value..

but if we write it in between & & as &w_value& script replaces the text with the value in that field at runtime !!! So In side loop we actually pass these values to the script from the print program ...

But in case of Smartforms .. we use a function module that is generated when u activate the smartform .. for this function module we will pass the table data ... and in smartform we can loop around this table and we can print the data directly !!!!

<b>SMARTFORMS are the advanced version of SAPSCRIPTS ..</b>

reward if it helps u...

sai ramesh

Read only

RaymondGiuseppi
Active Contributor
0 Likes
701

No SAP script only knew of one record at a time, the internal table is in the driver program.

NB: If you read the source of a smartforms generated FM, it will certainly remind you of your drivers program in sap script.

Regards

Read only

Former Member
0 Likes
700

Everytime you are passing a single line from the internal table to the script layout.

Hence when you want to write multiple lines from the internal table you loop the internal table and for every record you write it in the script layout using the FMs.

Hope this explains.

Shreekant

Read only

Former Member
0 Likes
700

Hi Varun,

The driver program sends the necessary information through the FM write_form (using element) to the script and finally the SAPScript displays the information.

SAPScripts does not create any internal tables.

Hope this helps,

Thanks,

Srinivas