Skip to Content

How to pass arguements to CREATE_STREAM?

Dear Experts,

I am now passing Files from browser to SAP Gateway via media resources. I am able to receive file content in the following argument.

ls_doc-content = is_media_resource-value.

I am able to pass value only to this single parameter called "IV_SLUG".But I also want to pass parameters like File name, File type, File size to this method "/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_STREAM".


Can anyone help how to pass above values from frontend?


Regards

Prabaharan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on May 12, 2014 at 08:18 AM

    Dear Experts,

    Can anyone suggest on above question raised?

    Regards

    Prabaharan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 13, 2014 at 11:47 PM

    hi Prabaharan,

    I think the correct way to do this would be to post the extra properties to the entity, not the stream. If you need to have those properties stored as well, then the entity that the stream is related to can carry those properties. How would you be expecting to read them back? I'd expect them available by GET request, which is most easily done within an entity representation.

    This is also much clearer and transparent for a service consumer; passing header values should be avoided unless they are required by the OData specification.

    regards

    Ron.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Peter,

      You won't get it that way - you are thinking in terms of one operation when you need two. You first post the entity to establish its existence on the backend. Within this entity you set any properties that you want it to have such as physical and logical IDs, "added by", etc.

      Then you send the stream (as a PUT if I recall correctly) which, being part of the entity, will have the same key.

      Cheers

      Ron.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.