07-25-2010 8:46 PM
hello, i am a bi developer and have to write badi to extract data from a table called ZNetSOME. I want to populate 2 fields in my structure "C_T_DATA". Those fields are ZOrder and ZAmount. here is the code that I wrote but keep getting u_c_objects_not_convertible message.i am not an abaper so your help will be very appreciated.
DATA: IT_ZNETSOME TYPE TABLE OF ZNETSOME,
WA_ZNETSOME TYPE ZNETSOME.
DATA: WA1_ZNETSOME TYPE ZNETSOME.
LOOP AT C_T_DATA INTO WA_ZNETSOME.
SELECT SINGLE * FROM ZNETSOME INTO CORRESPONDING FIELDS OF WA1_ZNETSOME WHERE ZORDER = WA_ZNETSOME-ZORDER.
WA_ZNETSOME-ZORDER = WA1_ZNETSOME-ZORDER.
WA_ZNETSOME-ZAMOUNT = WA1_ZNETSOME-ZAMOUNT.
ENDLOOP.
I would also need to do
APPEND C_T_DATA FROM WA_ZNETSOME to populate the values in C_T_DATA structure but it keeps giving me out error
"An explicit work area is necessary in the OO context. Use "APPEND wa TO C_T_DATA [SORTED BY]".
thanks.
please help me out.
07-26-2010 9:59 PM
07-26-2010 11:25 PM
Append the work area in the typed internal table which you have defined, and then copy the contents of your internal table to c_t_data.
After populating your internal table.
What you can do is, first
clear c_t_data[].
and then
c_t_data[] = itab[].
Edited by: WDAbap on Jul 27, 2010 12:25 AM