‎2007 Jan 23 9:41 PM
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,
‎2007 Jan 23 10:14 PM
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
‎2007 Jan 23 9:46 PM
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
‎2007 Jan 23 9:53 PM
Hi Naren
What would happen if i call this FM from one user exit and i want the data in userexit aswell.
‎2007 Jan 23 9:58 PM
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
‎2007 Jan 23 10:00 PM
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.
‎2007 Jan 23 10:00 PM
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
‎2007 Jan 23 10:02 PM
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
‎2007 Jan 23 10:07 PM
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_STRUCand how to change the value of the
‎2007 Jan 23 10:14 PM
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
‎2007 Jan 23 10:24 PM
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.