on 04-24-2015 10:09 AM
Hi,
i Have a senario for Date Of Birth validation..
In Webui when ever Click on SAVE Button i need to rise a error message on Date of Birth
Condition : Date of Birth is in between "Current date" and below "18years to current date" rise a error msg.
Please Help me How to do this.
Regards
Nagendra
clear lv_string1.
DATA: lv_date TYPE sy-datum.
*
lv_string1 = lr_node->get_property_as_string( iv_attr_name = 'BIRTHDATE').
if lv_string1 is not INITIAL.
CALL FUNCTION 'CONVERT_DATE_INPUT'
EXPORTING
INPUT = lv_string1
PLAUSIBILITY_CHECK = 'X'
IMPORTING
OUTPUT = lv_date
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
WRONG_FORMAT_IN_INPUT = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = lv_date
I_KEY_DAY_FROM = '00'
I_DATE_TO = sy-datum
I_KEY_DAY_TO = '00'
IMPORTING
E_DAYS = days.
* E_MONTHS =
* E_YEARS =
IF days LE 6570.
lr_msg_srv = me->view_manager->get_message_service( ).
IF lr_msg_srv IS BOUND.
lr_msg_srv->add_message( iv_msg_type = 'E'
iv_msg_id = '/RCRM/D_MSG'
iv_msg_number = '031' ).
EXIT.
ENDIF.
ENDIF.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Arden
Any Other Approch for doing this without BADI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
yes you can do this in the event handler of the button. Mostly the save button will have event handler name as "EH_ONSAVE" of the _IMPL class.
second approach is use "order_save" badi method "check_before_save" method, use raise do_not_save if you dont want to save the transaction
Br,
Navn
thanks for replying me.
i got a solution for this.
if lv_string1 is not INITIAL.
CALL FUNCTION 'CONVERT_DATE_INPUT'
EXPORTING
INPUT = lv_string1
PLAUSIBILITY_CHECK = 'X'
IMPORTING
OUTPUT = lv_date
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
WRONG_FORMAT_IN_INPUT = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = lv_date
I_KEY_DAY_FROM = '00'
I_DATE_TO = sy-datum
I_KEY_DAY_TO = '00'
IMPORTING
E_DAYS = days.
* E_MONTHS =
* E_YEARS =
IF days LE 6570.
lr_msg_srv = me->view_manager->get_message_service( ).
IF lr_msg_srv IS BOUND.
lr_msg_srv->add_message( iv_msg_type = 'E'
iv_msg_id = '/RCRM/D_MSG'
iv_msg_number = '031' ).
EXIT.
ENDIF.
ENDIF.
ENDIF.
Hi Nagendra
There is a PARTNER_UPDATE BADI which can be used for this purpose.
Regards
Arden
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.