cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Use of IT_KEY_TAB input parameter in post

prasanna_CD
Discoverer
0 Likes
2,657

I'm trying to create an attachment using create_stream method of dpc_ext class in SAP Odata.

Even I'm able to create the attachment and save that into DB. But the challenge is the attachment should be saved against the reference number which is present at UI side. How to get this from from UI.

I'm aware of slug which we can pass in the header. But I saw there is one input parameter IT_KEY_TAB how to use this?

How can I pass data to this from gateway client?

Thanks in advance

Prasanna CD

Accepted Solutions (0)

Answers (1)

Answers (1)

Abdul_Waheed
Contributor
0 Likes

Dear imprasannacdp

it_key_tab is an importing parameter which holds the KEY fields in the form of name-value pair which are passed from the URI.

The name should be same as the entity type property name & it is case sensitive.

For example:

If your Odata request is

/ety_codeSet(Carrid='AA')

You can read as shown below

data(lv_carrid) = conv s_carr_id( it_key_tab[ name = 'Carrid' ]-value ).

You may do the same for attachment entityset

prasanna_CD
Discoverer
0 Likes

Hi Abdul Waheed,
I understand the use of IT_KEY_TAB in Get methods but in Post method how it works?

Because during post we won't use any filters or we won't pass any key fields in the URL part ryte

For post always we pass data in payload but incase of create stream how can we pass data apart from Slug is the question

Regards,

Prasanna CD