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

structure in Function module

Former Member
0 Likes
2,796

Hi All,

I am using one function module 'Z_SD_CHARACT_CHANGE'.

LOOP AT I_FINAL.

I_CHARACT-ATINN = I_FINAL-ATINN.

I_CHARACT-KLART = '011' .

I_CHARACT-ATWRT = I_FINAL-ATWRT.

CALL FUNCTION 'Z_SD_CHARACT_CHANGE'

EXPORTING

IV_KUNNR = I_FINAL-KUNNR

IT_CHARACT = I_CHARACT

.

CLEAR I_CHARACT.

ENDLOOP.

here IT_CHARACT is structure defined like ZSD_CHAR_TAB and I defined I_CHARACT type structure like ZSD_CHAR_TAB.

But is giving following dump.

The function module interface allows you to specify only fields of a particular type under "IT_CHARACT".

The field "I_CHARACT" specified here is a different field type .

Could you please tell me what should I do for that?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,562

Hi Amar,

The Function module is expecting a table as input not a work area.

Try to change your code.

LOOP AT I_FINAL.

I_CHARACT-ATINN = I_FINAL-ATINN.

I_CHARACT-KLART = '011' .

I_CHARACT-ATWRT = I_FINAL-ATWRT.

  • append the above lines to an internal table and pass to FM.*

CALL FUNCTION 'Z_SD_CHARACT_CHANGE'

EXPORTING

IV_KUNNR = I_FINAL-KUNNR

IT_CHARACT = I_CHARACT

.

CLEAR I_CHARACT.

ENDLOOP.

Regards

Kumar M

7 REPLIES 7
Read only

Former Member
0 Likes
1,562

FM Expecting table not a structure.

Rhea.

Read only

Former Member
0 Likes
1,562

Hi Amar,

You need to pass the table and not the work area.

Try passing: I_CHARACT[]

Regards,

Aditya

Edited by: Aditya Laud on Apr 9, 2009 6:49 AM

Read only

Former Member
0 Likes
1,563

Hi Amar,

The Function module is expecting a table as input not a work area.

Try to change your code.

LOOP AT I_FINAL.

I_CHARACT-ATINN = I_FINAL-ATINN.

I_CHARACT-KLART = '011' .

I_CHARACT-ATWRT = I_FINAL-ATWRT.

  • append the above lines to an internal table and pass to FM.*

CALL FUNCTION 'Z_SD_CHARACT_CHANGE'

EXPORTING

IV_KUNNR = I_FINAL-KUNNR

IT_CHARACT = I_CHARACT

.

CLEAR I_CHARACT.

ENDLOOP.

Regards

Kumar M

Read only

0 Likes
1,562

Hi Amar,

Declare the structure IT_CHARACT in the table tab of the FM with associated type ZSD_CHAR_TAB.

This will resolve your problem.

Regards..

Read only

Former Member
0 Likes
1,562

Hi,

Check the ZSD_CHAR_TAB is Table Type or Structure..If it is Table Type then it behaves like internal table.Then you need to declate the I_CHARACT as

DATA : I_CHARACT LIKE LINE OF ZSD_CHAR_TAB.

Read only

Former Member
0 Likes
1,562

Hi u define this under tab table .

like

table name structure

T_MWDAT LIKE RTAX1U15.

this will help u.

Read only

0 Likes
1,562

I_CHARACT like It_CHARACT .

in table tab of fm.

Regards