Convert SAP format YYYYMMDD to MM/DD/YYYY format.
Hi folks,
I using a ALV FM (K_KKB_FIELDCAT_MERGE)to display the data using.In 4.6 version the date format used to display in MM/DD/YYY format whereas after the upgrade to ECC 6.0 version the date format is know dispalying in Sap std format YYYYMMMDD.
Any suggestion to display the date in US format.
Cheers.
wa_fieldcat-fieldname = 'AR_DATE'.
wa_fieldcat-ref_table = 'ROCTAB'.
wa_fieldcat-ref_field = 'AR_DATE'.
wa_fieldcat-reptext = text.
wa_fieldcat-col_pos = index.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
Similar Messages
-
How to convert date from "yyyymmdd" to "MM/DD/YYYY" format
1. I have one BLDAT field in my internal table.
its getting updated from input file.
2. The value in the input file is like yyyymmdd.
So the internal table field is filled like this
"YYYYMMDD".
3. After this,I have to compare this internal table
field with BSAD table.
4. The BLDAT field in BSAD table is in the format of
"MM/DD/YYYY".
5. the BLDAT field is having diff format in internal table and BSAD table.So I am unable to check this value.
How to convert it as like the BSAD table format."MM/DD/YYYY" format.
Thanks in advance!!Using the WRITE statement
data: gd_date(10). "field to store output date
* Converts date from 20020901 to 09.01.2002
write sy-datum to gd_date mm/dd/yyyy.
OR u can
CONCATENATE gd_date+4(2) gd_date+6(2) gd_date+0(4)
into gd_date seperated by '/' .
Hope this helps.
Kindly reward points and close the thread for the
answer which helped u OR get back with queries. -
Function module to change Date from YYYYMMDD to DD.MM.YYYY
Hi
PLease tell me the function module that will convert date from YYYYMMDD to DD.MM.YYYY
ThanksHi,
data lv_date1 type sy-datum.
data lv_date2(12).
lv_date1 = '20070123'.
concatenate lv_date16(2) lv_date14(2) lv_date1+0(4) into lv_date2
separated by '.' .
is what you require to do;
now lv_date2 = 23.01.2007.
Also look for conversion routine "CONVERSION_EXIT_PDATE_OUTPUT"
EG: call function CONVERSION_EXIT_PDATE_OUTPUT
exporting input = lv_date1
importing output = lv_date2.
Thanks,
Anitha -
Converting SAP Date format yyyyMMdd to MM/dd/yyyy
What FM can be used to convert the date from SAP's date yyyyMMdd to MM/dd/yyyy?
Moderator message: FAQ, please search for available information/documentation.
Edited by: Thomas Zloch on Mar 9, 2011 4:05 PMWhat FM can be used to convert the date from SAP's date yyyyMMdd to MM/dd/yyyy?
Moderator message: FAQ, please search for available information/documentation.
Edited by: Thomas Zloch on Mar 9, 2011 4:05 PM -
Convert date format yyyy-mm-dd to yyyymmdd
Hi All,
Could you please tell me how to do the mapping format to Convert date format yyyy-mm-dd to yyyymmdd
or
Please provide any UDF for this conversion.
Thank you .
Regards,
Bharat KumarHI ,
You can easily do that by using the standard datetransformation fuction . in the property of that function put your coming source and desired target format . However once you specify the source format then the source field should always be in thaat format
Regards,
Saurabh -
Convert date format YYYYMMDD to DD.MM.YYYY
hi
i was wondering is there a FM which convert date format YYYYMMDD to DD.MM.YYYY
instead of u know cutting the YYYY and MM and DD and concatement them againHi ,
See this piece of code
Data : w_date type dats value '20080903',
w_date1(10),
Constants : C(1) value '.'.
w_date1 = w_date.
concatenate w_date+6(2) w_date+4(2) w_date+0(4) into w_date1 separated by C.
Write : / w_date1.
With Regards.
Alwasy Learner -
Convert Date format from YYYYMMDD to MM/DD/YYYY --issue with Mapping
Hi All ,
I have IDOC(DESADV.DELVRY03-> file ) scenario which i am working on . While debugging noticed that the field :
E1EDT13\NATNZ -Data Transformation(from yyyymmdd to mm/dd/yyyy)-Target .This works
But say if IDOC doesn't pass any value (For Good's issue) I get Error during debugging : RuntimeException in Message-Mapping transformation: Unparseable date: ""
I did check thsi blog : Convertinf Date format from YYYY-MM-DD to MMDDYYYY but this is about the Data Transformtaion.
I tried using constants , create if , -these function doesn't work /not applicle in this case
Could you please provide inputs as to how to handle two condition :
1. With date -- then transform
2.Else , pass nothingHi Varalakshmi,
Plese try to use UDF for date conversion and include logic which would check the Space value from the source structure.
so if there is space return as such
else.
perform the conversion logic.
Convertinf Date format from YYYY-MM-DD to MMDDYYYY
(The conversion logic has been provided by micheal in the thread you have provided in the query)
Thanks,
Ram. -
How to convert date format dd.mm.yy into yyyymmdd?
Hello experts,
how to convert date format dd.mm.yy into yyyymmdd?
Thanx
AxelHi
go through these previous threads on similar question
https://forums.sdn.sap.com/click.jspa?searchID=673529&messageID=1763194
Date Conversion in Flat File
converting the DATE(yyyymmdd) into MONTH(yyyymm) format
Date Format Conversion from MM.DD.YYYY to YYYYMMDD
gives clear idea
Reagrds
Kiran
Message was edited by:
ravi kiran naalla -
How to change the date format YYYYMMDD to MM/DD/YYYY
Hi ,
How to change the date format YYYYMMDD to MM/DD/YYYY .
Ex : 20071008 to 10/08/2007
Is there any function module for this ??
Regards
RahulHi Sharma,
check the code:
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X', "SAP date format YYYYDDMM
date2 RADIOBUTTON GROUP rad1, "Date format like aprial31, 2006
date3 RADIOBUTTON GROUP rad1, "Date format like 31 apr,2006
date4 RADIOBUTTON GROUP rad1, "Date format like DD/MM/YYYY
date5 RADIOBUTTON GROUP rad1. "Date format like DD.MM.YYYY
SELECTION-SCREEN END OF BLOCK b2
FORM getmonth .
SELECT mnr
ktx
ltx
INTO TABLE T_month
FROM t247
WHERE spras = 'EN'.
IF sy-subrc NE '0'.
MESSAGE I "Message - Not able to get month values from the table T247
ENDIF.
ENDFORM.
DATA : temp_date(16) TYPE c,
temp1_date(60) TYPE c,
year(4) TYPE c,
daymonth(11) TYPE c,
daymonth1(11) TYPE c,
month(9) TYPE c,
day(2) TYPE c,
mon LIKE t247-ktx,
len TYPE i .
MOVE date TO temp1_date .
CONDENSE temp1_date NO-GAPS.
MOVE temp1_date TO temp_date .
IF date2 EQ 'X'. "The date format is like Aprial 31, 2007
CONDENSE temp_date NO-GAPS.
SPLIT date AT ',' INTO daymonth year.
IF STRLEN( year ) NE '4'.
error = 'X'.
WRITE : 'Invalid date format.'.
ELSE.
daymonth1 = daymonth.
CONDENSE daymonth1 NO-GAPS.
_len = STRLEN( _daymonth1 ).
l_len = 13 - len.
SHIFT daymonth1 RIGHT BY len PLACES.
CONDENSE daymonth1 NO-GAPS.
month = daymonth1.
CONDENSE month NO-GAPS.
SORT t_month BY monthltx.
READ TABLE t_month WITH KEY monthltx = month.
IF sy-subrc <> 0.
error = 'X'.
WRITE : 'Invalid date format.' .
ELSE.
len = STRLEN( month ).
CONDENSE daymonth NO-GAPS.
SHIFT daymonth LEFT BY len PLACES.
day = daymonth.
CONDENSE day NO-GAPS.
CONCATENATE year t_month-monthnumber day INTO o_date.
ENDIF.
ENDIF.
ELSEIF p_date3 EQ 'X'. "The date format is like 31 apr, 2007
CONDENSE temp_date NO-GAPS.
SPLIT i_date AT ',' INTO daymonth year.
IF STRLEN( year ) NE '4'.
error = 'X'.
WRITE : 'Invalid date format.'.
ELSE.
daymonth1 = daymonth.
CONDENSE daymonth1 NO-GAPS.
SHIFT daymonth1 LEFT BY 2 PLACES.
CONDENSE daymonth1 NO-GAPS.
month = daymonth1.
CONDENSE month NO-GAPS.
TRANSLATE month TO UPPER CASE.
SORT t_month BY monthstx.
MOVE month to mon.
READ TABLE t_month WITH KEY monthstx = mon.
IF sy-subrc <> 0.
error = 'X'.
WRITE : 'Invalid date format.' .
ELSE.
CONDENSE daymonth NO-GAPS.
day = daymonth+0(2).
CONDENSE day NO-GAPS.
CONCATENATE year t_month-monthnumber day INTO o_date.
ENDIF.
ENDIF.
ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'. "Date format is like DD.MM.YYYY or DD/MM/YYYY
CONDENSE temp_date NO-GAPS.
IF STRLEN( temp_date ) EQ 10.
o_date0(4) = temp_date6(4).
o_date4(2) = temp_date3(2).
o_date6(2) = temp_date0(2).
ELSE.
error = 'X'.
WRITE : 'Invalid date format.' .
ENDIF.
ENDIF.
IF STRLEN( o_date ) NE '8'.
error = 'X'.
WRITE : 'Invalid date format.'.
ENDIf.
ENDFORM. " f0100_conv_date
Reward if helpful.
Regards,
Harini.S -
How to convert date format into sap standard format?
Hi All,
In SAPUI5 screen i have one simple form in form i have date field which is format (MM/DD/YYYY). but i am getting POST error while inserting the data in to sap table.
I want convert date format in sap format (YYYY/MM/DD).
One more issue, when i am fetching the data from sap table,but the date display with time and time zone.
eg. Sat Aug 02 2014 05:30:00 GMT+0530 (India Standard Time)
I want to display only date.
Thanks,
Prashant.Now i am using <DatePicker id="Emp_fsdate" displayFormat="yyyy-MM-dd"/>
I checked in console, but date is display like mm/dd/yy
In my controller.js file i have written code
OData.request
requestUri: "http:sap/opu/odata/sap/ZSERVICE_FINAL_SRV/es_sodata",
method: "GET",
headers:
"X-Requested-With": "XMLHttpRequest",
"Content-Type": "application/atom+xml",
"DataServiceVersion": "2.0",
"X-CSRF-Token":"Fetch"
function (data, response){
var header_xcsrf_token = response.headers['x-csrf-token'];
OData.request
requestUri:
"http://sap/opu/odata/sap/ZSERVICE_FINAL_SRV/es_sodata",
method: "POST",
headers:
"X-Requested-With": "XMLHttpRequest",
"Content-Type": "application/atom+xml",
"DataServiceVersion": "2.0",
"Accept": "application/atom+xml,application/atomsvc+xml,application/xml",
"X-CSRF-Token": header_xcsrf_token
data:
Empid:Emp_id,
Empname:Emp_name,
Start_Date:Emp_sdate,
// End_Date:Emp_edate,
Status:Emp_status,
City:Emp_city,
Location:Emp_location,
and in my CREATE_ENTITY method
method ES_SODATA_CREATE_ENTITY.
DATA: ls_request_input_data TYPE zcl_zservice_final_mpc=>ts_et_sodata,
ls_userinfo TYPE zsodata.
DATA ls_temp TYPE sy-datum.
* Read Request Data
io_data_provider->read_entry_data( IMPORTING es_data = ls_request_input_data ).
* Fill workarea to be inserted
ls_userinfo-Empid = ls_request_input_data-Empid.
ls_userinfo-Empname = ls_request_input_data-Empname.
ls_userinfo-Start_Date = ls_request_input_data-Start_Date.
ls_userinfo-End_Date = ls_request_input_data-End_Date.
ls_userinfo-Status = ls_request_input_data-Status.
ls_userinfo-City = ls_request_input_data-City.
ls_userinfo-Location = ls_request_input_data-Location.
* Insert Data in table ZUSERINFO
INSERT zsodata FROM ls_userinfo.
IF sy-subrc = 0.
er_entity = ls_request_input_data. "Fill Exporting parameter ER_ENTITY
ENDIF.
endmethod.
But still i am getting an error
POST http://sap/opu/odata/sap/ZSERVICE_FINAL_SRV/es_sodata 500 (Internal Server Error)
I am able to insert all field except date field. How to insert date field in sap table. -
Function module to convert date format from yyyymmdd to mmddyyyy format
function module to convert date format from yyyymmdd to mmddyyyy format
Hi Rajitha,
Do like this
Data: Var1 type sy-datum,
var2(8) type c.
var1 = sy-datum.
Concatanate var1+4(2) var1+6(2) var1+0(4) into var2.
write var2.
Reward Points if this helps,
Satish -
How to convert date format to MM/DD/YYYY
Hi,
How to convert date format to MM/DD/YYYY.
Thanks,
Senthilhi,
tri with this function module
data :l_date(10) type c
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
DATE_INTERNAL = SY-DATUM
IMPORTING
DATE_EXTERNAL = l_date.
this function module converts date from 20050601 to external format which is specified in user profile
cheers,
sasi -
Convert java.sql.date to dd.mm.yyyy format
Hi,
Can any one tell me how to convert java.sql.date to dd.mm.yyyy format
Regards,
H.V.SwathiHi ,
Create a simple data type of type java.sql.date and give the format in it as "dd/MM/yyyy". This will work i guess.
Regards
Ishita -
Date conversion from Excel to the SAP format
Hi,
I have created a BDC program which uploads daat from Excel sheet.
There is a date field also, the format of which can be any as per the end user (it will be one of those allowed by SAP).
However, the file will be used for execution by another user who may have a date setting which is different than that from the one in Excel.
Eg. End User's date format: DD.MM.YYYY, SAP User's date format: MM/DD/YYYY
So, how do I convert the date format from excel to the format which will be accepted by the transaction during the recording?
Regards,
DaveHi Dave,
I have faced the same issue while uploading the date to the bdc.
if ur date format is DD.MM.YYYY in the excel file, first of all you need to change this to dats format ie YYYYMMDD ie character8 format and pass to the bdc, it will automatically convert to sap format
ie you need to convert splitting at .
data lv_date type char10,
lv_dd type char02,
lv_mm type char02,
lv_yyyy type char04,
v_date type char08.
lv_date = '30.12.2011'.
split lv_date at '.' into lv_dd lv_mm lv_yyyy.
if strlen(lv_dd) lt 2.
concatenate '0' lv_dd into lv_dd.
endif.
if strlen(lv_mm) lt 2.
concatenate '0' lv_mm into lv_mm.
endif.
concatenate lv_yyyy lv_mm lv_dd into v_date.
"Please use the variable V_DATE to populate to ur bdc"
Edited by: Rahul Babukuttan on Aug 11, 2011 5:35 PM -
Convert date from YYYYMMDD to DDMMYYYY
Please help if anyone knows any function module to convert date from YYYYMMDD to DDMMYYYY format..
Thanks in Advance,
manjariHello.
Simply do like this:
DATA: datum TYPE char10.
WRITE sy-datum TO datum <format option>.
<format options>:
DD/MM/YY and MM/DD/YY:
Both additions have the same effect. The date output has a two-digit year value and a separator. The separator and the order are taken from the definition for date output in the user master record.
DD/MM/YYYY und MM/DD/YYYY:
Both additions have the same effect. The date output has a four-digit year value and separator. The separator and the order are taken from the definition for date output in the user master record.
DDMMYY und MMDDYY:
Both additions have the same effect. The date output has a two-digit year value and no separator. The order is taken from the definition for date output in the user master record.
YYMMDD:
This addition provides a date output with a two-digit year value without a separator in the format YYMMDD.
Regards.
Valter Oliveira.
Maybe you are looking for
-
I cant open the itunes store anymore on my ipod touch, why??
in the last few months i think ive managed to access the iTunes Store maybe twice on my ipod touch. I dont know if has anything to do with me updating my ipod or not. what's happening every time i go to access the iTunes Store is i tap to open, and i
-
"iTunes has encountered a problem and needs to close." Quicktime problem!
I'm having a MaJoR problem with Quicktime and iTunes, but i think the main problem is Quicktime since iTunes runs off of it. I've never been able to install Quicktime, and i recently bought an iPod, and when i try to install Quicktime and iTunes the
-
Hi all I wish to learn ADF and as a beginner, I don't know where to start with . So please guide me... Regards, Sundar
-
How to Refresh a Variable screen in Webtemplet
Hi Experts, When i execute a WEB Templet giving Variable Selection Inputs , the Variable input values gets stored in the Variable Tab and will not change untill i Change it. Example Variable input 0PLANT 5030(this 5030 is the input where i give in th
-
Hp mini 110-4108tu upgradation
How To Upgrade the my hp mini 110-4108tu