05-09-2006 7:08 AM
Hi all,
while creating the FM can i use user defined types
if we can where we need to define this type.
thank u.
sai
05-09-2006 7:17 AM
if u have to define your own type then it has to be registered in Data dictionary, that means basically you will be creating a structure with all the required fields through SE11. Similarly you can create table types through Data dictionary if you want to pass tables as import/export parameters.
05-09-2006 7:21 AM
Hi Sai,
i guess u meant dat types as user defined types....
yes, u can use user defined types in your fm.
in import/export parameters,u have to mention like this
<field name> like <ztablename-fieldname>
now the datatype associated with <ztablename-fieldname> is assigned to your <field name>
Regard,
Sakthi.
05-09-2006 7:22 AM
Hi,
you can define from SE11 , using the option data type
enter your data type name and then say create then you can choose the type which you want to create .
Regards
vijay
05-09-2006 7:29 AM
HI all,
my question is in Fm
PARAMETERS: PAR1 TYPE ZZTAB.
ZZTAB IS A TYPES DECLARED BY THE USER .
IT NOT DEFINED IN THE DICTIONARY.
IS IT POSSIBLE
THANKS.
05-09-2006 8:01 AM
Hey Sai,
1 . You can declare a variable in this manner :
data : a like zztab.
This is done in the source code of your function module.
To do so however , zztab should be known .It means it has to be defined earlier ( that is, it should be either import / export parameter ). If it is a table, you can declare this variable in your tables tab of the function module.
2. You can not declare this way :
parameters : atab like zztab.
" zztab, a user defind data type has been declared earlier.
Reason :
2.1) You can only use parameters for programs other than type 1 between Begin/end of Screen.
2.2) Now if you try to declare this way,
selection-screen : begin of selection-screen 300.
parameters : atab like zztab.
selection-screen : end of screen 300.
This is also not possible . The reason for this is that within form routines and function modules, the <b>selection-screen</b> statement is not allowed.
Regards,
Kunal.
Message was edited by: Kunal Kumar
05-09-2006 7:31 AM
Hi Sai,
You can define your own types in the TOP include of the main program i.e. your function group.
TYPES : BEGIN OF TYPE,
END OF TYPE.
Data : variable type i.
Hope this helps.
Regards,
Amit Mishra
Message was edited by: Amit Mishra
05-09-2006 8:03 AM
HI
GOOD
I DONT THINK WE CAN ABLE TO DEFINED OUR TYPES WHILE CREATING A USER EXIT.
YOU GO THROUGH THE FOLLOWING LINKS FOR THE FUTHER CLARIFICATION
http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
THANKS
MRUTYUN
05-09-2006 8:36 AM
Hi Sai,
You can declare your user defined types in function pool. this is where you can define global data that will available to all the function modules under this function group.
Regards
Sumit Bhutani