How to convert a char data field to type p or i
Thanks.
Chek out if this FM's in your system
CALL FUNCTION 'RRBA_CONVERT_PACKED_NUMBER'
EXPORTING
I_CHAR = L_QUANTITY
I_DECIMALS = RRSI_C_SID-NOT_EXIST
I_DECIMAL_MARK = '.'
I_DECIMAL_MARK_IN =
I_SIGN_PRSNT = ' '
IMPORTING
E_VALUE_CHAR =
E_VALUE_WRITE =
E_VALUE_FLOAT = E_VALUE_FLOAT
E_VALUE_PACKED =
E_TOO_MANY_DECIMALS =
EXCEPTIONS
TOO_BIG = 1
INPUT_NOT_LEGAL = 2
ILLEGAL_SIGN_PRSNT = 3
ILLEGAL_DECIMAL_MARK = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
santhosh
Similar Messages
-
How to convert internal table data to PDF format
HI,
I have an internal table data having one field with 255 chars. length.I want to send that intenal table data as attachemnt with external mail. i am thinking of converting that data into PDF format and use the FM to send the mail. How to convert internal table data to PDF format.
KishoreIn which format is your data in the internal table currently. Is it returned by a smartform/script or its just data fetched from some database table into an internal table. Since its obvious that the data should appear in the PDF with some Layout, you should be using smartform to format the data properly. See the Link
Smartform to PDF to EMAIL
This shows convertion of smartform to pdf and send it through email
Regards,
Abhishek -
How to convert milliseconds to date format in sql query
Hi All,
The following code is in java.
String yourmilliseconds = "1316673707162";**
Date resultdate = new Date(Long.parseLong(yourmilliseconds));
could you plese tell me how to convert milliseconds into date format in query and comparing with another date like(sysdate-3)Hello,
http://stackoverflow.com/questions/3820179/convert-epoch-to-date-in-sqlplus-oracle
Regards -
How to convert files into DAT?
Does anyone know how to convert files into DAT? Not The other way around please.
This might do it:
http://www.videoconverterformac.com/dat-converter-for-mac.html
but can't imagine why you would want to! -
How can we give the Data Format (File Type ) in Runtime
Hi all,
How can we give the Data Format (File Type ) in Runtime for the following method,
cl_gui_frontend_services=>gui_download.
Thanks in advance
SriThere is a filetype parameter which you can set
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
* BIN_FILESIZE =
filename =
* FILETYPE = 'ASC'
* APPEND = SPACE
* WRITE_FIELD_SEPARATOR = SPACE
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = SPACE
* WRITE_LF = 'X'
* COL_SELECT = SPACE
* COL_SELECT_MASK = SPACE
* DAT_MODE = SPACE
* CONFIRM_OVERWRITE = SPACE
* NO_AUTH_CHECK = SPACE
* CODEPAGE = SPACE
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = SPACE
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* IMPORTING
* FILELENGTH =
changing
data_tab =
* EXCEPTIONS
* FILE_WRITE_ERROR = 1
* NO_BATCH = 2
* GUI_REFUSE_FILETRANSFER = 3
* INVALID_TYPE = 4
* NO_AUTHORITY = 5
* UNKNOWN_ERROR = 6
* HEADER_NOT_ALLOWED = 7
* SEPARATOR_NOT_ALLOWED = 8
* FILESIZE_NOT_ALLOWED = 9
* HEADER_TOO_LONG = 10
* DP_ERROR_CREATE = 11
* DP_ERROR_SEND = 12
* DP_ERROR_WRITE = 13
* UNKNOWN_DP_ERROR = 14
* ACCESS_DENIED = 15
* DP_OUT_OF_MEMORY = 16
* DISK_FULL = 17
* DP_TIMEOUT = 18
* FILE_NOT_FOUND = 19
* DATAPROVIDER_EXCEPTION = 20
* CONTROL_FLUSH_ERROR = 21
* NOT_SUPPORTED_BY_GUI = 22
* ERROR_NO_GUI = 23
* others = 24 -
How to Convert a 'Time Stamp' field to Date......?
Hello Gurus:
I am using a Generic Extractor to pull some stats data. One of the field is a Time Stamp field, which tells me the date and time of Transaction run. I only need "Date". I tried mapping the stamp field to Date info-object hoping for a automatic determination of the Date.... (like the Week, Month happens). Well, I was wrong!
I only need the Date part. How can I do this in BI? is teher a specific SAP info-object for this that could be used..? If not, what would be the routine. The Date field that comes in is a SAP format... "u201C20,070,505.0000000u201D meaning the Transaction was run
on 05/05/2007. How can I get this convertion in BI transaformation?? is there a special Routine...?
Also, we are trying to use "Time Stamp" based DELTA from a generic extraction. The field used is a System date with time stamp. Value looks like u201C20100,505,170,113.2918470u201D, u201C20100,505,170,113.4748820u201D Every record pulled has a different value... probably giving me the time at which the record was created or generated. Now, with DELTA specifid on this type of field, what will be the 'Current Status" value in Delta queue? Is it based on the last record created and will that be the highest value? For next Delta extraction, does it compare the extraction time stamp to this value and bring in those records that are greater than the 'Current Status" value? I guess with that we can have as many deltas as we want..... right?? is there any particular setting I should be doing or worried/ careful about setting etc....?
Thanks for the response in advance....
Best..... SMaaThanks Akshay,
Your suggestion worked right away and was probably the easiest of all. I tried the Function Module that Pravender suggested,
but it did not return me the date back.... may be because it does not need the Micro Seconds in it....? Routine as suggested by
Satyam might work too, but did not go there....!
Thanks to all of you.
Best..... SMaa -
How to Convert internal table data into text output and send mail in ABAP
Hi All,
Good Morning.
Taking a glance at a code that converts internal table data to an Excel file in ABAP. also checked how to send this excel to mailing list as attachment.
But thought of doing it without excel.
I mean, I have an internal table which contains fields of all types (character,integer,date,time). Since it is only around 4 to 5 rows in it (output),why to convert it to excel. not required!!. Instead I want to send this output to User's mails as Normal mail body with No attachments.
Could anybody please suggest me a way as to how to send internal table data as a mail ( not as an excel or PDF etc).
as of now my findings are, it is quite complex to convert internal table data to email (Text) format. but i believe if there is some way of doing it.
Best Regards
Dileep VThere's something I have used in the past where we send out information about failed precalculation settings (which are stored in internal table gt_fail)
notice we use gt_text as "mail body"
TRY.
* -------- create persistent send request ------------------------
gv_send_request = cl_bcs=>create_persistent( ).
* -------- create and set document -------------------------------
* create text to be sent
wa_line = text-001.
APPEND wa_line TO gt_text.
CLEAR wa_line.
APPEND wa_line TO gt_text.
LOOP AT gt_fail ASSIGNING <fs_fail>.
MOVE <fs_fail>-retry_count TO gv_count.
CONCATENATE text-002
<fs_fail>-setting_id
text-003
gv_count
INTO wa_line SEPARATED BY space.
APPEND wa_line TO gt_text.
CLEAR wa_line.
ENDLOOP.
APPEND wa_line TO gt_text.
wa_line = text-007.
APPEND wa_line TO gt_text.
* create actual document
gv_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = gt_text
i_length = '12'
i_subject = 'Failed Precalculation Settings!' ).
* add document to send request
CALL METHOD gv_send_request->set_document( gv_document ).
* --------- set sender -------------------------------------------
gv_sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD gv_send_request->set_sender
EXPORTING
i_sender = gv_sender.
* --------- add recipient (e-mail address) -----------------------
LOOP AT s_email INTO wa_email.
MOVE wa_email-low TO gv_email.
gv_recipient = cl_cam_address_bcs=>create_internet_address(
gv_email ).
CALL METHOD gv_send_request->add_recipient
EXPORTING
i_recipient = gv_recipient
i_express = 'X'.
ENDLOOP.
* ---------- set to send immediately -----------------------------
CALL METHOD gv_send_request->set_send_immediately( 'X' ).
* ---------- send document ---------------------------------------
CALL METHOD gv_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = gv_sent_to_all ).
IF gv_sent_to_all = 'X'.
WRITE text-004.
ENDIF.
COMMIT WORK.
* exception handling
CATCH cx_bcs INTO gv_bcs_exception.
WRITE: text-005.
WRITE: text-006, gv_bcs_exception->error_type.
EXIT.
ENDTRY.
with the following declarations
* TABLES *
TABLES:
adr6,
rsr_prec_sett.
* INTERNAL TABLES & WORK AREAS *
DATA:
gt_fail TYPE SORTED TABLE OF rsr_prec_sett
WITH UNIQUE KEY setting_id run_date,
gt_text TYPE bcsy_text,
wa_fail LIKE LINE OF gt_fail,
wa_line(90) TYPE c.
FIELD-SYMBOLS:
<fs_fail> LIKE LINE OF gt_fail.
* VARIABLES *
DATA:
gv_count(4) TYPE n,
gv_send_request TYPE REF TO cl_bcs,
gv_document TYPE REF TO cl_document_bcs,
gv_sender TYPE REF TO cl_sapuser_bcs,
gv_recipient TYPE REF TO if_recipient_bcs,
gv_email TYPE adr6-smtp_addr,
gv_bcs_exception TYPE REF TO cx_bcs,
gv_sent_to_all TYPE os_boolean.
* SELECTION-SCREEN *
SELECT-OPTIONS:
s_email FOR adr6-smtp_addr NO INTERVALS MODIF ID sel.
DATA:
wa_email LIKE LINE OF s_email. -
How to compare table's date field with dropdown year field
Hi All,
I have one requirement to display the selected rows from a database table based on the selection of drop down.
Here, I have one dropdown of year(like 2009,2010,....) and I have one database table which contains one field with "DATE".
Now, I want to compare table's DATE field with my dropdown field.
Problem is that table's DATE field is of type "DATS" and dropdown is of type INTEGER(or) STRING ...
How to compare this fields?
Can any one please give me solution for this...!
Thanks in Advance!Hi sreelakshmi.B,
try the following:
DATA lt_dats TYPE TABLE OF dats.
DATA l_dat_i TYPE i.
DATA l_dat_c_4(4) TYPE c.
DATA l_dat_c_12(12) TYPE c.
DATA l_dats_from TYPE dats.
DATA l_dats_to TYPE dats.
*Move Date from Integer to Char
l_dat_c_4 = l_dat_i = 2005.
*Create Date From use in WHERE-Clause
CONCATENATE '01.01.' l_dat_c_4 INTO l_dat_c_12.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = l_dat_c_12
IMPORTING
date_internal = l_dats_from
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
*Create Date To use in WHERE-Clause
CONCATENATE '31.12.' l_dat_c_4 INTO l_dat_c_12.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = l_dat_c_12
IMPORTING
date_internal = l_dats_to
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
* Select records in range
SELECT *
FROM [DBTAB]
INTO TABLE [ITAB]
WHERE [DATE] BETWEEN l_dats_from
AND l_dats_to.
Regards
REA -
How to Convert DateTime to Date ?
This sounds easy, but I'm not progressing as I should.
element MyDate : Date;
MyDate = contract.ValidityPeriod.TimePointPeriod.StartTimePoint.DateTime. ;
The above complains about "Assignment of type DateTime to type Date is not possible".
I've looked into DateTime functions, but am not getting anywhere.
Any tips on how to convert a DateTime field to Date field ?Afaik, AP.Common.GDT.DateTime does not have a ConvertToGlobalDateTime method, furthermore retrieving the date from the globalDateTime could give you the wrong local date since it does do not consider time zones.
I would use the similar to the following (no guarantee about correctness):
import ABSL;
import AP.Common.GDT;
var In = contract.ValidityPeriod.TimePointPeriod.StartTimePoint.DateTime;
// convert To GlobalDateTime
var timeGlobal = GlobalDateTime.ParseFromString(In.content.ToString()); // not sure whether this is correct -> please verify yourself
// convert to LOCAL_DateTime using timeZone
var timeZone = In.timeZoneCode;
var localDateTime = timeGlobal.ConvertToLocalDateTime(timeZone);
var localDateTimeStr = localDateTime.ToString();
// cut off time suffix (starts with "T")
var localDateStr = localDateTimeStr.Substring(0, localDateTimeStr.Find("T"));
var date = ABSL:Date.ParseFromString(localDateStr);
Best regards,
Ludger -
Using a Converter on a date field
Hi all. I’m having a problem using a converter in JSF. I’m pulling a lot of information from a database and throwing it all on a page. I’ve set up a custom converter for all my values that are of a String type. This converter basically says “if there is something in this variable, put it on the page, otherwise, put ‘N/A’ on the page”. The code for this converter is below:
public String getAsString(FacesContext context, UIComponent component,
Object value)
String stringValue = value.toString().trim();
return StringUtils.isNotBlank(stringValue) ? stringValue : "N/A";
...This code works. I’m having trouble doing the exact same thing for date fields. If I run it through the same converter, then it will show me the date if there is one, but if there isn’t anything in the variable, it just gives me nothing. No date, no “N/A”, nothing. I’ve seen that there is a separate converter called DateTimeConverter, but it looks like this is basically just used to format the date.
Anybody know how I can get this working?I'm still having this problem if anyone has any ideas. When I run it in debug, the value that's getting sent is "". There is a separate DateTimeConverter, but all it seems to do is format a date. I can't see a way to spit out a "N/A" if there isn't one.
-
How can I populate a date field when document is signed?
I have 4 digital signature fields in a PDF form. Next to each signature field is a date field (m/d/yyyy format). I would like it so when the user signs the signature box that the date field next to it populates with todays date, then changes to read only (so it cannot be altered).
In Adobe Acrobat Pro 9 I have this form and it has the following fields
Signature1
Signature2
Signature3
Signature4
DateField1
DateField2
DateField3
DateField4
The Signature fields trigger a Topaz.GemSignPlus driver where the end user will be signing on an electronic signature pad.
How can I use Javascript to detect when one of those Signature fields is populated and then fill in the date to the approrpiate date field? I tried creating boolean variables initialized as false for each sig field. Then when the signature is done I try to change it to true, but for whatever reason my javascript detecting the value doesn't do anything.
I've searched the net endlessly for this solution. I can't believe I'm having such a hard time finding an answer. I mean how many places do you go where they ask you to "Sign and date here". Every signature based document I've ever seen also requires a date.
Anyway here's what I have. In Document JavaScript functions I have a script name called populate date:
function populatedate()
var bSignature1 = new Boolean();
var bSignature2 = new Boolean();
var bSignature3 = new Boolean();
var bSignature4 = new Boolean();
if (bSignature1) {
DateField1.value = util.printd ("m/d/yyyy", new Date());
if (bSignature2) {
DateField2.value = util.printd ("m/d/yyyy", new Date());
if (bSignature3) {
DateField3.value = util.printd ("m/d/yyyy", new Date());
if (bSignature4) {
DateField4.value = util.printd ("m/d/yyyy", new Date());
In each signature field I have under the Signed tab "This script executes when field is signed:
var bSignature1 = new Boolean(true);
I'm trying to change it to true see. My thinking is if its true than DateField1.value should print the m/d/yyyy in it from the built in Date() function.
But maybe I am not getting this context correct. I am new to Javascript in Adobe.It's quite a round-about script... Why not simply use the signature signing script to set the value of the date field? The correct syntax for that is:
this.getField("DateField1").value = util.printd ("m/d/yyyy", new Date()); -
How to make the 'Finish Date' field Editable in Project server 2013
Hi All,
In Project server 2013 on premises deployment, When I try to create a new enterprise project [Also in case of new custom project type], Only the 'Start Date' field is available. The 'Finish Date' field is by default taking the value of the 'start Date' itself.
I am unable to make this 'Finish Date' field editable.
Any pointers on this would be very helpful,
Thanks
ShankyShanky --
When you create a new project in either Microsoft Project Professional or Project Online, the system does not allow you to enter both a Start date and a Finish date for the project. Here is how the software works:
You enter the Start date of the project.
You completely plan the project with tasks, task dependencies, task Durations, and assigning resources to tasks.
Based on the Start date you provide, plus all of the task information, the software calculates the Finish date of the project for you. So, you cannot provide both the Start date and the Finish date, nor is they any way to force the system to allow
you to do this. Hope this helps.
Dale A. Howard [MVP] -
How to get a noneditable date field...
Hi,
The date item in HTMLDB provides a calendar alright, but the actual column is still open to the users to change the date chosen from the calendar, how do u make it a disabled field so that users cannot change the format of date chosen from the calendar just like a popup lov,displays description returns key value type....
or do we have to set some attibute to make this field disabled...
Thanks in advance
Regards
NaveenHi Naveen,
I'm not sure that you can lock or disable the date field, after all you want your user to enter one. But I think that you can use a validation on the item - Item specified is a valid date. Your users will get an error message each time they will try to enter invalid date, including wrong date format.
Hope it helps,
Arie. -
How do I update a date field through CMP
I wonder how to update a date field through CMP.
For example, I can't update an employee table with following statement.
employee.setHire_date('2002-03-20');
Thanks,Thats correct......
Try using the following code....
String strDate ="2002-03-20";
String date_fmt = "yyyy-MM-dd";
java.text.SimpleDateFormat sdf=new java.text.SimpleDateFormat(date_fmt);
java.util.Date hireDate =null;
hireDate =(Date) sdf.parse(strDate);
employee.setHire_date(hireDate);
Hope this helps
Cheers
--Venky -
How to convert Milliseconds into Date format
Hi all,
I am getting the output of a variable in milliseconds format, how can I convert it into date format
For ex: I am getting input variable as 1366664691000 and I need to convert it to April 22, 2013 5:04:51 PM EDT ( or of SOA format). is there any function for this in XSL or XPath?
Thanks,It is working fine if i test it in provided site...
But it is returning "-1366664691001", If i am running it in EM. This is the code in my xsl
<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper
<!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
<mapSources>
<source type="WSDL">
<schema location="../JavaProcess.wsdl"/>
<rootElement name="process" namespace="http://xmlns.oracle.com/SampleApplication/JavaEmbeddingActivity/JavaProcess"/>
</source>
</mapSources>
<mapTargets>
<target type="WSDL">
<schema location="../JavaProcess.wsdl"/>
<rootElement name="processResponse" namespace="http://xmlns.oracle.com/SampleApplication/JavaEmbeddingActivity/JavaProcess"/>
</target>
</mapTargets>
<!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.4.0(build 110106.1932.5682) AT [TUE MAY 07 10:21:02 EDT 2013]. -->
?>
<xsl:stylesheet version="1.0"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:med="http://schemas.oracle.com/mediator/xpath"
xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:client="client"
exclude-result-prefixes="xsi xsl bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref bpmn ora socket ldap">
<xsl:template match="/">
<xsl:variable name="lastMTime" select="1366664691000"/>
<xsl:copy-of select="$lastMTime"/>
<client:processResponse>
<client:result>
<xsl:value-of select='xsd:dateTime("1970-01-01T00:00:00") + $lastMTime * xsd:dayTimeDuration("PT0.001S")'/>
</client:result>
</client:processResponse>
</xsl:template>
</xsl:stylesheet>
Maybe you are looking for
-
Need to call an Oracle Form from a stored procedure, any suggestions.
I have a stored procedure which runs on our 8i database on a scheduled basis. I have an Oracle Form (6i) that needs to be called automatically from this stored procedure. Any suggestions on how I might accomplish this? Thanks, Wes
-
Rollover one invisible movie clip and make a different one visible and the reverse
This is a very simple thing I want to do: show informational popups when an area of the screen is rolled over. I was able to get this working in action script 3 with MouseEventListener and the visible =true/false property but can't seem to get it wor
-
Simple select query is taking a lot of time
hi gems... my table has 7267563 rows...and i am doing a simple select * from table; but it is taking a lot of time nearly 25minutes but not completed... when i did select count(1) from table then it gave the result instantly also select * from table
-
Changes in Delivery doc effect in which table
Hi all, iam chaneing the deliveryquantity in delivery order, that changes iun which table that will be stored. i know likp,lips this tables are stored the delivery details. but i want in which table that delivery doc effect will be stored. pls help
-
Can't get SMS off phone...please help!
I have a Nokia N93i (RM-156). I'm using the latest Nokia PC Suite's Communication Center, and for some reason it's not able to talk to the phone. It just says "Loading messages..." in the upper left for about 15 seconds, then it goes away and nothing