Application Development 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: 

regarding SAPSCRIPT

Former Member
0 Kudos

hey guys

could you pls guide me how to connect SAPscript and report.

I created layout in SAPSCRIPT namely "SAPJ02PAY".

I want to do some calculation in report and want to display the item details in SAPSCRIPT layout after executing the report.

Is there any sample program anywhere.

ambichan.

7 REPLIES 7

athavanraja
Active Contributor
0 Kudos

Former Member
0 Kudos

Hello Abhi,

When you are calling Script form , you dont have the calculated value available?

You can use perform in script layout to call and you can exceute you code of calculation there.

/: PERFORM GET_calc IN PROGRAM XYZ

/: USING &value1&

/: USING &value2&

/: CHANGING &value3&

/: ENDPERFORM

In program XYZ.

FORM get_calc TABLES in_par STRUCTURE itcsy

out_par STRUCTURE itcsy.

read table in_par for values value1 and 2.

modify Out_par to pass teh calculated value.

Regards,

Manohar

endform.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

In your print program, use the following function modules.



data: itcpo like itcpo.

  itcpo-tddest     = 'OUTPUT_DEVICE'.
  itcpo-tdimmed    = 'X'.
  itcpo-tddelete   = 'X'.
  itcpo-tdprogram  = 'YOUR_PRINT_PROGRAM_NAME'.

  call function 'OPEN_FORM'
       exporting
            form     = 'THE_SAPSCRIPT_NAME'
            language = sy-langu
            options  = itcpo
            dialog   = 'X'
       exceptions
            others   = 1.

  call function 'WRITE_FORM'
       exporting
            window = 'MAIN'
       exceptions
            others = 1.

  call function 'CLOSE_FORM'
       exceptions
            others = 1.


This is the most basic printing of a sapscript.

Regards,

Rich Heilman

0 Kudos

hey rich,

I tried you way of program code in my report

ie. using call function.

This is my first trail program to print the value from report using SAP script. so could you pls tell me what should i do next. and what should i do in SAPSCRIPT layout to print value.

I created Pages,Windows, Pagewindows in sapscript.

should i have to write any script inside the sapscript

to display the value of report.

suppose i want to display customer name in SAPscript.

i have variable storing customer name in 'CUS-NAME' how can i pass this value to sapscript from report.

ambichan.

0 Kudos

You will obviously need to have a placeholder on the form to accomodate this variable. Something like <&CUS-NAME&>.

Forgive me if I'm wrong...long time since I've done anything with SAP Script...:-)

0 Kudos

If your variable is CUS-NAME, then in your sapsript, the variable would be &CUS-NAME&. Put &CUS-NAME& in a window. It will automatically be passed from the print program to the sapscript form.

Regards,

Rich Heilman

0 Kudos

You can use the menu option Insert> Symbols> Program Symbols in the change mode of the form to see what variables from the program are available.

Regards,

Anand Mandalika.