cancel
Showing results for 
Search instead for 
Did you mean: 

Problem on Get Entity Set

Former Member
0 Kudos

Hi Experts,

Have you ever got the following error message when trying to execute get EntitySet method ?

Error Info : Dereferencing the NULL reference

Class : CX_SY_REF_IS_INITIAL

My data definition :

DATA : ls_payment    TYPE zcl_zgw_ebpp_mpc=>ts_payment,

INSERT ls_payment INTO TABLE et_entityset.

initially i have 'Payment' Entity Type with Navigation Property and Association link to another Entity.

if I delete Navigation Property and Association - it works fine.

I am NOT sure if i need to define the data into something else because of navigational property and Association.

Please let me know what you think.

Thank You in advance !

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Hi Martin,

As you know both Navigation Property and Association Sets refer to Association.

When you play around with these artifacts (delete/create), sometimes you might end up with wrong names of associations, thus loosing the reference for association sets and navigations resulting in above error.

As I understand, you do require Association Sets for Associations to work. Association Set tells which Entity Set need to be used for an Association's End. If one of your Association End (Entity Type) is Partner, Association will tell if this Partner refers to Buyers or Sellers. (Entity Set).

Regards

Krishna

Former Member
0 Kudos

Hi Atanu and Krishna,

Thanks for your response.

So I deleted Association Sets of the Entity.

Then clean the cache from the following transaction code

* /IWBEP/CACHE_CLEANUP

* /IWFND/CACHE_CLEANUP

I tested my deep insert entity program and it still works without association set.

But I still got the same problem with get entityset method.

For some reason, they are still checking - /IWFND/IF_MED_MDL_OBJECT_CLASS~GET_ASSOCIATION_SET_BY_ASSOC method

and I got error in the following line

        lv_base_eset_name = lo_base_type->/iwfnd/if_med_mdl_node~get_entity_set_name( ).

I don't have any answer for this as of now.

Thank You,

-Martin Darmawi-

kammaje_cis
Active Contributor
0 Kudos

If you remember, in the get entity output, in each entry you see links to all associated entries. This might be the reason why it looks for Association Sets.

Hope you have deleted both Associations, related Associates Sets and related Navigations.

In this method "/IWFND/IF_MED_MDL_OBJECT_CLASS~GET_ASSOCIATION_SET_BY_ASSOC" you can check which association is getting referred to.

Former Member
0 Kudos

Hi Krishna,

Thanks for your response.

How can you see the links to associated entries from get entity output ? or maybe you refer to the SEGW data model.

et_entityset will have structure of an entity.

i can see correct data gets populated in et_entityset when I debugged my code.

I deleted only Association Sets.

I would need Association and Navigations for my Deep insert entity logic.

Thanks,

-Martin Darmawi-

kammaje_cis
Active Contributor
0 Kudos

For example see this. ES1

https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZCD204_EPM_DEMO_SRV/BusinessPartners('0100000000')

It has links to navigate to Sales Orders.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Atanu,

I got an error from /IWFND/IF_MED_MDL_OBJECT_CLASS~GET_ASSOCIATION_SET_BY_ASSOC Method

this is the code where error came from

lv_base_eset_name = lo_base_type->/iwfnd/if_med_mdl_node~get_entity_set_name( ).

I am not sure why they are trying to get association set.

Now, I am thinking maybe i should delete association set that i created before.

Do you know if we need to create association sets for Deep_insert_entity ?

Thank You,

-Martin-

former_member184867
Active Contributor
0 Kudos

Hi Martin,

I am not very sure.. what I would sugest you to create both association - association set  and then regenerate the runtime objects. Next clear the cache and then try deep insert....

Regards,

Atanu

former_member184867
Active Contributor
0 Kudos

Hi Martin,

From whihc class are you getting the error? I do not think that the dump is comig for association/navigartion property .Did you try putting a breakpoint in the DPC get_entitySet() method

and check the data that is being returned from the method?



Regards,

Atanu