Leading Zeros for variable vlaues(Date)
Hi,
How to remove leading zeros for variable values.
For example;
Comapny Code by Auth: 007.2004(July 2004)
How to take out the first two zeros or first zero.
Any suggestions would be of great help.
Regards,
Suresh
How is that related to sql develper?
Did you read the forum title? - SQL Developer (Not for general SQLl/PLSQL questions)
Similar Messages
-
How to remove leading zeros from variable
hi,
how to remove leading zeros from variable like it_vbap-matnr.
value in it_vbap-matnr is 000000000000000358
i want to remove leading zeros so that it become 358
regards
deepakYou can use Function Module <b>'CONVERSION_EXIT_MATN1_OUTPUT'</b>
This Function Module will eliminate leading Zeros.
For each MATNR Value read form DB Table,u can eliminate Leading zeros and then modify ur Internal table.
I think u will not get leading Zeros into utr Internal table when u read from VBAP.
Bcoz MATNR in VBAP itself have Conversion routine.
If u r getting leading zeros,U can use following Logic.
tables:
vbap.
data:
t_vbap like standard table of vbap.
select matnr
from vbap
into corresponding fields of table t_vbap.
loop at t_vbap into vbap.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
EXPORTING
INPUT = vbap-matnr
IMPORTING
OUTPUT = vbap-matnr
modify t_vbap from vbap transporting matnr.
endloop.
Hope this will work..... -
Remove Leading zeros for Material in Transformation
Hi Experts,
I'm using DTP first time. I don't have much exp on DTP & Transformations.
I'm creating infocube with some objects. I want to remove leading zeros for zmaterial.
In 3.x writen update routines as fallows:
data: zmat(18) type c.
zmat = COMM_STRUCTURE-/BIC/ZMAT.
shift zmat left deleting leading '0'.
result value of the routine
RESULT = zmat.
I'm confusing in Transfermation where to write this routines.
I'm writing in Transformation as fallows:
data: zmat(18) type c.
zmat = SOURCE_FIELDS-/BIC/ZMAT.
shift zmat left deleting leading '0'.
RESULT = zmat.
But it's getting remove zero's.
Anybody suggest on this.
SiriDear Sir,
No confusion at all.
Just double click on the Target Infoobjct i,e Material object in Transformation, you will see a wizard popping up.
There you will see a option called "RULE TYPE" and the default value will be "Direct Assignment". In the same check box click on the drop down icon and select "Routine".
The moment you select the routine option, it will open up ABAP workspace where in you can write your routine and get the desired result.
Hope it helps. -
Removal of leading zeros for material no. in report
hi
my issue is that i have to remove leading zeros for material number when displaying in alv grid.iam getting output.but leading have to truncated automatically.
eg: 000000000000000102
the ouput should be 102.
please do provide solution for this or any function module.thanks in advance.Hi Sanjana,
while populating the internal table use the conversion exit available for MATNR. this will remove the leading zeros.
oter possible way, declare the internaltable by referring the data element MATNR, i hope if you do this, it will delete the leading zeros automaticallt.
or if you declare the internal table field as charecter type, use the ALPLA_CONVERSION_EXIT_INPUT ot OUTPUT function module to remove the leading zeros.
Reward the points if it is helpful.. -
Suppress leading zeros for ALV column
Hello,
I have an ALV with a column mapped to a context attribute of type NUMC and would like to suppress the leading zeros being displayed. My initial solution was to change the attribute to a char/string type and remove the zeros in my code, but then, the sort functionality no longer works correctly. Any ideas if the ALV can use a 'hidden' field to do the sorting for a certain column... that way, I can display the number as a char/string without the zeros and when the user sorts the column, the ALV will use the hidden NUMC type field.
Thanx for any directions...Hi,
You can follow the following way which i implemnted for one of my application. Here i am setting this property for the context attrubute. May be this will work. But in ALV there is no separate method for this type of setting.
**This method is used to display the Leading zeros for the Lot Number in Step-1
DATA:
node_do_not_change TYPE REF TO if_wd_context_node,
node_d0130_sapmf05a TYPE REF TO if_wd_context_node,
node_pstap TYPE REF TO if_wd_context_node,
node_info TYPE REF TO if_wd_context_node_info,
ls_fprops TYPE wdy_attribute_format_prop.
node_do_not_change = wd_context->get_child_node( name = wd_this->wdctx_do_not_change ).
node_d0130_sapmf05a = node_do_not_change->get_child_node( name = wd_this->wdctx_d0130_sapmf05a ).
node_pstap = node_d0130_sapmf05a->get_child_node( name = wd_this->wdctx_pstap ).
node_info = node_pstap->get_node_info( ).
ls_fprops = node_info->get_attribute_format_props( 'VALUE' ).
ls_fprops-null_as_blank = if_wd_context_node_info=>c_format_null_as_BLANK.
node_info->set_attribute_format_props(
name = 'VALUE'
format_properties = ls_fprops ).
Warm Regards,
Vijay -
How to get the leading zeros for decimal values?
Hi,
How i wil get the leading zeros for decimal values.For CONVERSION_EXIT_ALPHA_INPUT it is not working.Now iam using overlay condition for getting leading zeros.But iam getting the value like 00013.500.But as per my requirement i want to display this value 0000013.5.
my code is
overlay w_MetLife_detail-rdempsalary with '000000000'
data :rdempsalary type char9
Please help me on this.
Regards,
SujanHi
For more info,
The function of the statement UNPACK is based on the fact, that the BCD display of a decimal place corresponds to the second half-byte of code of a digit in the most character representations. This conversion is commonly called "unpacking".
The statement PACK to pack is obsolete and can be replaced by MOVE.
If destination is specified as untyped field symbol or as untyped formal parameter and is not flat and not character-type during execution of the statement, then an untreatable exception occurs in Unicode programs. In non-Unicode programs, an exception occurs only with deep types, whereas flat types are treated as character-type types.
Example
After the assignments,char1 and char2 contain the values "123.456" and "0000123456".
DATA: pack TYPE p LENGTH 8 DECIMALS 3 VALUE '123.456',
char1 TYPE c LENGTH 10,
char2 TYPE c LENGTH 10.
MOVE pack TO char1.
UNPACK pack TO char2.
Regards -
How can i avoid leading zeros for a field in smartform?
how can i avoid leading zeros for a field in smartform?
Hi,
Using the Symbols.
&symbol(Z)& Omit Leading Zeros &symbol(S)& Omit Leading Sign
&symbol(<)& Display Leading Sign to the Left
&symbol(>)& Display Leading Sign to the Right
&symbol(C)& Compress Spaces
&symbol(.N)& Display upto N decimal places
&symbol(T)& Omit thousands separator
&symbol(R)& Right justified
&symbol(I)& Suppress output of the initial value
Regards,
Shiva Kumar -
Leading Zeros for Decimal values
Hi,
In my requirement i need to add leading zeros for Decimal values.
For Example.
If the value is = 0.00 then my Target value should be = 000000000000.00
Regards,
Anil.Hi Anil,
You have to use conversion exit ,
Kindly go through this link below:
Re: Conversion exit: numbers in database, two decimals on screen
Hope it helps
Regards
Mansi -
How to remove leading zeros for an item number within quickviewer
how to remove leading zeros for an item number within quickviewer. Pls help
ask your abap guy to do it. not portal guys business.
-
Delete leading zeros for material in mapping.
Hi,
How to delete leading zeros for material like 0000000128736 if so I am expecting 128736 only.
We need to consider if I get material number is like RPG2389 .
Thanks,
Vinay.Hi,
If you will be getting alphanumeric codes, it would be best to use a UDF with a regex-expression.
UDF Type:
ContextType
imports:
java.util.regex; (if you are using PI 7.1 you must remove the semicolon)
arguments:
input1
Here's the code (courtesy of Sun Developer Network):
Pattern p = Pattern.compile("[^a-zA-Z]");
Matcher m = p.matcher(input1[0]);
StringBuffer sb = new StringBuffer();
boolean output = m.find();
while(output) {
m.appendReplacement(sb, "");
output = m.find();
m.appendTail(sb);
result.addValue(input1[1]);
Now to solve the leading zeroes, just add formatNumber: 0 after the UDF and it will work.
Hope this helps, -
hi,
my numbers looks like 0 or -0,23 or ,45...
but i want to have a leading zero, e.g. 0,0 or 0,45
i know that i can use to_char(xxx,'format') in queries,
but i want to have the leading zero for the whole instance.
is that possible?
thx.In cas you use SQL*Plus for your queries modify your login file
SET NUMFORMAT ...http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch3.htm#1005686 -
Truncating leading zeros for the data
hi ,
I am doing a conversion project from oracle source system(DB2) to BI system. I have a situation here:
I am extracting material numbers from source system(DB2) into a ZXXXX characteristic and in the transfer structure i checked the conversion as well and for infoobject ZXXXX, i am using ALPHA conversion. but the data i get is truncating material numbers. For example, 050302 is coming as 50302 and truncating leading zero. I am not sure what needs to be done here.
Please advise..
Thanks in advance...Hi J Dorson,
This is the expected bahaviour if your InfoObject is configured to have ALPHA conversion. If the zero's in front of the material number is needed, then turn-off ALPHA conversion in your InfoObject (e.g. by removing the conversion exit). -
Adding leading zeros to the display data
hi folks,
I have the character variable of size 9, if I get the value of the variable less than 9, I need to add leading zeros to it accordingly before displaying the numeric value stored in it. I tried to use the 'SHIFT' command for that it did not work out.
here is the code..
data: len type I,
amount type C,
addspace len type I.
len = strlen( amount ).
write: ' the length of the string',len.
if ( len < 9 ).
addspace = 9 - len.
write: addspace.
SHIFT amount BY addspace Places LEFT.
Thanks in advance.Hi Santhosh,
All the suggestions here will work. Make sure that your number is on the right justified to your character field. Here is an example.
DATA: v_char09_left_justified(09) TYPE c,
v_char09_right_justified(09) TYPE c,
v_numc09(09) TYPE n.
START-OF-SELECTION.
*-- in case the value is left justified in the field
v_char09_left_justified = '9 '.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_char09_left_justified
IMPORTING
output = v_char09_left_justified.
WRITE:/ 'V_CHAR09_LEFT_JUSTIFIED from FM =', v_char09_left_justified.
v_numc09 = v_char09_left_justified.
WRITE:/ 'V_NUMC09 =', v_numc09.
*-- in case the value is right justified in the field
v_char09_right_justified = ' 9'.
SHIFT v_char09_right_justified LEFT DELETING LEADING space.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_char09_right_justified
IMPORTING
output = v_char09_right_justified.
WRITE:/ 'V_CHAR09_RIGHT_JUSTIFIED from FM =', v_char09_right_justified.
v_numc09 = v_char09_right_justified.
WRITE:/ 'V_NUMC09 =', v_numc09. -
How can we put the leading zeros for the extract file.
hello experts..
Iam extracting values from one ztable in this for one filed length will be 2, for this field i need leading zero s at the time of extract... please help me....Hi,
Declare the field as NUMC data type, automatically you will get the leading zeroes.
Regards,
Subramanian -
Leading Zeros Missing - When exporting data from ALV grid display to Excel
Hi,
Am exporting the data from ALV GRID DISPLAY to Excel sheet using standard toolbar icon 'Local file'
the leading zeros displayed in the ALV output is missing in the EXCEL sheet.
(eg) in ALV o/p - 0029.
in Excel - Only 29 is appearing.
As per the requiement i have to show the leading zeros in excel also.
Pls help on this issue.
Thanks in advance..Hi ,
Please set the property :
wa_fieldcat-lzero = 'X' .
when you are creating field catalog for display alv data .
your prob will solved .
Regards ,
Nilesh Jain
Maybe you are looking for
-
Hi I am very new to updating my iPod touch and this is the first time I've used the iCloud. However, I am having problems accessing any apps on my iCloud such as photos, reminders etc. I've set it up on my iPod touch successfully and I can sign in on
-
My friend has a blackberry and sends links to youtube videos to me all the time, in text messages, that I can watch easily. I could not figure out how to send him links to youtube videos. The youtube app doesnt provide a URL I can copy and paste into
-
hi, I have just bought a laserjet P1100 printer, ive sorted the printing by usb, but the default setting for wireless is different from my home network, so how can i change the ip address for the printer, I did try changing it via the printer setting
-
Issue with Oracle Application testing Suite
Hi Experts, I am new to Oracle Application testing suite.I am trying to record a flow from oracle Store inventory management application. But when there is a pop up for entering login and pasword the flow fails with "invalid user id and password". Bu
-
Silverlight crashing, all browsers
My mac pro hung this morning after an app apparently exhausted all memory. After rebooting, Silverlight now crashes on startup in any browser. I have removed Silverlight and reinstalled, including removing just about every trace I could find and rein