‎2007 Sep 10 9:20 PM
Hi Experts,
I do not know ABAP which explains my straight forward question.
I am coding in BI.
Based on an invoice date, I need to work-out the fiscal year.
If the month of the invoice date is >= 4, then the fiscal year, is the current year.
If the month of the invoice date is jan-march, then the fiscal year, it the current year-1.
Thank you.
PY
‎2007 Sep 10 9:43 PM
data: gs_month(2) type c.
gs_month = gs_invoice_date+4(2).
if gs_month GE 4.
gs_fiscal_year = sy-datum+0(4).
elseif gs_month between '01' and '03'.
gs_fiscal_year = sy-datum+0(4) - 1.
endif.
Greetings,
Blag.
‎2007 Sep 10 9:43 PM
data: gs_month(2) type c.
gs_month = gs_invoice_date+4(2).
if gs_month GE 4.
gs_fiscal_year = sy-datum+0(4).
elseif gs_month between '01' and '03'.
gs_fiscal_year = sy-datum+0(4) - 1.
endif.
Greetings,
Blag.
‎2007 Sep 10 9:51 PM
‎2007 Sep 10 9:56 PM
Like this...
data: gs_fiscal_year type sy-datum.
Greetings,
Blag.
‎2007 Sep 10 10:03 PM
Blag - wouldn't you rather have a four character fiscal year?
If you do subsequent work on the field as you have declared it (say add a year), you will get unexpected results.
Rob
Message was edited by:
Rob Burbank
‎2007 Sep 10 9:52 PM