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

function module.

Former Member
0 Likes
794

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

8 REPLIES 8
Read only

Former Member
0 Likes
739

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.

Read only

Former Member
0 Likes
739

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.

Read only

Former Member
0 Likes
739

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

Read only

0 Likes
739

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.

Read only

0 Likes
739

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

Read only

Former Member
0 Likes
739

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

Read only

Former Member
0 Likes
739

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

Read only

sbhutani1
Contributor
0 Likes
739

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