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

creating function module

Former Member
0 Likes
1,259

hi mates

i need to create a FM where my t_outtab shoud be compatible to my internal table. that is t_outtab has some structure, now i need to create a t_outtab whose structure should be compatible with my i_tab ( internal table ) which has five fields 2 from mara and 3 from marc . can anyone guide me on the same.

thanks in advance

regards

mano

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,236

Hi,

1.Go to se11.

2.In The data Type Enter Some Structure Name(Ex:ZITAB_S)

3.Press Enter. Select Structure radio button.

4.Enter The Fieldname and data type as Your internal Table from different table .Save and Activate.

5.After That Go back to se11 . Enter ZITAB_T in data Type .press create .Select Table Type.

6. There Give the line type as structure name.(zitab_s)

7. Save and Activate

Use This Table type in function module in changing tab

like

ITAB TYPE ZITAB_T

11 REPLIES 11
Read only

Former Member
0 Likes
1,236

More detail is requested.

Specifically:

What is the goal of your FM?

What will you pass the FM?

What do you expect it to return to you?

Read only

0 Likes
1,236

hi paul,

What is the goal of your FM?

in a function module there are different interface parameters like import, export, tables,changing etc... in tables parameter t_outtab is used to get internal table , my task is to create a structure for t_outtab which is compactible to my internal table.

What will you pass the FM?

internal table.

What do you expect it to return to you?

nothing, my task is to create a structure for t_outtab and include it in my FM.

thanks in advance....

regards

mano

Read only

Former Member
0 Likes
1,237

Hi,

1.Go to se11.

2.In The data Type Enter Some Structure Name(Ex:ZITAB_S)

3.Press Enter. Select Structure radio button.

4.Enter The Fieldname and data type as Your internal Table from different table .Save and Activate.

5.After That Go back to se11 . Enter ZITAB_T in data Type .press create .Select Table Type.

6. There Give the line type as structure name.(zitab_s)

7. Save and Activate

Use This Table type in function module in changing tab

like

ITAB TYPE ZITAB_T

Read only

0 Likes
1,236

thanks for ur reply...

how to Use This Table type in function module in changing tab,

can u elaborate it...

regards

mano

Read only

0 Likes
1,236

Hi,

In changing tab fill like this


_*Parameter column                           Type Spec.                      Associated type*_
<Your Internal table Name>                  TYPE                          <Your Table Type Name(ZITAB_T)

You can also fill this in Table Tab also.

Reward If Helpful

Sandipan

Read only

0 Likes
1,236

thanks for ur help..

in parameters colum is it neccessary to give my internal table name or can i give a structure name same as my internal table.

my doubt is this tables parameter wil get internal table in abap code and u r askin me to give my internal table name in parameter column..

regards

mano

Read only

0 Likes
1,236

Hi,

You have to pass your internal table name only to parameter column you cant pass structure to parameter.

In Tables Parameter you write

t_outtab Type <Table Type>

Or

t_outtab like < Structure type>

regards

Sandipan

Read only

0 Likes
1,236

thanks for ur reply, so i have to create an internal table in some executable program and pass this internal table name in FM's tables interface parameter rite?

regards

mano

Read only

0 Likes
1,236

Hi,

You just write the parameter name in Table tab. you dont have to declare it anywhere.

When Calling the FM in program u just Pass your internal Table Name to The t_outtab.


CALL FUNCTION 'ZTEST'
    EXPORTING
    i_mtart          =
    i_matkl          =
  tables
    t_outtab      =<your InterNal Table Name>

Regards

Sandipan

Read only

0 Likes
1,236

hi,

when im trying to activate the fm, it is givig a processor error stating my function module doesnot begin with funtion-pool.

wat is this error . can u guide me on the same

regards

mano

Read only

0 Likes
1,236

Hi,

I think it should not give any error. Have u created function group for his?

Try to save it another function group.

1.Then Go to SE80.

2.Select Package from Drop Down Box.

3.Select the Package where u have stored the FM

4.Then Expand Function Group

5.Then Select your Fuction group.

6.Expand That. you will find Include There called L<GroupName>TOP(Eg:LZSANDTOP).

7.Double click on the include it will be in inactive state

8.Click on activate button select all the relevent things try to activate the things at once.

If it doesnot solve your problem, Try to re-create the Fm again from Scratch.

Regards

Sandipan

Edited by: Sandipan Ghosh on Mar 26, 2008 1:43 PM