cancel
Showing results for 
Search instead for 
Did you mean: 

Reagrding export tab declaration in function module

Former Member
0 Kudos

Hi,

I am populating an error structure in the function module and want to export that error structure

to calling program.

Now I have to create this error structure using data: statement inside the function module.

The error structure has following fields:

REQUI like XFLED,

NON_Unique like XFLED,

FNAME like fieldname,

LIFNR like lifnr.

(Note: I am not creating an error structure skeleton permamnently in DDIC but in the SAP code.)

Now if I am exporting this error structure from function module to main calling program, I guess have to declare it in export tab inside se37 where I create function module.

What do I declare in the reference type for this error structure inside the export tab ?

Please help me out.

Thanks.

Regards,

Tushar.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Tushar,

1. U do not want to create a skeleton structure

in DDIC.

2. Then do the following things.

1. In FM declare ITAB as u mentioned.

2. In TABLES parameter declare

mention one parameter as MYITAB

(leave type and other fields as blank)

3. In the FM, last line should be

MYITAB[] = ITAB[].

3. Now in your CALLING Program,

Once Again Declare

an internal table in the SAME FASHION (WITH SAME FIELDS)

as in FM.

Pass this itab to FM.

4. It will work FANTASTIC.

I tried at my end.

Regards,

Amit M.

Former Member
0 Kudos

Dear Tushar,

The error structure you are defining must be defined in your 'Export' tab and 'Associated Type' has to be a DDIC declaration. Else it should be defined in Function-Pool.

regards,

Deva.

Former Member
0 Kudos

What do you mean when u say else it should be defined in the function pool ?

Former Member
0 Kudos

Dear Tushar,

You must have defined the function-module is some function group isn't it. Every function group has a no. of includes one of it has name patteren as '*TOP'. That is the function-pool. You can define the stucture here also.

regards,

Deva.

Former Member
0 Kudos

But still since I am exporting it to main program I need to define it under export tab. so what reference type do I give there even if I define the structure in function pool ?

suresh_datti
Active Contributor
0 Kudos

Hi Tushar,

You can try to put under Tables & leave the type blank.

Regards,

Suresh Datti

suresh_datti
Active Contributor
0 Kudos

Hi Tushar,

I think you can leave the reference type blank. Did you get any error when you left it blank?

Regards,

Suresh Datti