on 09-29-2011 4:16 PM
HI,
And i got a Doubt i need to Validate the Input and i have to show the Error Message and i know its Simple and i am Just trying in if_wd_message_maanger. but if i Enter Wrong Sale Order Number it should throw the Error.
Regards,
Sadiq.
You should use hook method WDDOBEFOREACTION to validate user inputs. As you stated, you throw error messages with the message manager.
I always get the Message Manager in WDDOINIT of CC and bind it to a global attribute so I don't have to define it ever again:
* WD4A API
DATA lo_api_componentcontroller TYPE REF TO if_wd_component.
* Globales Interface holen
lo_api_componentcontroller = wd_this->wd_get_api( ).
* Message Manager in Attribut schreiben für globalen instanziierten Zugriff
wd_this->z_go_mess_man = lo_api_componentcontroller->get_message_manager( ).
The you can just access it like this from wherever you want. Example:
wd_comp_controller->z_go_mess_man->report_attribute_error_message
But what exactly is your problem? Do you need help with the approach or is your coding not doing what you want it to?
regards, Lukas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Basha,
You want to raise a message if values is not there in vbeln field??
For example : if lv_vbeln is initial.
* 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->REPORT_MESSAGE
EXPORTING
MESSAGE_TEXT = 'Enter Sales Order'.
ENDIF.
OR if you want to check wheather entered value is there or not in database means..
using select quesry check that.
You need write use some coding to get this..
First get all vbeln values in one internal table.
loop at it_vbeln into wa_vbeln // Your vbeln field.
read table itab into witab with key vbeln = wa_vbeln.
if sy-subrc ne 0.
//raise error message. means the entered vbeln is not in database.
endif.
endloop.
Hope it clear.
Cheers,
Kris.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.