Add space to the end of textfield value

Hi,
  I have a requirement where I need to append 2 spaces to ta textfield at the end of field for certain conditions.
I used Concat() function and if I checked the length, it added the space successfully in the scripting. But in the output display, it is not considering the space to the text. I need this particularly because all my text fields are right alligned and if I have a space appended to the text at the end, I should able to see it in the form
for ex:
       I need     Martin     ( for the first text field)
                   Martin       ( with two spaces appended)
I need the output in the above way.
Can you please help me out.
Sample code I wrote on scripting:
var raw = $.rawValue
$.rawValue = Concat(raw, Space(2))
If I check the length of field, I could see that length got increased by 2. But I cannot display in the output.
Thanks in advance,
k.c

Hi,
Instead of inserting white spaces script to change the right indent:
if (this.rawValue == "Martin")
    this.para.marginRight = "1.5mm";
else
    this.para.marginRight = "0mm";
This is Javascript, but I am sure it will run in FormCalc.
N.

Similar Messages

  • How to add spaces at the end of record

    Hi Friends,
    i am creating a file which contains more than 100 records.
    In ABAP i have internal table with on field(135) type c.
    some time record have length 120, somtime 130 its vary on each record.
    but i would like to add space at the end of each record till 135 length.
    Can you please help me how to add speace at the end of record.
    regards
    Malik

    So why did you said that in your first posting? My glass sphere is out for cleaning...
    Instead of type c use strings and add spaces until they have the appropriate length.
    loop at outtab assigning <pout>.
      while strlen( <pout>-val ) < 135.
        concatenate <pout>-val `` into <pout>-val.
      endwhile.
    endloop.

  • How to pad spaces at the end of a string

    Hi All,
    I am new to ABAP and need help to achieve this functionality
       I have to build a string with fixed lenth . my input string
      is always lesser than equal to X . I need to calculate and
       add that many spaces at the end of the input string .
      I tried to do this and getting the following error
        please help on this :
      if strlen( t_resultc ) < 525.
      RFILL(t_resultc,' ',525)
      endif.
      Error : Comma without preceding colon(after RFILL(T_RESULTC ?)
    Q: Can I use RFILL with out Select statement in a ABAP program
    Thanks & Regards
      KLK

    Hi,
    Try the following code but kindly make a note..
    Note:-USE quote like this  ` `, Instead of normal single quotes ‘ ’
    WHILE strlen( T_RESULTC ) < 525.            “Check the length   
       CONCATENATE  T_RESULTC ` ` INTO T_RESULTC. ”Add spaces at the end   
    ENDWHILE.
    Hope this helps,
    Andrew

  • Adding space at the end of a ritchEditableText  line

    Hi!
    I found an interesting behaviour in my application.  I have a RichEditableText component with a fixed width . If I add text till almost the end of the line and then  insert spaces, the cursor get's stuck at the end of the line. My surprise was on retreiving the text from that line in the code, where all that spaces existed even if they were not visible in the app. So on screen you see let's say 3 spaces, but then you save the text you can get 10. If you keep inserting any letter the cursor will move itself to the next line, but this does not seem to be the case of " "(space).
    I tested it useing the following code. I'm useing 4.1 sdk.
    <s:RichEditableText id="richTxt"  width="100" height="500" change="richTxt_changeHandler(event)" />
    protected function richTxt_changeHandler(event:TextOperationEvent):void
                    var noOfLines:int = richTxt.textFlow.flowComposer.numLines;             
                    for (var i:int = 0; i < noOfLines; i++)
                        var startIndex:int = richTxt.textFlow.flowComposer.getLineAt(i).absoluteStart;
                        var seqLength:int = richTxt.textFlow.flowComposer.getLineAt(i).textLength-1;
                        var textLine:String = richTxt.text.substr(startIndex, seqLength);
    I try to set clipAndEnableScrolling=true; for richTxt but this thid not change anything.
    How can I retrieve only the visible text( with the corect number of spaces at the end of the line) from the RET in order to save it ?
    Thanks !

    Do you want to handle that space or just use the text value?
    If you just want to use the text value (i.e 1word - space)...u simply say CONDENSE <UR TEXT VARIABLE>.
    Else the other option is: Find the string length and then handle it the way u want.
    Or if u r sure that every word has that extra space, and u dont want that u can even use SHIFT RIGHT BY 1 PLACE in thet text variable.
    Hope this helps.
    Thanks
    Kiran

  • Preserve a single space at the end of line using spool command

    Hi,
    Can you please help me to write the result of an sql query into a file with the last column of the row ending with a single space?
    For example:
    COL1DATA|COL2DATA|COL3DATA<space1>
    As mentioned in the example the col3 value in the file should end with a single space. And there should not be any delimiters at the end of the row.
    I tried with set trimspool on/off. But, it didn't work. When I say trimspool on - it is trimming all the trailing spaces.
    When I say trimspool off - it is retaining all the trailing spaces to the size of the line.
    But, I do not wish to modify the file through shell commands once it is written thru spool. I mean I do not wish to append spaces to the end of a line using shell script or any other method.
    I do not wish to use other methods like UTL_FILE also.
    Please help me how to do it using spool command?
    Thank you.
    Ramana

    My requirement is that all the trailing spaces should be truncated except the last one in the row.Why?
    As you have discovered a single column in sqlplus, is always a fixed length regardless of the size of the data, if the length of the data varies the output is padded to the maximum or line size with spaces. The trim and trimpsool commands are there to remove all the spaces from the end of a line if there are any. There are no commands to trim all the spaces except one, or even to trim all the spaces except two, or three even.
    If you want such custom processing you should post process the file in the OS using sed, awk or perl or something designed for such things.

  • Space at the end of a word

    Hello,
    Is there a way to recognize space sign at the end of a sentence?
    The meaning of that is that there is a word that somebody typed at the end of the sentence
    and after that pushed the space bar . When looking at the text inside the sap system the text looks fine,
    but when transferring to excel the text doesnt equal because the space at the end of the sentence.
    Please advise
    Yifat

    Do you want to handle that space or just use the text value?
    If you just want to use the text value (i.e 1word - space)...u simply say CONDENSE <UR TEXT VARIABLE>.
    Else the other option is: Find the string length and then handle it the way u want.
    Or if u r sure that every word has that extra space, and u dont want that u can even use SHIFT RIGHT BY 1 PLACE in thet text variable.
    Hope this helps.
    Thanks
    Kiran

  • Add Counter at the end of file name

    Hi all,
       I am using NFS protocol and trying to add counter at the end of the file. I have given the Prefix as  '-'
    Format : 1
    Step: 1
    Mode: After First File
    Is the prefix is right? Am i giving the values in right way? Please help me.
    The format required is: test_1.xml
    Thanks,
    Sri

    HI Arun,
    I m not so sure but i think prefix can not have any special character.
    You can do this by giving your file name in target->file name schema as File_* while configuring your communication channel.
    After that it will add automatically your required counter.
    thanks.

  • May I run "shrink DB/truncate free space from the end of file" at PROD?

    We have a SAP/MSS production system.
    The disk is full.
    We want to truncate the log file by:
    "shrink DB/truncate free space from the end of file"
    on the log file.
    How risk is it? Can we do it during production is running?
    Thanks! Points!

    Backup the log file (to save the data and keep a consistent backup) Then shrink the file. Its normal for the log not to shrink down to the size you want. Do not shrink past 1GB.
    DO NOT TRUNCATE - you are losing/dropping data and recovery will only be possible to the last on-line, or on-line plus last log/s.
    You can avoid a full log file by setting a 9002 trap - this will trigger a backup (like oraarch when you back up based on % full). Else you need to change the frequency of the backups for the logs to ensure the system never fills ups.
    You can Also add a second log file on a separate F/S if this occurs regular - which it shouldn't if you have a correct backup strategy.

  • Blank spaces at the end of an IDoc text field get lost when posted to R/3

    Hi Guys,
    I am facing the following issue:
    In an XML file-to-Idoc scenario, there are spaces at the end of a text field in the inbound XML file, which I can see when I open the inbound file with a text editor like notepad, and they are kept after XI mapping is executed (I can see them in message mapping simulator). However, it seems that these spaces get lost once the IDoc is posted to SAP R/3 and they are not visible on SAP R/3 side.
    Do you have any idea ? Thanks.
    Best Regards,
    Evaggelos Gkatzios

    That means SAP is removing the spaces from IDoc fields, where you spaces are not allowed. Does it create any problem?
    Thanks,
    Nabendu.

  • Check space in the end to display warning message.

    I am currently working on validations on functional locations in the EDIT MASK. the code is already written for validations on to check for space in the beginning of the each level in the edit mask. however user requirement is that the program should produce warning messages for spaces regardless of where they appear in the Edit Mask. we have not validated to check for space at the end of each level.
    I have checked with condense ,shift string right deleting trailing spaces however I am not able to check for space at the end of levels.
    when i debugged the program the level8 length shows as 2 even though there is only one char in the level8. i
    could you please suggest any possible solution or any keywords that would help. you can go through the below code which is already written for checking space in the begining.
    here l_level1
    Level 8 errors
        l_length = STRLEN( l_level8 ).
    IF ( l_level8 = space AND l_dash_count > 6 ) OR
             l_dash_count > 7 OR
             l_length > 4.
          lt_mask_err-error = '8E'.
          APPEND lt_mask_err.
          l_errlvl8 = c_y.
        ENDIF.
    Level 8 Warning
        IF rb_bdc <> c_on AND p_warn = c_on AND
        ( l_level8 <> space AND l_level8+0(1) = space ).
          lt_mask_err-error = '8W'.
          APPEND lt_mask_err.
        ENDIF.
    i have added this code to display warning message using shift.
        l_lev8 = l_level8.                                                
        shift l_lev8 right.                                             
        l_length = STRLEN( l_lev8 ).                                    
        IF rb_bdc <> c_on AND p_warn = c_on AND                       
        ( l_lev8 <> space AND l_lev8+0(1) = space ).                    
          lt_mask_err-error = '1W'.                                     
          APPEND lt_mask_err.                                          
        ENDIF.

    You can use REGEX for string parsing, it is really handy. If you would like to test it out check out program "demo_regex_toy".
    Trailing space:
    FIND REGEX '[ ]+$' IN lv_text.
    leading space
    FIND REGEX '^[ ]+' IN lv_text.
    Any space
    FIND ALL OCCURRENCES OF REGEX '[ ]+' IN lv_text.

  • I made a video in imovie and saved it, now i want to carry on making it from where i left but every time i try to add an image onto the end it just goes tot he wrong part of the movie, how do i just add it onto the end?

    I made a video in imovie and saved it, now i want to carry on making it from where i left but every time i try to add an image onto the end it just goes tot he wrong part of the movie, how do i just add it onto the end?

    Have you seen my User Tipp here
    "Movie Magic" with Stills and Dissolve
    When you 'prep' your stills in any 'picture app', you can do a lot of marvel by simply applying dissolves.
    In your case, I would create a white document (in Pixelmator, Keynote, Photshop, online at pixlr.com, whatever ...) and another with your logo (and further more ones with additional logos). Drag the jpgs into your iMovie Project and apply dissolves  - tadahh! - logos appear on white.

  • Add Zeros at the Ending to make Length 20.

    Hi,
    I have a Target field WBS where the length should be always 20. If the length is less than 20, I shd add Zeros at the ending to make the length as 20. I think format Number cant be used in this case. Do I need to write a UDF or Is there any standard function
    Thanks & Regards,
    Varun

    Hi Varun,
    use this UDF:
    StringBuffer sb = new StringBuffer();
    int length = 20 - a.length();
    for(int i=0;i<length;i++)
         sb.append("0");
    return sb.insert(0,a).toString();
    The difference to the solution is the use of the StringBuffer class. This is better coding practice. Strings in java are immutable and concatenation of strings therefore very expensive.
    Regards Sven

  • How to add spaces to the column value to make it up specifi length string please

    Hello There,
    Could you please guide me here to solve this issue,
    in my column (named as State) contains values as below
    California
    Washington
    Utah
    Connecticut
    Massachusets
    in the output how can i add a spaces to make up every column values as 15 length (for ex, Utah is 4 length then need to add 11 spaces, California is 10 would like to add 5 spaces)
    i tried below but no use in Sql 2008 R2
    SELECT  distinct state
       state
    +SPACE(35-len(state)),
    len(state+SPACE(35-len(state)))
    FROM dbo.ordersInfo
    Thank you in advance
    Milan

    Fixed length CHAR(n) data in SQL is automatically padded with spaces. Either change the column's data type or cast to it. Also, the ISO-11179 rules are that the column should be "state_name" and not just the root attribute "state" -- state_code, state_population,
    etc are a few of the confusions you created. 
    Another rule of RDBMS is that we do not do display formatting in the data. That is what presentation layers do. Why are you trying to fake COBOL in SQL? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • SPACE at the end of number of gl account  (ALPHA Conversion)

    Hi,
    While updating data from ODS to cube, it is giving error as <b>"Characteristic value '010000 ' of characteristic 0GL_ACCOUNT is not ALPHA-converted " </b>. If you can see there is added <b>SPACE</b> at the end of '010000'. This number is not generating any problem while activation of ODS but it generates it while updating ODS to cube . In ODS data there is no added space in it.
    Please help me to solve it. It is urgent. I will give full points for correct answer.
    Thanks.

    Hi,
    Assune your ODS name is ODS1 then you can see a transfer rules 8ODS1 under 0DM node. In that tranasfer rules you can see it ,at the dead end of <i>Communication str./Transfer rules</i> part of the screen.
    If you are not using Datamart concept, thats means if you have only update rules between ODS and Cube, then you need to make this setting in the Transfer rules used to upload the data to ODS . And then reupload the data to ODs and activation and further upload has to be done once this setting is over.
    With rgds,
    Anil Kumar Sharma .P

  • Regarding blank space at the end of the record

    Hi All,
    We have a requirement where in which we have to pass either X or space to that field and this field is at the end of the record.
    I can download it to local pc or to an application server.
    If i pass normal space, i'm unable to view it when i download that to the local pc.
    I tried with cl_abap_char_utilities, i was able to get the tab, can you please tell me how can i acheive space both in the presentation and at application server.
    Thanks,
    Bharathi.

    Sowmya answer should work.
    Are you looking for something like this?
    CONSTANTS: BEGIN OF end_of_file,
      x(2) TYPE x VALUE '0D0A',
    END OF end_of_file.
    DATA: BEGIN OF itab OCCURS 0,
      line(20),
    END OF itab.
    itab-line = 'Hello World '.
    CONCATENATE itab-line end_of_file INTO itab-line SEPARATED BY space.
    APPEND itab.
    CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
              filename              = 'C:\helloworldtest.txt'
              write_lf              = ''
              trunc_trailing_blanks = 'X'
         TABLES
              data_tab              = itab.

Maybe you are looking for