on 07-03-2014 12:49 PM
Hello experts,
I'm trying to make my get_entity_set methode for a condition type:
DATA itab_cond_type TYPE TABLE OF zstruc_cond_type.
DATA wa_cond_type type zstruc_cond_type.
CALL METHOD class->GET_COND_TYPE IMPORTING ex_cond_type = itab_cond_type
.
DATA: ls_entityset LIKE LINE OF et_entityset.
LOOP AT itab_cond_type INTO wa_cond_type.
ls_entityset-KSCHL = wa_cond_type-KSCHL.
ls_entityset-class = wa_cond_type-VTEXT.
APPEND ls_entityset TO et_entityset.
ENDLOOP.
I get an error at the import. => "itab_cond_type" is not type-compatible with the
formal parameterr "ex_cond_type".
Even though they are both from the same type ... (type table of zstruc_cond_type).
When i change 'DATA itab_cond_type TYPE TABLE OF zstruc_cond_type' to 'DATA itab_cond_type TYPE zstruc_cond_type'
i get an error at the loop at because it is no longer an iternal table and i cannot append my data to et_entityset...
Any ideas of what it is i'm doing wrong here?
Kind regards,
Bart
K i solved it.
I defined the ex_cond_type as a structure. The type was a structure and not a table type...
So ex_cond_type was a structure and therefor not compatible with the itab_cond_type which is an internal table.
Thanks for all the help.
Kind Regards,
Bart
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for the below statement check what is the type of ex_cond_type. check the signature of method GET_COND_TYPE and the type associated with exporting parameter.
CALL METHOD class->GET_COND_TYPE IMPORTING ex_cond_type = itab_cond_type
It might be different than zstruc_cond_type.
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please check these threads and
your code should look as below,
DATA: lt_cond_type TYPE TABLE OF zstruc_cond_type,
ls_cond_type LIKE LINE OF lt_cond_type,
ls_entity LIKE LINE OF et_entityset.
*Get data from ZSTRUC_COND_TYPE table
SELECT * FROM zstruc_cond_type INTO TABLE lt_cond_type.
*Fill ET_ENTITYSET
LOOP AT lt_cond_type INTO ls_cond_type.
ls_entity-KSCHL = ls_cond_type-KSCHL.
ls_entity-class = ls_cond_type-VTEXT.
APPEND ls_entity TO et_entityset.
ENDLOOP.
assuming zstruc_cond_type is table.
Regards,
Chandra
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.