Function module for current year
Hi ,
Is there any function module which will give current year only ??
Regards
rahul
data : a(20).
<b>CALL FUNCTION 'GM_GET_FISCAL_YEAR'</b>
EXPORTING
I_DATE = SY-DATUM
i_fyv = 'V3'
IMPORTING
E_FY = a.
EXCEPTIONS
FISCAL_YEAR_DOES_NOT_EXIST = 1
NOT_DEFINED_FOR_DATE = 2
OTHERS = 3
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 : a.
Similar Messages
-
Function module for fiscal year
Hi all,
can you please suggest me the function module for automatic generation of fiscal year.
Thanks and regards,
S.Latha.Hi Latha,
Please find below the code for auto generation of the fiscal year.
l_date = sy-datum. "l_date should declared of type sy-datum
Use the function module to get the period
CALL FUNCTION 'MC_PERIODE_ZUM_DATUM'
EXPORTING
idate = l_date
iperkz = l_p " 'P'
iperiv = l_periv "V6
IMPORTING
eperid = l_period
EXCEPTIONS
wrong_period = 1
OTHERS = 2.
l_fiscal = l_period+0(4).
l_p - 'P' i. e. Is the period indicator (Period according to fiscal year variant)
l_periv - 'V6' i.e. Is the Fiscal year variant. Here it is V6 which relates country 'US'.
l_period - gives you the Fiscal period.
l_fiscal - The first four digits of l_period gives you the 'Fiscal year'.
Hope this helps you !.
Thanks & Regards,
MM Jaffer.
Edited by: MohammedJaffer on Aug 10, 2010 12:53 PM -
Any function module for getting fiscal year week numbers
can any one provide me function module for getting fiscal year week numbers ? if no function module please let me know work around.
Thanks!
Lakshmikandhhi,
Use FM <b>'DATE_GET_WEEK'</b>...
parameter D1 LIKE SCAL-DATE.
Data w like scal-week.
CALL FUNCTION <b>'DATE_GET_WEEK'</b>
EXPORTING
date = D1
IMPORTING
WEEK = W
EXCEPTIONS
DATE_INVALID = 1
OTHERS = 2
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 W+4(2).
Regards,
Santosh -
Function module for year todate
Hi ,
Here i am looking for a functiona module for year to date (YTD ) .
For example fiscal year is Apr 2010 to till date we need to have the information . to get this kindly suggest the FM .
Thanks
VenkatHi
Please take some pain in searching on Forum.
However have a look at this link but make sure you search for available information on SCN for all your future basic queries.
[http://wiki.sdn.sap.com/wiki/display/ABAP/FunctionModulerelatedonDate+calculations]
Regards
Abhii -
Function modules for the following
Hi,
I want to know the function modules for the following purposes.
1) Check whether a date is valid or not
2) Calculate the no of days between two dates.
Expecting an early response.
Thanks n Regards,
AmitHi,
PARAMETERS: p_list LIKE t009b-bumon AS LISTBOX
VISIBLE LENGTH 11 OBLIGATORY ,
p_list1 LIKE t009b-bdatj OBLIGATORY.
SELECTION-SCREEN POSITION POS_HIGH.
PARAMETERS: p_list2 LIKE t009b-bumon AS LISTBOX
VISIBLE LENGTH 11 OBLIGATORY,
p_list3 LIKE t009b-bdatj OBLIGATORY.
Calling Function Module for calculating no of days between the
selected period
CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
EXPORTING
par_month = p_list
par_year = p_list1
IMPORTING
par_days = ws_n_days.
CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
EXPORTING
par_month = p_list2
par_year = p_list3
IMPORTING
par_days = ws_n_days1.
For Concatenating the month and year into the date format
CONCATENATE p_list1 p_list ws_i INTO ws_c_date1.
CONCATENATE p_list3 p_list2 ws_n_days1 INTO ws_c_date2.
date = ws_c_date1 - ws_c_date2.
In the above sample code the selection screen has month and year as input.
Also check this link
http://www.sapdevelopment.co.uk/tips/date/datehome.htm
Check FM
<b>RP_CALC_DATE_IN_INTERVAL</b> Add/subtract years/months/days from a date
<b>SD_DATETIME_DIFFERENCE</b> Give the difference in Days and Time for 2 dates
<b>Also for checking valid date:</b>
U can specify the date field as
Select-options: s_date like likp-date(similar to ur requirement)
This itself ceck for the valid date no seperate validation needed.
Thanks & Regards,
Judith. -
Function Modules for Data and Time
Hi all,
I need 2 function modules for date and time. when we pass current data(sy-datum) and current time (sy-uzeit) into function modules, shoud get date in <b>dd/mm/yyyy or dd.mm.yyyy</b> and time in<b> HH:MM:SS</b> formats.
Thanks in advanceHi Ranjith,
i think this will b usefull for you..
SAP Bar Chart Function Modules and what they are used for
Function module
Used for
BARC_GRAPHIC_PBO
Starting bar chart at PBO time, using a graphic profile (parameter PROFILE)
BARC_GRAPHIC_PAI
Analyzing data returned by the graphic
BARC_SET_TIME_AXIS
Setting start and end of time axis
BARC_SET_OPTIONS
Setting options
BARC_ADD_CHART
Creating a chart
BARC_SET_CHART_ATTRIB
Setting chart attributes
BARC_ADD_SECTION
Creating a section on the time axis
BARC_SET_SECTION_ATTRIB
Setting section attributes
BARC_ADD_RIBBON
Adding a ribbon to the time axis
BARC_SET_RIBBON_ATTRIB
Setting attributes for ribbons in the chart
BARC_ADD_GRID
Adding a time grid
BARC_SET_GRID_ATTRIB
Setting grid attributes
BARC_ADD_LAYER
Adding a layer (graphic elements)
BARC_SET_LAYER_ATTRIB
Setting layer attributes
BARC_ADD_LINE
Adding a line
BARC_ADD_CALENDAR
Creating a calendar
BARC_SET_CALENDAR_ATTRIB
Setting attributes for a calendar
BARC_ADD_TIME_PROFILE
Creating time profiles
BARC_SET_TIME_PROFILE_ATTRIB
Setting attributes for time profile
BARC_ADD_INTERVAL
Adding a time interval
BARC_SET_INTERVAL_ATTRIB
Setting time interval attributes
BARC_ADD_TIME_OBJECT
Creating a time object
BARC_CONVERT_DATE
Creating a date string in bar chart format
BARC_REVERT_DATE
Converting a date string in bar chart format to date and time
BARC_ADD_DATELINE
Creating a date line
BARC_SET_DATELINE_ATTRIB
Setting dateline attributes
BARC_GET_PROFILE_CONTENTS
Obtaining profile contents for customizing a chart
BARC_GET_COLUMN_WIDTH
Selecting new column width
BARC_SET_COLUMN_WIDTH
Setting the column width
BARC_GET_TEXTINDEX
Obtaining the text index of a field
BARC_SET_LABELS
Positioning the chart display
BARC_SET_COLUMN_ATTRIB
Setting column attributes
BARC_SET_ROW_ATTRIB
Setting row attributes
BARC_SET_ROW_HEIGHT
Setting the line height
BARC_SET_MAXCHARTS
Setting the maximum number of charts sent
<b>If its usefull reward points
</b> -
Function module for Fiscal period ( monat field name)
Hi ,
please suggest the function module for (monat) Fiscal period. our reqirement is default to previous accounting period from the current month.
Thnks
SrinivasHi,
Refer to the following code:
DATA: LV_FISCAL_YEAR_VAR(2) TYPE C,
LV_PERIOD LIKE T009B-POPER.
CALL FUNCTION 'CCODE_GET_FISCAL_YEAR_VARIANT'
EXPORTING
COMPANY_CODE = S_BUKRS-LOW
IMPORTING
FISCAL_YEAR_VARIANT = LV_FISCAL_YEAR_VAR
EXCEPTIONS
COMPANY_CODE_NOT_FOUND = 1
OTHERS = 2.
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
I_DATE = P_BUDAT
* I_MONMIT = 00
I_PERIV = LV_FISCAL_YEAR_VAR
IMPORTING
E_BUPER = LV_PERIOD
* E_GJAHR =
EXCEPTIONS
INPUT_FALSE = 1
T009_NOTFOUND = 2
T009B_NOTFOUND = 3
OTHERS = 4 -
Function Modules for Format Date, Month Name and Quarter value.
Hi All,
1. I am getting the date field from the Flatfile, so i need to format the date to YYYYMMDD. Is there any Function module for that in BW.
2. Based on the above Formated Date i have to find out the Name of the Month like JANUARY, FEBUARY etc.
3. Based on the same above Formated Date i need to find out the Quarter like 1, 2 etc.
Could you please let me know if any function modules are there for the above questions in BW not in ABAP, why i mention is some Function modules are there in ABAP but not in BW.
Thanks in advance.
Regards,
srinivasHi ,
1.If your input date format is MMDDYYYY then Use SDATE as conversion routine in trans strucutre to convert into YYYYMMDD.
2.By passing year as input parameter for the following FM you would get all the months with text.Using READ statement in routine you can get month name
MONTH_NAMES_GET
3.For Quarters you can use the following FM:
TSTR_PERIODS_QUARTERS
hope it helps...
regards,
Raju -
Any BAPI/Function Module for adding new record with dates in PA0027
Hi all,
I am tryig to find is there any BAPI/Function module for updating new record with Start Date and End date for specified Personal Number in PA0027 Table.
In PA0027 table i will be passing start date and end date for selected personal number, it needs to add new record with this details in the table checking the condition that this start date and end dates should not be between any of of start date and end dates for the specified personal number.
thanks for ur time.
MuraliHi Raj/Suresh thanks for ur answers.
but i am having a problem,i gave this values.
INFTY -
0027
NUMBER -
00000010
SUBTYPE -
010
OBJECTID
LOCKINDICATOR
VALIDITYEND -
03/12/2006
VALIDITYBEGIN -
03/01/2006
RECORDNUMBER -
000
RECORD -
P0027
OPERATION -
CHK
TCLAS -
A
DIALOG_MODE -
0
NOCOMMIT -
Y
VIEW_IDENTIFIER
SECONDARY_RECORD
i am getting short dump saying that
The source field is too short.
The current program, "SAPLHRMM", tried to assign a field to a field symbo
However, the field is shorter than the type of the field symbol, which
is not allowed.
The statement in question is in the form ASSIGN f TO <fs> CASTING or
ASSIGN f TO <fs> with a field symbol that was created using the
STRUCTURE addition.
I tried operation - Chage,Create (same thing for all inputs)
is this correct funtion moduel for my requirment?
what ever i am passing the start and end dates this should check in the table records with this personal number and if this start date and end dates are not between of any start and end dates then it should add new record with this dates.
Thanks for ur time.
Murali. -
Regarding Function Module for Locking ( enque)
Hi,
I am facing a Problem that is when iam running Call transaction one popup is coming because some other user currently editing that Tcode at that time i need to lock tcode using enque specially for table . If suppose some other user editing at that time it will shoe that popup and it will exit from their with out doing any other process For that i need Function module for Lock and Delock.
thanks in advance,
murali krishna.So in this example, I am doing a loop and check for a lock, if I don't get one, I wait for 5 seconds, this loop continues untill 30 seconds, no lock then it quits and gives message.
report zrich_0001.
data: counter type i.
parameters: p_equnr type equi-equnr.
start-of-selection.
clear counter.
do.
Exhausted, no luch in getting a lock, get of of DO loop.
if counter > 6.
sy-subrc = 1.
exit.
endif.
Try for lock
call function 'ENQUEUE_EIEQUI'
exporting
mode_equi = 'E'
mandt = sy-mandt
equnr = p_equnr
_wait = 'X'
exceptions
foreign_lock = 1
system_failure = 2
others = 3.
Got a lock, get out of DO loop.
if sy-subrc = 0.
exit.
endif.
Still here? Then wait another 5 seconds
wait up to 5 seconds.
counter = counter + 1.
enddo.
Report status
case sy-subrc.
when 0.
message s001(00) with 'Lock could not be established'.
when 1.
message i001(00) with 'Lock could not be established'.
endcase.
Regards,
rewards point -
Are there BAPI or function modules for creating posting address ?
Are there BAPI or function modules for creating posting address and budget address? We are currently use BDC program and T code FMBSPO_MULT (Posting address) and T code FMBSBO_MULT(budget address), but it is a very slow processing because we have thousands of funds centers.
Your input will be appreciated!
Regards,
Fisher LiLi,
You will have, may be more answers in the technical forum :
https://www.sdn.sap.com/irj/sdn/collaboration
Regards
Valérie -
Rfc enabled function module for the updating the database table
Hi,
I need one rfc enabled function module for the updating the database table from the legacy system.currently i am using the rfc_read_table to read the database table.similarly i need for the update.Hi
I believe you need to create one by yourself
Max -
Functional module for automatic creation of pur requisition & pur order
hello,
what is the functional module for automatic creation of puchase requisition and automatic creation of purchase order which we will assign in action box in service order processing management.
please let me know as early as possible
regards,
rajesh kumar rajuHi,
Please check with following.
IDOC_INPUT_ACC_PURCHASE_REQUI
IDOC_INPUT_ACC_PURCHASE_ORDER
/ISDFPS/OR_PURCHASE_ORDER_CR
BS01_PURCHASE_DOCUMENT_CREATE
CO_MP_CREATE_PURCHASE_ORDER
Thanks & Regards
Sadhu Kishore -
Parameter for current year and previous year
Hi all,
I currently have 2 reports where the query is the same except in the where clause I have it filtered to current year and previous year based on the List_Date. I would like to make this one report with a parameter of Current or Previous year.
Would I create 2 more datasets one for current and another for previous? I would think there is a easier way. Any help or direction would be great.If you define a parameter in SSRS, you can use it's value in your query. Just make sure the parameter name, and CASE (SSRS is case sensitive when it comes to parameters) are the same in SSRS and your query. There's a parameter tab on the dataset properties.
It SHOULD auto fill, but it never hurts to check, just in case.
Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.
Yes it did auto fill the parameter tab in the dataset and I get a parameter to enter the year when I preview the report. Still a little confused on how I do current or previous year. Are the next steps what I need to do?
@yearParam parameter:
1) Create Available or Default values
2) Current and Previous year as label
3) For Value do I need to use a expression for current year =Year(now()) and previous Year?
4) Add a filter on the tablix for list_date? -
Function module for calculating planned and actual cost of production order
Hi ,
Do we have any standard function module for calculating planned and actual cost for production order?
i need to implement this in a Z-report.
Thanks
SriniHi,
try below function module
CRMCO_GET_PLAN_ACTUAL_COSTS
CO_IH_GET_PLANNED_COSTS_TOTAL
Regards,
Sankaran
Maybe you are looking for
-
Transcoding MPEG-2 to Quicktime to edit in FCP X
Hello, I have many DVD's I've burned from S-VHS tapes. Is it possible to somehow transcode the MPEG 2 files so I can edit the material in FCP X? I tried and Compressor won't accept the files. I would appreciate any help anyone could offer. Thank y
-
Pin connector for front headphone ja
The front headphone jack cable connection on my Dell 4600 is incompatible with my new Xtreme Gamer soundcard's male pin connection. Can anyone tell me where to find the correct female pin connector, and how do I know which leads go to which pin slots
-
Hi All, I have file to idoc scenario where I need to use adapter module on the sender side. Can any one please s-e-n-d me links for the adapter module documents since I need to learn it from scratch. Thanks, Siva.
-
Need help with deactivating this feature. The pointer becomes a hand, when I hover over email messages. What can I do to eliminate this situation?
-
Dear Gurus, In RZ20, under ccms monitoring template -> Buffers, i found the following messages. Please note the swap ratio for " table description, field description and Export/Imort. Please suggest me what should i do.... Startup time of server :