Skip to Content
avatar image
Former Member

how to upload file using sap netweaver gateway ?

hi this is totally new stuff for me, i don't know from where to start and would be great if someone can guide me regarding it.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Sep 22, 2013 at 03:16 PM

    Hi Abhishek,

    You need to understand concept of "Media Links" in OData..

    Below blog might be useful for gettingĀ  you started with uploading/downloading.

    http://scn.sap.com/community/netweaver-gateway/blog/2013/08/14/how-to-upload-and-download-files-using-sap-nw-gateway

    Below blog tells you how to upload a photo from a Backend system and access it in the OData service.

    http://scn.sap.com/community/netweaver-gateway/blog/2013/02/22/how-to-read-photo-from-sap-system-using-sap-netweaver-gateway

    Thanks

    Krishna

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 21, 2014 at 10:10 AM

    HI Abhishek,

    Try this link..

    http://scn.sap.com/community/netweaver-gateway/blog/2013/08/14/how-to-upload-and-download-files-using-sap-nw-gateway

    This is really helpful.

    Please specify the problem you are getting.

    Hope this helps.

    Thanks,

    Saurabh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 05, 2014 at 01:36 AM

    Hello Abhishek,

    1. Create an Entity , add properties u want and set it as Media Type.

    2. Generate Run-time Objects.

    3. Go to DPC_EXT class and in that implement Create_Stream method and call the appropriate business logic inside it which will upload content in ur BE

    4. Register the service.

    3. Fire the service as below.

    Sample with URL -> Please change the URL as per your inputs

    U can test your operation by disabling virus scan in the SPRO setting but it is not advised to disable it.

    U need to define profile for virus scan. As far as i know it should already been defined with a default one during the configuring GW systems.

    Pass the key inside SLUG header.

    If at all if u get error related to Mapping or Context or Data Type then please do the below.

    Got to MPC_EXT class and redefine Define method and add the below code.

    super->define( ).

    lo_entity TYPE REF TO /iwbep/if_mgw_odata_entity_typ,

    lo_property TYPE REF TO /iwbep/if_mgw_odata_property.

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

    IF lo_entity IS BOUND.

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

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

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

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

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

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

    lo_property->set_as_content_type( ).
    ENDIF.

    This shud resolve those errors.

    Regards,

    Ashwin

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 10, 2014 at 06:26 AM

    hai abhishekh plz check the below link

    File Upload/Download through NetWeaver Gateway

    Hope it Helps

    Regards

    Add comment
    10|10000 characters needed characters exceeded