Converting the DATE(yyyymmdd) into MONTH(yyyymm) format
HAI
I have one date InfoObject(ZDATE) in the format of YYYYMMDD format.
My client wants another 'Month InfoObject(ZMONTH) in the format of YYYYMM . This ZMONTH infoobject should be derived from ZDATE.
So please tell me how can i convert the ZDATE data into ZMONTH format.
I think , it is possible by writing the ABAP code.
Please give the ABAP CODE for converting the ZDATE data into ZMONTH format also .
i wll assing the points
bye
rizwan
Hi Rizwan,
You can use offset like:
zmonth = zdate+0(6)
Zmonth is variable in which yyyymm is going to be stored
and zdate is variable in which yyyymmdd is stored.
I think this will slove your issue.
Thanks=points
Similar Messages
-
I need convert the date of string format 'MM/dd/yyyy' to datetime format 'MM/dd/yyyy' when the system date format is 'dd/MM/yyyy'.Since
I need to search values based on date where my database datetime is 'MM/dd/yyyy' format.In my opinion you should re-consider the assumption that the date picker returns a string. Maybe it is able to return a
DateTime object directly instead of string. Then you will pass this value as a parameter of SQL query. This should work regardless of computer configuration.
Otherwise, follow the previous string-based approaches. -
Is there any function module to convert the date format
Dear ABAPers,
Is there any function module to convert the date format from dd.mm.yyyy to dd-mmm-yyyy.
I want to convert the date format from dd.mm.yyy to dd.mmm.yyy Eg.from 10.03.2008 to 10-mar-2009.
Thanks & Regards,
Ashok.hi,
create custom function module or copy the below code in the report ..and use it
the out put for below is :----Convert a DATE field into a full format date eg. March 23, 2000
FUNCTION Z_CONVERT_DATE_INTO_FULL_DATE.
""Local interface:
*" IMPORTING
*" VALUE(DATE) LIKE SY-DATUM
*" EXPORTING
*" VALUE(FORMATTED_DATE)
*" EXCEPTIONS
*" INVALID_DATE
TABLES: TTDTG.
DATA: BEGIN OF T_DATE,
YYYY(4) TYPE C,
MM(2) TYPE C,
DD(2) TYPE C,
END OF T_DATE.
DATA: DAY(3) TYPE N.
DATA: VARNAME LIKE TTDTG-VARNAME.
IF DATE IS INITIAL.
CLEAR FORMATTED_DATE.
EXIT.
ENDIF.
check document date format
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = DATE
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1.
IF SY-SUBRC NE 0.
RAISE INVALID_DATE.
ENDIF.
MOVE DATE TO T_DATE.
CONCATENATE '%%SAPSCRIPT_MMM_' T_DATE-MM INTO VARNAME.
SELECT SINGLE * FROM TTDTG WHERE SPRAS = 'EN' AND VARNAME = VARNAME.
WRITE T_DATE-DD TO DAY.
CONCATENATE DAY ',' INTO DAY.
CONCATENATE TTDTG-VARVALUE DAY T_DATE-YYYY INTO FORMATTED_DATE
SEPARATED BY SPACE.
ENDFUNCTION.
the output is :--Convert a DATE field into a full format date eg. March 23, 2000
Regards,
Prabhudas -
CONVERT DATE RANGE INTO MONTHS
HI FRIENDS,
ACTUALLY IN MY SELECT-OPTIONS I HAVE USED DATE BETWEEN 03/06/1980 TO 04/12/1980
BASED ON THIS DATE I HAVE TO CALCULATE NUMBER OF MONTHS.
WILL THIS BE DONE AUTOMATICALLY OR I NEED TO WRITE ANY CODE FOR CONVERTING THE DATE RANGE INTO NUMBER OF MONTHS.
REGARDS
SIRI.Hi,
Use FM's : MONTHS_BETWEEN_TWO_DATES_NEW
MONTHS_BETWEEN_TWO_DATES
FIMA_DAYS_AND_MONTHS_AND_YEARS
Sample code :
DATA : x_no_months type i.
DATA : x_stdat like sy-datum,
x_enddat like sy-datum.
x_stdat = s_date-low
x_enddat = s_date-high
CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = x_stdat
i_datum_von = x_enddat
IMPORTING
e_monate = x_no_months.
x_no_months will contain no.of months.
Regards
Appana -
How to drill date (column )into month in xcelsius
Hi,
I am fresher to Xcelsius. I need to know how to drill the date column into month, then further drilling down month to day.
I have 2 columns
Date Revenue
1/1/2010 452553
2/2/2011 97992
3/5/2011 23526
4/3/2011 63563
If i click " 1/1/2011" date column, i need to see the corresponding month data in seperate chart( i need to get the detailed data).
I need to know how the datas should be arranged in excel.
Thanks in Advance
Regards,
AbiramiHi Abirami,
To filter out date, you can use calendar component in Xcelsius. This article explains how to use the calendar component in an interactive way.
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b05b0244-0453-2e10-b4b3-fab707baddaf
Then with the help of an invisible combo box as explained in the article to could get just the selected month's data in bar chart.
Hope this helps.
Regards,
Anju Saseendran -
Routine to convert the date into month/year
Hi friends,
I have requirement like I have 0billdate, but i want only month and year in that. So i have created a z object for that taking reference as 0calmonth. I think the format is yyyymm.
So now I want to write a routine which converts the date to month/year. If anybody know this please let me know.
Regards
San ReddyHi
in the trnasfer rule or in the update rule select the Zinfo object to which you need to do conversion
in details select formula and create.
Select all functions and follow the steps below.
use the conversion function DATE_MONTH( )
Short Text
Function: Date -> Month
Functionality
Calculates the month from a specified date.
Requirements
The date must appear in the format yyyymmdd.
Parameters
DATE_MONTH (date)
Result
The result is calculated in the format yyyymm.
Regards
RaM -
Convert the date into user default date formate
I am wrinting a bdc and i want to convert the date into user default date farmate ..please suggust the functiom module should i use...
actually by using dats or d type you can get the user specific date itself.
but if u have different dates format that need to be converted to the user specific date then you can follow below procedure
1. retrieve the user format from usr01
SELECT SINGLE datfm
INTO w_datfm
FROM usr01
WHERE bname EQ sy-uname.
pass w_datfm to the below FM (4th import parameter)
2. create Z - FM and retrieve the user secific date
FUNCTION ZFXX_USER_SPECIFIC_DATE.
""Local Interface:
*" IMPORTING
*" VALUE(IW_DAY) TYPE CHAR2
*" VALUE(IW_MONTH) TYPE CHAR2
*" VALUE(IW_YEAR) TYPE CHAR4
*" VALUE(IW_DATFM) TYPE USR01-DATFM
*" EXPORTING
*" VALUE(EW_USER_DATE) TYPE CHAR0008
*1 DD.MM.YYYY
*2 MM/DD/YYYY
*3 MM-DD-YYYY
*4 YYYY.MM.DD
*5 YYYY/MM/DD
*6 YYYY-MM-DD
CASE iw_datfm.
when '1'.
concatenate iw_day iw_month iw_year
into ew_user_date.
when '2'.
concatenate iw_month iw_day iw_year
into ew_user_date.
when '3'.
concatenate iw_month iw_day iw_year
into ew_user_date.
when '4'.
concatenate iw_year iw_month iw_day
into ew_user_date.
when '5'.
concatenate iw_year iw_month iw_day
into ew_user_date.
when '6'.
concatenate iw_year iw_month iw_day
into ew_user_date.
when others.
clear ew_user_date.
endcase.
ENDFUNCTION. -
Hi All,
I have a requirement in my project like to convert the date time from one format to another.my situation is like to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format. I am using the soa suite 11.1.1.6.
Can any one suggest me how to convert in the BPEL transformation.
Thanks,
Sanju.Hi Sanju,
Store the date to be converted into a variable viz. dateVar. Now, process an expression in assign as: xp20:format-dateTime($dateVar,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]').
Regards -
How to convert the data decoded by MJPEG Decoder MFT into RGB32
I try to play .avi file(Motion JPEG) with MJPEG Decoder MFT and
My ColorConverter MFT to convert into RGB32 by using the Media Foundation.
The output format of MJPEG Decoder MFT is YUY2.
So, I implemented My ColorConverter MFT to convert YUY2 into RGB32.
I set the topology to play .avi file and to convert into RGB32.
But I got a MEError event with ME_ARITHMETIC_OVERFLOW in
IMFMediaEvent->GetStatus(&hrStatus)); after the event MESessionTopologyStatus.
So,the file isn't started to play.
The created topology is follow.
Source-> MJPEG Decoder MFT -> My ColorConverter MFT -> EVR
Format: YUY2
RGB32
Why do the error occur in processing to convert the data decoded by MJPEG Decoder MFT
into RGB32?
Please tell me a appropriate way to convert the data decoded by MJPEG Decoder MFT
into RGB32.You've got the High Speed Data Reader.vi as a starting point. That will retrieve the binary data and plot it on a chart. From the array of sgl's created, you could then use the Write to Spreadsheet File.vi to create a comma or tab separated file. The other option is to write the data straight to Excel using ActiveX. There's a shipping example that shows how that's done as well.
-
Converting the WAD applications into PDF format
Hi SAPians,
I'm in need to convert WAD results into PDF Format using SAP BW 3.5 and Acrobat Reader 7.0. And I've referred some documents in Net, But,they gave ideas only for 3.5 and Acorobat 5 version.
But i've to convert the WAD results into PDF format only by using Acrobat Reader 7.0. So, kindly let me know the steps to do so.
Thanks in Advance.
Jayaprakash JHi Shahid syed,
Thanks for your reply.
It was very useful.
But, i've askd the solution for sap bw 3.5 with Acrobat reader 7.0.
So, plz let me knw if any solutions for that to make wad reports into pdf format.
Points will be awarded.
Thanks & Regards
Jayaprakash J -
Everyting was perfect earlier. Used to convert all my videos into iPhone mp4 format using Any Video Converter - then add it to my iPhone 3GS. But last few days, I cant add video files to iTunes. and the iTunes doesnt even specify the reason except for that "files are not supported"
Everything is fine.
-They are the right format
-Quicktime is updated
-I have tried simply dragging them into the 'movie' library
-I have tried going to file<add file to library
Nothing works, has anyone else had this problem and found a way around it?
Any and all help appreciated.In addition to Mike's suggestions, you only have 4GB of RAM and Mavericks does use more RAM than other versions. You may also want to look at the apps that startup on login and the possiblity of upgrading RAM.
-
FM to convert the date in to the format in SU01
hi,
will u pls suggest the FM to convert the date in the format presented in SU01->Defaults.
with respect to user the diffrent format may stored in the su01.
kindly suggest.
thanks.data: dat TYPE date,
org TYPE date.
This function module converts data from the sy-datum format to ddmmyyyy.
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
input = sy-datum
IMPORTING
OUTPUT = dat.
write: sy-datum.
write: dat.
This function module converts data to sy-datum format.
CALL FUNCTION 'CONVERSION_EXIT_PDATE_INPUT'
EXPORTING
input = dat
IMPORTING
OUTPUT = org
write: org.
You can change the user settings for date using the transaction SU01. -
ABAP code in update rules to convert the date
Hi,
Could any one send me the ABAP code that is written in the update rules to convert the date (DD/MM/YYYY -- lenght 10) to YYYYMMDD --- length 8 format.
Also please let me know where I should write this code; while creating update rules or while creating infosource.
Thanks,Hi Bharath,
Hi Bharath,
I suggest you do the conversion of dates in the transfer rules. Here is the correct code you need:
* Assuming the source data field is called MYDATE
* Place the ff. in the routine in the transfer rules:
concatenate tran_structure-mydate+6(4) tran_structure-mydate+3(2) tran_structure-mydate(2) into result.
replace MYDATE with the name of the source field (10 chars) in the transfer structure. Hope this helps. -
How can i convert the date from M to MM ?
Dear Guru ,
I need to upload my list to SAP table , and in the list , we are using YYYY/M/D format ( Eg. 2010/5/20 , 2010/10/1 ) .
And now i want to convert all date format to YYYY/MM/DD , Is it possibile to do that ?
Here is my code , but it doesn't work . It returned "2009//3//5" format .
data: ld_date_int type datum.
data : test(10) type c.
test = '2009/3/5' .
ld_date_int = test .
WRITE : SY-SUBRC , LD_DATE_int .
Does SAP provide a standard function can convert the date format ?
Thanks .
Best Regards,
Carlos ZhangHi Dear
You can try in this way :::
data: ld_date_int type string.
DATA : ld_string TYPE string.
data : test(10) type c,
ld_res1(4) TYPE c,
ld_res2(2) TYPE c,
ld_res3(2) TYPE c.
DATA : ll_res2 TYPE i,
ll_res3 TYPE i.
test = '2009/03/5' .
ld_date_int = test .
ld_string = strlen( ld_date_int ).
CASE ld_string.
WHEN 10.
WRITE : SY-SUBRC , LD_DATE_int.
WHEN OTHERS.
SPLIT ld_date_int at '/' INTO ld_res1 ld_res2 ld_res3 in CHARACTER MODE.
ll_res2 = strlen( ld_res2 ).
ll_res3 = strlen( ld_res3 ).
IF NOT ll_res2 eq 2 and not ll_res3 eq 2.
CONCATENATE: '0' ld_res2 INTO ld_res2.
CONCATENATE: '0' ld_res3 INTO ld_res3.
CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
WRITE : SY-SUBRC , LD_DATE_int.
ENDIF.
IF ll_res2 eq 2 and not ll_res3 eq 2.
CONCATENATE '0' ld_res3 INTO ld_res3.
CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
WRITE : SY-SUBRC , LD_DATE_int.
ENDIF.
IF NOT ll_res2 eq 2 and ll_res3 eq 2.
CONCATENATE: '0' ld_res2 INTO ld_res2.
CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
WRITE : SY-SUBRC , LD_DATE_int.
ENDIF.
ENDCASE. -
Which Function Module is used for converting the DATE in BDC
HI,
Which Function Module is used for converting the DATE Format in BDC for Uploading purpose please help me.data : date like sy-datum.
data : odate(10) type c.
date = sy-datum. " in format YYYYMMDD
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
input = date
IMPORTING
OUTPUT = odate .
write:/ odate. "in ur format '.
1.
In ur itab make a field for date as 10 characters and use this Fm to store the date .
2. Pass the date as the charcter field to the screen and now check .
Maybe you are looking for
-
[Solved] embedded videos in firefox take a lot of CPU time
Playing embeded videos in Firefox take a lot of CPU time. Actually my old computer is not able to play these videos correctly if they are in HD. The problem appears with flash videos (not so surprising, flash sucks...) but also with html5 videos (the
-
What is WebServices and API in MDM? How both are linked to each other when you are doing ABAP API in the real time scenarios? Thanks in Advance, Best Regards, Vijay
-
I'm creating a JSP pie chart in Reports 9i. The legend labels are being truncated. To fix this I increased the chart width using a "width=" tag. If I increase the width by 200 pixels, however, the legend box itself is moved to the right by 100 pixels
-
Hi , i have created a report using some terminal id's. terminal id's like 1,2,3,4.. now my report displays like 1 2 3 4 i used the filter condition thru terminal id's.now my requirement is withuout using that filter condition have to display the repo
-
S there a way that I can send a monthly reminder to fill out this form?
Is there a way that I can send a monthly reminder to have the form completed ?