2009 Aug 17 12:21 PM
Hi I`m a newy in troubles, probably it will be such an obvious problem but it's making me mad.
I have to append a flat line structure into a table with a generic type "ANY TABLE" created with RTTS, the code is:
- Method declaration
set_config_consulta IMPORTING value(i_consulta) TYPE tipo_output
obj_lcl_ppal TYPE REF TO lcl_principal,- Method implementation
ASSIGN obj_lcl_ppal->dinamic_tab->* TO <f_tabla>
*I would need just to append this line in the corresponding fields of the table
APPEND i_consulta TO <f_tabla>.The i_consulta structure has a flat type while <ftabla> table has a table field type lvc_t_scol at the end of it's components, and that is the problem because a short dump is raised:
Err.tmpo.ejec. OBJECTS_MOVE_NOT_SUPPORTED
Fecha y hora 17.08.2009 13:09:37
Resume
Conversion of type "TIPO_OUTPUT" to type "v" not supported.
What happened?
Error in the ABAP Application Program
The current ABAP program "ZDDT04" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
Error analisys
You attempted to move one data object to another.
This is not possible here because the conversion of a data object
of type "TIPO_OUTPUT" to type "v" is not supported.
Any help would be really appreciated!
Thanks in advance.
2009 Aug 17 12:33 PM
Hi,
Do something like this.
LOOP AT itab assigning <f_wA_ITAB>.
REFRESH : color_tab[].
CASE sy-tabix.
WHEN 1.
wa_color-fname = 'MATNR'.
wa_color-color-col = 6. " red color
APPEND wa_color TO color_tab.
wa_color-fname = 'MAKTX'.
wa_color-color-col = 5. " green color
APPEND wa_color TO color_tab.
WHEN OTHERS.
wa_color-fname = 'MATNR'.
wa_color-color-col = 3. "yellow
APPEND wa_color TO color_tab.
wa_color-fname = 'MAKTX'.
wa_color-color-col = 7. "violet
APPEND wa_color TO color_tab.
ENDCASE.
INSERT LINES OF color_tab INTO TABLE <f_wA_ITAB>-colortab.
ENDLOOP.Here <F_WA_ITAB> has a field which is of type LVC_T_SCOL.
I hope you get the concept.
Regards,
Ankur Parab
Hi,
Do something like this.
LOOP AT itab assigning <f_wA_ITAB>.
REFRESH : color_tab[].
CASE sy-tabix.
WHEN 1.
wa_color-fname = 'MATNR'.
wa_color-color-col = 6. " red color
APPEND wa_color TO color_tab.
wa_color-fname = 'MAKTX'.
wa_color-color-col = 5. " green color
APPEND wa_color TO color_tab.
WHEN OTHERS.
wa_color-fname = 'MATNR'.
wa_color-color-col = 3. "yellow
APPEND wa_color TO color_tab.
wa_color-fname = 'MAKTX'.
wa_color-color-col = 7. "violet
APPEND wa_color TO color_tab.
ENDCASE.
INSERT LINES OF color_tab INTO TABLE <f_wA_ITAB>-colortab.
ENDLOOP.Here <F_WA_ITAB> has a field which is of type LVC_T_SCOL.
I hope you get the concept.
Regards,
Ankur Parab
2009 Aug 17 12:33 PM
Hi,
Do something like this.
LOOP AT itab assigning <f_wA_ITAB>.
REFRESH : color_tab[].
CASE sy-tabix.
WHEN 1.
wa_color-fname = 'MATNR'.
wa_color-color-col = 6. " red color
APPEND wa_color TO color_tab.
wa_color-fname = 'MAKTX'.
wa_color-color-col = 5. " green color
APPEND wa_color TO color_tab.
WHEN OTHERS.
wa_color-fname = 'MATNR'.
wa_color-color-col = 3. "yellow
APPEND wa_color TO color_tab.
wa_color-fname = 'MAKTX'.
wa_color-color-col = 7. "violet
APPEND wa_color TO color_tab.
ENDCASE.
INSERT LINES OF color_tab INTO TABLE <f_wA_ITAB>-colortab.
ENDLOOP.Here <F_WA_ITAB> has a field which is of type LVC_T_SCOL.
I hope you get the concept.
Regards,
Ankur Parab
2009 Aug 17 1:28 PM
Hi Ankur, thank you for your quick response. Unfortunately I think I didn't explain myself correctly, I'm not having problems to define the table colors but just to store the importing parameter i_output into the internal table.
The importing parameter i_ouput has a flat type without the color column, the table assigned to the field symbol however has many more fields (it's dinamically defined with RTTS classes), but only one of them has a deep table structure (the color column, that has the lvc_t_scol).
I'm sure it's a simple thing that I'm actually missing but I don't see how to append that information to the table ^^.
Thanks in advance!.
Edited by: David Diaz on Aug 17, 2009 2:29 PM - corrected misstypes
2009 Aug 17 2:15 PM
Hi,
The statement
APPEND i_consulta TO <f_tabla>.
will work only of I_CONSULTA is of the same type as the structure of <F_TABLA>.
If they are not the same then you cannot append I_CONSULTA to <F_TABLA>.
Do as follows:-
Define a new data object and a field symbol.
data : GV_OBJ type ref to data.
field-symbols : <F_WORKAREA> type any.
CREATE DATA GV_OBJ LIKE LINE OF <F_TABLA>.
ASSIGN GV_OBJ->* TO <F_WORKAREA>.
IF <F_WORKAREA> is assigned.
Move-corresponding I_CONSULTA to <F_WORKAREA>.
append <F_WORKAREA> to <F_TABLA>.
ENDIF.I hope you get the concept.
Regards,
Ankur Parab
2009 Aug 17 4:23 PM
Thank you very much, it worked like a charm. You've made my day
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |