‎2006 Jun 14 8:09 AM
Hello frnds,
I have to copy a function module into subroutine, but in that function module there is a command "IS REQUESTED" which won't work in subroutine. can you help me by giving some solution by providing some command which we can use instead of "is requested"
Thanks in advance
Navneet
chaubey_navneet@rediffmail.com
‎2006 Jun 14 8:12 AM
Guess inside a sub-routine you cannot have the functionality of IS REQUESTED.Because IS REQUESTED is used in case of FM's only.
‎2006 Jun 14 8:19 AM
hi,
IS REQUESTED check can be done on formal parameters of an FM whether this parameter was used when ur function module is called from a program.
I assume that the field on which IS REQUESTED was used is an optional parameter in your function module.
Let that statement be in the function module but use a flag.
if <field> is requested.
l_flag eq 'X'.
endif.
Now inside ur subroutine you can use flag.
if l_flag eq 'X'.
<the logic of the original code>.
endif.
‎2006 Jun 14 8:29 AM
Hi Navneet,
The command which can be used instead of "IS REQUESTED" is "IS SUPPLIED" .
"IS SUPPLIED"
This variant checks to see whether or not the parameter f was passed at runtime ( IMPORTING) or is to be passed (EXPORTING) in function modules and methods. The condition is true, if f contains a value, although the system checks only the actual value of the formal parameter, not the default value.
Sameena
‎2006 Jun 14 8:30 AM
hi
Please check thsi SAP help Doc
<i>The expression f IS [NOT] REQUESTED is true if an actual parameter was specified for the formal parameter f when the call was made.
Here, f must be the parameter of a function module, not a pure import parameter ("IMPORTING"). If you are dealing with a structured parameter, it must refer only to the parameter itself, not to a component. Moreover, this is allowed only in the function module itself (not in a subroutine called by the function module).</i>
hope this helps
Anirban