cancel
Showing results for 
Search instead for 
Did you mean: 

how to upload file using sap netweaver gateway ?

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hai abhishekh plz check the below link

Hope it Helps

Regards

AshwinDutt
Active Contributor
0 Kudos

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

Former Member
0 Kudos

HI Abhishek,

Try this link..

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

This is really helpful.

Please specify the problem you are getting.

Hope this helps.

Thanks,

Saurabh

kammaje_cis
Active Contributor
0 Kudos

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-usin...

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-usi...

Thanks

Krishna

Former Member
0 Kudos

thanks for help but i have tried these links already and this is not helping out, i thought there might be some step by step guide for it.

former_member184867
Active Contributor
0 Kudos

Please refer to thread http://scn.sap.com/thread/3262540 which is regarding uploading an image using OData service.

Former Member
0 Kudos

Hello Krishna,

The links that you provide really confused me a lot because i can not land up creating a successful upload by following any of those blogs.

Rashmi's blog - i got some error.

Jan's blow - again some error.

i have posted them both about the error. Let me know if u have complete working example which I can replicate.

SyambabuAllu
Contributor
0 Kudos

Hi Nitin,

What's error your getting?

Can you post here.

Thanks,

Syam