2006 Nov 18 5:57 AM
Hi all,
Which function module can use to check the validity of a date? For example, if user key in 20060931 or 20060940, the function module should return the date is invalid. Thanks.
2006 Nov 18 6:00 AM
Hi,
of ur using f4 help ie,
field like db_tabel_ name-date_field.
automatically f4 will come
it will chk the validity.
<b>another FM is available.</b>
Check this...
DATA: v_date TYPE sydatum.
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = v_date
EXCEPTIONS
plausibility_check_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE: / 'INvalid date'.
ELSE.
WRITE: / 'Correct date'.
ENDIF.
rgds
Anver
Hi all,
Which function module can use to check the validity of a date? For example, if user key in 20060931 or 20060940, the function module should return the date is invalid. Thanks.
2006 Nov 18 6:00 AM
Hi,
of ur using f4 help ie,
field like db_tabel_ name-date_field.
automatically f4 will come
it will chk the validity.
<b>another FM is available.</b>
Check this...
DATA: v_date TYPE sydatum.
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = v_date
EXCEPTIONS
plausibility_check_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE: / 'INvalid date'.
ELSE.
WRITE: / 'Correct date'.
ENDIF.
rgds
Anver
2006 Nov 18 6:02 AM
Hi,
Use the FM:
<b>DATE_CHECK_PLAUSIBILITY</b>
Check to see if a date is in a valid format for SAP. Works well when validating dates being passed in from other systems.
Hope it helps.
Reward if helpful.
Regards,
Sipra
2006 Nov 18 6:32 AM
Hi,
If your issue solved kindly mark all helpful answers , and please close the thread.
Thanks and Regards
Anver
2006 Nov 18 9:07 AM
Hi tan
u meant to say that the user will enter the date in this format
as u quoted like <b>20060940</b> or is it in a text ? "--> my assumption
or<b> 20060930</b>
just execute the code
note that this Function module takes the input in the format YYYYMMDD
data: input(8) type c value '20060940',
H_DATUM_OUTPUT(50) TYPE C.
write:/ input.
CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'
EXPORTING
input = input
IMPORTING
OUTPUT = H_DATUM_OUTPUT.
if h_datum_output eq ' '.
write:/ 'Invalid date format' .
else.
write:/ 'Valid date format' .
endif.by changing the date value,
check this also.
input(8) type c value '20060930'
input(8) type c value '20060931'
o/p is fine .
hope this helps regards,
vijay.
2006 Nov 18 10:58 AM
Hi,
declare variable or select-option s
select-options s_date for mkpf-budat.
system implicitly check for validi date
else
use FM
month_plus_detrmine or any date fM
Regards
amole
Regards
amole
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |