cancel
Showing results for 
Search instead for 
Did you mean: 

EML Create by association on existing Root

cdietrich1958
Explorer
0 Kudos

I am trying to create a child instance for an existing root using EML. My understanding is that %cid and %cid_ref are for working with the transactional buffer CREATE + CREATE BY ASSOCIATION). In my case the root already exists with a valid key. The root entity is Case with esch_case_key as the key. The child entity is Log with esch_case_key and esch_seq_no as keys. I am getting an "unspecified" error in the FAILED table. Can anyone see what I am missing below? Thanks in advance.

MODIFY ENTITIES OF zi_cdd_esch_case IN LOCAL MODE

ENTITY Case

CREATE BY \_Log

FIELDS (esch_case_keyesch_seq_noentry_dateentry_timemessage_typemessage_textcreated_bycreated_atlast_changed_bylast_changed_at )

WITH VALUE #( (

%target = VALUE #( (

esch_case_key = ls_keys-%param-esch_case_key

%control-esch_case_key = if_abap_behv=>mk-on

esch_seq_no = lv_next_seq_no

%control-esch_seq_no = if_abap_behv=>mk-on

entry_date = '20200721'

%control-entry_date = if_abap_behv=>mk-on

entry_time = '082500'

%control-entry_time = if_abap_behv=>mk-on

message_type = 'I'

%control-message_type = if_abap_behv=>mk-on

message_text = 'Payee data updated'

%control-message_text = if_abap_behv=>mk-on

created_by = 'CB0000000170'

%control-created_by = if_abap_behv=>mk-on

created_at = zv_tsl

%control-created_at = if_abap_behv=>mk-on

last_changed_by = 'CB0000000170'

%control-last_changed_by = if_abap_behv=>mk-on

last_changed_at = zv_tsl

%control-last_changed_at = if_abap_behv=>mk-on ) ) ) )

MAPPED mapped

FAILED failed

REPORTED reported.

Accepted Solutions (1)

Accepted Solutions (1)

dominik_ee
Advisor
Advisor

Hi Charles,

you are not passing the root id for which a child should be created. The EML statement should look something like:

MODIFY ENTITIES OF root ENTITY root CREATE BY \_child
FROM VALUE #( ( root_key = X
%target = VALUE #( ( %cid = 'CID_DUMMY'
element_x = value_x
%control-element_x = if_abap_behv=>mk-on ) ) ) )
MAPPED DATA(ls_mapped) FAILED DATA(ls_failed) REPORTED DATA(ls_reported).

Best regards,

Dominik

Answers (1)

Answers (1)

cdietrich1958
Explorer

Thanks Dominik, I added esch_case_key = ls_keys-%param-esch_case_key and it worked! I spent an entire day trying to get this to work before your assistance and do not recall seeing an example that wasn't a CREATE + CREATE BY ASSOCIATION. Now thanks to you I have my own example of a child create.

inesmartins
Participant
0 Kudos

Hi,

How did you solve that??

I'm having the same problem:

MODIFY ENTITIES OF i_billingdocumenttp

ENTITY billingdocument

EXECUTE createfromsddocument AUTO FILL CID

WITH VALUE #(

( %param = VALUE #( _reference = VALUE #( ( sddocument = <fs_outbound_delivery>-id-content

%control = VALUE #( sddocument = if_abap_behv=>mk-on ) ) ) ) ) )

 

RESULT DATA(lt_result)

FAILED DATA(ls_failed)

REPORTED DATA(ls_reported).

I«m getting failled 'UNSPECIFIC'

Thanks in advance,
Ines Martins