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

Regarding Module Pool

Former Member
0 Likes
912

Hi guys,

I would definatly appreciate if any one could solve my problem

<b>My Problem is I Have created one FM and inside this FM module I called one Screen.

Inthe PAI of the screen i want to use one structure which is imported in the FM .

So please tell me how ot access that FM module structure in the PAI of the screen.</b>

Thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
884

Hi,

Ok..Let me explain clearly..

Assuming this is your Z Function module code..

FUNCTION z_call_screen.

*"----


""Local interface:

*" IMPORTING

*" IM_STRUC TYPE MARA

*"----


  • Move the value IM_STRUC to the top include structure..

  • The structure S_STRUC should be declared in the top include of the FM.

  • In the menu..GOTO -> GLOBAL DATA..

  • declare the structure S_STRUC which should of type MARA.

S_STRUC = IM_STRUC.

  • CALL the screen.

CALL SCREEN '0100'.

ENDFUNCTION.

************************************************

****************FLOW LOGIC**************

************************************************

PROCESS BEFORE OUTPUT.

....

PROCESS AFTER INPUT.

MODULE get_data.

************************************************

****************PAI MODULES************

************************************************

MODULE get_data.

<b> IF S_STRUC-MATNR IS INITIAL.</b>

ENDIF.

ENDMODULE.

Thanks,

Naren

9 REPLIES 9
Read only

Former Member
0 Likes
884

Hi,

Create a structure S_STRUC in the top include of the function group..Which should be of the same structure of the IMPORTING structure.

MOVE the value from the IMPORTING structure to the top include structure S_STRUC.

S_STRUC = IM_STRUC.

Then you can use the structure S_STRUC any where in your screen..

Thanks,

Naren

Read only

0 Likes
884

Hi Naren

What would happen if i call this FM from one user exit and i want the data in userexit aswell.

Read only

0 Likes
884

Hi,

The best way would be to EXPORT the parameters from one part of your program and then IMPORT them back when needed.

Please click the link below to know about IMPORT/EXPORT commands in SAP.

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3bc4358411d1829f0000e829fbfe/content.htm.

This should solve your problem.

Regards,

Vara

Read only

0 Likes
884

Can you please specify me how to access .

I am still not able to acees my structure inthe screen although i have declared the same type of structure in TOP include

Where should i use this statememnt

S_STRUC = IM_STRUC. 

please tell me again.

Read only

Former Member
0 Likes
884

Hi,

I don't understand your question..

If you are calling the FM in a user exit...The value will be passed in the exporting parameter right..Which means in the calling place..You will have that data..

Example.

-


USEREXIT code..

***In the user exit the value is available in the WA_STRUC

CALL FUNCTION 'ZZZZ'

EXPORTING EX_STRUC = WA_STRUC.

FUNCTION ZZZZ.

***IMPORTING EX_STRUC

**Now you have the value in the work area EX_STRUC.

ENDFUNCTION.

Thanks

Naren

Read only

Former Member
0 Likes
884

HI,

>Can you please specify me how to access .

>I am still not able to acees my structure inthe screen although i have declared >the same type of structure in TOP include

>Where should i use this statememnt

>S_STRUC = IM_STRUC.

>please tell me again.

You have to declare the structure S_STRUC in the top include of your function group.

IM_STRUC will be your importing parameter..

IN the function module you should give

S_STRUC = IM_STRUC.

THanks,

Naren

Read only

0 Likes
884

I am not able to get the strucutre value on the screen. Although i have declared it on the same structre on hte TOP include of the Funciton Gruoup. But now the thing is how to get get the data in PAI. where should i use the statement

S_STRUC = IM_STRUC

and how to change the value of the

Read only

Former Member
0 Likes
885

Hi,

Ok..Let me explain clearly..

Assuming this is your Z Function module code..

FUNCTION z_call_screen.

*"----


""Local interface:

*" IMPORTING

*" IM_STRUC TYPE MARA

*"----


  • Move the value IM_STRUC to the top include structure..

  • The structure S_STRUC should be declared in the top include of the FM.

  • In the menu..GOTO -> GLOBAL DATA..

  • declare the structure S_STRUC which should of type MARA.

S_STRUC = IM_STRUC.

  • CALL the screen.

CALL SCREEN '0100'.

ENDFUNCTION.

************************************************

****************FLOW LOGIC**************

************************************************

PROCESS BEFORE OUTPUT.

....

PROCESS AFTER INPUT.

MODULE get_data.

************************************************

****************PAI MODULES************

************************************************

MODULE get_data.

<b> IF S_STRUC-MATNR IS INITIAL.</b>

ENDIF.

ENDMODULE.

Thanks,

Naren

Read only

0 Likes
884

Thanks Naren,

Now it works,

The problem was that i declared the structure in the global data but i didn't understand how to access this vlaue

Thanks alot.