LENGTH  OF QUAN field

hai
I want to find the lenght of the field which data type as quan type
My Requirement is as follow
For example :  variable with value 1.500
     X = 1.5000  i want to find the length of the X . (My Excepted Answer should be  6)
  I tried using the STRLEN and Describe Field Option but still i am not getting the correct count
Any Function Moudle or Code this ?

dear friend,
DESCRIBE FIELD <field> [LENGTH <l>] [TYPE <t> [COMPONENTS <n>]]
                   [OUTPUT-LENGTH <o>] [DECIMALS <d>]
                   [EDIT MASK <m>] [HELP-ID <h>].
Attributes of SAP ABAP Data Objects can be determined at Runtime. The following attributes can be determined at runtime.
FIELD LENGTH
DATA TYPE
OUTPUT LENGTH
DECIMAL PLACES
CONVERSION ROUTINE
DISTANCE BETWEEN TWO FIELDS
HELP TEXT ID
Data: d_intiger    type i,
      d_float      type f,
      d_packed     type p,
      d_character  type c,
      d_date       type d,
      d_numc       type n,
      d_time       type t,
      d_hexa       type x,
      d_type       type c.
      DESCRIBE FIELD d_intiger type d_type.
      Write:/ 'd_intiger', d_type.
      DESCRIBE FIELD d_float type d_type.
      Write:/ 'd_float', d_type.
      DESCRIBE FIELD d_packed type d_type.
      Write:/ 'd_packed', d_type.
      DESCRIBE FIELD d_character type d_type.
      Write:/ 'd_character', d_type.
      DESCRIBE FIELD d_date type d_type.
      Write:/ 'd_date', d_type.
      DESCRIBE FIELD d_numc type d_type.
      Write:/ 'd_numc', d_type.
      DESCRIBE FIELD d_time type d_type.
      Write:/ 'd_time', d_type.
      DESCRIBE FIELD d_hexa type d_type.
      Write:/ 'd_hexa', d_type.

Similar Messages

  • What's a good way to handle this conversion to a QUAN field?

    Good day everyone,
    I developed an RFC that receives data from XI.  I assign this data to a BAPI, and one of the fields is a field with a data type of QUAN(length 13, decimals 3).  All works fine if XI passes me a numeric value in this field.
    Here's the problem:  In running some test cases through XI and into the RFC, we ran a test case where the quantity field had a value of "test" (e.g. no numeric value).  Incredibly, XI transforms the text value of "test" into the value of 4534 and sends it to my RFC.  So my RFC thinks everything's fine when, in fact, that number was derived from a text field and is completely wrong.
    What we need to do is change the field to something that will "kick out" in XI when it tries to call my RFC.  I thought I could change it to a type of NUMC, but that doesn't let me use decimals.  We've already sent out the file layout to vendors, so we expect them to include numeric values with decimal places if need be.
    Is my best bet changing this to a character field with a length of 17, then checking to make sure it consists only of 0-9, a space, or a decimal?  I then need to assign it to the BAPI's field with the data type of QUAN(13,3) -- am I going to have issues trying to do this from a character field?  Do I need to worry whether or not they include a decimal (it might be implied -- in other words, they might just say quantity is "20" which becomes "20.000" to the BAPI).  Is there a nifty routine I can use to do all this easily?
    Thanks everyone.  Points awarded as always for ALL helpful answers.

    Ravi, that's kinda what I was thinking, but if it's true (i.e. a proper amount) can I just move the contents directly to my QUAN field?  Will SAP automatically do the conversion for me such that it ends up in the right place?  I've yet to have to worry about such conversions -- this is the first time I've had to deal with it -- and I want to make sure that the right value gets assigned, whether that value is "20", "54.1", "1000.25", or "986.500".

  • Owb error while edit a mapping:the minimum length of this field is 1

    after creating a mapping,an error always occur when i attemp to
    edit it just as add a mapping table,the error description is:
    the minimum length of this field is 1 and its maximum length is
    15,You have 19 characters.
    can some one help me?thanks

    Hi Vidyanand,
    Did you create the runtime access user using the runtime assistant? Did you select the correct runtime repository (if you have more) to associate your runtime access user with?
    Note that there are 4 database roles being created when you create a runtime repository owner:
    - OWB_A_<runtime repository owner>
    - OWB_D_<runtime repository owner>
    - OWB_R_<runtime repository owner>
    - OWB_U_<runtime repository owner>
    If you would grant those roles to a user, then that user becomes an access user for the user with username <runtime repository owner>.
    Note that you can also use the runtime repository credentials to connect to the runtime repository for deployment purposes, but you may not want that because of security concerns.
    Thanks,
    Mark.

  • Length of a field in a structure

    Hi,
    Is there any restriction on the length of the field in a structure which is CHAR type ??
    Thanks.

    Sample
    report zrich_0001
           line-size 1023.
    data: begin of s,
          a(65510) type c,
          b(25) type c,
          end of s.
          s-a = 'This is field 1 asdfkljas;dfkja;sldkjf;aslkdjf;alskdjfa' &
                'asdfkajsd;kfjas;dlkfj;aslkdjf;alksjdf;lkasjdf;lasdfasdf' &
                'asdfkljas;dlkfj;askdjf;askjdf;lkasdjf;lkasj  thd end'.
          s-b = 'This is field 2'.
          Write:/ s-a.
          write:/ s-b.
    Regards,
    Rich Heilman

  • How to get the length of a field value, not the length of DB's CHAR(20)

    Hello.
    I'm trying to handle a String from my DataBase and get its length:
    String myName;
    int i;
    PreparedStatement sql = Conn.prepareStatement("SELECT NAME FROM MY_TABLE");
    ResultSet results = sql.executeQuery();
    results.next();
    myName = results.getString("NAME");
    i = myName.length();
    out.println("The value is " + myName + " and the length is " + String.valueOf(i) );
    I get:
    " The value is Tom and the lengh is 20 "
    20 is the length of the field (it's a CHAR (20) ), but I would like to get the length
    of 'Tom'.
    On other hand, I would like to detect if this value is 'Tom' or not, but trying with:
    if (myName.equals("Tom")) {...}
    or
    if (myName == "Tom") {...}
    There is no response.
    Any experience?

    myName = results.getString("NAME");
    if(myName!=null) myName = myName.trim(); //Take out trailing spaces
    i = myName.length();Sudha

  • Length of Input field in PCUI ???

    Hello Expert,
    Is there anyway to change the length of input field ?
    I created a input field of lenght 1 in GUI. and added this field PCUI also. In pcui this field is accepting only one char but the field visiable on screen is too long for a single char.I want to change this visiable length of the field on the screen.
    Please Guide me!!!
    Thanks
    Amit

    Thanks Thirumala for ur reply
    Dear visiable length is not taken from DDIC structure field
    length, that also control length of input value.
    Visiable length is controled by layout Algo. only this much i know.How can we change that, No idea.
    Thanks
    Amit

  • Length of amount field in New GL at the document entry

    Hi,
    1) At present I am working on ECC 6, EhP 4 with New GL Activated & Old GL "Not deactivated" (i.e deactivate update of Classic General Ledger GLT0 not done).
    2) The total table (FAGLFLEXT) & Line item table (FAGLFLEXA) field in new GL has amount field length as 23 digit.
    3) When I am trying to enter any FI Document in SAP, using transaction code F-02 or FB60 etc, the length of amount field is coming as 13 digit. I am not able to enter higher value
    Question:-
    a) Is the above issue due to "non-deactivation" of "Old GL"? As per my understanding, it is not, but wanted your opinion.
    b) Is there any configuration which needs to be done to increase the length of the amount field at transaction level?
    Thanking you in advance
    Santosh Agarwal

    a) Is the above issue due to "non-deactivation" of "Old GL"? As per my understanding, it is not, but wanted your opinion.
    No, it is not.
    b) Is there any configuration which needs to be done to increase the length of the amount field at transaction level?
    No, there isn't.  The field length that is appearing during document entry is really dictated by the data type of fields such as DMBTR, WRBTR in table BSEG; which is CURR (13,2).  Although the GL view (FAGLFLEX* tables) have longer length, the limitation in entry view (BSEG, etc.) stays as 13,2.

  • Output data to txt file with full length of the field as in database

    Hi
    I have a problem related to output data I ntxt file on server
    for eg
    CONCATENATE
    wa_sagadr_outtab-seqno
    wa_sagadr_outtab-bpext
    wa_sagadr_outtab-name_org1
    wa_sagadr_outtab-country INTO wa_sagadr_text SEPARATED BY ''.
    the output is separated by single space irrespective of database length of the field , I want to display all the lenth of the database field eventhough the remaining space is blank ie if a field is 20 char in dtabase and only filled with 6 char the whole 20 char lenth should be displayed in the output file
    ouput as below
    required format ie space equvalent to as in database lenght
    000001       700006               C4 Plant AMD Export Sdn.Bhd.so on.
    my format as coming single space in between only
    000001 700006 C4 Plant AMD Export Sdn.Bhd
    pls suggest

    For this maintain an work area with the fields and structure same as the one which you want.
    ten populate the work are and write to file.
    concatenate will not work.
    e.g.
    DATA: begin of wa_sagadr_text,
              seqno like wa_sagadr_outtab-seqno,
              bpext like wa_sagadr_outtab-bpext,
              name_org1 like wa_sagadr_outtab-name_org1,
              country like wa_sagadr_outtab-country
              end of wa_sagadr_text,
    clear wa_sagadr_text.
    wa_sagadr_text-seqno = wa_sagadr_outtab-seqno.
    wa_sagadr_text-bpext= wa_sagadr_outtab-bpext.
    wa_sagadr_text-name_org1 = wa_sagadr_outtab-name_org1.
    wa_sagadr_text-country = wa_sagadr_outtab-country INTO wa_sagadr_text.
    transfer wa_sagadr_text to outputfile
    or write:/ your fields.

  • How to fix the output length of a field

    Hi!
    I want to 'allocate' the full length of the field while smartform printing even if it is initial.
    How can I do this? I tried the &field(*)& &field(F<' '>)& output format, but nothing.
    Thanks

    Hi!
    I have only one text element, and in that I have two variables separated only with one space. In the printed form the starting place of the second variable depends on the length of value in the first variable.
    like this:
    The first variable has the dictionay type 'VBELN', despite this fact, the &FIELD(*)& does not work.
    The template doesn't work here too. because I have only one text element.
    Or can I print two text element in one row? It could be a solution probably.

  • Adhoc query - length of service fields

    Hi all,
    I have question regarding the length of service fields in adhoc query (Actions infotype data fields PNP database).
    When I select these fields I get different results according to reporting period; if i select a keydate then the service is calculated according to this date, but if I select a reporting period, then the service is calculated according to the start date of the reporting period.
    Is this expected behaviour? Please let me know how this can be coded to reference the end date of the reporting period.
    many thanks

    Hi,
    Please check OSS notes 333517 and 357093. Both notes, though from 2000, contain detailed functionality and recommendation around u201Clength of serviceu201D.
    Hope this helps.
    Donnie

  • FB03 - Increase length of the field "Account Short Text" in FB03

    Dear Expert!
    I understand that Tcode: FB03 is SAP standard tcode. However, i just want to ask, is it possible to increase length of the field "Account Short Text" to 42 characters in FB03? Because my vendor/customer name is quite long, and when i view via FB03, the field "Account Short Text" only displays 20 characters, not full vendor/customer name. Unless, i double click on the line item, then i can see full vendor/customer name. But i want the "Account Short Text" field can display full vendor/customer name.
    Is that possible?
    Thank you very much.
    LeLinh

    Hi,
    there's a matadata table behind it RFPSD and for Account short text field KTEXT is used, which in fact has a length of 35 chars.
    But on the other hand there's also a filed KTEXT_GL (G/L Account Short text) which is maybe applied here. It has a length of 20.
    You can do some more checks on program to clear it finally
    Regards

  • How can I search the attribute including type and length of the field in the SD table or form such as sales executive table through debug?

    Some users show that  the sales docment external name is not printed completely in the form of delivery form printing, so I want to find how much length of the field is there through debugging. I am very expected to gain some suggestion from you.

    for exploding the bom if you know header material use
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          CAPID                 = 'PP01'
          DATUV                 = SY-DATUM
          MEHRS                 = 'X'
          MTNRV                 = P_MATNR
          WERKS                 = P_WERKS
        TABLES
          STB                   = I_BOM
        EXCEPTIONS
          ALT_NOT_FOUND         = 1
          CALL_INVALID          = 2
          MATERIAL_NOT_FOUND    = 3
          MISSING_AUTHORIZATION = 4
          NO_BOM_FOUND          = 5
          NO_PLANT_DATA         = 6
          NO_SUITABLE_BOM_FOUND = 7
          CONVERSION_ERROR      = 8
          OTHERS                = 9.
    now check PLPO & PLKO table for routing or AFVC and AFVV for routing.
    if production order created you have to check in afvc and afvv else check in plpo and plko.
    for checking with plpo and plko you have to check MAPL table.
    for bom and material link
    MAST,STPO,STKO.
    stlnr is the common field
    regards
    shiba dutta

  • Fixed length of a field

    Hi Guru's,
    Can anyone help me about my program.?
    How can i get the exact length of a field so that when they are concatenated they have the same size of the field.
    Thank You in advance.
    Regards,
    dranel

    hi,
    To find out the field length of a data object, use the LENGTH addition:
    DESCRIBE FIELD <f> LENGTH <l> IN CHARACTER MODE | IN BYTE MODE.
    exp.
    DATA: text(8) TYPE c,
          len TYPE i.
    DESCRIBE FIELD text LENGTH len IN CHARACTER MODE.
    o/p:-
    Field LEN contains the value 8.
    regards
    Gaurav

  • Setting max length of the field when using Context Model Node

    I have created a model using Import Adaptive Web Service model option (a web service was a wrapper around SAP BAPI function module).
    There were no dictionary types created in the Local dictionary as a result of import.
    I have mapped the context of the controller to the model node.
    One of the fields in the model is name     CUSTOMER_NUMBER type string;
    Corresponding element in the wsdl of the web service is
    <xsd:element name="CUSTOMER_NUMBER" type="tns:char10" />
    I have created a view with the input filed mapped to the CUSTOMER_NUMBER field of the model node.
    When I type more than 10 chars into the field and hit the search button, I get a com.sap.dictionary.runtime.Ddcheck exception that the length of the field should be less than 10 chars.
    How can I set the max length of the field in design time to prevent runtime exception?
    Thanks,
    Julia

    Thank you for your reply.
    Java trim function will trim the white spaces only, not the characters.
    I can code check length functionality before calling execute function (the function that call the web service).
    I can also create a dictionary structure based on the model structure; create a context value node based on the dictionary structure and use WDCopyService API to move the data between value node and model node.
    I was looking for the best practice...
    When importing model based on Adaptive RFC, the dictionary structures are imported together with the model. This does not happen for Adaptive web service - hence there is a need to add coding for simple checks.
    Julia

  • How to enhance an Input NUMC field to a QUAN field in  web UI ?

    Hi All ,
        I am facinga a particular problem in the web UI .
        I have a component in that I have a field which is a NUMC 'Input' field .
        My requirement is to convert this field to a QUAN type field .
        Hence I have created another field in the enhancement for the same purpose . But while saving and generating, its not allowing me to generate .. the reason is I have not provided a reference UNIT type field. And as I am less experienced with CRM UI  I am not sure How do I create a reference UNIT type field . Can anyone please help me with resolving this issues .
    Thanks,
    Ranjita
    Edited by: Ranjita Kar on Apr 7, 2011 10:32 PM

    Hi Both ,
        My requirement is , in one of the standard views  have an Input  field of type NUMC . And I want to enhance this field to QUAN type field . I did the configuration level  changes to change the type of this field from NUMC to QUAN , but I am facing a problem while generating this field . the reason is, a I am using the QUAN data type , the system is asking for a reference UNIT type  field which is not present.And I dont know  how do I create this unit type field as a  reference to this QUAN field . This UNIT type field is not required to be shown in the UI .
    Can any one of you give me the steps so that I can do some experiments .
    Regards,
    Ranjita

Maybe you are looking for

  • How to find a program, which is using "Z" variant

    Hi All, I know only on custom devloped variant name, say "ZTEST". I do not know, which program is using it. Entry is there in TVARV table. Please let me know, how can I find the program, which is using that variant. Thanking you, Chetan Shah

  • EUL5 where clause incomplete

    A Report in Discoverer generade the follow sql query. SELECT o109758.DATUM_CONTACT as E111907      , o109780.ID as E112794      ,o109764.NAAM as E114146      ,o109761.INSTELLINGSNAAM as E114250      ,o109780.OMS as E114427      ,o109962.REGIO as E114

  • Imac 2008 24 inch power off and reset no reason

    Once i a while it turn off and back on with no reason. Turned off the bluetooh happens 1 a week vs 2 a day. What's your 2 cents thanks

  • [Fault] exception, information=[object Exit] from C++ code

    I'm creating a small bit of C++ to CrossBridge into our AS3 AIR application but I'm getting an odd error which isn't really giving me any explanation as to what's going on. My C++ CrossBridge code: #include <stdlib.h> #include <stdio.h> #include "AS3

  • Schema qname collision issue

    I am trying to apply a BPEL orchestration (11g PS2) to receive and process an outbound msg from Salesforce. Salesforce provides the wsdl for the outbound msg that Salesforce sends to my service. Alone, this is not a problem. However, circumstances re