Function Module to get first day of the fiscal year on passing a date
Hi Experts!!
Can you please suggest a Function Module to get first day of the fiscal year on passing a date..?
Example: if a fiscal year starts from 30 November 2009 and ends at 28 november 2010.
it should return 30 th nov 2009 (first day of the fiscal year)
Moderator message - Welcome to SCN.
I think you'll find that this question has been answered before. Please search the forum before posting.
Also, Please read Please read "The Forum Rules of Engagement" before posting! HOT NEWS!! and How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
Rob
Similar Messages
-
Function Modules to get First day of week, month, Year
Can anyone name the Function Modules for getting First day of week, month ,year.
to get first day of week use this function; WEEK_GET_FIRST_DAY
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
WEEK = '201107'
IMPORTING
DATE = l_date
EXCEPTIONS
WEEK_INVALID = 1
OTHERS = 2.
with DATE_COMPUTE_DAY function you can get date number in week.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
DATE = workdate
IMPORTING
DAY = day_of_week_num
EXCEPTIONS
OTHERS = 8.
CASE day_of_week_num.
WHEN 1.
hold_day_of_week = 'Monday'.
WHEN 2.
hold_day_of_week = 'Tuesday'.
WHEN 3.
hold_day_of_week = 'Wednesday'.
WHEN 4.
hold_day_of_week = 'Thursday'.
WHEN 5.
hold_day_of_week = 'Friday'.
WHEN 6.
hold_day_of_week = 'Saturday'.
WHEN 7.
hold_day_of_week = 'Sunday'.
WHEN OTHERS.
hold_day_of_week = 'invalid'.
ENDCASE. -
FM for First day of the Fiscal Year.
Hi ,
i want to calculate First day of the Fiscal Year ,please send me the FM name urgently.
Thanks in advancehi,
BAPI_CCODE_GET_LASTDAY_FYEAR
this will give you back the last day of a fiscal year for a company code, but if you start with previous year, than you add 1 to the result, than you get first day of current fiscal year.
FIRST_AND_LAST_DAY_IN_YEAR_GET
this will give you back the first and the last dates of a given year, but you'll need the period version as well.
hope this helps
ec -
BI Content Variable on 0Calday for first day of the fiscal year and first day of the current month
Hi Friends,
In one of my BEx queries, I need to restrict a key figure for 0Calday based on the first day of the current fiscal year. And another key figure for the first day of the current month. Instead of using Customer exit, I hope there is some SAP delivered standard variable for these filters.
Please let me know if there is anything available for this. Your answers will be highly appreciated.
Thanks & Regards,
RanjanHi Ranjan,
Please find below standard variables.
Pls check below link for more.
Standard Variables in BEX related to Time Charcteristics
Characteristic
Variable
Description
0CALDAY
0CWD
Current Workday (SAP Exit)
0CALDAY
0CYTCD
Cumulated to Current Day (SAP Exit)
0CALDAY
0DAT
Current Calendar Day (SAP Exit)
0CALDAY
0DAY_***
Cumulation of all Values to Key Date (SAP-Exit)
0CALDAY
0LYTCLD
Cumulated to Current Day of Previous Year
0CALDAY
0LYTCLD
Previous Year Cumulated to Current Day (SAP Exit)
0CALDAY
0L_DATE
Last Calendar Date
0CALDAY
0P_LY_R
Comparative Period for Last Year
0CALDAY
0P_TY_R
Period for Current Year up to Yesterday
0CALDAY
0S_KDATE
Key Date Interval for Previous Year (SAP Exit)
0CALDAY
0S_KDAY
Key Date Interval Current Year (SAP Exit)
Best,
SATYA. -
Function module for getting starting day of a week form current data
Hi ,
Is there any function module that gives starting day of week when we give a particular date
eg: today date is 19-12-2007
if i give this date as input i should get 16-12-2007 because this is starting day of this week .Hi,
Use FM GET_WEEK_INFO_BASED_ON_DATE
You will get the first day of the week in export parameter MONDAY
Lokesh -
How to get first day of the month by the given date?
Now, is there function in CRM system that can get the first day of the month ?
for example:
input date is 2007/12/12, then return 2007/12/01 (the first day of month).
Thank you~Hi ping,
data: w_date type sy-datum ,
w_temp(2) type c.
w_date = '20071212'.
w_temp = w_date+6(2).
w_temp = w_temp - 1.
w_date = w_date - w_temp.
write / w_date.
Plz Reward if useful,
Mahi. -
I am trying to get "First day of the week" data from CLDR spec24 but cannot find where to look for it in the spec. I need this data to calculate numeric value of "LOCAL day of the week".
This data to implement "c" and "cc" day formats that equals numeric local day of the week.
e.g if "First day of the week" data for a locale is 2 (Monday) , it means numeric value for local day of the week will be 1 if it is Monday that day, 2 if it is Tuesday that day and likewise.Hi
If you want to week to be started with Sunday then use the following formula:
TimestampAdd(SQL_TSI_DAY, 1-DAYOFWEEK(Date'@{var_Date}'), Date'@{var_Date}') if it's retail week(starts from Monday) then the follow below:
TimestampAdd(SQL_TSI_DAY, 1-DAYOFWEEK(Date'@{var_Date}'), Date'@{var_Date}')
I'm assuming var_Date is the presentation variable for prompt...
Edited by: Kishore Guggilla on Jan 3, 2011 4:48 PM -
The system could not calculate the fiscal year start or finish date message
While running the transaction FMO1 and FMOA in funds management we have confronted with the following problem.
Message no. FI 500
The system could not calculate the fiscal year start or finish date.
WE are using year dependent fiscal year and are implementing Funds Management for the first time.
SAP Version 4.0 B
Priority Urgent
For the same problem in Version 4.5 and 4.6 there is a note number 213713 available on service.sap.com.No, there is no bug.
Those activities that have asterisks (Stars) next to their start or finish dates (despite having no constraints) have "External Early Start" or "External Late Finish" dates, respectively, assigned to them. These dates get imported with XER and represent links to activities of those projects that are not in your database but in the external database where the XER originated from.
To remove, filter out all such activities (with stars) and delete their "External" dates. However, be aware that Start or Finish dates of such activities might change if you delete theire External dates. If getting rid of asterisks does alter your schedule, ask the person who sent you the XER to confirm start/finish dates of all such (starred) activiites.
Cheers -
Find out the FISCAL YEAR by putting today date.
From which table I can find out the FISCAL YEAR by putting today date.
Thanks
Krishi Kris,
try FM GET_CURRENT_YEAR.
You have to add a date and a company code and you'll get:
current year
current period
previous year
previous period
hope this helps
ec -
Dear All.
As there is one function module BWSO_DATE_GET_FIRST_WEEKDAY which returns the first day of the week but its Monday but in our case we require Saturday and in some cases Monday.
our user in UK are running the same report in which i have to calculate the stock base on starting day Monday and other uses are in KSA where the starting day of the week is Saturday.
Is there any standard option available do achieve this.
Kind regards,Hi Zeeshan,
There are two options
Option 1: In Routine or CMOD or in Variable use offset +5 or -2 according to your reporting requirements.
Option 2: Maintain the table entries 52 Posting periods in T0009 or in custom table with special FISCAL Variant. (i.e., each week = one posting period). Have a loop up in that table according to your requirement.
Hope either one of the option would help you in meeting your requirement.
Best Wishes,
BVC -
How to - get first DAY of the month from the date ?
Hi
pls helphi,
data : DAYNR LIKE HRVSCHED-DAYNR,
DAYTXT LIKE HRVSCHED-DAYTXT.
data langu like sy-langu value 'EN'.
Parameters PDATE LIKE SY-DATUM.
PDATE+6(02) = '01'.
CALL FUNCTION 'RH_GET_DATE_DAYNAME'
EXPORTING
LANGU = LANGU
DATE = PDATE
CALID =
IMPORTING
DAYNR = DAYNR
DAYTXT = DAYTXT
DAYFREE =
EXCEPTIONS
NO_LANGU = 1
NO_DATE = 2
NO_DAYTXT_FOR_LANGU = 3
INVALID_DATE = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE :/ PDATE, DAYNR, DAYTXT.
(OR)
Try..
DATA:DAYNR LIKE HRVSCHED-DAYNR,
DAYTXT LIKE HRVSCHED-DAYTXT,
DAYFREE LIKE HRVSCHED-NODAY.
DATA:LANGU LIKE SY-LANGU ,
DATE LIKE SY-DATUM,
CALID LIKE P1027-CALID VALUE 'US'.
date = sy-datum.
date+6(2) = 01. "----->to get the first day .
*first day of the month
write:/ 'First date of the month', date.
*Day name
CALL FUNCTION 'RH_GET_DATE_DAYNAME'
EXPORTING
langu = SY-LANGU
date = DATE
CALID = CALID
IMPORTING
DAYNR = DAYNR
DAYTXT = DAYTXT
DAYFREE = DAYFREE
EXCEPTIONS
NO_LANGU = 1
NO_DATE = 2
NO_DAYTXT_FOR_LANGU = 3
INVALID_DATE = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ DAYTXT.
Don't forget to reward if useful.... -
Urgent ...! How to get Current Quarter of the Fiscal Year
Hi Friends,
I need to calculate current Quarter of the Fiscal Year 4 , 5 like that. SAP has Provided 3 Variable(Current Quarter of the Fiscal Year 2 like that 3 variables), my customer is looking for some more variables. Can any one help me out hhow to Calculte Current Quarter of the Fiscal Year 4. How can i see the code of the SAP EXit's. Based on that i will try to write the code.
Thanks in Advance!
Nagesh.Hi Nagesh,
the code for SAP Exits must be in Function-Pools SAPLRS_BCT* (I'm not quite sure). But this code
seems to work different than customer Exits.
See How-To-Guide
https://service.sap.com/~sapdownload/011000358700002762582003E/HowToDeriveVariableValue.pdf
for a good example of how to implement Customer-Extis.
(It's a 2.x Guide but still valid for 3.x)
Regards
Robert -
Function module for getting ASCII number of the character
I need to know the ASCII number of the appropriate character. Which function module can I use? Thank you
hi,
U can use this code below
report demtest.
data : c.
field-symbols : <n> type x.
data : rn type i.
c = 'A'.
assign c to <n> casting.
move <n> to rn.
write rn.
This will convert 'A' to 65.
OR try FM LIST_TO_ASCII
Sri -
Function module to read customer balances for current fiscal year.
Hi,
Could anyone please tell me about the function module which would display the customer credit balances from the FD10n transaction code for teh current fiscal year. that means from july 2010 to july 2011.Hi,
use the BAPI 'BAPI_AR_ACC_GETCURRENTBALANCE'
CALL FUNCTION 'BAPI_AR_ACC_GETCURRENTBALANCE' "Closing balance of customer account in current fiscal year
EXPORTING
companycode = " bapi3007_1-comp_code Company code
customer = " bapi3007_1-customer Customer
IMPORTING
actual_balance = " bapi3007_9 Carry forward balance and balance
return = " bapireturn Return Code
. " BAPI_AR_ACC_GETCURRENTBALANCE
This method provides a customer's balance for the current fiscal year.
It displays both the balance of standard transactions and the total balance of standard transactions and all special general ledger transactions.
Read the Documentation of the BAPI.
Regards,
Dhina.. -
FM to get Controlling area with Input Fiscal Year Variant..
Hi,
I need a Function module to get Controlling Area with Input fiscal Year Variant(PERIV).
Regards,
Deepthi.Hi,
Check the FMs whether it satisfies your requirement.
FERC_DEFAULT_GET
FERC_PARAMETERS_GET
Thanks,
Nithya
Maybe you are looking for
-
Got a white screen on my brand new iPod touch. Any ideas how to fix it?
Got a brand new iPod touch last night & as soon as I turned it on I got a white screen. It connected to iTunes fine & I did try to restore it with no luck. Any sugggestions would be appreciated!
-
Hi to all guru i need your help can anybody provide me any doc of free of charge item, speacially wat type of condition types will be there in the pricing... what r the necessary configaration my mail id is [email protected]
-
I can't download any software after my 10.6.3 update from 10.5.8
I was updating my imac from os 10.5.8 to 10.6.3 which went smoothly. Afterwards though i can't download the update combo 10.6.8 and any other updates for other software i have on my computer.
-
Hi All Ihave problem with importin data import done in AR8ISO8859P6 character set and AR8ISO8859P6 NCHAR character set export client uses WE8ISO8859P1 character set (possible charset conversion) export server uses WE8ISO8859P1 NCHAR character set (po
-
Display Large Float w/o Scientific Notation
I have a series of dollar amounts (from an SQL cursor) that I am summing up using a java.lang.Float. The values total correctly, but when I display the value it is displayed using Scientific Notation (4.19150150185925 E12). I need to write my total v