Skip to Content

How to Obtain Fiscper from Cal month in Update routine

Dear Xpertz

Could any please answer how can we get fiscper from cal month.Ny code will appreciate.

Here is the function module"FISCPER_FROM_CALMONTH_CALC"

is there any other option with out using the above function module..

Any answers will appreciate..

Thanx In Advance

Urs

RMK

**No need to say good answers will get full pointz**

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2006 at 12:53 PM

    Hi,

    in start routine of update rule of your ODS/Cube.

    Try this code...

    *********************************

    DATA: S_DATA TYPE STANDARD TABLE OF DATA_PACKAGE

    WITH HEADER LINE

    WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

    DATA: IT_DATA TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE

    WITH HEADER LINE

    WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

    DATA: ZCALMONTH TYPE RSCALMONTH.

    DATA: ZFPER3 TYPE T009B-POPER,

    ZFYESR TYPE T009B-BDATJ,

    ZFPER TYPE RSFISCPER.

    LOOP AT DATA_PACKAGE INTO S_DATA.

    S_DATA-CALMONTH = ZCALMONTH.

    CALL FUNCTION 'FISCPER_FROM_CALMONTH_CALC'

    EXPORTING

    IV_CALMONTH = ZCALMONTH

    IV_PERIV = 'K4' 'you can give your fiscvarnt there

    IMPORTING

    EV_FISCPER =ZFPER3

    EV_FISCYEAR = ZFYEAR

    EV_FISCPER =ZFPER.

    if sy-subrc eq 0.

    S_DATA-FISCPER = ZFPER.

    endif.

    APPEND S_DATA TO IT_DATA.

    ENDLOOP.

    CLEAR DATA_PACKAGE[].

    DATA_PACKAGE[] = IT_DATA[].

    *********************************

    if any issues,let me know.

    Regards,

    San!

    Message was edited by: San!

    Message was edited by: San!

    Message was edited by: San!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2006 at 12:57 PM

    Hi,

    Compute it yourself manually with FM "<b>DATE_TO_PERIOD_CONVERT</b>".

    logic:

      DATA: ld_gjahr    LIKE t009b-bdatj,
            ld_poper    LIKE t009b-poper,
            ld_date     LIKE sy-datum.
     
     DATA : e_fiscper(7) TYPE NUMC,
            i_calday(8)  TYPE C VALUE '20060101',
            i_periv(2)   TYPE C VALUE 'V9'. '<< or K4    
        
    *
    * Format of date input 'YYYYMMDD'.
    *
      ld_date = i_calday(8).
    
      CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
        EXPORTING
          i_date               = ld_date
    *     I_MONMIT             = 00
          i_periv              = i_periv
       IMPORTING
         e_buper              = ld_poper
         e_gjahr              = ld_gjahr
       EXCEPTIONS
         input_false          = 1
         t009_notfound        = 2
         t009b_notfound       = 3
         OTHERS               = 4.
    
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                RAISING invalid.
      ENDIF.
    
      e_fiscper(4) = ld_gjahr.
      e_fiscper+4(3) = ld_poper.

    Regards!

    P.S. or use FM "<b>UMC_CALDAY_TO_FISCPER</b>"

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2006 at 01:04 PM

    Hi RMK,

    San is right, forget it.

    Ciao.

    Riccardo.

    Message was edited by: Riccardo Venturini

    Add a comment
    10|10000 characters needed characters exceeded

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.