Skip to Content
author's profile photo Former Member
Former Member

data type

is there any data type for the field in the selection screen, so that i can enter only the year value?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 02, 2007 at 09:49 AM

    Hi,

    use the int type and then validate ur input as per the year requirement

    Regards,

    Sonika

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 02, 2007 at 09:47 AM

    according to my knowledge we dont have.

    if u want to display only the year means why cant u use the integer data type

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 12:14 PM

    use the data type date and the by using string concept remove it from month and date ,,system order for data type date is yyyy/mm/dd

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      HI Pramod.

      Try this sample code..Is this what you are looking for.

      TYPES: BEGIN OF ty_year,

      year TYPE gjahr,

      END OF ty_year.

      DATA: i_years TYPE STANDARD TABLE OF ty_year,

      wa_years TYPE ty_year.

      PARAMETERS: ws_year TYPE gjahr.

      AT SELECTION-SCREEN ON VALUE-REQUEST FOR ws_year.

      DO 20 TIMES.

      IF wa_years-year IS INITIAL.

      wa_years-year = sy-datum+0(4).

      ELSE.

      wa_years-year = wa_years-year - 1.

      ENDIF.

      APPEND wa_years TO i_years.

      ENDDO.

      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

      EXPORTING

      retfield = 'GJAHR'

      dynpprog = sy-repid

      dynpnr = sy-dynnr

      dynprofield = 'WS_YEAR'

      value_org = 'S'

      TABLES

      value_tab = i_years

      .

      IF sy-subrc <> 0.

      • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.