‎2009 May 25 11:33 AM
Hi all,
i have problem in printing the variables in the Sapscript calculated in report.
i done this in the same report once by using,
PERFORM convert_to_scriptvar USING 'medi' medi.
here 'medi' is my variable. this worked.
but now im trying for another variable but its not working like above, i also tried by using element in sapscript like,
PERFORM write_form USING 'ELEMENT' 'APPEND' 'BODY' 'MAIN'.
but it still not working in both cases. plz help me out to solve this problem.
thanx...
‎2009 May 25 11:42 AM
‎2009 May 25 11:52 AM
why there is not a single reply????
plzz reply back...
plzzz.
thanx...
‎2009 May 25 12:07 PM
Hi Nelesh,
Please be more descriptive about the requirement.
Regards
Vijai
‎2009 May 25 12:04 PM
Hi
what i understand,
You want to print values of variable in the sapscript.
Can you please confirm ur requirements or let me know ur requirements.
‎2009 May 25 12:34 PM
i have a variable on which i have performed some operatiopn and now i want to disply the value (total amount) in the sap script for this i have tried various options mention in my question. it worked for 1 earlier with those thechniques but now it is not working.
why is it? or is there any other simple way to print report variable in sapscript.????
thax a lot for reply..
‎2009 May 25 12:39 PM
Hi,
your question is not clear. but I am giving the syntax for calling the perform
Syntax in a form window:
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
......
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
......
/: ENDPERFORMINVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
*reading the invar1 value and multiplying with 20
read table in_tab with key name = 'invar1'.
in_tab-value = in_tab-value *20.
* asiging the calculated value into out var1.
out_tab-name = 'outvar1'.
out_tab-value = in_tab-value.
modify out_tab from out_tab.
here for &invar1&
...
ENDFORM.similary do calculations on all variables.
Thanks,
Suma
‎2009 May 25 12:51 PM
You can do this via using the commant
Perform
endperform.
For example
write the following code in script
/: PERFORM get_amount PROGRAM ztest
/: USING &VAR1&
/: CHANGING &VAR2&
/: ENDPERFORM
write the following code in program ztest
FORM get_amount TABLES l_input_table STRUCTURE itcsy (table to hold the variables passed frm script)
l_output_table STRUCTURE itcsy. table to hold the variables passed to script)
READ TABLE l_input_table WITH KEY name = 'VAR1.
VAR2 = VAR1 * 100.
CLEAR l_output_table.
READ TABLE l_output_table WITH KEY name =' VAR2'.
IF sy-subrc = 0.
MOVE l_amount TO l_output_table-value.
MODIFY l_output_table INDEX sy-tabix.
ENDIF.
ENDFORM.
‎2009 May 25 12:58 PM
will it not work with this?
PERFORM convert_to_scriptvar USING 'medi' medi.
bcoz i it worked before for this 'medi' variable.
thanx for ur reply..
‎2009 May 25 1:14 PM
plz someone tel me ???
will it work..???
im not getting reply..??
sorry
& thanxxx a lot...
plzz relpyy....
‎2009 May 25 1:29 PM
where are all the experts gone...?????
plz tel me can we pass the values to sapscript from report using
PERFORM convert_to_scriptvar USING 'medi' medi.
this statement????
plzzzzzz reply...
‎2009 May 26 7:19 AM