on 04-26-2023 7:39 AM
Hello Everyone,
I am writing this question as I could not find answer to this in any of the tutorials or documentation.
How can I show popup message or message container to customer on frontend via the if_rap_query_provider~select ? I am working on simple RAP List Report App with Custom CDS Entity. I don't need any behavior implementation as it is display only. The data is called via ABAP method in if_rap_query_provider~select and stored in internal table, then selected with offset and max rows implementation.
But sometimes I would like to throw some message to frontend. For example if some of the filter is initial or something else went wrong during the runtime.
Is it possible somehow? Did anyone managed to do that?
Also will there be some more tutorials for using Custom CDS Entity in RAP applications? With more details on this feature or implementing top, skip on internal table etc. ?
Thank you and best regards,
Lubos
The select method offers two class based exceptions that could be raised by your implementation.
You will have to create a new exception classes that inherit from the above mentioned classes. E.g as follows:
CLASS zdmo_cx_rap_gen_custom_entity DEFINITION<br>
PUBLIC
INHERITING FROM cx_rap_query_provider
and you can raise an exception in your implementation as follows:
TRY.
....
CATCH cx_root INTO DATA(exception).
DATA(exception_message) = cl_message_helper=>get_latest_t100_exception( exception )->if_message~get_longtext( ).
DATA(exception_t100_key) = cl_message_helper=>get_latest_t100_exception( exception )->t100key.
RAISE EXCEPTION TYPE zdmo_cx_rap_gen_custom_entity
EXPORTING
textid = VALUE scx_t100key(
msgid = exception_t100_key-msgid
msgno = exception_t100_key-msgno
attr1 = exception_t100_key-attr
attr2 = exception_t100_key-attr2
attr3 = exception_t100_key-attr3
attr4 = exception_t100_key-attr4 )
previous = exception.
ENDTRY.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.