cancel
Showing results for 
Search instead for 
Did you mean: 

Why do we need to handle Header parameter 'SLUG' while playing around with images?

Pavan_Golesar
Active Participant

Hello Guru's,

While carrying out GET and POST operations on Gateway (Eg: This one).. I saw mostly use of SLUG header parameter handling.

Why is it used?

What is the impact of it?

Can we Make 'custom header parameter' behave as SLUG header parameter ?

Also few pointer to material docs would be helpful.

Thanks for read and would appreciate your response.

Pavan G

Message was edited by: Pavan Golesar

Accepted Solutions (0)

Answers (2)

Answers (2)

AshwinDutt
Active Contributor

Hello Pavan,

As far as i know there is no impact even if you do not add slug header while doing Create Operation for the media resources. Your operation would be successful with out any error.

We use slug header where ever we are creating a new resource inside the system. We use it in order to provide/suggest a name for that resource.

For example -> Lets say i want to attach a supporting document for a document number 3500000255 for Company Code 1000 for a fiscal Year 2016 and for Business Area IN00 in SAP.

Then i would like to name that attachment as 350000025_1000_2016_IN00.docx and send as part of slug header and save it so that it would be saved with that name which is unique and easy to identify.

You can also use a header 'CustomParameter' and send values inside it.

But we use slug as its a standard header which is already provided by HTTP

Regards,

Ashwin

former_member206574
Active Participant
0 Kudos

Hi Pavan,

Slug header parameter is used to pass the key fields along with media type in odata services i.e for attachments.

You can see an import parameter in the method signature of CREATE_STREAM.

If you want to send the key parameters along with the attachments you have to use the SLUG Header and value as key value.

If there are multiple key parameters u need to pass send the key values with any separator like

'test.jpg/20001' and in Create_Stream method you can split the separator and pass for respective variables.

For eg. For particular Sales order you want to save the Sales document in ECC.

For that in SLUG Header you will pass the Sales Order no. and in payload you will have the sales document.

Check this link for more about media streams of gateway service.

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

Regards,

Venu