Replace a string in a character field with a amount value

Hi,
    I have a text field in which I want to replace a string with an amount value. while am trying to replace it , it gives me some empty space.
For example:
amount = '1200   '
message = 'The STIP amount is &1'
in my code :
replace &1 with message into message.
the result is
'The STIP amount is 1200   '
I dont want the space after 1200.
I tried for condense no-gaps also but it is not working ..
What may be the problem?
Can you suggest some solution for this?
Regards,
Vimala

Hi,
replace &1 with message into message.
I guess its replace &1 with amount into message.
Convert the amount to a character type (example move amount to amount_c ), then condense it and and then replace it using the 'REPLACE' statement.
regards,
Advait.

Similar Messages

  • Form field with comma delimited value list to cfc

    I have a form that passes a field to an action page with a
    comma delimited value.
    For instance the field name is: Program_ID
    value for program_ID is: 31, 32
    I am able to treat this variable as a list and check its
    length, and loop over the list prior to passing it to a cfc using
    the attached code:
    When I try and pass the variable as a string to a cfc and
    invoke a query, cf no longer recognizes my var as a list.
    Therefore the code attached does not function...
    Is there a specific var type that will pass through as a list
    and allow me to run the code block attached?
    thanks
    Craig

    Ok answered my own question.. Here is the answer for those
    who are interested...
    initialize var for cfc in cfinvoke statement
    <cfinvokeargument name="Program_ID"
    value="#Form.Program_ID#">
    pass argument to cfc as a string
    <cfargument name="Program_ID" type="string"
    required="true">
    use listqualify to parse list in cfc and set new var
    <cfset selectedProgramID =
    ListQualify(Program_ID,"'",",","CHAR")>
    use the new var in the following statement in sql code:
    ((Program_ID) IN (#PreserveSingleQuotes(selectedProgramID)#))
    The following code handles a form field with a single value
    or a comma delimited value.

  • Padding character fields with zeros

    Hello,
    I need to add zeros to the end of character fields TYPE C. I know i can use the conversion routines but that only works for numeric fields.
    Thanks

    Thanks for all the replies.
    STRLEN will give me the lenght of the field but i need the offset of the last chararcter.
    Your post gave me an idea though. I'm doing the following and it's working.
    value = 'Thank You          '.
    tmp    = '00000000000000'.
    FIND REGEX `\w[ [:space:] ][ [:space:] ]` IN value MATCH OFFSET moff.
    IF SY-SUBRC = 0.
       OVERLAY value+moff WITH tmp.
    ENDIF.
    The find looks for the last alphanumeric char and 2 spaces after it meaning the last alphanumeric char in the string.
    Thanks to all, i will reward as fairly as possible.

  • 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.

  • Character field with date format alike & character entered

    Hi all,
    I got one character field created ( varchar2 ) for the purposed to let user the enter the date and also any character since it is a character field.
    Hence, my field may contain the following data :-
    Ship_date
    01/10/2010
    07/02/2011
    15/01/2011
    25/01/2011
    31/01/2011
    TBA
    STOP
    11/01/2011
    TBA
    Hence when come to sorting, I will like it to be date format like sorting so that the earlier date will display first then only follow by the character. The expected result will be :-
    ship_date
    01/10/2011
    11/01/2011
    15/01/2011
    25/01/2011
    31/01/2011
    07/02/2011
    STOP
    TBA
    Trying to do the normal sorting, it does not exactly sort on the date format, as it only sort on the first two character on the date hence I am not getting the correct sorting on this.
    01/10/2011
    07/02/2011
    11/01/2011
    15/01/2011
    25/01/2011
    31/01/2011
    STOP
    TBA
    Could someone help me on this. Thanks.
    Lim

    Hi, Lim,
    sm**** wrote:
    Hi all,
    I got one character field created ( varchar2 ) for the purposed to let user the enter the date and also any character since it is a character field.That's a very bad idea. Use a DATE column for storing dates. Have another, separate column for VARCHAR2 data.
    Hence when come to sorting, I will like it to be date format like sorting so that the earlier date will display first then only follow by the character. The expected result will be :-
    If you must deal with the table as it is:
    ORDER BY  CASE
              WHEN  TRANSLATE ( ship_date
                        , '012345678'
                        , '999999999'
                        ) = '99/99/9999'
              THEN  SUBSTR (ship_date, 7)
                 || SUBSTR (ship_date, 4, 2)
           END
    ,       ship_dateThe CASE expressionj sorts anything the looks like a date ('99/99/9999' where '9' stands for any digit) first, in order by the last 4 digits, then the middle 2 digits. The first 2 digits are sorted by the second ORDER BY expression.
    I will like it to be date format like sorting so that the earlier date will display first then only follow by the character. The expected result will be :-
    ship_date
    01/10/2011
    11/01/2011
    15/01/2011
    25/01/2011
    31/01/2011
    07/02/2011That must be a mistake. I don't believe you want January to come after October and before February, but if you do, you can change what comes after THEN in the CASE expression.

  • Field with a default value from another field

    I need to populate a field as the default value from another field that the user inputs. I've tried the scripting that I found from the below Topic in the Archived Forums, but I'm not able to make it work. I've tried numerous variations and still to no avail. I tried to make the scripting work in Acrobat 6 and then decided that maybe I needed to upgrade, so I'm now trying it in Acrobat 8 with no results. Can anyone help?
    Topic
    Acrobat 5 - field with default value of another field
    Ben PF - 03:31am Mar 23, 2007 Pacific
    How can I have a field date2 which has the default value of field date1, but which can be edited by the user if necessary without changing the value of date1.
    I've tried, but I just can't figure it out!
    Any help much appreciated.
    Ben
    | Back to Topic List | Bookmark | Subscribe
    To start a NEW discussion click on the Back to Topic List link and select Add Topic.
    If you are in an archive forum please go up to the main topic list (archives are read only).
    Messages
    2 messages. Displaying 1 through 2.
    First Previous Next Last Show All Messages
    Gene Dianoski - 5:22am Mar 23, 07 PST (#1 of 2)
    This, or some variation of this, should work:
    if(this.getField("date2").value == ""{
    this.getField("date2").value = this.getField("date1).value;
    | Bookmark back to top
    Ben PF - 6:49am Mar 23, 07 PST (#2 of 2)
    Thanks very much.
    I put it in at document level to start, but it didn't run the script automatically when date1 was first filled in, so I have put it in as a mouse exit action in date1 and it works a treat.
    Thanks for your help.
    Ben

    Okay forget what I posted above and lets start over. Go to your first field and under Properties -> Actions Tab -> Select Trigger -> On Blur Run A JavaScript.
    Put this:
    this.getField("myField2").value = event.target.value;
    Make sure that you replace ("myField2") with the actual name of your second field. I just tested this and it works for Acrobat version 6.
    I haven't been doing as much javascripting as I used to, so sometimes I too make some basic mistakes.

  • How to count ONLY fields with a specific value

    I modified the code below from the API reference to count combobox fields with a value of "MT" so I could total the number of a specific choice the form user input.
    var count = 0;
    for (var i=0; i<this.numFields; i++)
    var fname = this.getNthFieldName(i);
    if ( this.getField(fname).type == "combobox" && this.getField(fname).value == "MT" ) count++;
    this.getField("mTurb").value = count.value;
    Here's the problem: I tried to use a similar script, modified only slightly from this form, in another total field to tally a different choice made with comboboxes and the script continues to tally the first choice. An example of one of the modified versions of the script is below.
    var gcount = 0;
    for (var i=0; i<this.numFields; i++)
    var gname = this.getNthFieldName(i);
    if ( this.getField(gname).type == "combobox" && this.getField(gname).value == "MT" ) gcount++;
    this.getField("gPack").value = gcount.value;
    I suspect I'm just missing something painfully obvious to seasoned scripters, but I can't seem to figure it out and I need this script to be able to count the number of 9 different options in the comboboxes.

    OK, you can use a script like the following as the custom calculate script for the text fields that perform the counts:
    // Custom calculate script for text field
    (function () {
        // Declare and initialize variables
        var fn, s = "MT", count = 0;
        // Loop through the combo boxes
        for (var i = 1; i < 25; i++) {
            // Determine the current field name
            fn = "M" + util.printf("%02d", i));
            // See if the field value matches
            if (getField(fn).valueAsString === s) count++
        // Set this field value to the count
        event.value = count;
    Change the value of the "s" variable to match the item that you want to count. The first and last lines prevent the unnecessary creatio of global variables, which is good. It also makes it easy to transfer to a more general document-level routine, which would be event better, something like:
    // Custom calculate script for text field
    function getCBCount(s) {
        var fn, count = 0;
        // Loop through the combo boxes
        for (var i = 1; i < 25; i++) {
            // Determine the current field name
            fn = "M" + util.printf("%02d", i));
            // See if the field value matches
            if (getField(fn).valueAsString === s) count++
        // Set this field value to the count
        event.value = count;
    You would then call this function from the individual text boxes with the following custom calculate script:
    getCBCount("MT");
    and replace "MT" with the vlaue you want to count.

  • How to populate 2 screen-fields with one [ON VALUE-REQUEST FOR input] evnt?

    I have a selection screen with 2 text inputs - input1, input2.
    For the first one I have an "AT SELECTION-SCREEN ON VALUE-REQUEST FOR input1" event.
    I successfully get a value there and that is set to the screen field. But I also want input2 to be automatically populated with a value corresponding to the selected input1 (eg. input1=ID, input2=Name).
    I'm able to set input2 ABAP variable but not the screen-element.
    (I guess that ON VALUE-REQUEST doesn't fire any events for screen fields update, because if I press ENTER after using my search-help, then input2 is set with the right value)
    How to solve the problem?

    Hi Ramchander,
    Actually I used FM F4IF_FIELD_VALUE_REQUEST which doesn't have mapping parameters.
    But after your advice I looked through F4IF_INT_TABLE_VALUES_REQUEST and found that it's
    DYNP_VALUES_UPDATE FM that solves my task.
    Thanks!

  • Need to replace the string that contains '|'   character using replaceFirst

    I have the code snippet like this
                   String aaa= "HEY | PRAKASH, HOW ARE YOU";
                   String bbb = aaa.replaceFirst("HEY | PRAKASH", "HI");
                   System.out.println(bbb);
    I want the output as
    HI,HOW ARE YOU
    But the output I am getting is      "HI| PRAKASH, HOW ARE YOU"
    Wat is the issue with '|' symbol, is there any way to achive this......

    String aaa= "HEY | PRAKASH, HOW ARE YOU";
    String bbb = aaa.replaceFirst(java.util.regex.Pattern.quote("HEY | PRAKASH"), "HI");
    System.out.println(bbb);

  • Guid Downloading Character field with numeric value

    Hi All,
    I am downloading one table through gui_download, file type is asc. While downloading the internal table contains one field
    w_lif(20) type c, which contains the value '1234545567' all numeric value, now in excel it is displaying as exadecimal , here i need to convert the type of the column in excel to see the actual value.
    could you please tell me ,  how to get actuall value directly to excel
    your valuable help is appreciated.
    Regards,
    Siddivinesh Jogu

    Hi,
    You can try the File Type as DBF. This retains the format of all the columns as Data.
    Please let me know if this help,
    Regards,
    Janani

  • Displaying data from a list into a single field with comma separated values

    Hi,
    I have a requirement to change a report with an XML structure (simplified version) as below
    <Protocol>
    <ProtocolNumber>100</ProtocolNumber>
    <SiteName>Baxter Building</SiteName>
    <ListOfActivity>
    <Activity>
    <Description>Communication Memo Description.</Description>
    <Name>James</Name>
    </Activity>
    <Activity>
    <Description>Visit 4</Description>
    <Name>James</Name>
    </Activity>
    <ListOfActivity/>
    </Protocol>
    On the report I need to display all the 'Names' for each of the Child (Activities) in a single field at the Parent (Protocol) level, with each Name separated by a comma.
    How do I go about getting this to work?
    Thanks

    Take a look at this: http://blogs.oracle.com/xmlpublisher/entry/inline_grouping
    You could do this (ofcourse, you will need to add extra logic to ensure that there is no comma added after the last name..)
    <?for-each@inlines:Name?><?.?><?', '?><?end for-each?>
    Thanks,
    Bipuser

  • Field with comma separated values to be split into Rows using a Query

    Thanks for the Reply.. I also have to Decode each of the spilt values with some text..
    replace(disc_topics,',',chr(10)) A from XYZ
    Disc_topics values are '01,02,03,04,05'
    this has to be done in SQL
    01 Test1
    02 Test2
    03 Test3
    04 Test4

    select replace( replace( replace( replace( '#' || '01,02,03,04,05,10,11', ',', ',#'), '#0','#'),'#','Test'),',',chr(10)) A from XYZ

  • How To BLank A Field With A Numeric Value

    I am trying to write a formula as follows:
    IF {CRD1.U_PriceOnPick} = "N" THEN
    ELSE
    {ODLN.DiscPrcnt}
    My problem is I need for the field not to display if = "N" else I will print the numeric field of {ODLN.DiscPrcnt} . I am not sure how to code a formula that will meet my objective. When I try to save the formula, I receive an error of , "A String Is Expected Here". Any help would be appreciated it.
    Thanks Jim Dyer

    Cardinal rule of CR, the result of both the IF and ELSE parts must be of the same data type.
    Try changing your formula to:
    IF {CRD1.U_PriceOnPick} = "N" THEN
    ELSE
    totext({ODLN.DiscPrcnt});

  • How fill r/3 transaction field with current property value of user profile?

    Hi Experts!! I
    have a transaction iview ("sap_transaction_iview") currently pointing to a R/3 transaction. I want to use the "application parameters" iview field to pass a variable value to the R/3 transaction. We need to pass R/3 userID that we store in property department of portal user profile. Thus, we need to pass dinamically a value as part of name/value pair in application parameter.
    How can do achive that?
    Thanks in advance to all for your advices and help.
    Best Regards,
    Rosa Ferrando

    Hi,
      I think this blog should help you do it. Create a java class or portal project. You can create iView from par then.
    How to launch SAP transaction & pass parameters via URL
    Here in the same component, you can try getting the user profile attribute and pass it on to this url.
    Here is another link about the same topic.
    Passing a parameter to a transaction iview
    Regards,
    Harini S

  • Choice field with no default value

    I have a field in a list that is a multiple select check box field and do not want to have a default value in InfoPath form.  I have searched and tried using blanks and different calculated formulas and have struck out.  Any ideas?  Thanks!
    David

    Try below:
    http://social.msdn.microsoft.com/Forums/en-US/6a2b4230-49e2-45a4-96d3-c2539d35d78c/infopath-dropdown-list-select-some-value-by-default?forum=sharepointcustomizationlegacy
    http://geekswithblogs.net/KunaalKapoor/archive/2012/06/26/infopath-dropdown-remove-clear-blank-rowitem.aspx
    Regular Dropdown (Pulling from DataSource)
    1. Double click on dropdown field in the data
    source.
    2. Select Fx button for Default value.
    3. Select Insert field or group.
    4. Select secondary xml from data source.
    5. Select “value” and click on ok.

Maybe you are looking for

  • How can I delete and e-mail address from thunderbird?

    I tried to download my e-mail address to thunderbird, but the spelling of the domain was wrong. I then added the e-mail account with a correctly spelled name. Now I have two e-mail accounts and it keeps trying to connect with the wrong one. I need to

  • Computer Name changes

    I am moving a computer to a new use and need to change the computer name. After reformatting the hard drive and installing OSX and running all updates I was surprised to see the original computer name in the Sharing preference pane. So I changed it t

  • Hide content id field

    Hi,, anyone knows how to hide the content id field from the "Content Check id form (Folder)". which comes under link Browse Content->any of the folder -> Actions (situated top right corner) -> New Content. Tell me how to hide the meta data from there

  • Showing Trace from Output Window on Stage

    I am currently developing a flash application that would allow a user to control a movieclip on the stage using 2 keyboard inputs (like turning 2 knobs in order to align something).  I have it set up that on the 2 keyboard inputs, the movieclip moves

  • Client Installation

    hi everyone, I want to install Oracle 10gr2 client on Microsoft windows server 2003. I have opened the official documentation for this, what Im confused about is the installation type i.e which type shall I choose, Instant Client Administrator Runtim