Function Module for DATE Conversion
Hi All,
I need some help to know a function module to get the exact date in a year.
If i give the no. of days and the year.. it has to give me the exact date.
for eg: if no. of days are 90 and the year is 2006 the output should be 31st MARCH 2006. Like that if i enter any number (< 364 or 363) and the year it has to tell me the date of the count of no.of days.
Thank You,
Suresh
Hi Suresh,
You can use FM HR_SEN_CALE_DAYS_DATE.
Here you can pass '01.01.2006' , operator as '+' and in
IS_DURATION enter the number of days under 'CALDD'.
For eg:
Test for function group HRSEN00CRULE_CALE_DAYS
Function module HR_SEN_CALE_DAYS_DATE
Import parameters
ID_DATE 01.01.2006
ID_OPERATOR +
IS_DURATION 0.0000 0.0000 30.0000
Export parameters Value
ED_DATE 30.01.2006
Regards,
Raj
Similar Messages
-
Any Function module for Date conversion
Hi,
In my output the date is coming like 80999898 but the actual date is 01.01.1900.
Could you please tell me is there any Function module for that.
Regards,
TusharUse the conv. exit CONVERSION_EXIT_INVDT_OUTPUT for this purpose.
BR,
Suhas -
Function Module for Date Conversion - 20060131 - January 31, 2006
I can write some quick code and use the T015M table, but I figure there must be an existing function module. I want to convert a system date to a character string. Ideally, I would like it based on a country field.
20060131 -> January 31, 2006
20060131 -> 31 January 2006Norman
Strange I've used edit mask LDATE, function CONVERSION_EXIT_LDATE_OUTPUT, and get the full month name.
Anyway, here is a little program to see the outputs for different countries. It does need updating for edit mask MODAT, and checking the return code after select and function calls:
REPORT ZZMATTG004 .
DATA: D8(20),
WA_MASK LIKE DD01D-CONVEXIT,
MONTH_NAMES LIKE T247 OCCURS 12 WITH HEADER LINE.
TABLES: T005. "Countries
PARAMETERS: DATE LIKE SY-DATUM DEFAULT SY-DATLO.
SELECT-OPTIONS S_LAND FOR T005-LAND1 NO INTERVALS.
PARAMETERS: P_LANGU AS CHECKBOX DEFAULT 'X'.
D8 = DATE.
DESCRIBE FIELD DATE EDIT MASK WA_MASK.
WRITE: 'MASK IS :- ''', WA_MASK NO-GAP, '''' NO-GAP.
SKIP.
WRITE:
/ DATE DD/MM/YYYY, 22 'DD/MM/YYYY',
/ DATE MM/DD/YYYY, 22 'MM/DD/YYYY',
/ DATE DD/MM/YY , 22 'DD/MM/YY',
/ DATE MM/DD/YY , 22 'MM/DD/YY',
/ DATE DDMMYY , 22 'DDMMYY',
/ DATE MMDDYY , 22 'MMDDYY',
/ DATE YYMMDD , 22 'YYMMDD'.
SKIP.
WRITE:
/ D8 USING EDIT MASK '==LDATE', 'LDATE',
/ D8 USING EDIT MASK '==SDATE', 'SDATE',
/ D8 USING EDIT MASK '==IDATE', 'IDATE',
/ D8 USING EDIT MASK '==D3DAT', 'D3DAT',
/ D8 USING EDIT MASK '==PDATE', 'PDATE',
/ D8 USING EDIT MASK '==INVD1', 'INVD1',
/ D8 USING EDIT MASK '==INVDT', 'INVDT'.
LOOP AT S_LAND.
* BREAK-POINT.
SET COUNTRY S_LAND-LOW.
SELECT SINGLE SPRAS INTO T005-SPRAS FROM T005
WHERE LAND1 = S_LAND-LOW.
IF P_LANGU = 'X'.
SET LANGUAGE T005-SPRAS.
ENDIF.
REFRESH MONTH_NAMES.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = T005-SPRAS
* IMPORTING
* RETURN_CODE =
TABLES
MONTH_NAMES = MONTH_NAMES
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 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.
* READ TABLE MONTH_NAMES INDEX DATE+4(2).
READ TABLE MONTH_NAMES WITH KEY MNR = DATE+4(2).
SKIP.
WRITE: / 'COUNTRY SET TO', S_LAND-LOW COLOR 2,
/ 'Month name is', MONTH_NAMES-KTX, MONTH_NAMES-LTX,
'Language (T005) is', T005-SPRAS, '(SYST)', SY-LANGU.
WRITE:
/ DATE DD/MM/YYYY, 22 'DD/MM/YYYY',
/ DATE MM/DD/YYYY, 22 'MM/DD/YYYY',
/ DATE DD/MM/YY , 22 'DD/MM/YY',
/ DATE MM/DD/YY , 22 'MM/DD/YY',
/ DATE DDMMYY , 22 'DDMMYY',
/ DATE MMDDYY , 22 'MMDDYY',
/ DATE YYMMDD , 22 'YYMMDD'.
SKIP.
WRITE:
/ D8 USING EDIT MASK '==LDATE', 'LDATE',
/ D8 USING EDIT MASK '==SDATE', 'SDATE',
/ D8 USING EDIT MASK '==IDATE', 'IDATE',
/ D8 USING EDIT MASK '==D3DAT', 'D3DAT',
/ D8 USING EDIT MASK '==PDATE', 'PDATE',
/ D8 USING EDIT MASK '==INVD1', 'INVD1',
/ D8 USING EDIT MASK '==INVDT', 'INVDT'.
ENDLOOP.
SET COUNTRY SPACE.
* SET LANGUAGE T005-SPRAS.
REFRESH MONTH_NAMES.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
* IMPORTING
* RETURN_CODE =
TABLES
MONTH_NAMES = MONTH_NAMES
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 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.
* READ TABLE MONTH_NAMES INDEX DATE+4(2).
READ TABLE MONTH_NAMES WITH KEY MNR = DATE+4(2).
SKIP.
WRITE: / 'COUNTRY SET TO', 'SPACE' COLOR 2,
/ 'Month name is', MONTH_NAMES-KTX, MONTH_NAMES-LTX.
WRITE:
/ DATE DD/MM/YYYY, 22 'DD/MM/YYYY',
/ DATE MM/DD/YYYY, 22 'MM/DD/YYYY',
/ DATE DD/MM/YY , 22 'DD/MM/YY',
/ DATE MM/DD/YY , 22 'MM/DD/YY',
/ DATE DDMMYY , 22 'DDMMYY',
/ DATE MMDDYY , 22 'MMDDYY',
/ DATE YYMMDD , 22 'YYMMDD'.
SKIP.
WRITE:
/ D8 USING EDIT MASK '==LDATE', 'LDATE',
/ D8 USING EDIT MASK '==SDATE', 'SDATE',
/ D8 USING EDIT MASK '==IDATE', 'IDATE',
/ D8 USING EDIT MASK '==D3DAT', 'D3DAT',
/ D8 USING EDIT MASK '==PDATE', 'PDATE',
/ D8 USING EDIT MASK '==INVD1', 'INVD1',
/ D8 USING EDIT MASK '==INVDT', 'INVDT'.
MattG. -
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 data retrival for work order clearence (WCA)
Hi All ,
Function Module for data retrival for work order clearence (WCA) for a particular Planning plant and (WCD's).
Thanks.Hi Anne,
BAPI_PRODORD_GET_DETAIL
BAPI_PRODORD_GET_LIST
You can find further FM in Function Group COPRINT and CODR or take F4 on CO* in Function Group
These will serve your purpose.
Cheerz.
Ram -
Hi is there any function module for radix conversion
Hi,
I need to convert number of base 36 to decimal number. Is there any function module for that.
i.e) z to 35
10 to 36
11 t0 37Hai,
This program perfectly converts a number from one number system to another number system.
REPORT Z_RADIX_CONVERSION.
PARAMETERS:
P_S_RAD(2) TYPE N, " Source Radix
P_D_RAD(2) TYPE N, " Destination Radix
P_S_NUM(5) TYPE C. " Source Number
*" Data declarations...................................................
Work variables *
DATA:
W_LEN TYPE I,
W_FACT TYPE I,
W_D_NUM(5) TYPE N,
W_T_LEN TYPE I,
W_NUM TYPE C,
W_NUM1 TYPE I,
W_REM TYPE I,
W_INDEX TYPE I VALUE 20,
W_T_NUM(30) TYPE C,
W_T_NUMBER(5) TYPE N.
IF P_S_RAD GE 1 AND
P_S_RAD LE 16 AND
P_D_RAD GE 1 AND
P_D_RAD LE 16.
IF P_S_RAD EQ 01 AND P_S_NUM CO '0 ' OR
P_S_RAD EQ 02 AND P_S_NUM CO '01 ' OR
P_S_RAD EQ 03 AND P_S_NUM CO '012 ' OR
P_S_RAD EQ 04 AND P_S_NUM CO '0123 ' OR
P_S_RAD EQ 05 AND P_S_NUM CO '01234 ' OR
P_S_RAD EQ 06 AND P_S_NUM CO '012345 ' OR
P_S_RAD EQ 07 AND P_S_NUM CO '0123456 ' OR
P_S_RAD EQ 08 AND P_S_NUM CO '01234567 ' OR
P_S_RAD EQ 09 AND P_S_NUM CO '012345678 ' OR
P_S_RAD EQ 10 AND P_S_NUM CO '0123456789 ' OR
P_S_RAD EQ 11 AND P_S_NUM CO '0123456789A ' OR
P_S_RAD EQ 12 AND P_S_NUM CO '0123456789AB ' OR
P_S_RAD EQ 13 AND P_S_NUM CO '0123456789ABC ' OR
P_S_RAD EQ 14 AND P_S_NUM CO '0123456789ABCD ' OR
P_S_RAD EQ 15 AND P_S_NUM CO '0123456789ABCDE ' OR
P_S_RAD EQ 16 AND P_S_NUM CO '00123456789ABCDEF ' .
W_LEN = STRLEN( P_S_NUM ).
W_T_LEN = W_LEN - 1.
DO W_LEN TIMES.
W_NUM = P_S_NUM+W_T_LEN(1).
CASE W_NUM.
WHEN 'A'.
W_NUM1 = 10.
WHEN 'B'.
W_NUM1 = 11.
WHEN 'C'.
W_NUM1 = 12.
WHEN 'D'.
W_NUM1 = 13.
WHEN 'E'.
W_NUM1 = 14.
WHEN 'F'.
W_NUM1 = 15.
WHEN OTHERS.
W_NUM1 = W_NUM.
ENDCASE.
W_D_NUM = W_D_NUM + W_NUM1 * ( P_S_RAD ** W_FACT ).
ADD 1 TO W_FACT.
SUBTRACT 1 FROM W_T_LEN.
ENDDO.
ELSE.
WRITE'Invalid Number'(003).
ENDIF.
ELSE.
WRITE'Enter radix between 1 and 16 '(002).
ENDIF.
W_T_NUMBER = W_D_NUM.
IF P_D_RAD = 1.
DO W_D_NUM TIMES.
WRITE'O'.
ENDDO.
ELSE.
WHILE W_T_NUMBER NE 0.
W_REM = W_T_NUMBER MOD P_D_RAD.
CASE W_REM.
WHEN 10.
W_T_NUM+W_INDEX(1) = 'A'.
WHEN 11.
W_T_NUM+W_INDEX(1) = 'B'.
WHEN 12.
W_T_NUM+W_INDEX(1) = 'C'.
WHEN 13.
W_T_NUM+W_INDEX(1) = 'D'.
WHEN 14.
W_T_NUM+W_INDEX(1) = 'E'.
WHEN 15.
W_T_NUM+W_INDEX(1) = 'F'.
WHEN OTHERS.
W_T_NUM+W_INDEX(1) = W_REM.
ENDCASE. " CASE W_REM.
SUBTRACT 1 FROM W_INDEX.
W_T_NUMBER = W_T_NUMBER DIV P_D_RAD.
ENDWHILE.
ENDIF.
WRITE:
/10 'The Equivallent number in Base'(001),
P_D_RAD,
'is',
W_T_NUM.
<b>Reward points if helpful .</b>
regards,
rama pammi -
Function module for date format conversion
hi ,
Can someone plzz tell me if there is a SAP standard function module that can convert date of any format to date of a particular format .
Thanks
SheetalHi,
Data: V_date(10) type c.
v_date = 'yyyy/mm/dd'. " your format.
write : v_date using edit mask '__/__/____' " this will conver the format
If you want the user specfic format, then use the below code
Data: Date1 type Sy-datym,
Date2(10) type c.
date1 = Sy-datum
Write: Date1 to Date2.
Write:/ Date2. " This Date2 will have the user Specif format
Regards
Sudheer -
Function modules for unit conversion
hai gurus.
what is the function module to make one qty to the same unit as other qty.
if one is in kg and other in pounds
i want to make both in pounds.
pls help me with thisHi
chk UNIT_CONVERSION_SAMPLE
also chk this
CF_UT_UNIT_CONVERSION
Some Insights-
Unit conversions
with NW2004s the HOW-TO GUIDE for qty conversion is obsolete.
http://help.sap.com/saphelp_nw2004s/helpdata/en/27/b65c42b4e05542e10000000a1550b0/content.htm
As of SAP NetWeaver 2004s you can create quantity conversion types using transaction RSUOM.
The business transaction rules of the conversion are established in the quantity conversion type. The conversion type is a combination of different parameters (conversion factors, source and target units of measure) that determine how the
conversion is performed.
In terms of functionality, quantity conversion is structured similarly to currency translation.
Quantity conversion allows you to convert key figures with units that have different units of measure in the source system into a uniform unit of measure in the BI system when you update them into InfoCubes
http://help.sap.com/saphelp_nw04s/helpdata/en/27/b38c4284a8c353e10000000a1550b0/content.htm
It is entered in ODS table linked to info object (0material)
What you need to do basically is-
1 ) Goto your infoobject for eg- 0material
2 ) In Info object Maintenance- Tab page- Bex Explorer
3 ) Enter 0BASE_UOM in Base unit of measure
4 ) Generate UOM ODS (System generates it with prefix UOM)
It is made of 4 fields (1 more in case of compounding) with SID for them. This is the place where you enter numerator and
denominator to calculate conversion factor
5 ) Load the UOM ODS with conversion from 0MAT_UNIT_ATTR or flat file
6 ) Define conversion type
7 ) In the conversion type, then you can select 0Material in the dynamic determination of conversion factor
8 ) Select source unit and target unit
For more help refer SAP help file on NW2004s. It is comprehensive and even explain - How to do unit conversion in
transformation rule?
http://help.sap.com/saphelp_nw04s/helpdata/en/4f/707242df019c60e10000000a1550b0/content.htm
Check this sample code,
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
* CLIENT = SY-MANDT
DATE = pdate
FOREIGN_AMOUNT = p_amt1
FOREIGN_CURRENCY = p_curr1
LOCAL_CURRENCY = p_curr2
* RATE = 0
* TYPE_OF_RATE = 'M'
* READ_TCURR = 'X'
IMPORTING
EXCHANGE_RATE = w_rate
FOREIGN_FACTOR = w_fact1
LOCAL_AMOUNT = w_amt
LOCAL_FACTOR = w_fact2
* EXCHANGE_RATEX =
* FIXED_RATE =
* DERIVED_RATE_TYPE =
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.
IF SY-SUBRC <> 0.
write: / 'Conversion to loc.curr. failed:',
p_curr1, '->', p_curr2, 'err.code=', sy-subrc.
ELSE.
write: / 'to Loc.curr:', p_amt1 currency p_curr1, p_curr1, '->',
w_amt currency p_curr2, p_curr2,
'(', w_rate, ')', w_fact1, w_fact2.
ENDIF.
http://www.geocities.com/victorav15/sapr3/examples/currconv.txt
Check this
CONVERSION_FACTOR_GET
Measurement unit conversion: Get measurement unit conversion factor Not for Dimensionless Units of Measure
UNIT_CONVERSION_SIMPLE Measurement unit conversion by table T006, with rounding
UNIT_OF_MEASURE_SAP_TO_ISO
UNIT_OF_MEASURE_ISO_TO_SAP
MATERIAL_UNIT_CONVERSION Material quantity conversion from Base Unit of Measure to Alternative Unit of Measure and vice versa. For Dimensionless Units of Measure (Each, Piece, Box etc.) conversion depends on the given Material (see table MARM). For other Units of Measure (Length, Weigth etc.) conversion can be calculated from the T006 table or via CONVERSION_FACTOR_GET.
CONVERSION_EXIT_CUNIT_INPUT Conversion exit for commercial (3-char) measurement unit INPUT
CONVERSION_EXIT_CUNIT_OUTPUT Conversion exit for commercial (3-char) measurement unit OUTPUT
CONVERSION_EXIT_LUNIT_INPUT Conversion exit for technical (6-char) measurement unit INPUT
CONVERSION_EXIT_LUNIT_OUTPUT Conversion exit for technical (6-char) measurement unit OUTPUT
UNIT_OF_MEASUREMENT_HELP Input help for measurement units of a predefined dimension
http://www.geocities.com/victorav15/sapr3/abapfun.html
Reward all helpfull answers
Regards
Pavan -
Function modules for data retrieval from diff. tables
Hi,
I would just like to ask if there are function modules that can be used to retrieve data from the ff. tables:
TSAD3T
KNVV
ESTRH
for TSAD3T i need to get the value of title_medi
for KNVV i need to get the fields klabc vkorg vtweg
for ESTRH i need to get the fields subcat subid.
Thanks.I doubt if you have such a FM
-
Hi ALL,
I would like to know the various function modules that can be used for calculating dates.Like first day of month,last day.....etc etc.
Please give me a list of the FM's and not the F4 help option info.
CheersHi ,
Here are a few FM used for date manipulation
<b>DATE_IN_FUTURE </b> Add / Substract days from a given date
<b>HR_SGPBS_ADD_TIME_TO_DATE</b> Find the next date based on input date , addition / sub and month , year ,date
<b>CONVERT_DATE_TO_EXTERNAL</b> Convert date to External format
<b>SG_PS_ADD_MONTH_TO_DATE</b> Find the next date based on input date , addition / sub and month , year ,date
<b>DATE_COMPUTE_DATE</b> For a input date gives the day of the week
<b>DATE_GET_WEEK</b>For an input date ,gives the week as output
<b>WEEK_GET_FIRST_DAY</b> Input year and week output is the first day of the week
<b>WEEKDAY_GET</b> Gives the day range , Monday , Tuesday , ..
<b>RP_CALC_DATE_IN_INTERVAL</b> Calculate Future Date
<b>CALCULATE_DATE</b> Calculate Future Date
<b>FIMA_DAYS_AND_MONTHS_AND_YEARS</b> Difference between two dates
<b>CONVERSION_EXIT_PDATE_INPUT</b> It checks if the date is in future , if yes an error is displayed
Reagrds
Arun -
Hello experts.
my requirement is , I am having a fiscial year ( gjahr) and period ie month (monart) . Now i need afunction module that gives the last date of the month. say if it is january it should give 31 - month-year. I want to populate this date to the budat field. so please tell me how to solve this issue. i want to pass as date-month-year to budat. but i am having year as seperate field and month as seperate field. so please tell me the function module that gives all the three or any other solution to this.
thanks for all the repliespopulate month, year u have and 01 into w_datum in and it should always give day1 of that month like this.
concatenate l_year l_month '01' into w_datum_in.
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
day_in = w_datum_in
IMPORTING
last_day_of_month = w_datum_out
EXCEPTIONS
day_in_not_valid = 1
OTHERS = 2.
*reward if solved* -
Function Module for Date/ Time difference in Working Days
Hi all,
Are there any function modules which will calculate the difference between a date AND time, but in working days?
I can use the FIMA_DAYS_BETWEEN_TWO_DATES_2 FM for the dates, but I need to include times in this as well.
This is for situations where the 'starting date' is a non-working day, and the 'end date' is a working day. In this situation I need to take all the hours and minutes into account, which happened on the working day. To give an example -
Start date: 04.07.2010 (Sunday - Non working day)
Start time: 21:12:36
End date: 05.07.2010 (Monday - Working day)
End time: 04:47:24
I realise there is a Time option in this function module, but when I test it, it doesn't seem to be returning the desired results (returns 0 for days and time). I am using '5' as the I_STGMETH and 'GB' as the I_SKALID.
I need a calcuation which will return the time, post midnight on the working day - in this example, 4 hours, 47 minutes (seconds are optional!).
Can anyone help? - can I still use FIMA_DAYS_BETWEEN_TWO_DATES_2 but with different parameters?
Thanks
Mischa
Edited by: Mischa Gulseven on Jul 20, 2010 10:40 AMHi,
Thanks but this FM does not seem to account for working days.
For example, if I use:
DATE1 04.07.2010 (non working day)
TIME1 04:00:00
DATE2 05.07.2010 (working day)
TIME2 21:00:00
It will give the following results -
DATEDIFF 1
TIMEDIFF 17
EARLIEST 1
I don't want to account for the non-working day so the result I actually want would be to calculate from midnight on 05.07 to 21:00 on 05.07 which should be 21 hours.
I suspect I probably need to include the STGMETH and the factory calendar somewhere in the FM?
Does such a FM exist, or could anyone help me with some ABAP for this?
thanks
Mischa -
Function module for date ranges
Hi all,
Is there any function module to display all the dates in between start date and end date. Or provide blocke code for this.
Ex : If i have given nov 5th 2008 and nov 10th 2008 as input parameters.
Output should be nov 5th 2008, nov 6th 2008,nov 7th 2008,nov 8th 2008,nov 9th 2008,nov 10th 2008,
Please help me out in this regard.
thanks
naiduHi Omkaram,
Thank you verymuch for your code. That link is useful for me. I have rewarded you.
But when i'm using the same code in my function module its not working.
I have done the debugging the function module is not taking the input.
Ex : itab[] = lt_date[].
when i'm doing debugging the input parameter lt_date has no value.
I dont know why it is.
Can you help me please.
Regards
Naidu -
Function module for date format
Hi,
what is the function module name to get the date format in <b>(dd.mm.yyyy)</b> from (<b>dd-mon-yyyy)</b>
Thanx.try this Fm
CONVERSION_EXIT_SDATE_INPUT
input as dd-mon-yyyy
28FEB2007
im assuming mon in literal format.
output is 20070228
WRITE STATEMENT WILL DISPLAY THE DATA IN DEFALUT DATE FORMATS OF SU3 .
<b>Elaborate teh query with an example .</b>
check this
regards,
vijay. -
Need function modules for date manupulation
HI,
Could you please suggest the function module the below reqiurments
1) adding days to date.
ex: 20 days to 25.03.2008 = 15.04.2008
2) To find the given date is working date or not according to factory calender id.
3) To find the previous or last working date to the given date(Holiday date) according to the factory calender id.
It is very urgent requirment. please help me.
Thanks in advance
sathish kumar swamyhi use this...
RE_ADD_MONTH_TO_DATE
DATE_CONVERT_TO_FACTORYDATE
CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'
EXPORTING
I_DATE_OLD = date1
IMPORTING
E_DATE_NEW = date1
data date2 like sy-datum.
date2 = date1 + 1.
write date2.
If you put 27.12.2005 as the input date, date2 you will get as 01.12.2005.
Or else you can use the following code:
v_startdate = sy-datum.
v_startdate+6(2) = '01'.
v_enddate = v_startdate.
if v_enddate+4(2) >= '01' AND v_enddate >= '11'.
v_endate4(2) = v_enddate4(2) + 1.
elseif v_enddate = '12'.
v_enddate+4(2) = '01'.
v_enddate(4) = v_enddate(4) + 1.
endif.
v_enddate = v_enddate - 1.
regards,
venkat.
Maybe you are looking for
-
IChat 4 AV does not work in Leopard
iChat 4 AV does not work in OS 10.5. iChat 3 worked in OS 10.4.x with no problems. Why the problem? I have iMac G5 20-inch with 2.5-gb memory using Motorola SB5101 cable modem provided by ISP Roadrunner (Brighthouse Bakersfield CA). I am relatively n
-
Dear community, I have a Thinkpad T430 and I want to use two external monitors. The Thinkpad T430 has just one mini Displayport and I do not want to use the VGA port. So I thought about buying a docking station. But there are several ones. I just nee
-
How to copy harddrive to an external drive
Can anyone tell me how to copy my hard drive to an external drive and then erase the stuff from the hard drive? I have 160g drive and I am at 159g of space.
-
I am extremely annoyned to the fact that when I play music on my iPod Nano 6G (The small one with touch feature), I will play next song by double clicking sleep button then suddenly an an EXTREMELY LOUD DEADLY SOUND will play as if the iPod wants to
-
BAPI or FM for HU create Packing Instructions
Can Anyone plz tell me any BAPI or Function Module to create HU from Packing INstructions. Many Thanks Edited by: Hiren N. Panchal on Feb 7, 2011 9:50 AM