Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Hi All,

Actually all of you knows the Error handling Messages in OData

But I am going to show you the Header messages at the success Status-200.

Some one knows this in other way but max number of developers don't know this scenario


I am going to tell you the simple way to display the Customized Header

messages at the HTTP Response.


Follow the below steps to create project as usual :

  1. Go to T-code SEGW.

2. Create the project and give properties.

3. Create the get entity and get entity set.

4. Give the properties and Generate Service

5. Redefine the Get entity set method.

6. Write the logic.


METHOD purchaseset_get_entityset.

***Extracting the data

SELECT * FROM ekko INTO TABLE et_entityset  UP TO 1 ROWS.

IF et_entity set IS NOT INITIAL.

**Display the header message

DATA : ls_message TYPE ihttpnvp ,

lt_message TYPE TABLE OF ihttpnvp .

ls_message-name = 'Message1'.

ls_message-value = 'SUCCESSFULY UPDATED'.

** Moving to internal table

APPEND ls_message TO lt_message.

CLEAR ls_message.

** Moving to internal table

ls_message-name = 'Message2'.

ls_message-value = 'Sucessfully Updated'.

APPEND ls_message TO lt_message.


**For display header message

LOOP AT lt_message INTO ls_message.

/iwbep/if_mgw_conv_srv_runtime~set_header( ls_message ).

CLEAR ls_message.





In this scenario I have given 2 messages with Capital and small letters and will be

displayed as Message1 and Message2.

After executing the scenario the messages will be displayed at the Success header

level status 200 at the  HTTP Response.



Thank you.


Some Important Articles :
Labels in this area