Application Development 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: 

Perform Inside a RFC function Module

Former Member
0 Kudos

Hi Experts,

I am using a perform inside an RFC function module,

In the perform I have used the select statmetns to fill the internal table , but once the perform subroutine is completed , then the internal table iniside the perform is not passing data to the table in the RFC.

Could you please suggest the method to pass the data in the internal table.

Thanks in Advance,

Regards,

Iff

10 REPLIES 10

Former Member
0 Kudos

Hi ,

Please check the follwing

Where is the perfom defined ?

, are you declaring local varaibles in the subroutine to store the data ,

pass you internal table as a parameter to the subroutine.

Regards

Arun

0 Kudos

Hi Arun,

I am passing 3 variables with the form in the subroutine,

But I am getting the resultant table filled inside the form of a subroutine,

How to pass this filled table out side the subroutine.

Regards,

Irfan

0 Kudos

Hi,

Either you assign this internal table to a global internal table which you will declare in the TOP include of the FM, this is possible only if this subroutine belongs to the same function group as that of the function module.

Else you pass this internal table as a parameter to the subroutine from the FM itself using CHANGING or TABLES statement.

You can use CHANGING only if this internal table us typed after a DDIC table type.

Regards,

Sesh

Message was edited by:

Seshatalpasai Madala

0 Kudos

Hi ,

In subroutine you have the additions CHANGING and TABLES , usually tables is not used.

So what you can do is in addition to the parameters you are passing pass the internal table in which you want the result to the subroutin as a changing parameter ,and after selecting your data populate this internal table.

Or a simple option would be to declare the IT you are currently using in the subroutine as a global varaible and use this in your further processing.

Please do revert back in case you want more info..

Regadrs

Arun

0 Kudos

Hi Arun,

When I am using the Syntax

Perform Validation1 tables ITab

USING par1 par2 par3.

In the form statment i am getting error for the table part to get it declared.

Could you please suggest the method.

Regards,

Iff

0 Kudos

Hi ,

Here is a sample code

Data : it_1 type table of matnr ,
       v_matnr type matnr.

start-of-selection.

perform get_matnr using it_1.

loop at it_1 into v_matnr.
write / v_matnr.
endloop.
*&---------------------------------------------------------------------*
*&      Form  get_matnr
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_IT_1  text
*----------------------------------------------------------------------*
form get_matnr using    p_it_1 like it_1[].  "This decleration is required for tables

data : it_2 type table of matnr.

select matnr into table it_2
up to 10 rows
from mara.

p_it_1[] = it_2[].

endform.                    " get_matnr

You can also define the form this way

<b>form get_matnr using p_it_1 type table.</b>

do revert back in case you have any queries.

Regards

Arun

Former Member
0 Kudos

Hi IFF,

1. Declare the Internal Table Globaly in Function module.

2. In perform statment use the internal table as parameter in TABLES statement.

3.IN RFC FM also Use the Internal table in Tables tab.

Now it will work.

Pls. reward if useful

0 Kudos

Hi,

One way is to declare the internal table in the TOP include of this RFC function modules function group then after the perform this internal table will still have the data and this can be accessed in the FM.

Another way is to pass the Internal table to the subroutine either with the help of USING or CHANGING. Create this internal table before the perform call and then populate it in the perform. ONce perform is over you will be able to access the data in the FM.

Regards,

Sesh

Former Member
0 Kudos

Hi Arun,

I am passing both Itab and variables in the perform.

and in the form part I am geeting error because I am mentioning both itab and variable parameteres.

Regards,

Iff

0 Kudos

Hi IFF,

u could even think of Set Paramerer in the subroutin and pass the itab to SAP global memory and use Get Parameter in FM to retrieve ur itab.

Hope it helps.

Regards,

Hardik