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

help me please

Former Member
0 Likes
870

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
846

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

7 REPLIES 7
Read only

Former Member
0 Likes
846

ANY IDEAS

Read only

0 Likes
846

Hi,

check this FM in SE37

F4_DATE

Cheers,

jose.

Read only

Former Member
0 Likes
846

You can use FM 'F4_DATE' for displaying the calender.

Read only

Former Member
0 Likes
846

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.

Read only

Former Member
0 Likes
847

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

Read only

Former Member
0 Likes
846

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.

Read only

Former Member
0 Likes
846

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.