Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9193

Re: how to upload file using sap netweaver gateway ?

$
0
0

Hello Abhishek,

 

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

 

file1.PNG

file2.PNG

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.

 

Virus_SPRO.png

Post_Image.png

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


Viewing all articles
Browse latest Browse all 9193

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>