Application Development 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: 

How to call fm with table type import param?

Former Member
0 Kudos

Hi all,

I tried to find this in the archives without luck, so hope some of you have an answer..

I'm simply trying to fill up a table and call a function module with it as a parameter like this:

  • Function module import parameter type is table type hap_t_hrsobid

DATA: lt_params TYPE hap_t_hrsobid WITH HEADER LINE

lt_params-field1 = val1.

lt_params-field2 = val2.

APPEND lt_params.

CALL FUNCTION <function name>

EXPORTING

table_param = lt_params

However, this crashes in a type conflict and I can't see what's wrong here even after trying multiple scenarios of data types.

Please note the fm import param is a table type and not a simple type.

Help anyone?

Best regards,

Mikko

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Can you give the FM name?

Regards,

Raj

Refer this FM call and see the FM in SE37, you will know where you went wrong...

form conv_otf_c2x changing p_otf type tsfotf.

if c_unicode = true.

call function 'SSFCOMP_CONVERT_OTF_C2X'

changing

otf = p_otf[].

endif.

endform.

Message was edited by: Rajasekhar Dinavahi

14 REPLIES 14

Former Member
0 Kudos

Hi,

Can you give the FM name?

Regards,

Raj

Refer this FM call and see the FM in SE37, you will know where you went wrong...

form conv_otf_c2x changing p_otf type tsfotf.

if c_unicode = true.

call function 'SSFCOMP_CONVERT_OTF_C2X'

changing

otf = p_otf[].

endif.

endform.

Message was edited by: Rajasekhar Dinavahi

0 Kudos

Yes, here goes: HRHAP_SEL_ORG_UNIT_OF_POSITION.

0 Kudos

Try this

CALL FUNCTION <function name>

EXPORTING

table_param = lt_params[]

put [] after lt_params

Message was edited by: Vijay

0 Kudos

PL ignore my earlier post & try this..


DATA: lt_params TYPE hap_t_hrsobid,
      rec_params like line of lt_params.

rec_params-field1 = val1.
rec_params-field2 = val2.
APPEND rec_params to lt_params.

regards,

Suresh Datti

0 Kudos

remove <b>with header line</b> in the declaration

0 Kudos

Yes, that's it. Thanks!

-Mikko

Former Member
0 Kudos

try this

sorry deleted , pls give FM name

Message was edited by: Chandrasekhar Jagarlamudi

0 Kudos

Nope, tried already. Syntax check error: When using "WITH HEADER LINE", the line type cannot be a table type.

suresh_datti
Active Contributor
0 Kudos

Hi Mikko,

Instead of using the EXP/IMP Parameter, why don't you use the <b>Tables</b> option when creating the function module?

Regards,

Suresh Datti

0 Kudos

Hi,

can't use it because this is a standard function module which has the parameter as an import param.

-Mikko

0 Kudos

Hi,

Try this way.

call function 'HRHAP_SEL_ORG_UNIT_OF_POSITION'

exporting T_POSITIONS = <b>itab[]</b>

importing

.

.

.

NOte the [].

Regards,

Ravi

Former Member
0 Kudos

Hi mikko,

1. Just declare it like this.

2. DATA: lt_params TYPE hap_t_hrsobid .

DATA: wa TYPE LINE OF hap_t_hrsobid .

3. Use wa (work area)

to put data in the table lt_params.

regards,

amit m.

Former Member
0 Kudos

Hi Mikko,

Refer this FM call and see the FM in SE37, you will know where you went wrong...

form conv_otf_c2x changing <b>p_otf type tsfotf</b>.

if c_unicode = true.

call function 'SSFCOMP_CONVERT_OTF_C2X'

changing

otf = p_otf[].

endif.

endform.

Regards,

Raj

Former Member
0 Kudos

Hello Mikko,

U need to declare the it_params as follows..

lt_params type hap_t_hrsobid. then use it in FM

call function 'HRHAP_SEL_ORG_UNIT_OF_POSITION'

exporting

t_positions = lt_positions

.......