‎2008 Feb 11 9:38 AM
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?
‎2008 Feb 11 9:44 AM
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
‎2008 Feb 11 9:44 AM
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
‎2008 Feb 11 9:45 AM
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
‎2008 Feb 11 9:45 AM
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.
‎2008 Feb 11 9:58 AM
hi
good
check these links on F4_DATE
http://help.sap.com/saphelp_nw04s/helpdata/en/3d/e53642e2a3ab04e10000000a1550b0/content.htm
thanks
mrutyun^
‎2008 Feb 11 10:04 AM
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.
‎2008 Feb 11 10:12 AM
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