How to remove extra zeros in quantity field.
I am retrieving the field which is of type QUAN(13) and decimals 3. The values are stored as
1,000
20,000
50,000
2,340
23.50
Now i want to output as 1, 20, 50 , 2.34, 23.5
I want to remove the additional zeros. Is there any FM for the same.
satya
hi
Check this similar thread
https://forums.sdn.sap.com/click.jspa?searchID=700505&messageID=401791
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Message was edited by:
Rahul Kavuri
Edited by: Alvaro Tejada Galindo on Dec 30, 2009 11:21 AM
Similar Messages
-
Remove trailing zeroes in quantity field.
Hi all,
I am having quantity field in ALV grid display : VBAP-KWMENG. Iam getting quantity value as 1,000.My requirement is to get quantity value as 1.(without ',' and zeroes).
Suggest me a suitable solution.
Thanks all.Other way is check for the below code ..
DATA:
lv_decimal TYPE f DECIMALS 3,
lv_string TYPE string.
lv_decimal = '22.010'.
WRITE lv_decimal TO lv_string.
SHIFT lv_string RIGHT DELETING TRAILING '0'.
* also delete trailing '.', if possible
SHIFT lv_string RIGHT DELETING TRAILING'.'.
CONDENSE lv_string NO-GAPS.
* now no trailing zeros are in the decimal stored in LV_STRING -
How to remove leading Zeroes in all fields in Payload
Hi,
How can I remove the leading Zeroes in every Filed I have in whole Payload Structure.there are around 10000 fields that have to be removed the leading Zeroes.any good idea please.
<POSNR>000010</POSNR>
<MATNR>000002465640</MATNR>
<ARKTX>000012 KG D107</ARKTX>
<MATKL>00030010000</MATKL>
<WERKS>0000ORGC</WERKS>
<LGORT>0000GC55</LGORT>
<CHARG>000TEST</CHARG>
like this mutliple segments and multiple Fields.so I can take as whole payload with multiple fields should not have leading Zeroes.I can handle if they are 10 0r 20 fileds,but not like whole pay load/1000 fields right.
thank you,
PremHi
You can have an additional XSLT mapping, to your existing one..
use copy-of & apply-templates to copy the whole tree & make changes recursively.
below is a sample code , the marked line is where you need to try your logic of trimming Zeros. (this code does upper case)
add this below code in your interface mapping object, as XSLT mapping, which does the job (only try putting your logic)
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output method="xml"
indent="yes"
omit-xml-declaration="yes"/>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="upper-case(.)"/>
</xsl:template>
</xsl:stylesheet>
hope this fixes your issue
Regards
Vishnu -
How can we remove the following zeros from quantity field ?
Hi All.
how can we remove the following zeros from quantity field while populating ALV by using FM REUSE_ALV_GRID_DISPLAY ?
eg:getting output zqty = 2.000
but i need zqty = 2.
help me to reslove this issue.
Regards.
jayHi,
While populating the field catlog do the following thing to avoid zeros.
wa_fieldcat-tabname = 'I_OUTPUT'. " Curr
wa_fieldcat-fieldname = 'FWAER'.
wa_fieldcat-seltext_l = text-023.
wa_fieldcat-no_zero = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Thanks,
Khushbu. -
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..... -
How to remove target node if source field value is empty SAP PI Mapping
Hello,
how to remove target node if source field value is empty in graphical Mapping.
Like if
MIddle name in source filed is empty, I would like to eliminate target field from out put XML.
Thank you
JohnHi Jhon,
If you want to remove all empty tags and you dont to complicate your message mapping, you can use a XSL, after the message mapping, to remove all the empty tags:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*[not(@*|*|comment()|processing-instruction())
and normalize-space()='' ]"/>
</xsl:stylesheet>
Regards -
How to remove the check from ShpmntCostsRel. (field VTTK- FRKRL)
Hi Experts,
Can you please tell me to how to remove the check from ShpmntCostsRel. (field VTTK- FRKRL) when saving of the shipment document.shipment cost calculation only on the Leg level and not on header level. Currently a lot of confusion happened after creating the shipment cost document and found that the status is u201CBu201D.
now we intend to define detailed specifications to how to create this new user exit to update the shipment cost relevancy at shipment header.
The main functionality of the user exit to be created is to remove the check from ShpmntCostsRel. (field VTTK- FRKRL).can u pls tell how to do this. -
How to remove leading zero from Material Number
Hello Everyone,
I need to figure it out how to remove leading zero from material number. Cureently extractor is sending material number as 100663. But when comes into BI i am getting as "000000000000100663" and similariy in report it is appearing as "000000000000100663". Now my client wants me to exclude preceeding zero for a material in all the reports.
Is there any setting in query desinger to handle this issure or in the backend.
Need your inputs.
Thanks,
Lasya.Hi
you can use the function Module
CONVERSION_EXIT_ALPHA_OUTPUT in the start routine
to test this go to SE37 --- give the CONVERSION_EXIT_ALPHA_OUTPUT -
>display -
> F8
in the input give 000000456
and execute
the out put will be 456
for getting Zeros you can use
CONVERSION_EXIT_ALPHA_INPUT--- to remove leading zeros
Santosh
Edited by: Santhosh Nagaraj on Oct 29, 2009 10:52 PM
Edited by: Santhosh Nagaraj on Oct 29, 2009 10:54 PM -
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.
-
How to add two zeros end of field
how to add two zeros end of field?
Hi srinu,
If it's a number field, then just multiply by 100.
If it's a string, then just use CONCATENATE and add the '00' to your existing string.
Hope this helps.
SL -
How to remove trailing zeros from a fraction part.
How to remove trailing zeros from fraction part, need standard API rather then some java code.
user8726363 wrote:
How to remove trailing zeros from fraction part, need standard API rather then some java code.I'm pretty sure we have all gathered that English is not your first language, but your question is not a good question in any language.
Back up. Take a deep breath.
Now - what's your problem ?
Please illustrate with results, and the code (just the class/method; not your entire application) that is causing them.
Winston -
CONVERSION EXIT to remove thousand separator from quantity field
HI
NEED HELP
do u know any FM or CONVERSION EXIT which remove thousand separator from quantity field.
Eg. 1,234,567.11 SHOULD be displayed as 1234567.11Hi Chetanpatil.
Try this:
If your quantity has thousand separator as comma:
translate lv_quantity using ', '.
condense lv_quantity.
If your quantity has thousand separation as dot:
translate lv_quantity using '. '.
translate lv_quantity using ',.'.
condense lv_quantity.
You'll need to check for the user thousand separator configuration in table USR01 field DCPFM or by calling BAPI_USER_GET_DETAIL and act accordingly.
Regards,
Andres. -
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 -
Extra zeros in numeric fields when I create spreadsheet from data files
I created a form with Live Cycle, and then in Adobe I use the option "create a spread sheet from data files" to import the answers to a xls file.
I have two problems with this action: the first one is that I get 8 extra zeros in each numeric field, the second one is that fields are ordered by type and not by appearance.
I tried a different approach importing directly in Excel, in that way there are no extra zeros and the order is correct, but I get just one form each time, and in a "stairways" fashion (i. e. first field in A1, second in B2, and so on)
I'd appreciate any helpWhere do you find the command "create a spread sheet from data files"?
Anyway i have a similar problem: when i export data in a .csv file and than i import it in excel, i always get 8 extra zeros... how can i solve the problem? -
How to remove leading zeroes of a coloumn in a table
can someone tell me how to remove the leading zeroes in a table's coloumn .... its a NUMC data type..
i tried with abap statement shift leading zeroes, but its not working for me.... the sorting is missing..
in properties is there any option to remove the leading zerores>
nirajaHi Niraja,
I am displaying a table with information from SFLIGHT. The CONNID field is of type NUMC and so it too used to contain the leading zeroes. I so deleted the leading zeroes in my WDDOINIT method before binding the internal table to the context node. The table now does not display the leading zeroes as earlier. Find my coding as shown below:
METHOD wddoinit .
DATA: lr_node TYPE REF TO if_wd_context_node,
wa_sflight TYPE ig_componentcontroller=>element_node,
lt_sflight TYPE ig_componentcontroller=>elements_node.
SELECT * FROM sflight INTO TABLE lt_sflight.
LOOP AT lt_sflight INTO wa_sflight.
SHIFT wa_sflight-connid LEFT DELETING LEADING '0'.
MODIFY lt_sflight FROM wa_sflight TRANSPORTING connid.
ENDLOOP.
lr_node = wd_context->get_child_node( name = ig_componentcontroller=>wdctx_node ).
lr_node->bind_table( new_items = lt_sflight ).
ENDMETHOD.
Regards,
Uday
Maybe you are looking for
-
Process Order tables and Production System Performance
Hi All, What are the different tables of Process order? Also how do i know which table affects the system performance of Production system and to what extent if Change Logging is made active ? The issue is in our clients place we would like to set th
-
Physical Model - Primary Key changed
I have a report called 'Service Report' running fine. This report uses multiple tables like Service,Specification etc... Now that the primary key of service table has changed from 'jdoid' to 'entityId' (The primary key of all the other tables also ha
-
Help! double sided printing.
Hi, i recently purchased my first macbook air (os x 10.9.2) and have loaded my printer on however can not find any options or buttons to print double sided or duplex printing in word (office for mac 2011). I know my Brother MFC-J6510DW CUPS does do t
-
I want to add music manually from my mac. however when i try to set it up to do that, it wipes my itouch music out completely and have to do a complete re-sync for music from the Library. Isn't there some way to sync it and only add new music that i
-
Windows 7, one computer, one library, multiple users
I installed iTunes 10.0.1 (64 bit) on a new computer running Windows 7. 1. I copied my old iTunes library from an old computer. 2. In iTunes, I changed my iTunes media folder location to C:\users\public\music\itunes\itunes media 3. I selected th copi