Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
4,064

Calendar F4 for characteristic classification

Requirement:

When we enter Date specific classification values the F4 help should display a calendar to choose a date.

Detailed Requirement:

Transaction to create the characteristics is CT04

The characteristic Test_date is defined with data type “ Date format”.

We don’t get a calendar while we try to maintain value for the characteristic through MM02.

Go to transaction MM02 > Enter Material 100057

Select Views > Classification

Use Material Class 001> HALB

Go to characteristics values “TEST_DATE”

Requirement is when we use F4 it should give the calendar to select a date from it.

Normally we do not have a calendar as F4 help given in the classification.

We can obtain this in the following ways.

Technical Solution:

In CT04 give the characteristic and Go to values tab .

Click on “Other values check” and choose the radio button “ Funct. Module”

We are about to assign a function module Z_TEST_DATE in it.

We require two function modules to be created per to the following

  1. Z_TEST_DATE
  2. Z_TEST_DATE_F4 (Function module name which we use along with _F4)

Z_TEST_DATE function module contains the export parameters as follows which has the characteristic value

The Tables parameter is defined with the reference type RCTVALUES through which the values get passed to the characteristic.

There is no coding part in this function module

Z_TEST_DATE_F4

In this function module define the tables parameter

Fill the following source code in the function module

FUNCTION Z_TEST_DATE_F4.

*"----------------------------------------------------------------------

*"*"Local interface:

*"  IMPORTING

*"     REFERENCE(CHARACT_NO) TYPE  CABN-ATINN OPTIONAL

*"     REFERENCE(CHARACT) TYPE  CABN-ATNAM OPTIONAL

*"     REFERENCE(LANGUAGE) TYPE  SY-LANGU OPTIONAL

*"  TABLES

*"      VALUES STRUCTURE  RCTVALUES

*"----------------------------------------------------------------------

DATA: l_date TYPE WORKFLDS-GKDAY.

  CALL FUNCTION 'F4_DATE'

    IMPORTING

      select_date                  = l_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.

  CHECK sy-subrc EQ 0 AND NOT

        l_date IS INITIAL.

  write l_date to values-value.

  values-status = 'I'.

  APPEND values.

ENDFUNCTION.

Conclusion :

After creating the above two function module we may give the function module name in the characteristic at CT04

We get the calendar F4 displayed there in the characteristic value as given below


Labels in this area