on 08-10-2007 12:54 PM
Hi all,
When i want to display some fields from tables that are not used in "print program" i generally write subroutine which will fetch and display in the form. Now my question is whether we can use function module in place of subroutine? If not why?
Thanks
Rakesh
Hi,
We can not use the Function module sin teh SCRIPTS directly,
Why sub routines, we can write the ABAP code without changing the print program, SAPSCRIPT allows you to write the SUBROUTINES using a program to write teh ABAP code in that program
Regards
Sudheer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me tell what is the advantage of sub-routine... if your driver program is not in your control(I mean you are using standard print program) then you cannot fetch the values that are not existing in the print program.. to overcome this we call sub-routines inside our form and fetch the data in external program and pass it back to the form...(note: you cannot write Select statement inside form/ call function module inside form) but you can use functions inside your sub-rotines and pass back the value to script..
I guess the concept is clear to you... anyhow for clear picture I am giving sub-routine example...
Ex.
/: PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>
/:USING &<field name>&
/:CHANGING &<field name1&
/:ENDPERFORM
Then create subroutine pool program and you have to write the code.
FORM ><subroutine name> tables int_cond structure itcsy
outt_cond structure itcsy.
data : value(20), value1(20). "do your own declarations
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.
Just rough idea given above.
Regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can't use the function modules instead of subroutines in scripts
This facility allows us without modifying the Std driver program of the script we can fetch the external data that is needed from other tables and incorpoarte in the script
<b>Reward points for useful Answers</b>
Regards
Anji
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.