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.
Similar Messages
-
How to convert system Date into DD-MMM-YYYY Format
hi friends,
please help me How to convert system Date into DD-MMM-YYYY Format.
Regards
YogeshHI..
data: w_dt(11) type c,
w_month(2),
w_mon(3).
w_month = p_date+4(2). **p_date = given date**
case w_month.
when '01'.
w_mon = 'Jan'.
when '02'.
w_mon = 'Feb'.
when '03'.
w_mon = 'Mar'.
when '04'.
w_mon = 'Apr'.
when '05'.
w_mon = 'May'.
when '06'.
w_mon = 'Jun'.
when '07'.
w_mon = 'Jul'.
when '08'.
w_mon = 'Aug'.
when '09'.
w_mon = 'Sep'.
when '10'.
w_mon = 'Oct'.
when '11'.
w_mon = 'Nov'.
when '12'.
w_mon = 'Dec'.
endcase.
Now...
concatenate p_date6(2) '-' w_mon '-' p_date0(4) into w_dt.
write w_dt. -
Want date into 'yyyy/mm/dd' format
Hi
all
Im creating date onject like
Date d = new Date();
but date object d is availabe with date and time.
i want to exctract date into 'yyyy/mm/dd' format.
can anybody helpe in this case
Help will be appricated.
Thanx
sanjayYou are hereby served with notice of a hearing to be held in 18th Circuit Court of Seminole County, FL, on 12 April 2005 to answer a suit brought against you for spoon-feeding. You have 15 days upon receipt of this notice to provide written response to the original filing (see Attachment A).
� {� -
How to store xml data into file in xml format through java program?
HI Friends,
Please let me know
How to store xml data into file in xml format through java program?
thanks......
can discuss further at messenger.....
Avanish Kumar Singh
Software Engineer,
Samsung India Development Center,
Bangalore--560001.
[email protected]Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
i got a piece of code from the net which allows me to parse th file:
import java.io.IOException;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import org.apache.xerces.parsers.SAXParser;
import java.lang.*;
public class MySaxParser extends DefaultHandler
private static int INDENT = 4;
private static String attList = "";
public static void main(String[] argv)
if (argv.length != 1)
System.out.println("Usage: java MySaxParser [URI]");
System.exit(0);
String uri = argv[0];
try
XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
MySaxParser MySaxParserInstance = new MySaxParser();
parser.setContentHandler(MySaxParserInstance);
parser.parse(uri);
catch(IOException ioe)
ioe.printStackTrace();
catch(SAXException saxe)
saxe.printStackTrace();
private int idx = 0;
public void characters(char[] ch, int start, int length)
throws SAXException
String s = new String(ch, start, length);
if (ch[0] == '\n')
return;
System.out.println(getIndent() + " Value: " + s);
public void endDocument() throws SAXException
idx -= INDENT;
public void endElement(String uri, String localName, String qName) throws SAXException
if (!attList.equals(""))
System.out.println(getIndent() + " Attributes: " + attList);
attList = "";
System.out.println(getIndent() + "end document");
idx -= INDENT;
public void startDocument() throws SAXException
idx += INDENT;
public void startElement(String uri,
String localName,
String qName,
Attributes attributes) throws SAXException
idx += INDENT;
System.out.println('\n' + getIndent() + "start element: " + localName);
if (localName.compareTo("Machine") == 0)
System.out.println("YES");
if (attributes.getLength() > 0)
idx += INDENT;
for (int i = 0; i < attributes.getLength(); i++)
attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
if (i < (attributes.getLength() - 1))
attList = attList + ", ";
idx-= INDENT;
private String getIndent()
StringBuffer sb = new StringBuffer();
for (int i = 0; i < idx; i++)
sb.append(" ");
return sb.toString();
}// END PRGM
Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
The next step is to write the data to the DB.
Am sending an example of my file:
<Start>
<Machine>
<Hostname> IPCServer </Hostname>
<HostID> 80c04499 </HostID>
<MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
<CPU> UltraSPARC-IIi at 360 MHz </CPU>
<Memory> RAM : 512 MB </Memory>
<HostAdapter>
<HA> kern.info] </HA>
</HostAdapter>
<Harddisks>
<HD>
<HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
<HD2> ST38420A 8.2 GB </HD2>
</HD>
</Harddisks>
<GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
<NetworkType> hme0 : Fast-Ethernet </NetworkType>
<EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
<IPAddress> 149.51.23.140 </IPAddress>
</Machine>
</Start>
Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
Cal u tellme what to do!
Even better- do u have a piece of code that will help me understand and implement the database writing portion?
I badly need help here.
THANX -
Report for converting the documents into the PDF format.
Hello Experts,
I need to know if any report/ T-code is available in SAP to convert the files into PDF format.
We are processsong these PDF's then into IXOS system.
Regards,
Anna.Hello ,
You may check with the below programs:
Program name Report title
RSTXCPDF Routines for Converting OTF Format to PDF Format
RSTXPDF2 Administration/Upload of type 1 and TrueType font files
RSTXPDF3 Customizing for OTF-PDF Conversion
RSTXPDF4 Help Report from CONVERT_OTFSPOOLJOB_2_PDF
RSTXPDF5 Help Report from CONVERT_ABAPSPOOLJOB_2_PDF
RSTXPDFT Test report for PDF conversion - converting standard texts to PDF
RSTXPDFT2
RSTXPDFT3 Test
RSTXPDFT4 Convert SAPscript (OTF) or ABAP Lists Spool Job by PDF
RSTXPDFT5 Test: GUI Download of Spool Request
Regards
Ramesh Ch -
Conversion failed when converting the varchar value 'undefined' to data typ
Conversion failed when converting the varchar value 'undefined' to data type int.
hi, i installed oracle insbridge following the instruction in the manual. in rate manager, when i tried to create a new "Normal rating" or "Underwriting", im getting the following exception
Server Error in '/RM' Application.
Conversion failed when converting the varchar value 'undefined' to data type int.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value 'undefined' to data type int.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Conversion failed when converting the varchar value 'undefined' to data type int.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1948826
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844747
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlDataReader.HasMoreRows() +157
System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) +197
System.Data.SqlClient.SqlDataReader.Read() +9
System.Data.SqlClient.SqlCommand.CompleteExecuteScalar(SqlDataReader ds, Boolean returnSqlValue) +50
System.Data.SqlClient.SqlCommand.ExecuteScalar() +150
Insbridge.Net.Fwk.DAO.DataAccess.ScalarQuery(String connectionString, String command, Transaction transType, Object[] procParams) +110
[Exception: Cannot Execute SQL Command: Conversion failed when converting the varchar value 'undefined' to data type int.]
Insbridge.Net.Fwk.DAO.DataAccess.ScalarQuery(String connectionString, String command, Transaction transType, Object[] procParams) +265
Insbridge.Net.Fwk.DAO.SqlProcessor.ExecuteScalarQueryProc(String subscriber, String datastore, String identifier, String command, Transaction transType, Object[] procParams) +101
Insbridge.Net.Fwk.DAO.SqlProcessor.ExecuteScalarQuery(String subscriber, String identifier, String command) +22
Insbridge.Net.RM.IBRM.ExeScalar(String cmd, Object[] paramsList) +99
Insbridge.Net.RM.Components.Algorithms.AlgEdit.Page_Load(Object sender, EventArgs e) +663
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
my insbridge versions are as follows
IBRU 4.0.0 Copyright ©2010, Oracle. All rights reserved. - Version Listing
RMBUILD.DLL 4.0.0.0 (x86)
SRLOAD.DLL 3.13.0 (x86)
IBRM v04.00.0.17
IB_CLIENT v04.00.0.00
RM.DLL 4.00.0 (x86)
IBFA 3.0.2
OS: Windows Server 2003
DB: Sql Server 2008
Browser: IE8
how do i solve this, please helpThis is an error due to conversion failed from character string to int datatype. Infact, the table column contains "NO" value which you are trying to convert to Int/SUM which is illegal. Without your code and table structure, its difficult to pinpoint your
actual issue. But check, all columns for value "NO". -
Convert system time into User local time.
Hi,
How to convert System time into User Local time.
Are there any FMs available.
Regards,
Kiranhi,
There is just one simple funda behind the Date and time logic in SAP.
-> It is absolutely useless to store Date and time directly in DB. Why ?
Because 00:00 a.m in London could mean 05:30 in India !! So If I (in India) store a Date 1st Feb 2008 , 10:00 a.m .. This time for a person in London could be invalid.. because he is behind your time zone..
So the solution is to store the date/times in Timestamps format. Taking the above example.. 1st Feb 2008, 10:00 a.m (in India) will be stored as 20080201043000.
This time if seen in German Time zone will look as : 1st Feb 2008, 05:30 a.m.
Simple right
-> In India we store date as DD.MM.YYYY while in other countries they store it as MM.DD.YYYY.
The separator could be . or - or / .
The date format is user dependent. I might prefer to store it as DD.MM.YYYY and you might want to store it as MM-DD-YYYY.
System does not bother what your format is. It always stores in YYYYMMDD (8 Char)
On screens if you want to display Date then it must always be shown in that users format who is seeing it. How to get this done ?
DATA : lv_date(10) type c.
write sy-datum into lv_date.
So in LV_DATE variable the date will be stores in the users format.
Simple right
There are function modules that do the same. But normally we should avoid use of FM to make code simpler, short and easy... no complications at all ..
You can use system variables sy-datlo (Local Date for Current User) and sy-timlo ( Local Time of Current User ).
You can also use GET TIME statement.
reward if useful,
preet -
Converting sql timestamp into a usable java format??
hi there.
does anyone know how to convert an sql timestamp into a usable java format? i have retrieved a timestamp from a mysql table in a jsp script and would like to convert it into the following format:
12:42pm | 08.07.02
as i understand it, i'll need to convert the timestamp into seconds since 1970 and then manipulate it as a calendar object? my first line is working, but i don't know what to do after...
java.sql.Timestamp sqlTimestamp = resultSet.getTimestamp("date_and_time");
next...?
any help would be much appreciated!!
thanks.please excuse my java sytnax ignorance, but i've tried a bunch of different syntax arrangements and can't figure out how to use the getTime() method. what comes after my first line there?
java.sql.Timestamp sqlTimestamp = resultSet.getTimestamp("date_and_time");
then something like:
long msec=date.getTime(sqlTimestamp);
but that doesn't seem to work...
thanks for any help! -
How to load Matrix report data into basic table data using ODI
Hi,
How to load Matrix report data into basic table data using oracle Data Integrator ?
Requirement Description:
Following is the matrix report data:
JOB DEPT10 DEPT20
ANALYST 6000
CLERK 1300 1900 Need to convert it into below format:
JOB Dept Salary
ANALYST DEPT10
ANALYST DEPT20 6000
CLERK DEPT10 1300
CLERK DEPT20 1900
Thanks for your help in advance. Let me know if any further explanation is required.Your list seems to be a little restrictive, you can do a lot more with ODI procedures.
If you create new procedure, and add a step. In the 'command on source' tab set you technology and schema as per your source database. Use the unpivot functionality as described in the link, please, rather than using 'SELECT *' use the appropriate column names and alias them for eg:
SELECT job as job,
deptsal as deptsal,
saldesc as saledesc
FROM pivoted_data
UNPIVOT (
deptsal --<-- unpivot_clause
FOR saldesc --<-- unpivot_for_clause
IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
Then in your 'command on target' tab set the technology and schema to your target db, then put your INSERT statement for eg:
INSERT INTO job_sales
(job,
deptsal,
saledesc
VALUES
:job,
:deptsal,
:saledesc
Therefore you are using bind variables from source to load data into target.
Obviously if the source and target table are in the same database, then you can have it all in one statement in the 'command on target' as
INSERT INTO job_sales
(job,
deptsal,
saledesc
SELECT job as job,
deptsal as deptsal,
saldesc as saledesc
FROM pivoted_data
UNPIVOT (
deptsal --<-- unpivot_clause
FOR saldesc --<-- unpivot_for_clause
IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
also set the log counter as 'Insert' on the tab where your INSERT statement is, so you know how many rows you insert into the table.
Hope this helps.
BUT remember that this feature only came out in Oracle 11g. -
Date of origin,Default date-0015
Hi Seniors,
Can any body please put some light on Date of origin,Default date-0015.
How these 2 field have to be maintained and what effect these 2 have on 0015.
I am having difficulties in maintaining 0015 as any changes made in PA30 deletes the previous record.
Please update.
Is it advisable to configure 0015 in ACTION>>DEFINE INFOGROUPS>>INFOGROUPS as till now i have COP-0001,COP-0008.
After running the change in Pay till 0008 when i try to change 0015 in PA30 the old data is not stored any where and the new data takes its place.
Thanks in advance.
Edited by: srssaphr09 on Apr 12, 2011 9:21 PMHi Raj,
Thanks for the information,the shred information seems to be good.
Well the issue is there is a PERNR who was hired in the month of FEB and as per his joining bonus he was getting 35000k
But the negotiation was on and finally the Mgmt decided to make it 50,000.Now the changes has to be done without running the Change is pay,but has to be changed through PA40,but the changes are overwriting the previous record and new record comes into the system,but how to check the old data then,which is required for future purpose.
Please put some light on the following-The date of origin is by default the last date of the payroll period according to the control record. However you can overwrite it and also put in a PP # and year in which you want that entry to be processed.
I am in testing phase and the payroll is not been run,the contropll record is set monthly say-01.04.2010-30-04-2010- 1st payroll period.On the above how to go about 0015.
please share your knowledge.,
Thanks in Advance.
Edited by: srssaphr09 on Apr 13, 2011 6:34 AM
Edited by: srssaphr09 on Apr 13, 2011 6:47 AM -
UOM is getting rounded-off while converting the PR into PO
Dear all,
We have created a PR with the UOM - EA for the qty 2.256 but the same was changed as 2 while converting the PR into Purchase order (If the PR qty is 2.564, then PO qty is changed to 3).
I have checked in "CUNI". In this, for "EA", decimal pl rounding is maintained as 3.
(If we create the PO directly for decimal qty w/o referring the PR, qty is getting rounded-off in print format. We have already posted this print script issue alone and we were advised to change the print script.)
What we have to do to get the actual PR qty in PO.
Pl give your valuable suggestions.
Warm regards,
M.Selvaganesh,Friends,
What is the application of decimal places under display and decimal pl. rounding under conversion in CUNI?
(If i maintained decimal pl. rounding as 2, system is taking the PR qty of 2.256 as 2.25 in PO. and i've maintained decimal places as 3. But where can i see this in PO?)
Pl clarify.
Cool regards,
M.Selvaganesh, -
Any difference between Master data and User master data ?
Any difference between Master data and User master data ?
hi
A user master record defines the authorizations assigned to a user. Based on these authorizations one can access the master data.
Master data - it is the data which is used long term in SAP r/3 system such as vendor master , material master, customer master,
there is no such thing like user master data to the best of my knowledge
hope this helps
regds
Manan -
i have an ipad 2 and want to put my dvds onto the ipad. i have downloaded handbrake and converted the file into mpeg4 file but i cannot get the file to open in itunes
I have the same problem , i've converted my videos to mp4 , by using different programmes and tried to open them in itunes but it didnt .
Some people suggested the following although it didnt help me , it might help you
One suggested to paste the videos that you want in automatically add to itune ( go to your music folder m then click on itunes , then itunes media , and you will find it there )
Others suggested to o to the ontrol panal , then programmes and features m then lick on quick time (. Or itunes) then Change then repair
If it didnt help. And you find another method m please let me know
Thank you -
Converting the amount into words in different languages
Hi All,
Is there any FM to convert the amount into words in a specific language.
SPELL_AMOUNT FM is not working for some of the languages like portuguese, etc..
Any idea on this.
Thanks in Advance.Hi,
Use the FM:
CALL FUNCTION <b>'Y_AMOUNT_IN_WORDS'</b>
Hope it helps.
Reward if helpful.
Regards,
Sipra -
Hello, I was wondering if you could convert the IMEI # into the serial number using letters and digits?
No the imei from what I understand is a randomly given number. to get serial number you must have it. you can try supportprofile.apple.com and login.
Maybe you are looking for
-
My four year old Macbook Pro couldn't start yesterday and after going through solutions and all, it worked. But now it's freaking laggy and whenever I want to open an app, it takes a long time or the app will just crash. Any idea how to fix it? I rea
-
Hi Experts, I am using BEx 7.0 Query designer. While executing any query I am getting followng error. com.sap.ip.bi.base.exception.BIBaseRuntimeException: Error while generating data provider: <parameterList> <param name="BI_COMMAND_TYPE" value="CRE
-
I was using (as always) Safari 4 and by some weird finger movement I was typing something in google search bar/URL bar and then I heard "swish" (kind of similar to sound when you drag and drop into trash can)- I think I hit an F key by mistake- and t
-
Please help before December 2012
-
How do I get previous and next quarter dates in coldfusion? Using the below function I will get current quarter. <cfoutput>#Quarter(Now())#</cfoutput>. ---> Output ---> Q1 Q#Quarter(Now())#-#DateFormat(Now(), "yyyy")# --> Output ----> Q1-2007 I want