cancel
Showing results for 
Search instead for 
Did you mean: 

Get Entityset with Media Entity

kai2015
Contributor
0 Kudos

Hi all,

can I use get_entityset and get_stream on the same media entity?

I want to call get_entityset, because there is more than one file relating to another entity.

kind regards,

Kai

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor

Yes. You can fetch multiple entries at a time (by implementing get entityset).

But you read one attachment at a time. ($value).

kai2015
Contributor
0 Kudos

Thank You!

I wasn't sure, if this could work (but it should).

Answers (2)

Answers (2)

rpalotai
Participant
0 Kudos

Hi,

Just add the this annotation to the media type entity in MPC_EXT DEFINE method:

lo_entity = model->get_entity_type( iv_entity_name = 'Image' ).

IF lo_entity IS BOUND.

lo_property = lo_entity->get_property( iv_property_name = 'MimeType' ).

lo_property->set_as_content_type( ).

ENDIF.


Br

Richard

0 Kudos

Hi,

How did you achieve this?

Bcoiz when I try to retrieve entityset collection from an entity of type media, I get error .

However, if I remove the media flag from entity, the entityset works fine.

I need to use same entity to retrieve list of all attachment and then when use rclicks on any one, retrieve the media content using $ value.

Any inputs would be very useful.

kai2015
Contributor
0 Kudos

Hi,

would be nice to know the error.......

Anyway, try this

http://help.sap.com/saphelp_nw74/helpdata/de/eb/7743aa3e0148c4ba632b9f993af5fe/content.htm

"set_as_content_type"

kind regards

Kai