Deleted zero
Hi all,
i have small prob.... how i want to delete zero in string format... let say i have 123000 and i want to get output 123 or i have 1200000 so i want to be 12...
can someone help me...
Thanks...
Hi,
u can do it in number of ways.
Use TCODE SU3
Select default tab and select radio button 123467.89 in decimal notation and save it.
or u can try :
if you want to do this through ABAP program.
1. to delete trailing spaces.
SHIFT <V_VARIABLE> RIGHT DELETING TRAILING '0'.
to delete leading zeroes,
SHIFT <VARIABLE_NAME> LEFT DELETING LEADING '0'.
only for one abap program, u can use set country command
for all programs :
sap menu>system->go to user profil->own data>default --> and choose ur format.
or u can use these fms also..
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
reward if it helps..
Regards,
Omkar.
Similar Messages
-
Hello Experts,
I have one problem in one sapscript. The problem is that i display in two columns two fields I_LTAP-CHARG and I_LTAP-VLENR.
After to pass them to my form i delete zero at the left with the MF: CONVERSION_EXIT_ALPHA_OUTPUT.
The first column is for I_LTAP-CHARG and the last one is for I_LTAP-VLENR.
In the sapscript, i call them like this: &I_LTAP-CHARG& and &I_LTAP-VLENR&.
So, the problem that the first field I_LTAP-CHARG is displayed correctly but for I_LTAP-VLENR
is truncated in the begin.
Example: I_LTAP-VLENR = 00000000001200000565
After the call of CONVERSION_EXIT_ALPHA_OUTPUT --> I_LTAP-VLENR = 1200000565
And in the form the value displayed is : 00000565 (Without the two first caracters)
I switch the order of the columns but the same problem, i change the Alignment for paragraph format and the tabulation but always the same problem.
What i don't understand is why the problem occurs just for I_LTAP-VLENR and not for I_LTAP-CHARG and just before Write_Form of the main the value of I_LTAP-VLENR is always correct 1200000565 but when we display the form the value displayed no es correct, why the system truncates the two first letters!!!!
If can anybody explain me why and what is the solution for this problem.
Thank you very much.Hi Bhupal,
Thank you for your response.
I tried &I_LTAP-VLENR(Z)& but doesn't work!!!!
What i don't understand why the same logic works for I_LTAP-CHARG and not for I_LTAP-VLENR!!!!!!!!!!!!!!!!!!!!!!
Thank you very much, if you have any other idea give me it pleassse. -
HI EXPERTS,
Field1 = CAL_0000138171_XYZ
Hw to delete zeros between CAL_ and XYZ.
ie output should be FIELD1 = CAL_138171_XYZ.
if FIELD1 = 0000138171
I can use this SHIFT FIELD1 LEFT DELETING LEADING '0'.
But hw to do first one.
Please help me.Hi,
Actually you can use Replace as it is the easiest and efficient way to solve your requirement. But you need to utilize the REGEX addition, try as follows;
DATA field1 TYPE string.
field1 = 'CAL_0000138171_XYZ'.
WRITE : / 'Before Replace :' , field1.
REPLACE REGEX '_0*0' IN field1 WITH '_'.
WRITE : / 'After Replace :' , field1.
Output:
Before Replace : CAL_0000138171_XYZ
After Replace : CAL_138171_XYZ
This will be more efficient then SPLIT & SHIFT.
REPLACE REGEX '_0*0' IN field1 WITH '_'.
Regards
Karthik D -
Date Range - Delete ZERO Values
Hi All,
Few days back I had posted Query Regarding Date range where in I enter Proj# from_month, from_year, To_month and To_year.
The output data for the project must be within this year range.
suppose I enter proj no. 13381 and
from_month - 05
from_year - 2004
To_month - 04
from_year - 2005
This is the Desired Output:
yearmonth plan14
200406 -
13381 -
100
200407 -
13381 -
100
200409 -
13381 -
678
Right Now the Output what Iam getting is:
yearmonth plan14
200405 -
13381 -
0
200406 -
13381 -
100
200407 -
13381 -
100
200408 -
13381 -
0
200409 -
13381 -
678
I Just want the NON ZERO PLan14 values. The PLan14 values with '0' should be deleted .
Below is the Jist of the code.
RANGES: S_GJAHR FOR COSP-GJAHR,
R_YEAR FOR COSP-GJAHR,
R_DATE FOR PROJ-ERDAT,
R_MONTH FOR CKML1-POPER,
S_OBJNR FOR COSP-OBJNR,
S_KSTAR FOR COSP-KSTAR.
DATA: MNT_INDX(20) TYPE C,
HLD_INDX(3) TYPE N.
DATA: W_MTH(2) TYPE N,
W_DATE LIKE PROJ-ERDAT.
DATA: BEGIN OF ITAB_OUT_TYPE,
PERIOD(10) TYPE C,
PROJDEF(20) TYPE C,
PROJ_TITLE(20) TYPE C,
STATUS(20) TYPE C,
PROJECT_TYPE(20) TYPE C,
START_DATE(20) TYPE C,
FINISH_DATE(20) TYPE C,
CONTRACT(20) TYPE C,
CLIENT(20) TYPE C,
PLAN14(25) TYPE C,
END OF ITAB_OUT_TYPE.
DATA ITAB_OUT LIKE ITAB_OUT_TYPE OCCURS 10 WITH HEADER LINE.
FIELD-SYMBOLS <FS>.
PARAMETERS FR_MONTH(2) TYPE N OBLIGATORY.
PARAMETERS FR_YEAR(4) TYPE N OBLIGATORY.
PARAMETERS TO_MONTH(2) TYPE N .
PARAMETERS TO_YEAR(4) TYPE N .
DATA: W_TXT(20) TYPE C.
R_YEAR-LOW = FR_YEAR.
R_YEAR-HIGH = TO_YEAR .
R_YEAR-OPTION = 'BT'.
R_YEAR-SIGN = 'I'.
APPEND R_YEAR.
concatenate FR_YEAR FR_MONTH INTO R_DATE-LOW .
concatenate TO_YEAR TO_MONTH INTO R_DATE-HIGH.
R_DATE-OPTION = 'BT'.
R_DATE-SIGN = 'I'.
APPEND R_DATE.
SELECT * FROM COSP
WHERE OBJNR = PRPS-OBJNR AND
GJAHR IN R_YEAR AND
KSTAR BETWEEN '0000400996' AND '0000400999' AND
VERSN = '014' AND
WRTTP = '01' .
DO 12 TIMES.
W_MTH = SY-INDEX.
CONCATENATE COSP-GJAHR W_MTH INTO W_DATE.
CHECK W_DATE IN R_DATE.
PERFORM CONVERT-DATE1 USING W_DATE.
MOVE HOLDDATE1 TO ITAB_OUT-PERIOD.
HLD_INDX = SY-INDEX.
CONCATENATE 'COSP-WKG' HLD_INDX INTO W_TXT.
ASSIGN (W_TXT) TO <FS>.
CLEAR ITAB_OUT-PLAN14.
ITAB_OUT-PLAN14 = ITAB_OUT-PLAN14 + <FS>.
APPEND ITAB_OUT.
enddo.
ENDSELECT.
I need all positive values of the month that are in the range. The Zero values must be deleted . How can i do that. PLease do let me know.
Thanks in advance
DanYou can do this easily just by deleting all records in one shot.
delete ITAB_OUT where plan14 = 0.
You can put that statement after the SELECT...ENDSELECT.
Or you can not even add them to the internal table at all. You can check before you APPEND to the table.
CLEAR ITAB_OUT-PLAN14.
ITAB_OUT-PLAN14 = ITAB_OUT-PLAN14 + <FS>.
<b>If itab_out-plan14 > 0.
APPEND ITAB_OUT.
endif.</b>
enddo.
ENDSELECT.
Regards,
Rich Heilman -
Hi,
While loading data from Smart view we are loading Zero (0) values, because of this our size of data is increasing, is there any chance to delete those Zeros. client is accepting to chnage options in smart view.
Thanks,
BabuWe use code such as the following in the Calc sub when this is needed.
Dim vDataUnit
Dim vNumItems, i
Dim dPCon
Dim vAccount, vCustom1, vCustom2, vCustom3, vCustom4, vICP, dData
Set vDataUnit = HS.OpenDataUnit("")
vNumItems = vDataUnit.GetNumItems()
For i = 0 To vNumItems - 1
Call vDataUnit.GetItem(i, vAccount, vICP, vCustom1, vCustom2, vCustom3, vCustom4, dData)
If dData = 0
HS.Clear "A#" & vAccount & ".I#" & vICP & ".C1#" & vCustom1 & ".C2#" & vCustom2 & ".C3#" & vCustom3 & ".C4#" & vCustom4
End If
NextFor the record to be completely removed from the db, I believe you have to run it on all periods. You might work with your dba to ensure all 0 records have been removed. -
How to delete zero rows from a matrix?
Hi,
I have a 2D datamatrix and there are some zero rows. My original program should recognize all zero rows and delete them. How to do that?
I have tried with the Delete From Array function but no success. I also tried with the OpenG array functions but...no.
I attached a vi which simulates my problem. There is one zero row and I want to delete it and have a matrix without zero rows.
Kudos for any good help!
Solved!
Go to Solution.
Attachments:
DeleteZeroRows.vi 19 KBChristian_M wrote:
The idea was to give a hint that people try using their brain....
Stilll, I think your code is fundamentally flawed and will thus lead the student into a deep swamp.
Have you actually tried it with multiple rows of zeroes?
Since "delete from array" rearranges the array indices with each deletion, the code will break if there is more than one row to be deleted. For example if a row is already deleted and it needs to also delete the last row, it would try to delete a row that no longer exists. If a later row still exists, it will delete the wrong row.
Also, since NaN gets coerced to a valid index (2147483647), it's probably not such a good idea. "-1" would be a better choice. (Well, it's an unlikely implossible possibility in LabVIEW 32 bit, but still....)
I also don't understand your logic with "search array". You need to test all elements for zero.
LabVIEW Champion . Do more with less code and in less time . -
Pages keeps deleting zeros in tables
When I put a zero as the first thing in a cell of a table Pages automatically deletes it. How do I stop it from doing this?
Funny, there is a living thread
http://discussions.apple.com/thread.jspa?threadID=1607551&tstart=0
about that in the Numbers forum.
Rremember that a table in Pages is quite the same object than a table in Numbers or a table in Keynote.
Yvan KOENIG (from FRANCE jeudi 17 juillet 2008 19:07:43) -
Delete zero value keyfigure (volume)
Hi,
This is for BW3.5 BPS.
I would like to see the list of records which has volume = 0.
What is happening now...
already( last yr) we deleted few records (material A, sold to A), so the volume become zero, if some user try to add record ( same as the deleted records) this yr, error shows that the record already exists.
Is there anyway I can add volume to the records which is zero now.
Note: if the key figure value is zero those records are not displayed in the layout.
Thanks
Billy<FONT FACE = "Tahoma", Font Color = "Blue">
Hi<br>
I am very surprised to see this. Because a cube can have multiple records with same characteristic key combination but different/same key figure values. Then based on the Aggregation behaviour defined in the key figure definition, system should add records or do the necessary action.<br><br>
Can you please compress your InfoCube with ZERO ELIMINATION tick mark selected? This should solve your problem, I think.
<br><br>
Hope it helps.<br>
Cheers Abhijit</FONT><FONT FACE = "Verdana", Font Color = "Red">
REMOVED
</FONT> -
Hi Experts,
i need material have all zero's like this it as deleted.
Matrial No 1567
open Balance 0.00
Mat Doc Mat Dat Mvt Doc No Recipts issues balance
0.00 0.00 0.00 0.00 0.00 0.00
But i am using below logic it had deleted the below material also,
below material, opening balance have some value,
But in this logic both were deleted
if below once like ( Mat doc ) all are zeros having opening balance also deleted,
i need material having all zeros one deleted.
Matrial No 1567
open Balance 550.00
Mat Doc Mat Dat Mvt Doc No Recipts issues balance
0.00 0.00 0.00 0.00 0.00 0.00
logic is
LOOP AT INT_DATA WHERE MENGE_O = 0 AND MENGE_RT = 0 AND
MENGE_CL = 0 AND MENGE_AD = 0 AND
MENGE_S = 0 AND MENGE_TO = 0 AND
MENGE_CR = 0 AND MENGE_R = 0 AND MENGE_BAL = 0.
DELETE IT_HEADER WHERE MATNR = INT_DATA-MATNR.
ENDLOOP.
opening bal logic is
FORM GET_OPENING_STOCK.
SELECT SUM( MZUBB ) SUM( MAGBB ) INTO (V_STOCK, V_STOCK1)
FROM S031 WHERE MATNR = IT_HEADER-MATNR AND
WERKS = ITAB-WERKS AND
SPMON LT V_MONTH1 AND LGORT = ITAB-LGORT.
OSTOCK = V_STOCK1 - V_STOCK.
IF OSTOCK < 0.
OSTOCK = OSTOCK * -1.
MENGE_RE = OSTOCK.
ENDIF.
ENDFORM. " GET_OPENING_STOCK
Thanks & Regards,
Sreedhar.<b>if it_header-matnr is not initial.</b> " this will pick only for a material having a value.
SELECT SUM( MZUBB ) SUM( MAGBB ) INTO (V_STOCK, V_STOCK1)
FROM S031 WHERE MATNR = IT_HEADER-MATNR AND
WERKS = ITAB-WERKS AND
SPMON LT V_MONTH1 AND LGORT = ITAB-LGORT.
OSTOCK = V_STOCK1 - V_STOCK.
IF OSTOCK < 0.
OSTOCK = OSTOCK * -1.
MENGE_RE = OSTOCK.
ENDIF.
<b>endif.</b>
LOOP AT INT_DATA WHERE MENGE_O = 0 AND MENGE_RT = 0 AND
MENGE_CL = 0 AND MENGE_AD = 0 AND
MENGE_S = 0 AND MENGE_TO = 0 AND
MENGE_CR = 0 AND MENGE_R = 0 AND MENGE_BAL = 0.
here sy-subrc is so it_header is deleted .
<b>in order to retain this
if open_stock/open balance eq 0. "bring in this logic so that *it_hheader is retained as it has some value
DELETE IT_HEADER WHERE MATNR = INT_DATA-MATNR.
endif.</b>ENDLOOP.
check if this works,
hope this helps ,
regards,
vijay
Message was edited by:
Vijay
Message was edited by:
Vijay -
Dear experts.
i have a string data '3.1200'
how can i delete the two zero of last.
the result is :'3.12'
Thanks.
Johnmin.
Message was edited by: zhongming LIUHi,
Use following code to remove last 2 0's.
shift str1 right deleting trailing '0'.
Cheers,
Vikram
Pls reward for helpful replies!! -
hallow
i have field type numc20 and i wont to delete all zero before num
how can i do that
example
i have
000000000317
i wont 317
REGARDShi,
CONVERSION_EXIT_ALPHA_OUTPUT is the Fm used for giving desired o/p and takes a input from user
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = int [int is avaraible of type num20
IMPORTING
OUTPUT = k. [ resultant value by FM]
if useful reward some points.
with regards,
suresh. -
Deleting Zeros at the end of fields in ALV report
I want to make an ALV report that include both integer and decimals in same column.
for example :
1 - 1234.0000
2 - 0.0027
i dont want to see zeros at the end of value.
But the type will be decimal and integer values will be shown with zeros at the end.
For Ex.
I want to take report like this ;
1 - 1234
2 - 0.0027
How can i make this?
Thanks.
Edited by: aydnbk on May 14, 2010 3:22 PMHello aydnbk.
As far as i know, there is no way to do what you want using standard ALV-Functions. There is a field 'DECIMALS' in structure LVC_S_FCAT, but using this field you could only define ONE setting, that would affect ANY value.
Furthermore i am asking myself, if this feature is really sensible - when numbers are right-justified, a global setting for the number of decimals makes it much easier to compare the values - at least this is my personal opinion...
If i had to do this trick, i would simply add some character fields to the output-structure and write the values to the charater-fields to enforce this quite special layout.
Additionally i would set the fields 'NO_OUT' and 'TECH' for the fields of type 'P', that are holding the values - 'NO_OUT' hides the column and 'TECH' ensures, that the field can not be selected in a user-defined layout.
Hope this helps.
Regards, Jörg -
Deleting zeros in Quantity field in Sap Script
Hi,
I have a Quantity(FKIMG) field in Invoice (Sap Script), It is showing as 1.000 ,I want to show this as 1 ,By removing all zeros and point.
how can i do this in Script?
Thanks in advance,
fractalHi,
Use <b>TRUNC</b> "Interger part of x
ex:
TRUNC(FKIMG) to get integer part of the quantity.
or
declare an integer variable and pass quantity to this variable , use the same variable for print.
Regards
Appana -
How to delete zeros in layout for quantity and currency fields
Hi All
Iam getting zeros in place of quantity and currency field records, which i doesnt require in layout SAP-Script.
Please let me know if any one has an idea.
Regards
BhaskarHi,
Add NO-ZEROES statement to it.
or
U can use CONDENSE statement.
Cheers,
SImha. -
Hi,
I am capturing coset center values from BAPI which is of type string.
i declared it as string and displaying value in webdynpro java.it is taking zeroes before the values of cost center if the cost center is number.for eg : if the cost center value is 88888 in the R/3, it is displaying as 00088888.if the cost center value is D30045 it is displaying as D30045, not taking any zeroes before the value.how to omit the zeroes before the cost center value.
pls guide me .
Regards,
PavaniHi Pavani
Same problem is already disucssed in forums
Re: Removing leading zeros in a column
Please go through this wiki.
https://www.sdn.sap.com/irj/scn/wiki?path=/display/java/remove%252bleading%252band%252btrailing%252bzeros%252bfrom%252ba%252bstring
Maybe you are looking for
-
ISE to do wireless network guest access services
Hi Forumers' I need to know how WLC can support ISE guest management in wireless mode. Tested and confirm by Cisco SE, Knowing that WLC currently does not support dynamic VLAN authorization for central web authentication. This limitation will be addr
-
"ICM_HTTP_CONNECTION_FAILED" Error SUP
Hi, I am trying to establish a connection from SAP to SUP server with transection sm59. But im getting "ICM_HTTP_CONNECTION_FAILED" error with "sr000" message no. I ping the host and port successfully. Connection profile: Target Host : <Host> Path P
-
E220s freezing without symptoms after renewing fan and thermal pad
Hello fellow Lenovians, I recently renewed a rattling fan in my E220s. Since then I get permanent freezes every time, starting from ca. 5 to 40 minutes on. I checked with Sandra, and to my understanding no temperature sensor shows anything abnormal.
-
Whenever I try to get photos from my camera or files on my computer the dialogue box shakes (really) and most of the file names disappear, and I get a message telling me that 'the file could not be copied'. Any ideas?
-
Invoke webservice (authentication issue)
Hi, I am facing wierd thing. I have a invoke WSDL step in the process and for some reason when I try to load the WSDL URL I get 401 error. However if I open web browser on the same machine and paste the URL to the address field and supply correct cre