How to identify contents of a character field.

Hi,
I have a field type c and length 5.
I want to check if the contents of this field are number or not, how do i achieve it.
Ex: if that field has 2000, then I want to identify it...
Please help me with the logic,
Thanks,
CD..

One option would be to catch the CONVT_NO_NUMBER exception whilst moving the characters into a numeric field:
parameters:
  p_char(5) type c.
end-of-selection.
  data:
    lv_int type i.
  catch SYSTEM-EXCEPTIONS
    convt_no_number = 1.
    lv_int = p_char.
  endcatch.
  if sy-subrc = 0.
    write: 'It is a number.', /.
  else.
    write: 'It is not a number.', /.
  endif.

Similar Messages

  • How to identify the change in the field of a screen

    Hello,
    In a program , i have a screen 100 with some PBO logic and PAI. sample of PAI code
    chain:
    structure-A,
    structure-*,
    module check_mandatory_fields
    module return: ( this will set screen to 0 and then leave statement)
    endchain
    in one of the subroutines we have
    if sy-batch is initial
    call screen 102.
    else
    endif.
    perform ...
    perform ...
    The issue is for some records the processing goes to the PAI of the screen and then returns to the calling program correctly, However few cases it never enters the PAI, there by goes to the main routine which calls this FM.
    Questions
    1. How do I identify there is a change in the structure-A or Structure-B values. Beacuse if check the values are the same.
    2. How do i force it to always enter the PAI irrespective of the change.
    Thanks and regards,
    Shylaja

    Hello Siva,
    Thanks for the reply.
    Currently the issue there is no change in any of the fields. I think thsi is the reason why the PAI is not called. Only in the PAI we have set screen to 0 and leave.
    Without any change in the screen elements how do i force it to enter the PAI
    or
    when i call a screen statement as Call 102, how do i ensure that it returns to the call routine back irrespective of the PAI being executed.
    thanks and regards,
    Shylaja

  • Identify contents of a screen field via a BDC

    Hello
    I am executing transaction F-03 to clear billing docs via a BDC. I need to identify the line items to clear by tax code. The tax code field is displayed on a subscreen by double clicking the line item (belnr).
    I then position the cursor on the tax code field (BSEG-TXJCD) within the BDC. I would now like to obtain it's value from the screen so I can then determine if this is a valid tax code to clear or not clear. Is there a way to accomplish this within a BDC.
    I tried placing a "get paramter id 'TX J' id BSEG-TXJCD statement within the flow of the BDC logic but don't believe I am retireving anything.
    Thanks for you help,
    Joe

    Have you used SHBD to record the transaction? Maybe it would help you out...
    Greetings,
    Blag.

  • How to move the value from a character field to numeric or packed decimal

    Hi,
    can anyone explain me on how to move the value from a character field to numeric or packed decimal.
    Please help me on this. Thanks...
    Regards,
    Rose.

    Hi ,
    if you use keyword MOVE u may loose the decimal and thoussan separator and if u don't want to loose them just call the FM ..HRCM_STRING_AMOUNT_CONVERT.
    i doubt wherther it is HRCM or HCRM just try using *
    this will suit ur requirement.
    Regards,
    KK

  • How to get a currency format for a character field

    for some specifix reason, we have a requirement to show character field (which results in value 633948) in the format $633,948
    how do i do this?
    if i do SELECT to_char(:c_1,'$999,999')) from dual;
    it gives me ora: 01722: invalid number error
    c_1 is a user parameter of data type character

    Try using TO_NUMBER first, as in something like:
    SQL> VARIABLE c_1 VARCHAR2(6)
    SQL> EXECUTE :c_1 := '633948';
    PL/SQL procedure successfully completed.
    SQL> SELECT TO_CHAR(TO_NUMBER(:c_1), '$999,999') FROM DUAL;
    TO_CHAR(T
    $633,948Hope this helps.

  • Using javascript in PDF how to identify insatnces of field on all pages

    Hi,
    I am creating a PDF document with report kind strcuture,so that if i have a field in 1 Page (Header section ) then the field will also be there on Page 2 (Header section ) and so on for all pages.
    I am basically creating from a tool.So if i have text field on Page 1 with name 'text1' then on Page 2 it has a name say 'text1_osi21' kind.
    What i need is how to identify or get all the occurences of my desired field on all pages.
    I also tried with getField('text1.0') kind but it wont work since for the second,thrid ... instances of the field its appending a value 'osi#'.
    Also tried using 'rect' properties but we cant gurantee about the position of the desired field to remain same on all pages.
    Please help with any clue
    Thanks & Regards
    nitin

    I can do it with the word  template builderbut not with the layout editor. Is there a way to achieve the same result with the bi layout editor?

  • How to accomodate more than 255 characters in character field

    HI All
    i need to accomodate more than 255 characters in character field. How can i do that ?
    thanks in advance!!!

    Hi,
    You can try the following things:
    1. Use a datatype STRING and check it will work.
    2. In se11 transaction goto datatype and search for char* in data elements.
    You will find predefined data types ,you can make use of it.
    For eg. char2000,char3000,char4000 etc.
    Hope this will help.
    Regards,
    Nitin.

  • How do I convert the ASCII character % which is 25h to a hex number. I've tried using the scan value VI but get a zero in the value field.

    How do I convert the ASCII character % ,which is 25h, to a hex number 25h. I've tried using the scan value VI but I get a zero in the value field. 

    You can use String to Byte Array for this.

  • How to save contents of a structure into a field (of type LRAW) of a table?

    Hi,
    I've got a structure, with a few fields, some being char fields and some of type decimals and would like to save the contents into a field of a table, which is of type LRAW.
    I know that I've got to also update the table with the correct length of the value stored in LRAW, and have done that, but it seems to have lost the end bits of the LRAW field.
    Also, can I also find out how I can then retrieve the LRAW value after it's being saved? This needs to be done as later on, we would have to move the values from LRAW into the initial structure it came from.
    Thanks for your help!
    Regards,
    Adeline.

    Use MOVE command to move the contents of the stucture fields to the Wok area of the Internal table and then APPEND it to the Internal table

  • How to set Character field's Format Mask?

    dear all,
    how to set Character field's Format Mask?
    i searched the forum and found the following, where can i use this code and how to change and set its format mask.
    SRW.SET_FORMAT_MASK('mask');
    Thanks
    Muhammad Nadeem

    Nadeem,
    If you have database 10g, look into function REGEXP_REPLACE. Otherwise you can also try this (you might already know).
    SELECT SUBSTR('CHHOCMIPO07020001', 1,2)||'-'||SUBSTR('CHHOCMIPO07020001' ,3,2)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 5,2)||'-'||SUBSTR('CHHOCMIPO07020001' , 7,3)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 10,2)||'-'||SUBSTR('CHHOCMIPO07020001' , 12,2)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 14,4)
    FROM dual
    CH-HO-CM-IPO-07-02-0001
    If you have to use this at many places, create a function, pass the raw value, manipulate the string and return.
    FS

  • How to Identify Delta Field in DS

    Hi Gurus,
      1. My understanding is if a field in datasource(DS) is
      set as Delta, whenever that field value changes in DS
      then the delta process will initialize. (please correct
      me if i am wrong) Do we need to replicate everytime
      the field value is changed so that the value is updated
      in the data target, if so is there a process to
      automate it...  
      2. Can someone tell me how to identify Delta Field in a
      DS for example in 0FI_AP_4. i tried to search for it in
      help.sap.com but all i could find is that 0FI_AP_4 is
      delta capable but couldn't find which field is set to
      delta...
    Thanks,
    SM

    Sri Mal,
       1. Yes, there should be one field enabled enabled for delta.
       2. no need to replicate every time when ever data changes. we need to replicate when DS changed. i mean not business data, if meta data changes we need to replicate the DS. let us assume you made one field for selection and one field as hide. then  you need to replicate this.
      3. OFI_AP_4 is standard DS. you can't enable delta for this one if SAP didn't provide that. we need to active data for this. in the SAP Documentation you can see whether it is delta capable or not.
    comming to 0FI_AP_4, IT IS DELTA CAPLABLE.
    Hope this helps.
    All the best.
    Regards,
    Nagesh Ganisetti.

  • How to identify relevant BADIs to hide a screen field from specific users

    We have a business requirement to hide a document item field (BSEG-XREF3) from specific users (i.e make the field invisible if the userid does not exist in a Z table) during FI invoice entry/maintenance/display via transactions FB01, FB02, FB03, FV50, FV60, FBV0, etc..  We know that it would be possible to do this via modification to the Process Before Output sections of LF040O00, LFDCBFM0, MF05AO00_DYNPRO_MODIFIZIEREN, MF05LO00, but would prefer to avoid modification if possible. 
    I believe that BADIs could possibly be used for screen enhancements, but have not had any previous exposure to BADIs, so I'm really not sure whether it's possible to use BADIs for our specific requirement.  For example, using the advice given in the 2nd post in thread BADI for contract, I've searched SAPMF05A for all 'CALL METHOD cl_exithandler=>get_instance' statements, and have found that a single BADI (FBAS_CIN_MF05AFA0 - EWT - Downpayment Clearing - Tax transfer for CIN) seems to exist for FB01.  The description of this BADI sounds completely inappropriate for our requirement.  However, subsequent posts in that thread suggest far more BADIs for the relevant transaction than were given when searching the ABAP for all 'CALL METHOD cl_exithandler=>get_instance' statements, so I'm not convinced that the procedure I'm following will provide me with all the relevant BADIs for the transaction.
    Please can you advise me how to identify which BADIs - if any - can be used to control screens before output for FB01 screen SAPMF05A/332 (SAP R/3 4.6C)? 
    Many thanks in anticipation,
    Jules

    Hi Kuntal,
    Thank you very, very much for your prompt response and very useful alternative suggestion.
    The screen variant solution would be invaluable under different circumstances, but would be too complex to administer for this particular issue because we're trying to hide the field from unauthorised users in over 100 invoice entry/maintenance/display transactions. 
    We can make a Process Before Output modification to 4 SAP standard programs (LF040O00, LFDCBFM0, MF05AO00_DYNPRO_MODIFIZIEREN, MF05LO00) to make the field invisible for unauthorised users (i.e. whose user-ids are not in a Z* table), but would prefer to avoid modification if we could use BADIs instead.  You've said that you're not sure how we can identify the relevant BADIs, but I very much appreciate the suggestion you've made anyway - it might be useful to others who find themselves in a similar situation for a more limited number of transactions.
    Please can someone advise me how to identify which BADIs - if any - can be used to control screens before output for FB01 screen SAPMF05A/332 (SAP R/3 4.6C)?
    Many thanks,
    Jules

  • How to sort a character field with numbers and letters on the end

    I have an internal table with character field which has data like this after I sort it.  This is not what I expect from the sort.:
    13A
    15A
    29A
    30A
    31A
    33A
    123A
    125
    62 
    76 
    94A
    I expect this, which is sorted number first, then alpha.  Any ideas how to get this sort?:
    13A
    15A
    29A
    30A
    31A
    33A
    62 
    76 
    94A
    123A
    125

    Thanks for the suggestions.  After reading the suggestions and reviewing some other post threads, here's what I did to get the sort to work:
    Add a dash - to the end of any record that did not have an alphabet character at the end.  This way, all records have at least one non-numeric character at the end.  Then I overlayed zeros  '0000000'  over each record.  Then I sorted the table.  Afterwards, I removed the dashes and zeros.
    The long way around, but it worked for me.  Since the internal table is processed in memory, it doesn't add much overhead to the run time.

  • How to identify whether Technical Content is been installed or not?

    Hi all,
    Can anyone let me know how to identify whether technical content in BW 3.5 is been installed or not?
    thanxs
    haritha

    Hi Haritha,
    Check this PDF,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90080703-4331-2a10-cd98-9c1e95acdea0
    And this link also,
    http://help.sap.com/saphelp_nw04/helpdata/en/e5/2d1e3bd129be04e10000000a114084/frameset.htm
    Hope this clears your doubt...

  • How to identify the changed fields on view

    Dear Colleagues,
    can you please let me know how can we identify what are all the fields are changed by user and what all the fields are not changed.
    example: i have 10 fld on my screen i changed only 3 fld we need to know which is changed and which is not.
    i tried with wd_context->is_changed_by_client( ) , buy this we can know whether any changed is done by client or not. But i need to know at UI element wise.
    Thanks,
    Mahesh.Gattu

    Hi Manas,
    this is very lengthy process i found very easy way to get it done.
    keep this code in wddoinit of component controller.
    * enable context change log
        data: context type ref to if_wd_context.
        context = wd_context->get_context( ).
        context->enable_context_change_log( ).
    then write one method in component contoller like get_changes.
    keep this code in get_changes.
    CHANGES     Returning     0     0     WDR_CONTEXT_CHANGE_LIST          
    method get_changes .
        data: context type ref to if_wd_context.
        context = wd_context->get_context( ).
        changes = context->get_context_change_log( ).
    endmethod.
    in above code what ever the chagnes are done it will come into chagne table.
    in debug mode you can find the table values.
    if you want more details you can refer to the WDC: demo_context_changes as refered by Leka.
    Thanks Leka.
    Thanks,
    Mahesh.Gattu

Maybe you are looking for

  • Open Letter to Creative La

    I've sent this via snail mail as well and sent it to by email to the few email Addies I can find. I hope some one gets it. Dear Creative Labs ?This is to inform you that I have become very disappointed in both your products and your customer service.

  • How can I do to insert a 1D array in a line of a table or a 2D array ?

    I have some vectors I concatenate in a 1D array when I pushed a button. Furthermore, when I pushed the same button, I would like to insert this 1D array in a line of a 2D array or in a line of a table. How can I do ? Thanks. Cyril.

  • Source System Already Exists

    Dear Team, After the system copy from PRD to DEV, all the existing source system(s) from our ealier R/3 quality got vanished, according to BASIS team, the source sys assignments have been deleted during the databse restore, Now, the problem is, when

  • IdeaPad U530 Webcam - is this a joke?

    Hey guys, just bought a new Lenovo IdeaPad U530. I was pretty happy until I check the built in "HD Webcam". The quality has absolutely nothing to do with HD, I think I would have a better quality recording with a potato! Since it came with Windows 8.

  • XMLType, TopLink 1013dp3r2 = which JDBC driver supports XMLType?

    I'm using the oracle thin driver 10.1.0.4 and getting this exception when reading an XMLType column that is mapped to a string: [exec] Exception Description: The object [oracle.sql.OPAQUE@f63c6a], of class [class oracle.sql.OPAQUE], could not be conv