Converting charecter to quantity.

Following is the issue, I want to write l_char to l_quan, The following code is throwing a dump error.
Write and Move are not working.
Please solve this for me.
data : l_char(18),l_quan type kwmeng.
l_char = '123,456.000'.
l_quan = l_char.
write : l_quan.
<REMOVED BY MODERATOR>
-Veeru.
Edited by: Alvaro Tejada Galindo on Feb 21, 2008 3:28 PM

Try this -
in this case, WRITE TO will not work, as you are sending CHAR value to a numeric field.
here is the logic i followed to overcome the (user settings of comma(,) and DOT(.))
DATA : V_WEIGHT TYPE LTAP-BRGEW,
V_WT_CHAR(21) TYPE C.
assume you have weight value in a CHAR field.
v_WT_CHAR = '21,987.258'.
here your requirement is to push this value to a weight field.for that follow this,
REPLACE ALL OCCURRENCES OF ',' IN V_WT_CHAR WITH ''.
REPLACE ALL OCCURRENCES OF '.' IN V_WT_CHAR WITH ''.
CONDENSE V_WT_CHAR.
MOVE V_WT_CHAR TO V_WEIGHT.
V_WEIGHT = V_WEIGHT / 1000.
now your V_WEIGHT will have value '21987.258' (as it stores in INTERNAL format)
~ As found in forum.
Regards,
Amit

Similar Messages

  • Convert char to quantity(15) and compare

    Hi Expert!,
           I have to convert Char30 format to quantity15 format and compare those to value.
          I have written code below . is the right ? is there any
    data: x_objdata_ausp_1 TYPE char30,
           l_ausp_1          type p decimals 3,
           l_vbap_kwmeng     type p decimals 3,
           x_vbap_kwmeng     type vbap-kwmeng.
    x_objdata_ausp_1 = '1.500'.  "char30 type data
    move x_objdata_ausp1 to l_ausp_1.
    l_ausp_1 = l_ausp_1 * 1000.
    x_vbap_kwmeng  = '1600.000'.   "quan(15) type data.
    move x_vbap_kwmeng to l_vbap_kwmeng.
       if l_vbap_kwmeng > l_ausp_1.
          write: 'item quantity is greater than characteristic value'.
    else.
          write: 'Item quantity is less than characteristic value'.
       endif.

    Hi Mithilesh,
    I have checked your code and it's working fine.
    you can use it.It's good that your converting both variables in  packed.
    Thanks.
    Anurag

  • Convert char to quantity

    Hi there,
    Do you know if there's any standard function module which converts a char into a field of type quantity? or, if there isn't any, do you know if it is possible to show in a table control field the value 0,000 when no quantity is introduced by the user and the field is set as modificable and as field of type quan instead of char?

    FUNCTION Z_CONV_POINT_TO_COMMA.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(NUM1)
    *"  EXPORTING
    *"     VALUE(STR1)
    data:i type i,
         length type i,
         stest(16),
         sakt(1).
    stest = num1.
    length = strlen( stest ).
    while i < length.
    sakt = stest(1).
    if sakt = '.'.
    sakt = ','.
    endif.
    shift stest.
    concatenate str1 sakt into str1.
    i = i + 1.
    endwhile.
    ENDFUNCTION.

  • Converting Char to Quantity field

    Hi
    I want to convert the Char field calue to the Quantity.
    Please let me know how to do it.
    Thanks
    Kumar

    First verify that the field you want to convert is a number.  Try using the following function:
    data: v_char_field(100),
          v_qty_num type rl03t-pickm.
        call function 'MOVE_CHAR_TO_NUM'
             exporting
                  chr             = v_char_field
             importing
                  num             = v_qty_num
             exceptions
                  convt_no_number = 1
                  convt_overflow  = 2.
        if sy-subrc <> 0.
          "write/throw error message
        endif.

  • Convert string to quantity

    Hi, Dear all
    DATA: L_STR TYPE CHAR50,
               L_FKIMG TYPE FKIMG.
    DATA: BEGIN OF LS,
                 FKIMG TYPE VBRP-FKIMG,
              END   OF LS.
    L_STR = '200'.
    CATCH SYSTEM-EXCEPTIONS ARITHMETIC_ERRORS = 4
                                       OTHERS = 8.
      LS-FKIMG = L_STR.
    ENDCATCH.
    When I debug, LS-FKIMG is '0.2', not '200.000'.
    But when use it to calculate, system look it as '200.000'.
    What funny is that this is not for all program.
    Will appreciate it for your reply.
    Thanks.

    hi,
    Thank you for your reply.
    That happens when I print out tax invoice, t-code is VF02/VF03 , in printing program.
    But if I create customizing report, it will be no issue.
    How come?
    Thanks.

  • Convert the all the quantity units into one Unit of measure that is 'CSE'.

    Hi all,
    I want to convert the all the quantity units into one Unit of measure that is 'CSE'.
    would anybody tell me what is the FM that converts all the quantity units into one Unit.
    Thanks in advance,
    Mythily

    Hi Mythily,
    You can check the following function module - -
    FCO_CONVERT_FROM_BASE_UNIT
    MD_CONVERT_MATERIAL_UNIT
    MS_CONVERT_UNIT_TO_TIME
    RV_CONDITION_CONVERT_UNITS
    VHUMISC_CONVERT_TO_ALTERN_UNIT
    VHUMISC_CONVERT_TO_BASEUNIT
    WALL_QUANTITY_CONVERT_UNIT
    WALL_QUANTITY_CONVERT_UNIT_RND
    WSTP_CONVERT_UNIT
    Regards
    Pinaki

  • Tolling / Sub-Contracting Material Quantity Change During Order Creation

    I have created a requisition for 80,000 KG of a tolling material. When converting the requisition into a purchase order, one of the components of the material goes from 45,881.875 KG to 45,881.874 KG, resulting in an overall amount of 79,999.999 KG and a mismatch between my requisition and purchase order.
    I have checked the rounding profiles in the MRP 1 view for all the materials, and each is set to 1.000 KG. Why is this material component rounding down?
    Thanks.

    so the reduced order quantity is not caused by an component that goes down. it is actually the other way around.
    SAP converts the Kg from the requisition into LB in the PO.
    And rounds the decimals.
    Using this as basis then for the components.
    The leading unit is now the order unit, which is LB. whenever you look at a oder  quantity in KG, then SAP converts the LB quantity back into KG, which causes again a rounding issue.
    That is one of the problems when the base unit is not the smallest unit.

  • Can we Purchase with Secondary UOM Quantity and with Secondary UOM Price on

    Friends..
    wanna ask about Purchasing matters..
    we have item with Dual Unit of Measure, say it with Kilogram and Pieces,
    now, on Purchase Orders Form, when i enter my order,
    TOTAL Price is driven by Primary QUANTITY multiply PRICE.
    My question:
    when user would like to purchase with SECONDARY UOM, how oracle handle it?
    i mean, when i try to locate secondary quantity,Total Price is still driven
    by Primary QUANTITY (which is already autoconvert after i enter secondary quantity)
    multiply PRICE.
    is there any advanced setup to do this?
    if not user have to manual calculate the Price converted to Primary Quantity,
    when user purchase base on secondary Quantity.
    really appreciate your help

    Hi
    I think you can try "Adv Pricing Integration with Purchasing" for diff UOM with diff Price.
    But what you are seeing is the Standard functionality as per Oracle. I faced similar kind of issue and got a reply from SR like that.
    Regds
    Ravisankar

  • Convert PDF to Flash

    Hi There,
    1 Month ago, I was required to convert a batch of PDFs to animated Flash (better with Page-flip). I've browsed and listed some PDF to Flash sites, hope this would help any of you.
    http://www.axmag.com
    Offers free online conversion and offline software which is my favorite. Multiple choices can be satisfied. It is such an innovative conversion tool for creating page flipping reading experiences.
    http://www.page-flip.com
    Can be the most professional converter with higher credit rating. However the cost is higher. The license fee for per user is €40, and this is for 3 months
    not lifetime.
    http://www.swftools.org/
    An open source software. To be frank, the conversion effect is not as good as the former. May it meet the needs of flash/web developer.
    http://www.issuu.com  
    Terrific online converter with large quantity of users, features in sharing documents (more like magazines 2 me). Multiple formats support: PPT/Word/PDF to Flash
    That's all I got, any comment is welcome.

    OtisGoff wrote:
    Nice work!
    Issuu and Scribd.com? These to seems to be the most famous platforms for online PDF conversion and reviewing. "PDFmeNot", which is absorbed by Google, is not me my choice. "aXmag".com is a new site with free online conversion.
    I know, It is non of our business. But, things do turn ugly in Website merge, like "PDFmeNot". Whatever, it a pleasure that you like my post.

  • Msaccess_utilities.convert -- what's it for?

    Hi all,
    I'm using SQL Developer 1.2.1.3213 with extension "Oracle Migration Workbench - MS Access" version 10.2.0.32.13
    When I convert a query that uses CLNG in Access, it seems to be half-translated in the Oracle SQL to a call to the msaccess_utilities.convert function : the syntax is changed but the CLNG function name is not updated.
    This causes the CREATE OR REPLACE VIEW function to fail when running the script into my Oracle database (10g XE)
    Three questions on this:
    1) Is this intentional?
    2) Is there a switch or something I'm missing to make it use the convert function?
    3) Why is the function there in the first place - the SQL does nothing?
    Access SQL:
    SELECT DISTINCTROW [Order Details].[Order ID], Sum(CLng([Unit Price]*[Quantity]*(1-[Discount])*100)/100) AS Subtotal
    FROM [Order Details]
    GROUP BY [Order Details].[Order ID];
    Migration workbench sql
    SELECT DISTINCT Order_Details.Order_ID,
    SUM(CLNG('NUMBER', Unit_Price * Quantity * (1 - Discount) * 100) / 100) Subtotal
    FROM Order_Details
    GROUP BY Order_Details.Order_ID
    (You can see it's added 'NUMBER' for the destination data type (?) to the function call)
    What I expected:
    SELECT DISTINCT Order_Details.Order_ID,
    SUM(msaccess_utilities.convert('NUMBER', Unit_Price * Quantity * (1 - Discount) * 100) / 100) Subtotal
    FROM Order_Details
    GROUP BY Order_Details.Order_ID
    OR
    SELECT DISTINCT Order_Details.Order_ID,
    SUM( Unit_Price * Quantity * (1 - Discount) * 100) / 100 Subtotal
    FROM Order_Details
    GROUP BY Order_Details.Order_ID
    Thanks
    Greg H

    Hi Greg,
    Thanks for this feedback.
    I have logged a bug against the issue you encounter.
    6645891: ACCESS CLNG FUNCTION TRANSLATE INCORRECTLY
    I hope to have this resolved for our next release.
    Regards,
    Dermot.

  • Help!How to convert a plenty of doc files to pdf format?

    System: windows xp
    Software: Adobe Acrobat Professional 7.0
    I'm tired of repeatedly click open,convert,save,close to convert a large quantity of doc files to pdf format.Is there any easy way to do this? Is there any kind of plugin or batch command provided to this software?

    Turn off the view in Acrobat option in the Adobe PDF printer and then just drag and drop them on the printer. You may have to figure out where to send them or accept the default, again an option in the printer.

  • Material Quantity Conversion - Base UOM to Sales UOM

    Hi,
    Is there any SAP Function Modules to Convert a Matrial Quantity from Base UOM into Sales UOM?
    Appreciate Your Help!.
    Thanks,
    Kannan.

    You can use this FM:
      CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
        EXPORTING
          I_MATNR                    = WS_BSEG-MATNR  " < material
          I_IN_ME                    = WS_BSEG-MEINS " < Base Uom
          I_OUT_ME                   = LF_MEINS " < Sales Uom
          I_MENGE                    = LF_E_MENGE " < Qty in Base Uom
        IMPORTING
          E_MENGE                    = LF_I_MENGE " < Qty in Sales Uom
    Regards,
    Naimesh Patel

  • Quantity Tolerance for material in the PO and GR

    Hi Gurus,
    I have this requirement, specific material type( i.e ERSA) quantity in the PO is 100 then if I GR it, I want to have converted the 100 quantity to 150. How can this be happen? Changing the tolerance in the info record or material master?i have tried it but still doesnu2019t work?How can I do that? Converting the PO quantity to a specific quantity without changing the original figures in the PO. Please help.
    Thanks!

    The system will not automatically convert the 100 qty to 150 qty while GRN....
    We have to set the Over delivery tolerance in PO line item for what you want to excess recieve the materials while doing GRN based on your PO qty...and also
    we can set the unlimited tab in PO line item for recieveing excess materials during GRN.

  • Is the any FM to convert The ALterante UOM to Base UOM?

    Hi ,
    Is there any FM to convert the Ordered quantity(In alterante UOM )of a particular material in to Eqvivalant quantity interms of base UOM ?
    Thanks in advance ,
    Dharma .

    Hi Srinivas,
    You can see the sample code mentioned below. It will throw those errors which u mentioned. Even you can change the logic as u required. This is just for your information...
    parameters: P_date(6) type n  obligatory.
    DATA: p_len TYPE i.
    at selection-screen.
    if ( p_date4(2) lt '01' or  p_date4(2) gt '12' ) .
      MESSAGE e400(ZCA_GENERAL) WITH 'Date format is wrong enter only YYYYMM'.
    elseif ( p_date0(4) lt '1960' or p_date0(4) gt '2099' ).
    MESSAGE e400(ZCA_GENERAL) WITH 'Date format ( Year 1960-2099 ) is wrong enter only YYYYMM'.
    endif.
    Regards,
    Naveen Veshala

  • Recording with MP3 converter

    For MP3 conversion , CCA seems to be compliant only with LAME application that is a single thread conversion and take long time to convert a big list in the quality folder.
    I need to convert a big quantity of recording.
    Anyone know if it is possible to use another third party application instead Lame ?
    Thanks and regards
    Mauro

    If the file server is a windows machine you can disable the last modified update in the registry. This will increase the performance in a large directory quite a bit while it converts each file.
    I'd also recommend you run Profiler or similar on the 'selects' the MP3 server sends. Create an index specific to that select and be sure to add the result set as the included columns. That will make the DB query to identify the files very efficient. Unfortunately you will see that the company ID’s that are higher will be lower on the order returned.
    Other than that, you will be depending on CPU and base file system IO to work the backlog.

Maybe you are looking for

  • Background job scheduling problem in APO

    Hi fellow SDNers, i am going through this peculiar problem of background job scheduling: scenario is like , i have an CSV (excel file) in aplication server which would load data into the infosource, which i have scheduled to run in backhround (in inf

  • Problem with previews browser and email clients vs DW

    Hey everyone.  I am having an issue with DW.  I wanted to see if I could get some quick help.  I am having a problem with the DW Design looking fine and great on my screen in DW, but when I go to preview in a browser or upload to an Email client, it

  • OSN - Inbound XML AP Invoices

    We are attempting to receive AP invoices from one of our suppliers directly from the OSN. 1) We can successfully import the sample AP invoice from the OSN into the AP interface tables. 2) We can receive the suppliers invoice into the ECX_DOCLOGS tabl

  • OSX asking to choose startup volume

    Hi. I don't know why but now my computer is asking to choose startup volume even if I don't press any key on startup. I just turn it on and sometimes (like 3 times a week) it shows that screen to select hard drive or time machine to boot from. I was

  • WLAN Design

    I've inherited our current WLAN that consists of two identically configured 1121 APs in separate buildings. Authentication is WPA-TKIP PSK that requires manual configuration of all devices. Guest access is handled through a separate VLAN that has ACL