cancel
Showing results for 
Search instead for 
Did you mean: 

Once the "End Date" is set, Custom error message should disappear.

Former Member
0 Kudos
78

Hi Experts,

On Lead screen, I have REASON picklist. If i select the REASON as "Extended for 3 Months"

then an custom error message is displayed asking to set the "End Date" to 90 days.

"Reson" Component details as follows

BT108H_LEA/Detail

BTSUBJECT/STRUCT.CONC_KEY

"End Date" Component details as follows.

BT108H_LEA/Detail

BTLEADEND/BTLEADEND

I used the following code to display that message.

if typed_context->BTSUBJECT->GET_REASON( attribute_path = '' ) = 1."For 3 Month
* Create Message 
 DATA: lr_msg_service       TYPE REF TO cl_bsp_wd_message_service.
  lr_msg_service = cl_bsp_wd_message_service=>get_instance( ).
  CALL METHOD lr_msg_service->add_message
    EXPORTING
      iv_msg_type       = 'E'
      iv_msg_id         = 'ZERR_MSG'
      iv_msg_number     = '000'.   
endif. 

Now the problem is once i change the 'End Date' to 90 days, the error message which is dispalyed to

"set the date to 90 days" should disappear. What should i do to take out the displayed error message

once the 'End Date' is set.

Thanks in advance.

Cheers

Mythili

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Resolved

Former Member
0 Kudos

Hi Mythili,

Sorry for replying late.

According to me while displaying error message you are filling some table, make that table global and read that table where u want to delete message i.e in method or anywhere and use following method.

CALL METHOD cl_crm_isu_order_check=>delete_messages

EXPORTING

x_guid = pass here item guid

x_msgid = 'ECRM_ISU' your message class name

x_msgno_from = '102' your message number

x_msgno_to = '102'. your message number

I think these should work and if doesnt then let me know your screen, view, component of yours.

Let me know.

Cheers,

Parth Parikh

Former Member
0 Kudos

Hi Mythili,

I had used same class which u r using but with different method.

DATA:

lw_return TYPE bapiret2.

DATA:

lt_message_return TYPE TABLE OF bapiret2_t.

lw_return-type = 'E'

lw_return-message = text-000 "Your message text.

APPEND lw_return TO lt_message_return.

CALL METHOD lo_msg_ser->add_bapi_messages

EXPORTING

it_bapi_messages = lt_message_return.

Use this aand let me know this works according to your requirements

Cheers,

Parth

Former Member
0 Kudos

Hi Parth,

In your code where does it say that, If "End Date" is changed, erase custom error message.

I am able to display the message. Can you please look into it once again..

Cheers

Mythili

Former Member
0 Kudos

Hi,

Can you please provide me some pointers on this....I too have a similar issue the only difference being that I want to delete a SAP standard message ( instead of the custom message as discussed in this).

Regards,

Vijay

Former Member
0 Kudos

Is there any way. Replies appreciated.

Still Waiting....

Former Member
0 Kudos

Hi Mythili,

Write if...else...endif for the solution.

if typed_context->BTSUBJECT->GET_REASON( attribute_path = '' ) = 1."For 3 Month

  • Create Message

DATA: lr_msg_service TYPE REF TO cl_bsp_wd_message_service.

lr_msg_service = cl_bsp_wd_message_service=>get_instance( ).

IF (your condition)

CALL METHOD lr_msg_service->add_message

EXPORTING

iv_msg_type = 'E'

iv_msg_id = 'ZERR_MSG'

iv_msg_number = '000'.

else.

CALL METHOD lr_msg_service->delete_message

EXPORTING

iv_msg_type = 'E'

iv_msg_id = 'ZERR_MSG'

iv_msg_number = '000'.

endif.

i think this should work let me know after u implement this that this solution works or not.

Former Member
0 Kudos

Hi Parth,

I don't think it works.

My requirement is once the custom error message is displayed as "Change End Date to 90 days", after changing the "End Date" , the custom error message should disappear.

Cheers

Mythili