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: 

Problem with field symbols

Former Member
0 Kudos

Hi Experts ,

I am writing a FM , which has a TABLES parameter of generic type (No type).

Also a importing paramater which gives me the Infotype name.

Inside the FM , I create dynamic workareas and internal tables based on the infotype name passed.

The problem is when I try to assign , the infotype data (passed in the TABLES paramater) , to the dynamically created internal table , I am getting a type conflict error.

The dump says , "You attempted to assign a field to a typed field symbol , but the field does not have the required type".

Please provide me a solution to the problem.

Thanks a lot in advance,

Aditya.

2 REPLIES 2

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Aditya,

Next time remember to post a few lines of your code for better analysis

Anyway your code should look something like this:

DATA: V_DREF_TAB TYPE REF TO DATA.

FIELD-SYMBOLS: <ITAB> TYPE STANDARD TABLE. 
"You can use ANY TABLE if you may, depends on the TYPE of the TABLES parameter

* Initialize the data ref. variable
CREATE DATA V_DREF_TAB TYPE STANDARD TABLE OF IM_HR_TAB. "IM_HR_TAB->Param. for IT name

*De-reference the data ref. variable
ASSIGN V_DEF_TAB->* TO <ITAB>.

<ITAB> = T_HR_DATA. "TABLES parameter of generic type 

BR,

Suhas

Former Member
0 Kudos

Hi Suhas ,

Thanks a lot.

And yes next time will post the code:):).

Thanks,

Aditya.