Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

 To find the number of days in a factory calendar, for a given year

*******finding numbe of days in a month*******

TABLES: tfacs.

DATA: lv_num TYPE i, lv_string TYPE char40,

      lv_var TYPE char20.



DATA: lv_date TYPE d,

      lv_count TYPE i.



FIELD-SYMBOLS: <fs> TYPE tfacs, <fs_temp> TYPE ANY.



lv_date = sy-datum.



DATA: BEGIN OF itab OCCURS 0.

        INCLUDE STRUCTURE tfacs.

DATA: END OF itab.



SELECT SINGLE *

  FROM tfacs

  INTO itab

  WHERE ident = 'US'

  AND  jahr = lv_date+0(4).

APPEND itab.



READ TABLE itab ASSIGNING <fs> INDEX 1.



DO 12 TIMES.

  ASSIGN COMPONENT sy-index OF STRUCTURE <fs> TO <fs_temp>.

  IF sy-subrc NE 0.

    EXIT.

  ELSEIF sy-index NE 1.

    lv_count = STRLEN( <fs_temp> ).

    WRITE:/ lv_count.

  ENDIF.

ENDDO.