Formatting Character values

Guru's,
I have a character (varchar2) field I need formatted 9999-99-999-999 (It's an NSN - National Stock Number). I want to use srw.set_format_mask, but that only works for date/number fields. I have the field formatted FMXXXX"-"XX"-"XXX"-"XXXX in forms, but what is the correct way to format it in Reports? Seems like such a simple task but I can't find an easy resolution.
Thanks in Advance
abc

i figured it out on my own - in format trigger
function F_nsnFormatTrigger return boolean is
tmp varchar2(16);
begin
     if :nsn <> 'N/A' then
     tmp := substr(:nsn,1,4)||'-'||substr(:nsn,5,2)||'-'||substr(:nsn,7,3)||'-'||substr(:nsn,10,4);
     srw.set_field_char(0,tmp);
     end if;
     return (TRUE);
end;

Similar Messages

  • How to convert character value to_date?

    I want to change the time (hours) in sysdate to '10' and then save this new date into a date column for that i've written the following command
    (TO_CHAR(SYSDATE,'DD-MON-RRRR')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'))this command will remove the actual hours in sysdate and change it with the value '10'. but the result of this command is a character value. and i want a date value to insert into a date column. for that i've converted this command to_date as follows
    TO_DATE(TO_CHAR(SYSDATE,'DD-MON-RRRR')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'))but it gives the following error
    ORA-01830: date format picture ends before converting entire input string
    how to do this?

    Gul wrote:
    I want to change the time (hours) in sysdate to '10' and then save this new date into a date column for that i've written the following command
    (TO_CHAR(SYSDATE,'DD-MON-RRRR')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'))this command will remove the actual hours in sysdate and change it with the value '10'. but the result of this command is a character value. and i want a date value to insert into a date column. for that i've converted this command to_date as follows
    TO_DATE(TO_CHAR(SYSDATE,'DD-MON-RRRR')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'))but it gives the following error
    ORA-01830: date format picture ends before converting entire input string
    how to do this?TO_DATE(TO_CHAR(SYSDATE,'DD-MON-YYYY')||' 10:'||TO_CHAR(SYSDATE,'MI:SS AM'),'DD-MON-YYYY HH:MI:SS AM')

  • Error while assigning a character value to a numeric variable.

    I fire a sql statement and check the number of rows returned by the sql.
    I check this result with the application logs.
    The application logs keeps the sqls fired by the application and the no of rows returned, in the example below the sql returned 8454 rows.
    My script compares the two results.
    ***********Application Log***********
    4/14/2008 11:15:01 AM: 0059 SQL SELECT "CLUSTER_CD",
    4/14/2008 11:15:01 AM: 0060 "PRODUCT_DESC",
    4/14/2008 11:15:01 AM: 0061 "TEAM_CD"
    4/14/2008 11:15:01 AM: 0062 FROM "OPS$TMS"."MAP_CLUSTER_TEAM_PROD"
    4/14/2008 11:15:01 AM:      3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD, 8,454 lines fetched
    ***********Application Log***********
    My script:
    #!/bin/ksh
    typeset -i resA
    typeset -i resB
    opstms_conn_string="abc/[email protected]"
    set `sqlplus -s $opstms_conn_string << EOF
    set pages 0
    WHENEVER SQLERROR CONTINUE
    SELECT count(*)
    FROM MAP_CLUSTER_TEAM_PROD;
    exit
    EOF`
    resA=$1 ##returns 8454
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}'`
    ##resB returns 8,454
    ## here i get syntax error
    if [ $resA -eq $resB ]; then
    echo "QA passed for sql1"
    else
    echo "QA failed for sql1"
    fi
    The problem is as resB is integer variable it does not accept character value: 8,454 so returns a syntax error:
    How do I change the value assigned to resB into a numeric variable?
    error:
    + grep 3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD, BCVP_Main_Loader.qvw.log
    run.ksh[52]: 8,454: syntax error

    Change:
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}'`
    to this:
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}' | tr -d ,`
    to drop the comma. Or you could do it in awk(1):
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{ gsub( /,/, "", $10 ); print $10}'`
    Or you could to it all in awk(1):
    resB=`awk '
    /3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD/ {
    gsub( /,/, "", $10 )
    print $10
    ' BCVP_Main_Loader.qvw.log`
    (This example was not tested, it's just for a model.)
    Someone more of an SQL guru than I can probably tell you how to change your numeric locale to avoid presenting those commas in the first place and avoid the problem.
    HTH

  • How 2 assgin a character value to the auxillary cell

    Hi,
         I'm assigning a character value to the auxiliary cell in the macro. But it gives me a dump. So do let me know can I assign a character value to the auxiliary cell ( I need to display this value for the alert text).
    Thanks,
    Siva.

    Why are you trying to use a character in the planning book - why not a representative value in numbers
    but if you HAVE to use characteristic then you can also try to use the notes functionality (right click on a cell and go to notes if you have not seen this )
    These notes are usually anchored to a cell. These notes are stored in a table (check in se 16 with wildcard on notes ) and is associated to the value of a cell
    So if you can reference a cell value and put in the conditons to the values on it you might be able to manipulate the values in the table for notes and this will cause the notes in the interactive planning boo to change accoring to the value of the cell

  • Problem with display of a character (value 65533)

    Hi all, sorry for my english but i don't speak it very well.
    I have a big problem with the visualization of a character.
    I have a binary text that i have to analyze with java. With my utility all works fine, but when i get the character (binary 81) and i analayze this character i obtain an int 65533 or a byte -3 , and after a casting to char i see that java doesn't display correctly this char, infact i obtain a char like this a question mark in a square. Even if a try to write this into a text file, i can see correctly all the other char, but instead of this char i see a question mark.
    Someone know why i obtain this?i have to set some specific character encoding or something like this?
    I don't know if this is usefull, but these are Hebrew char.
    Thanks,bye.

    A character value of 65533 in not in the Unicode range for Hebrew and Java characters are Unicode encoded as UTF16. See http://www.unicode.org/charts/ .
    65533 is not a byte value since bytes have a range -128 to +127 .
    0x81 is not the same as 65533 decimal.
    How are you converting the bytes of the file to characters?
    Edited by: sabre150 on Oct 9, 2008 8:51 AM

  • Passing multiple character values from parameter form to PL/SQL

    Hi,
    I am passing multiple character values from parametr form into
    the report query and a PL/SQL procedure. It works fine with the
    query, when I use &variable. But, it doesn't compile in PL/SQL,
    so I just used the :variable, but not getting any records in the
    PL/SQL procedure. Any suggestions?
    sincerely,
    gj

    gj / Fedro,
    Only using the &referecne, you can pas a string / multiple character values and this would work for query only.
    The bind parameter in PL/SQL wouls support only single value
    Thanks
    The Oracle Reports Team

  • XML Report Excel Output Numeric & Character value left aligned

    Hi,
    I want the XML Report Excel ouput both numberic and character values to be left aligned in the report ouput. Currently my report excel ouput prints the number value right aligned and character value left aligned.
    I have tried to concat a space to the value to make that as a character value, but this gives a extra space in the report output, which shld not happen..
    Please could anyone help me with a solution.
    Thanks

    Hi Uday,
    You are making number as a string, by adding a character :) , so it will be displayed as string with space and not as number.

  • Function module to convert character value of month into numeric value?

    Hi Experts,
                     I need to convert a character value of a month in three alphabets to its numeric value.
    e.g. 'jun' should be converted into '06' and 'jan' into '01' using a function module.Can anybody please provide me a similar function module?
    TIA
    Abhishek

    try this code:
    DATA: text(20) TYPE c,
    date TYPE sy-datum.
    text = '06. Jul 06'.
    TRANSLATE text TO UPPER CASE.
    TRANSLATE text USING '. '.
    CONDENSE text NO-GAPS.
    CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'
    EXPORTING
    input = text
    IMPORTING
    output = date.
    WRITE date USING EDIT MASK '__.__.____'.
    Regards,
    Dara.

  • Problem in formatting Total Value in advanced table

    I want to format Total Value for each column to USD format i am able to do for Column values but for Total Value i am not able to make it, i reffered all the previous threads and tried nothing worked out, can any one help me out its very urgent
    Thanks
    Babu

    First thing is as Tapash has pointed out, How did you do it which is not working? Second point is that there is straight forward mention of this scenario in Advanced table section of the Dev guide. Have a look.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Passing 900 character value into a Single line

    Hi Experts,
    I have a scenario that i have to pass 900 character value to a single field. After that i need to download this internal table into an text file.
    What happening after some characters the values are not getting passed into my varaibale.
    So please help me how to accomodate all the 900 character values in a single field.
    With Regards,
    Sumodh.P

    Hi,
       Chk this ...
    DATA : BEGIN OF IT_ITAB900 OCCURS 0,
             VAL(900) TYPE C,
           END OF IT_ITAB900.
    INITIALIZATION.
    CONCATENATE 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    INTO
    IT_ITAB900-VAL.
    APPEND IT_ITAB900.
    START-OF-SELECTION.
    DATA : P_FILENAME TYPE  STRING.
    P_FILENAME = 'C:\Documents and Settings\testingis on.txt'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    = BIN_FILESIZE
        FILENAME                        = P_FILENAME
      TABLES
        DATA_TAB                        = IT_ITAB900 .
    This writes all the characters ....
    Regards,
    Srini.

  • How to format the value in narrative ?

    Hi Experts,
    In BIEE 11,
    How to format the value in narrative , such as separator.
    In table or pivot property, I have set the separator for measure , but in narrative, the format will be disappeared. So how to implement this requirment?

    I had this problem with 11.1.1.6.0
    If you want this format as the default display format for this column everywhere, then you can save that format as default display format for the column or data type (Lower right corner of data format tab: "Save as Default" button, "Save as the system-wide default for "Table"."Column"). When I had the problem the narratives did use the default display format.
    Another workaround could be a direct database call to convert the data to a string. For example, in Oracle
    EVALUATE('TO_CHAR(%1,%2)' AS CHAR(30), “Table".“Column" ,'$9,999.00')
    but you may need to set EVALUATE_SUPPORT_LEVEL in your nqsconfig.ini, and this ties you to the database technology.

  • [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specifi

    [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
    An you help me with this error?
    This is the problemativ query:
    Search QUERY : SELECT DISTINCT theK_files.fileid, theK_files.name, theK_files.t
    itle, theK_files.description, theK_users1.name AS AuthorName, theK_users1.surn
    ame AS AuthorSurname, [theK_file-extensions].name AS Extension, theK_files.publ
    ished, theK_files.updated FROM theK_users INNER JOIN [theK_users-to-groups] ON
    theK_users.userid = [theK_users-to-groups].userid INNER JOIN theK_usergroups
    ON [theK_users-to-groups].groupid = theK_usergroups.groupid INNER JOIN [theK_g
    roups-to-files] ON theK_usergroups.groupid = [theK_groups-to-files].groupid INN
    ER JOIN theK_files ON [theK_groups-to-files].fileid = theK_files.fileid INNER
    JOIN theK_users theK_users1 ON theK_files.authorid = theK_users1.userid INNER
    JOIN [theK_file-extensions] ON theK_files.extensionid = [theK_file-extensions]
    .extensionid WHERE theK_users.userid = '1' AND theK_files.extensionid = '1' AN
    D ( theK_files.name LIKE '%a%' OR theK_users1.name LIKE '%a%' OR theK_files.de
    scription LIKE '%a%' )

    are these columns character/string/varchar:
    theK_users.userid = '1'
    theK_files.extensionid = '1'
    if these are number columns, change them to
    theK_users.userid = 1
    theK_files.extensionid = 1
    Jamie

  • Character value can display automatically

    Dear Experts,
    i have a question for character value.
    In BW, we have master data for PH1-PH6.
    And if you know the PH6, there is unique value for PH1-PH5.
    For example, if PH6 = 111111, PH1 = 1, PH2 = 11, PH3 = 111,etc.
    This value is unique.
    Now we have a excel layout for user to key in.
    User only key in PH6, we want that the value for Ph1-Ph5 can fill-in automatically.
    Just like user key in ph6 = 111111, ph1 = 1, ph2 = 11, ect.
    I think characteritic relationship can achieve this requirment.
    But question is that we must use the exit type for this requriment, am I right.
    Can we use attribute or reference data or hierarchy ,etc to achieve this target?
    If we use exit, we must create a function to support this requirement.
    Thanks and best regards
    Alex yang

    Hi Alex,
    you can do that easily with standard relationship, you need to have in the master data of PH6 the others PH as attrubutes, this way you can use char relationship based on master data. A similar way is to have a DSO with PH6 as a key and all the others PH and you can use C R with DSO. again hier is the same, if you have the hier you can easily set C R based on hier.
    if you don't want to create such relations then you need exit relat.
    hope this helps
    Mike

  • Include character value variable processed by customer exit in the report

    I have defined a character value variable' processed by 'customer exit'. i am troubleshooting a problem so I need to see the value of this variable. Is there a way to display this variable in the report. If so, what section, rows or columns? And how to configure?
    Thanks,
    Sharon

    Hi,
    You can add directly the variable, in BEx Analyzer 7.0 you can add variables in the Excel Cell that you would.
    Steps:
    - Select the Excel Cell
    - In the BEx Design Toolbox, select Insert text
    - When you are in Design Mode - click over the text element
    - Go to Constants tab and select the Custom Exit Variable
    - Save the workwook
    Regards,
    Dani

  • How 2 convert numeric value to character value?

    Hi friends,
    I want to convert numeric value to the character value.
    Is there any FM available?
    Points rewared soon.
    Regards
    Ronn

    REPORT ZSPELL.
    TABLES SPELL.
    DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
    DATA : PAMOUNT LIKE SPELL-NUMBER  VALUE '1234510'.
    SY-TITLE = 'SPELLING NUMBER'.
    PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
    WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
    FORM SPELL_AMOUNT USING PWRBTR PWAERS.
      CALL FUNCTION 'SPELL_AMOUNT'
           EXPORTING
                AMOUNT    = PAMOUNT
                CURRENCY  = PWAERS
                FILLER    = SPACE
                LANGUAGE  = 'E'
           IMPORTING
                IN_WORDS  = T_SPELL
           EXCEPTIONS
                NOT_FOUND = 1
                TOO_LARGE = 2
                OTHERS    = 3.
    ENDFORM.                               " SPELL_AMOUNT

Maybe you are looking for

  • How to create a table of values from a calculation sheet ?

    Forgive me if this has been asked and answered already, I have searched and gone through the functions manual, but I cannot find what I am looking for. I currently have a sheet containing multiple tables. The tables all perform various sorts of calcu

  • Photoshop desaturating but lightroom is not (same file)

    I'm sure this has been asked a million times before but.. Basically, I designed an ad for a client on my Macbook Pro (I usually design on my PC). Using my Mac: 1. I saved the image using Save For Web in Photoshop CS4 (with Convert to sRGB), and it sl

  • Issues Starting iTunes...

    My iTunes and Quicktime utilities will not open - they crash almost immediately upon clicking the icons. I have uninstalled and then re-installed both the current and previous versions of iTunes, and nothing has fixed the issue. This is the error for

  • Assign MIDI Keyboard Pedal to control Record?

    I can't seem to get it to work, I used MIDI learn but it didn't assign the Pedal, a simple 0-127 cc64 VFP 1/25, to control the transport record button. Could the problem be that the box the pedal came in mentions most makes of keyboards but not my M-

  • Pass variables and return ResultSet from same preparedStatement

    I am passing "fp" and "week_no" to a preparedStament in a class and want to return the values to my jsp page. "fp" and "week_no" are used twice. Please see below. When I run it, I get no error messages but, it doesn't display any data. I have the fol