02-25-2011 4:38 AM
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.
02-25-2011 5:19 AM
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
02-25-2011 5:54 AM
Hi Suhas ,
Thanks a lot.
And yes next time will post the code:):).
Thanks,
Aditya.