cancel
Showing results for 
Search instead for 
Did you mean: 

message appearing after validation successful

Former Member
0 Kudos

Hi Gurus,

My scenario is like this:

I m validating a field ( selct options ) in wdbeforeaction event..

If the vbeln is wrong I m raising a error message..

But again when I do f4 help and select the correct vbeln.. it validates in the wdbeforeaction evnt.

But the earlier message which was raised cab be still seen on the top of view..

How do I make this error message exist only when wrong..

Best Regards,

Navin fernandes.

Accepted Solutions (1)

Accepted Solutions (1)

former_member206441
Contributor
0 Kudos

Hi

Try this code before displaying the success message for selecting the correct vbeln value.

after using this code include your success message.


*             get message manager
            DATA lo_api_controller     TYPE REF TO if_wd_controller.
            DATA lo_message_manager    TYPE REF TO if_wd_message_manager.

            lo_api_controller ?= wd_this->wd_get_api( ).

            CALL METHOD lo_api_controller->get_message_manager
              RECEIVING
                message_manager = lo_message_manager
                .

*             report message
            CALL METHOD lo_message_manager->clear_messages
*              EXPORTING
*                including_permanent_msg = ABAP_FALSE
*                only_permanent_msg      = ABAP_FALSE
                .

Regards

Arun.P

Former Member
0 Kudos

Hi Arun,

I Tried using clear_messages but its not of any help..

still the error message is showing..

Is there any workaround for this..!

best Regards,

Navin fernandes.

Former Member
0 Kudos

What is the code you have written to throw an error messge. ?

former_member206441
Contributor
0 Kudos

Hi

Otherwise try with this.

if you are checking the value in the inputfield by an event handler ie:selecting a value and clicking on the submit button.

Get the selected value of the inputfield which has come from f4 help and check it like this

select * from ekko into table itab where ebeln eq ebeln.

if sy-subrc eq 0.

display succes message

else

display warning message.

endif.

Regards

Arun.P

Former Member
0 Kudos

Hi ,

My code is as follows:

IF LWA_KUNNR1-LOW IS NOT INITIAL.

***

SELECT SINGLE KUNNR

FROM KNA1

INTO LV_KUNNR

WHERE KUNNR = LWA_KUNNR1-LOW.

IF SY-SUBRC <> 0.

CALL METHOD lo_message_manager->report_error_message

EXPORTING

message_text = 'Customer Number Invalid'

VIEW = 'SELSCREEN_VIEW'.

  • is_permanent = abap_false. " Give your error text here

wd_comp_controller->gv_fire = 'X'.

ELSE.

wd_comp_controller->gv_fire = ' '.

CALL METHOD lo_message_manager->CLEAR_MESSAGES(

  • exporting

  • INCLUDING_PERMANENT_MSG = abap_false

).

Best Regards,

navin fernandes

Former Member
0 Kudos

Hi everyone..

Problem solved.

SInce my view in which i was giving the error messages was held in another view ..

the application was creating a prob.

I defined a message area in my sub view and gave the message there.

Thank You everyone.. specially arun..!

Answers (2)

Answers (2)

Former Member
0 Kudos

hi ,

ur method WDDOBEFOREACTION validates ur input which u have entered ,

so u r correct in the way u r validating in this methood.WDDOAFTERACTION is the method for non specific operations before navigation .

the sequence shud be

WDDOMODIFY->WDDOINIT->WDOBEFOREACTION->WDDOAFTERACTION->WDDOEXIT

regards,

amit

Former Member
0 Kudos

Do the validation in WDDOAFTERACTION EVENT.

This will solve your problem.

Regards,

Pramod

Former Member
0 Kudos

Hi ..

tried doin it in the wdafteraction event..

its still the same..

May i know how does is it actaually supposed to behave..

Best Regards,

navin fernandes.