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

F4_DATE

Former Member
0 Likes
2,031

Hi,

can anyone tell me what is the use of F4_DATE function module and how is it used in the program?and also can you give me a sample code for that?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,454

Hello,


FU F4_DATE

____________________________________________________

Short text

    Display factory calendar or Gregor. calendar and choose a day

     see also the parameter documentation (long texts).

Parameter

    DATE_FOR_FIRST_MONTH
    DISPLAY
    FACTORY_CALENDAR_ID
    GREGORIAN_CALENDAR_FLAG
    HOLIDAY_CALENDAR_ID
    PROGNAME_FOR_FIRST_MONTH
    SELECT_DATE
    SELECT_WEEK
    SELECT_WEEK_BEGIN
    SELECT_WEEK_END

Exceptions

    CALENDAR_BUFFER_NOT_LOADABLE
    DATE_AFTER_RANGE
    DATE_BEFORE_RANGE
    DATE_INVALID
    FACTORY_CALENDAR_NOT_FOUND
    HOLIDAY_CALENDAR_NOT_FOUND
    PARAMETER_CONFLICT

This is the sample code

DATA: DATE TYPE D.
CALL FUNCTION 'F4_DATE'
     IMPORTING
          SELECT_DATE = DATE.

Regards,

Vasanth

6 REPLIES 6
Read only

Former Member
0 Likes
1,455

Hello,


FU F4_DATE

____________________________________________________

Short text

    Display factory calendar or Gregor. calendar and choose a day

     see also the parameter documentation (long texts).

Parameter

    DATE_FOR_FIRST_MONTH
    DISPLAY
    FACTORY_CALENDAR_ID
    GREGORIAN_CALENDAR_FLAG
    HOLIDAY_CALENDAR_ID
    PROGNAME_FOR_FIRST_MONTH
    SELECT_DATE
    SELECT_WEEK
    SELECT_WEEK_BEGIN
    SELECT_WEEK_END

Exceptions

    CALENDAR_BUFFER_NOT_LOADABLE
    DATE_AFTER_RANGE
    DATE_BEFORE_RANGE
    DATE_INVALID
    FACTORY_CALENDAR_NOT_FOUND
    HOLIDAY_CALENDAR_NOT_FOUND
    PARAMETER_CONFLICT

This is the sample code

DATA: DATE TYPE D.
CALL FUNCTION 'F4_DATE'
     IMPORTING
          SELECT_DATE = DATE.

Regards,

Vasanth

Read only

Former Member
0 Likes
1,454

Hi,

If you use this F4_DATE function module, then a Calender will open in a Pop up.

Here is the example code

CALL FUNCTION 'F4_DATE'

EXPORTING

date_for_first_month = '20031208'
holiday_calendar_id = 'CA'           "<<==-- Here is how you point on a holiday calendar
*     factory_calendar_id = T001W-FABKL    "<<==-- ... or a factory one

display = ' '

IMPORTING

select_date = select_date

EXCEPTIONS

OTHERS = 4.

Regards

Sudheer

Read only

Former Member
0 Likes
1,454

if you pass a date , it would display the claender and highlight that particular date inthe calender, wherein u can select another date too...

reward if helpful.

Read only

Former Member
0 Likes
1,454
Read only

gautam_totekar
Active Participant
0 Likes
1,454

IT DISPLAYS A GREGORIAN OR A FACTORY CALENDER AND ALLOWS YOU TO CHOOSE A DATE.

PARAMETERS TO BE PASSED :

DATE_FOR_FIRST_MONTH - DISPLAYS THE CALENDER WITH THE DATE PASSED TO IT. YOU CAN NAIGATE LATER IF YOU WANT WHILE SELECTION.

usually we pass todays date over here.

If both HOLIDAY_CALENDAR_ID and FACTORY_CALENDAR_ID were passed, the function module reacts with an exception.

if display is 'X' then selection is not allowed.

SELECT_DATE contains the value DATE_FOR_FIRST_MONTH or the value of the date which user has selected .

code:

CALL FUNCTION 'F4_DATE'

EXPORTING

  • DATE_FOR_FIRST_MONTH = SY-DATUM

  • DISPLAY = ' '

  • FACTORY_CALENDAR_ID = ' '

  • GREGORIAN_CALENDAR_FLAG = ' '

  • HOLIDAY_CALENDAR_ID = ' '

  • PROGNAME_FOR_FIRST_MONTH = ' '

  • IMPORTING

  • SELECT_DATE =

  • SELECT_WEEK =

  • SELECT_WEEK_BEGIN =

  • SELECT_WEEK_END =

  • EXCEPTIONS

CALENDAR_BUFFER_NOT_LOADABLE = 1

DATE_AFTER_RANGE = 2

DATE_BEFORE_RANGE = 3

DATE_INVALID = 4

FACTORY_CALENDAR_NOT_FOUND = 5

HOLIDAY_CALENDAR_NOT_FOUND = 6

PARAMETER_CONFLICT = 7

OTHERS = 8

.

IF SY-SUBRC <> 0.

ENDIF.

Read only

Former Member
0 Likes
1,454

Hi ,

please check the same , for more Info check Documentation of this FM.

PARAMETER: DATES LIKE SY-DATUM.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATES.

PERFORM F4..

START-OF-SELECTION.

WRITE: DATES.

&----


*& Form f4

&----


  • text

----


FORM F4.

CALL FUNCTION 'F4_DATE'

  • EXPORTING

  • DATE_FOR_FIRST_MONTH = SY-DATUM

  • DISPLAY = ' '

  • FACTORY_CALENDAR_ID = ' '

  • GREGORIAN_CALENDAR_FLAG = ' '

  • HOLIDAY_CALENDAR_ID = ' '

  • PROGNAME_FOR_FIRST_MONTH = ' '

IMPORTING

SELECT_DATE = DATES

  • SELECT_WEEK =

  • SELECT_WEEK_BEGIN =

  • SELECT_WEEK_END =

  • EXCEPTIONS

  • CALENDAR_BUFFER_NOT_LOADABLE = 1

  • DATE_AFTER_RANGE = 2

  • DATE_BEFORE_RANGE = 3

  • DATE_INVALID = 4

  • FACTORY_CALENDAR_NOT_FOUND = 5

  • HOLIDAY_CALENDAR_NOT_FOUND = 6

  • PARAMETER_CONFLICT = 7

  • OTHERS = 8

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. "f4

Regards

Peram