cancel
Showing results for 
Search instead for 
Did you mean: 

Resulttype of "IS_EE_ORG_ASS_REPL_REQ-ORG_ASSIGNMENT[... ]" cannot be converted into the type of

PTecnico
Explorer
0 Kudos
86

Hello.

I have the following issue :

My requirement is define a TYPES with the following structure and a field additional , and then create a internal table of this type. called lt_fin

TYPES : BEGIN OF gty_displaydata_order,
    INCLUDE TYPE SFIOM_S_REPL_REQ_ORG_ASS_EXTND,
    persg       TYPE persg.
TYPES END OF gty_displaydata_order.

DATA :lt_fin  TYPE TABLE OF gty_displaydata_order .
IF lv_cont >= 2.
  APPEND LINES OF is_ee_org_ass_repl_req-org_assignment[ lv_cont - 1 ] TO lt_fin .
ELSEIF lv_cont = 1.
  APPEND is_ee_org_ass_repl_req-org_assignment[ lv_cont ] TO lt_fin.
ENDIF.

Initially I have a internal table is_ee_org_ass_repl_req-org_assignment that receive as parameter with information information and I nee add to the table lt_fin only the two last record .

I need complete the information of the field persg that query of the table HRP1013 in the table lt_fin for each position that have in the field employee_class = 9.

however when want pass the two last record the system generate  the following error:

Result type of "IS_EE_ORG_ASS_REPL_REQ-ORG_ASSIGNMENT[... ]" cannot be converted into the type of
"LT_FIN".

I share the following information

PTecnico_0-1737458337671.png

 

View Entire Topic
radinator
Participant
0 Kudos

You have 2 issues here:

First you try to append a field

is_ee_org_ass_repl_req-org_assignment

to the internal table

lt_fin

which is defined as

DATA :lt_fin  TYPE TABLE OF gty_displaydata_order .

which doesn't work. You simply cannot append a field to a structure. It's a type mismatch.

Second (even if you resolve the type conflict) you would try to append a structure of type iTab1 to the iTab2 which have 2 totally different (differing by 1 field but still totally different to the compiler) layouts.

It's like tryting to append a line type line of MARA to a iTab type table of MARC for simplicity.

If you want to append the structure is_ee_org_ass_repl_req to lt_fin you have to either use MOVE-CORRESPONDING and then add the additional field manually or use some sort of VALUE #( ) construct.

PTecnico
Explorer

Hi

Thank you .

And for  add the additional field manually is of this way:

TYPES : BEGIN OF gty_displaydata_order,
    INCLUDE TYPE SFIOM_S_REPL_REQ_ORG_ASS_EXTND,
    persg       TYPE persg.
TYPES END OF gty_displaydata_order.
 
DATA :lt_fin  TYPE TABLE OF gty_displaydata_order .
MOVE-CORRESPONDING is_ee_org_ass_repl_req-org_assignment TO lt_fin.
*...Here read a table db for the the records and get the persg.
LOOP at lt_fin INTO data(ls_fin).
*...Here READ TABLE it_table_persg
wa-persg = it_table_persg[ KEY key POSITION_ID = lt_fin ].
lt_fin-persg = wa-persg.
                  
ENDLOOP.

Regards