on 2020 Mar 05 8:48 AM
In ABAP Restful Programming Model, how should the media type entity be declared?
In ABAP Programming model for Fiori, we can implement CREATE_STREAM, GET_STREAM in code based implementation of the DPC_EXT class. What is the equivalent approach in RAP?
Hi sumit.kundu2 ,
From my understanding, it is not supported. SAP created attachment service for this specific reason and for reusability.
Any reason you want to provide stream option in rap entity?
-Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks maheshkumar.palavalli . Yes attachment reuse component is an option(enjoyed reading your blog post already,btw 🙂 ). I am just exploring the options in RAP. An example use case could be an employee BO entity with employee photo displayed in the object page (could be an avatar control). Just wondering what are the equivalent options of uploading an image using only ABAP in such a scenario in RAP.
Regards,
Sumit
Hi sumit.kundu2
Thanks man 🙂
I believe the best way to do this is to use ABAP Virtual Elements. and populate the URL dynamically instead of the xstring data. This URL can be your stream URL from a normal odata service or it can be a URL generated by standard FMs.
I've observed this same behaviour with standard apps as well.
For ref. code to generate URL, check the ref. code.
cl_document_thumbnail_api=>get_instance( )->get_document_thumbnail(
EXPORTING iv_objecttype = ‘MARA’
iv_objectkey = lv_object_key
iv_get_url_only = abap_true
IMPORTING
ev_mimetype = lv_mimetype
ev_thumbnail_url = lv_thumbnail_url ).
Regard,
Mahesh
shabnamjalal , I didn't try this scenario :(. You can raise a new question in the community for a better visibility and also did u try debugging and see why it is failing (I know it's a very lengthy process, considering that it's all standard sap classes, but it will be worth a try if you want to figure this out quickly)
User | Count |
---|---|
75 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.