Skip to Content
0
Dec 27, 2021 at 05:30 AM

How to populate sap-message in RAP when using "IF_RAP_QUERY_PROVIDER" ?

370 Views Last edit Dec 27, 2021 at 06:35 AM 5 rev

  1. Implemented Custom Entity.
  2. Used annotation @ObjectModel.query.implementedBy: 'ABAP:ZCL_DEMO_TECH'
  3. Inherited the Interface "IF_RAP_QUERY_PROVIDER"

While using "IF_RAP_QUERY_PROVIDER" , how can I populate the sap-message header .

https://help.sap.com/viewer/fc4c71aa50014fd1b43721701471913d/202110.000/en-US/794cd7428b82493d98863b4165aa217e.html

As if now I am raising the exceptions like this

RAISE EXCEPTION TYPE zcx_text_message<br>        EXPORTING<br>           textid   =  VALUE scx_t100key( msgid = 'Z_MSG_CLASS'<br>                             msgno = '02'<br>                             attr1 = 'TEXT2' ) .

.Is there a way in RAP in "IF_RAP_QUERY_PROVIDER~MAIN " where i can populate sap-message header