Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

"IS REQUESTED" IN FUNCTION MODULE

Former Member
0 Likes
1,025

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

4 REPLIES 4
Read only

nishanthbhandar
Contributor
0 Likes
661

Guess inside a sub-routine you cannot have the functionality of IS REQUESTED.Because IS REQUESTED is used in case of FM's only.

Read only

Former Member
0 Likes
661

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.

Read only

Former Member
0 Likes
661

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

Read only

former_member480923
Active Contributor
0 Likes
661

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