‎2008 Mar 25 5:08 AM
hi,
What is a subroutine pool in SAP script, when it is used,
give me with example.
‎2008 Mar 25 5:14 AM
Hai.
check the links.
http://www.saptechnical.com/Tutorials/Smartforms/PassingTableData/Script1.htm
http://www.mynewblog.net/software/blogdetails-3710.html
http://abapprogramming.blogspot.com/2007/11/setting-header-text-in-main-window-top.html
http://www.sap-img.com/sapscripts/faq-for-sap-scripts.htm
http://www.abapcode.sapbrainsonline.com/2008/03/generate-abap-keyword.html
regards.
sowjanya.b
‎2008 Mar 25 5:14 AM
Hai.
check the links.
http://www.saptechnical.com/Tutorials/Smartforms/PassingTableData/Script1.htm
http://www.mynewblog.net/software/blogdetails-3710.html
http://abapprogramming.blogspot.com/2007/11/setting-header-text-in-main-window-top.html
http://www.sap-img.com/sapscripts/faq-for-sap-scripts.htm
http://www.abapcode.sapbrainsonline.com/2008/03/generate-abap-keyword.html
regards.
sowjanya.b
‎2008 Mar 25 5:15 AM
Hi
Its an Abap prog of type sub routine pool, it is used for calculating certain variables, eg DUE date for an Invoice. You pass the values from the form thru ITCSY structure inthe prgram.
To calculate totals and sub totals in sap scripts you have to use subroutines.
Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
/: DEFINE &TOT_PRICE&
/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
Then write the variable where ever you want it to be printed (mostly it will be in footer window)
Then create subroutine pool program and you have to write the code.
FORM F_GET_PRICE tables int_cond structure itcsy
outt_cond structure itcsy. data : value type kbert.
statics value1 type kbert.
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
‎2008 Mar 25 6:55 AM
Hi,
We use Sub Routine Pool (Program) in Scripts when there is a requirement to extend the functionality of the Standard Print Program. ie., When the existing Print Program does not give you the desired output and you have included some new code in the ZForm, then we write the code in the Sub Routine Pool program in SE38.
From Forms--> Text Editor, we use the following stmt to call the Sub Routine code.
PERFORM Calculate_amount IN PROGRAM Z_SR_FRM001
USING &VAR1&
CHANGING &VAR2&.
(Z_SR_FRM001 is the name of the Sub Routine Pool Program we write in SE38)
In the SE38 Editor, we code as following :
&----
*& Form CALCULATE_AMOUNT
&----
text
----
--> VAR1 text
<-- VAR2 text
----
FORM calculate_amount TABLES in_tab STRUCTURE
itcsy out_tab STRUCTURE itcsy.
...
...
...
ENDFORM.
You have to write the required code in the above Form in order to get the desired result.
Reward if helpful.
Best Regards.