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

Dinamyc table with deep table append

Former Member
0 Likes
800

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
671

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 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.

4 REPLIES 4
Read only

Former Member
0 Likes
672

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

Read only

0 Likes
671

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

Read only

0 Likes
671

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

Read only

0 Likes
671

Thank you very much, it worked like a charm. You've made my day