Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Date validations

Former Member
0 Likes
678

Hi,

Any body tell me what is the function module to validate the date.

and is there any function module to check both the dates date1 and date2. Please send me all the function modules regarding all the date validations and to check the dates. Very urgent........

Thanks.........

5 REPLIES 5
Read only

Former Member
0 Likes
588

Hi anil,

1. DATE_CONVERT_TO_FACTORYDATE - Calculates and returns factory calendar date for a date (if CorrectOption = '+'); Checks if the date is work day (if CorrectOption = '-').

2. DATE_GET_WEEK - Returns week in which a date lies import : YYYYMMDD; Export : YYYYNN, where NN is # of week.

3. DATE_COMPUTE_DAY - Returns day of week for a date Import : YYYYMMDD; Export : 1-Monday, ...

4. WEEK_GET_FIRST_DAY - Import week in format YYYYNN where NN is # of week.

5. GET_WEEK_INFO_BASED_ON_DATE - mport : YYYYMMDD; Export : YYYYNN - week # for the date, Monday and Sunday of the week.

6. DATE_GET_FIRST_DAY_OF_WEEK - Returns week within which a date lies

check the below link for all the date and time function modules with description.

http://www.geocities.com/victorav15/sapr3/abapfun.html#date

date validation

Read only

Former Member
0 Likes
588

Check with the words CHECKDATE* in SE37

Read only

Former Member
0 Likes
588

try with

GM_VALIDATE_DATE_RANGE

Read only

andreas_mann3
Active Contributor
0 Likes
588

here's a simple routine:

*check Überlappung

   LOOP AT ztab WHERE mahns = ztab-mahns
                  ...
                  AND ( d1 BETWEEN ztab-d1 and ztab-d2
                  or    d2 between ZTAB-d1 AND ztab-d2 ).

    ENDLOOP.

    IF sy-subrc = 0.
      MESSAGE e000(yp) WITH text-e02.

A.

Read only

Former Member
0 Likes
588

to validate 2 dates u can store the dates in one itab , then loop at itab and call this FM

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.

Message was edited by:

Chandrasekhar Jagarlamudi