cancel
Showing results for 
Search instead for 
Did you mean: 

Message handling in DRAFT and Strict Mode

shavneet1
Participant
0 Kudos

Hello andre.fischer ,

I have created two applications , one is draft enabled other one is Strict (Non-draft), both from your RAP generator.

I have some validations for mandatory fields , and i log message which i want to show in the UI.

Everything is working fine , but with one big difference , on how the messages are displayed.

In Non- draft behavior , i get the messages at the footer with hyperlinks, and in draft based app , i get the message in the form of pop up.

My requirement is get the error messages at the footer in draft Scenario.

Is this some kind of product error in RAP , or i am missing something in my code , which i have to add.

Raising messages and calling validation from Behavior is 100% same in both cases. But message handling is different

koradaramjee789

volker.drees : would you please look at this bheaviour and provide some solution or answer

Waiting for your response.

Thanks and Regards ,

Shavneet Singh

View Entire Topic
p619793
Active Participant
0 Kudos

Hi shavs ,

Can you share the code you have used to implement the behavior for draft case?

'Error in footer' indicates that it is the final state of the BO entity.

I think it is by design that for a draft entity (i.e. still not saved to active table) the messages will appear in a popup.

Ideally, If you don't add entry into 'failed' workarea explicitly RAP framework assumes that the BO has not failed yet (final state), hence http=412 precondition failed which results in confirmation popup.

Best regards,

shavneet1
Participant
0 Kudos

Hi sumit.kundu2 ,

Below Screenshot shows, the code of behaviour defnition.

AS you can see its a draft table , and validation NettpriceDeliveryTime on save is called.

and the implementation code is as below.

READ ENTITIES OF zscp_rfx_r_header01tp IN LOCAL MODE ENTITY items BY \_Header

FIELDS ( Ebeln revno )

WITH CORRESPONDING #( keys ) RESULT DATA(dATASETS).

LOOP AT datasets INTO DATA(dataset).

READ ENTITIES OF zscp_rfx_r_header01tp IN LOCAL MODE

ENTITY header BY \_items FIELDS ( Netpr EliveryTimeWe ) WITH

VALUE #( ( %tky = dataset-%tky ) ) RESULT DATA(ItemDataset).

SORT ItemDataset BY Ebelp DESCENDING.

LOOP AT ItemDataset INTO DATA(ItemData).

lv_item_no = ItemData-ebelp.

IF ItemData-netpr > 0 AND ItemData-eliverytimewe IS INITIAL .

APPEND VALUE #( %tky = ItemData-%tky ) TO failed-items.

APPEND VALUE #( %tky = ItemData-%tky

%msg = NEW zscp_rfx_msg_defn(

textid = zscp_rfx_msg_defn=>delivery_time

mv_value = lv_item_no

severity = if_abap_behv_message=>severity-error )

%element-EliveryTimeWe = if_abap_behv=>mk-on

) TO reported-items.

ENDIF.

ENDLOOP.

ENDLOOP.


Thanks for your time.. if you can help.. what is missed here..



Regards ,

Shavneet