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: 

Transfer values between Function Groups

Nkrish
Contributor
0 Kudos
182

This may be a very silly question. I have two function groups x and y. X calls a z function module which is in the same funcion group as X. Now I want to pass some value that x gave to z to Y function module . How do I do it??

8 REPLIES 8

Former Member
0 Kudos
90

- you can create a function (of the Z group) with suited interface to take these values;

- you can use import/export parameter statements

0 Kudos
90

Yes, just pass the values thru the interface using the IMPORT or TABLES.

Regards,

Rich Heilman

christian_wohlfahrt
Active Contributor
0 Kudos
90

Who is calling when Y?

0 Kudos
90

In X Function module I have called a function module called Z . Both X and Z are in the same function group.

Now there are some values in X which I need in Y function module.

So I create a function module Z which gets values from X.

Now how do I get this table/Values to Y as it is in another function group. Could you please give me the code.

0 Kudos
90

You would use the interface of the function module.




call function 'GUI_DOWNLOAD'
<b>     exporting
          filename = the_file_path
     tables
          data_tab = itab</b>
     exceptions
          others   = 22.


Notice is this example, I am passing "the_file_path" as one value and the ITAB which is an internal table with many rows.

Regards,

Rich Heilman

0 Kudos
90

I think function Z shouldn't called by X, but Y.

Infact X and Z are in the same group so they can see the global variables of group.

For example:

GROUP 1 -> Function X, Z.

TOP include.

DATA: FIELD1 TYPE C.

DATA X_BKPF LIKE STANDARD TABLE OF BKPF.

FUNCTION A.

FIELD1 = 1.

X_BKPF = .....

ENDFUNCTION.

FUNCTION Z.

  • EXPORTING

  • REFERENCE(FIELD)

  • TABLES

  • T_BKPF...

*----


FIELD = FIELD1. "Take field1 value

T_BKPF[] = X_BKPF[] "Take table values

ENDFUNCTION.

Group 2 Y

FUNCTION Y.

CALL FUNCTION Z

IMPORTING FIELD = FIELD_Y

TABLES T_BKPF = T_BKPF_Y.

ENDFUCTION.

Message was edited by: max bianchi

0 Kudos
90

Thank you very much MAX I was able to solve the problem. I am not able to see the stars where I can give points. Thanks for the prompt and excellent example.

0 Kudos
90

Ok! If you can't do it, I'll reward ten virtual points to myself