‎2008 Feb 11 5:10 AM
Hi all,
Can anybody help me out please? I'd like to let the user to select a date through f4 and please note that the date should be in month & year.
Thanks in advance.
‎2008 Feb 11 5:36 AM
Try it this way:
PARAMETERS: p_mon TYPE char2,
p_yr TYPE char4.
DATA: g_date TYPE gkday.
START-OF-SELECTION.
CONCATENATE p_yr p_mon '01' INTO g_date.
CALL FUNCTION 'F4_DATE_CONTROL'
EXPORTING
date_for_first_month = g_date
IMPORTING
select_date = g_date
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.
WRITE: g_date.
Regards
Eswar
‎2008 Feb 11 5:28 AM
‎2008 Feb 11 5:31 AM
‎2008 Feb 11 5:30 AM
‎2008 Feb 11 5:32 AM
parameter: pa_date type sy-datum.
this will automatically provide a calendar at F4. But to show the factory calendar, that depends on.. how your system is configured...
Reward points if useful.
‎2008 Feb 11 5:36 AM
Try it this way:
PARAMETERS: p_mon TYPE char2,
p_yr TYPE char4.
DATA: g_date TYPE gkday.
START-OF-SELECTION.
CONCATENATE p_yr p_mon '01' INTO g_date.
CALL FUNCTION 'F4_DATE_CONTROL'
EXPORTING
date_for_first_month = g_date
IMPORTING
select_date = g_date
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.
WRITE: g_date.
Regards
Eswar
‎2008 Feb 11 5:37 AM
HI Shaheen,
Create a data element with the data type DATS. Assign this data element to the parameters field that you want to display in selection screen.
Ex. parameters p1 type ZMODIFIED_DATE.
ZMODIFIED_DATE is the data element with the data type DATS.
Reward points if useful.
Regards
Vidhya.
‎2008 Feb 11 5:38 AM
Thanks ..... can you please show me how it should be so that I can have the only monthe and year appearing
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.