on 03-05-2024 3:55 PM
Iam using this fm to get data of a fiscal year. If i enter posting period as 8 ie, November and Year as 2023. it should get data from 1st Dec 2022 to 30th Nov 2023 ie, 12 months. Instead of this it is fetching data from 1st Nov 2022 to 30th Nov 2023 ie, 13 months. kindly help. below is the code. it is giving e_date = 1st Nov 2022 , instead of 1st Dec 2022.
* Get Billing Date
* Posting Date YYYY
DATA lv_gjahr TYPE bdatj.
* Posting Period
DATA lv_poper TYPE poper.
lv_gjahr = im_gjahr - 1. " Previous Year of Input
* Date of First Day determined for Period and Fiscal Year
CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = lv_gjahr
i_periv = 'V3' " April - March, 4 Special Periods
i_poper = lv_poper
IMPORTING
e_date = gv_ysd
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.
ENDIF.
IF im_poper > 2.
lv_poper = im_poper - 2. " Last 2 Months of Input Period
ELSE.
lv_poper = im_poper.
ENDIF.
lv_gjahr = im_gjahr.
* Date of First Day determined for Period and Fiscal Year
CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = lv_gjahr
i_periv = 'V3' " April - March, 4 Special Periods
i_poper = lv_poper
IMPORTING
e_date = gv_qsd
EXCEPTIONS
input_false = 1
t009_notfound = 2
t009b_notfound = 3
OTHERS = 4.
IF sy-subrc <> 0.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.