F4_DATE_CONTROL is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name F4_DATE_CONTROL into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
SCAC
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'F4_DATE_CONTROL' "Display factory calendar or Gregor. calendar and choose a day
* EXPORTING
* date_for_first_month = SY-DATUM " workflds-gkday For determining the first month to be displayed
* display = SPACE " workflds-displ X = no selection option
* factory_calendar_id = SPACE " workflds-calid Factory Calendar
* gregorian_calendar_flag = SPACE " Display Gregorian calendar
* holiday_calendar_id = SPACE " workflds-hident Public Holiday Calendar
* holiday_style = '6' " i
* progname_for_first_month = SPACE " sy-repid to determine the date at the cursor position
* week_begin_day = 1 " t246-wotnr
* select_option_week = SPACE " workflds-displ
* select_option_month = SPACE " workflds-displ
IMPORTING
select_date = " workflds-gkday selected date
select_week = " scal-week
select_begin = " sy-datum
select_end = " sy-datum
select_month = " scal-week Selected month
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE = 1 " Factory calendar read error
DATE_AFTER_RANGE = 2 " Date is later than factory calendar
DATE_BEFORE_RANGE = 3 " Date is earlier than factory calendar's
DATE_INVALID = 4 " Date in invalid format
FACTORY_CALENDAR_NOT_FOUND = 5 " Factory calendar is not available
HOLIDAY_CALENDAR_NOT_FOUND = 6 " Holiday calendar is not available
PARAMETER_CONFLICT = 7 " Pass Factory calendar and Holiday calendar
. " F4_DATE_CONTROL
The ABAP code below is a full code listing to execute function module F4_DATE_CONTROL including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).
| ld_select_date | TYPE WORKFLDS-GKDAY , |
| ld_select_week | TYPE SCAL-WEEK , |
| ld_select_begin | TYPE SY-DATUM , |
| ld_select_end | TYPE SY-DATUM , |
| ld_select_month | TYPE SCAL-WEEK . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_select_date | TYPE WORKFLDS-GKDAY , |
| ld_date_for_first_month | TYPE WORKFLDS-GKDAY , |
| ld_select_week | TYPE SCAL-WEEK , |
| ld_display | TYPE WORKFLDS-DISPL , |
| ld_select_begin | TYPE SY-DATUM , |
| ld_factory_calendar_id | TYPE WORKFLDS-CALID , |
| ld_select_end | TYPE SY-DATUM , |
| ld_gregorian_calendar_flag | TYPE STRING , |
| ld_select_month | TYPE SCAL-WEEK , |
| ld_holiday_calendar_id | TYPE WORKFLDS-HIDENT , |
| ld_holiday_style | TYPE I , |
| ld_progname_for_first_month | TYPE SY-REPID , |
| ld_week_begin_day | TYPE T246-WOTNR , |
| ld_select_option_week | TYPE WORKFLDS-DISPL , |
| ld_select_option_month | TYPE WORKFLDS-DISPL . |
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name F4_DATE_CONTROL or its description.