2005 Apr 18 2:46 PM
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.
2005 Apr 18 2:55 PM
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap code sample for reporting with smartforms.doc
Regards
Raja
2005 Apr 18 2:56 PM
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.
2005 Apr 18 2:56 PM
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
2005 Apr 18 3:06 PM
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.
2005 Apr 18 3:12 PM
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...:-)
2005 Apr 18 3:16 PM
2005 Apr 18 3:28 PM
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.