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

Dump on table type when using FM

Former Member
0 Likes
751

Hi,

I am using FM RSAN_ODS_DATA_READ.

CALL FUNCTION 'RSAN_ODS_DATA_READ'

EXPORTING

I_ODSOBJECT = 'ZORGFUND'

IMPORTING

ET_DATA = g_t_data1

EXCEPTIONS

FAILED = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

I defined g_t_data1 as follows

TYPES: BEGIN OF GT_S_DATA1,

ZFUNDCNTR(24) TYPE C,

ZFUNDGRP(24) TYPE C,

ZDWR_ORG(24) TYPE C,

END OF GT_S_DATA1.

DATA: g_t_data1 TYPE STANDARD TABLE OF gt_s_data1

WITH HEADER LINE,

But then I got an error:

<b>You attempted to pass the field "G_T_DATA1" to the formal parameter "ET_DATA"

but the formal parameter "ET_DATA" can accept only fields of

type "h". The field "ET_DATA" has the type "u".</b>

What is type 'h' and ''u'. I have never seen this. How should I define g_t_data1 so that I won't get a dump?

Thanks,

RT

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
654

Hi,

please remove the WITH HEADER LINE statement in internal table declaration.

4 REPLIES 4
Read only

Former Member
0 Likes
654

How is ET_DATA declared as an export parameter inside the function module RSAN_ODS_DATA_READ???? Declare your G_T_DATA1 as,

data: G_T_DATA1 type standard table of <type assosiated with ET_DATA inside the FM> with header line.

Read only

0 Likes
654

Hi Rob,

What's your SAP version,I can't get the FM named "RSAN_ODS_DATA_READ" in my SAP system.

I used IDES ECC5.0.

Read only

0 Likes
654

Hi Bob,

Actually I am working withg BW and this is to read data from the ODS Object in BW.

Hi Sharath kumar,

ET_DATA is define as TYEP ANY TABLE from the EXPORT tab of the FM. I think I already have defined G_T_DATA1 similar to your suggestion as seen here:

<b>I defined g_t_data1 as follows

TYPES: BEGIN OF GT_S_DATA1,

ZFUNDCNTR(24) TYPE C,

ZFUNDGRP(24) TYPE C,

ZDWR_ORG(24) TYPE C,

END OF GT_S_DATA1.

DATA: g_t_data1 TYPE STANDARD TABLE OF gt_s_data1

WITH HEADER LINE,</b>

Per your suggestion

data: G_T_DATA1 type standard table of <<b>gt_s_data1</b>> with header line.

Have I missed something? Please advise.

Thanks,

RT

Read only

Former Member
0 Likes
655

Hi,

please remove the WITH HEADER LINE statement in internal table declaration.