String Manipulation with blank space at the end

Hi All,
DATA:  str1(999),
       a(10),
       b(10).
DATA: len TYPE i.
a = 'Welcome'.
b = 'To all'.
CONCATENATE a b INTO str1 RESPECTING BLANKS.
len = STRLEN( str1 ).
WRITE: len.
result : 16.
If I declared str1 as string result is 20. Because in above case empty space is truncated at last .
So any otherway to getting result 20 with out declaring str1 as string.

Hi vinoth ,
To get spaces at last  ,
data : str1 type char10 ,
         len type i .
str1 = 'the ' .                  " space given by pressing space bar button
len = STRLEN( str1 ).     " in len we get it as 3 , coz 'the ' is 3 only .
str1 = 'the ' .                 " space given by pressing ALT 2 5 5
len = STRLEN( str1 ).   " in len we get it as 4 , coz 'the ' is 3 and 1 space is given by pressing ALT 255 .
This works,
Hope it might be helpfull,
Regards,
Aby

Similar Messages

  • Change Filenames with blank spaces in the Filename

    I want to change many filenames with blank spaces and replace
    blank spaces with underbar character.
    Example:
    File One change to File_One
    File Two change to File_Two
    Here is my script:
    for file in `ls`
    do
    i=`ls -1 *" "*`
    b=`ls -1 *" "* | sed -e s/\ /_/g`
    done
    mv "$i" $b
    Please advise what is wrong with my script that isnt
    working. The script works if I only have one filename
    with a blank space. But if I have several filenames
    with blank spaces in the name then it doesnt work.

    I want to change many filenames with blank spaces and replace
    blank spaces with underbar character.
    Example:
    File One change to File_One
    File Two change to File_Two
    Here is my script:
    for file in `ls`
    do
    i=`ls -1 *" "*`
    b=`ls -1 *" "* | sed -e s/\ /_/g`
    done
    mv "$i" $b
    Please advise what is wrong with my script that isnt
    working. The script works if I only have one filename
    with a blank space. But if I have several filenames
    with blank spaces in the name then it doesnt work.

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

  • PI removing blank spaces at the end of the lines in a plain text file

    Hi -
    I have an interface that transfers a file via FTP. I defined both the sender and receiver to transfer either Text or Binary but the interface removes every blank space I have after the last character. The file is a fixed lenght file.
    Example:
    Original file:
    Hello world(space)(space)(space)(space)(space)(space)(space)(space)(eol)
    where (space) is the space character and (eol) is the end of line char.
    File after it is received.
    Hello world(eol)
    I already defined the parameter Row.fieldFixedLenghts with 10164 which is the lenght of the lines of the file.
    Any ideas why it may be happening?
    Thanks,
    Carlos.

    Hi -
    I tried both the parameters:
    xml.fieldContentFormatting
    structure.fieldContentFormatting
    The received file still has the problem. All the blank spaces are cleared out.
    The file is a plain text file not an XML file. May this be the issue?
    Thanks,
    Carlos.

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

  • Names imported with a 'space' at the end..

    I discoverd that I imported a batch of names (contacts) into my address book not realizing that a 'space' had entered at the last name field. So when I try to remove duplicate names address book does'nt recognize the fields and does'nt remove them. Would it be difficult to write a script to remove all the spaces behind the fields 'last name'?
    thanks!

    Click here to launch Script Editor.
    <pre class=COMMAND>tell application "Address Book"
    set nameList to every person whose last name ends with " "
    repeat with somePerson in nameList
    last name of somePerson
    set lastName to text 1 thru -2 of result
    set last name of somePerson to result
    end repeat
    end tell
    </pre>

  • Blank space at the end of the TXT file using FDTA (T.code)

    We have created payment runs in Quality Client as follows:
    1. Payment Run ID MSA01 Run Date: 24.02.2011
    2. Payment Run ID MSA11 Run Date: 24.02.2011
    The resulting DME Files are as per our attachment.
    The file got rejected by the bank due to an extra white space on the last
    line of the DME File. The file should end immediately after the last
    character in the fle. We have not done any thing to the DME File structure.
    The connection to SAP CQ1 is now open and your user id and password are
    in the secure area.
    Thanks.
    Regards,

    Hi Kiran,
    Maybe check the following note to see if this addresses your problem:
    [1514624 - Extra CR (carriage return) in DME file created by RFFOGB_T program when run on AIX (unix system) |https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3135313436323426]
    Kind regards,
    Robert
    PS. unable to see in this note to which support package and release the note pertains.

  • After making a live recording, how does one delete the blank space at the end?

    I have asked everyone I know and no one seems to know how to do this. Thanks, for any info!

    Do you want:
    A) Remove the blank space in your GarageBand Project
    B) Remove the silence in the actual audio file
    Just make sure that you are aware of the difference between an Audio Region and an Audio File
    About A)
    Just resize the right border of the Audio Region. The Audio Region is just a reference to the actual Audio File on your drive. This solution is just for editing your Project it won't get rid of any silence int he actual Audio File
    About B)
    You cannot do that in GarageBand itself. GarageBand only allows editing of the Audio Region (non-destructive editing) not the actual Audio File (destructive editing). A quick way to do it is open the file in QuickTime, crop it and save it.
    Hope that helps
    Edgar Rothermich
    http://DingDingMusic.com/Manuals/
    'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'

  • How do I delete the blank space at the beginning or end of a project?

    I constantly end up with blank space at the beginning or end of a project - how do I remove it?  I get this ALL the time and I jsut can't get rid of it.  Obviously I want my project to start at 0.00 not at 1.xx.
    Thanks.

    That's not a project. You're inside an multicam angle editor. You need to edit the multicam clip into a project. That's where you edit it.

  • How to replace a character in a string with blank space.

    Hi,
    How to replace a character in a string with blank space.
    Note:
    I have to change string  CL_DS_1===========CM01 to CL_DS_1               CM01.
    i.e) I have to replace '=' with ' '.
    I have already tried with <b>REPLACE ALL OCCURRENCES OF '=' IN temp_fill_string WITH ' '</b>
    Its not working.

    Hi,
    Try with this..
    call method textedit- >replace_all
      exporting
        case_sensitive_mode = case_sensitive_mode
        replace_string = replace_string
        search_string = search_string
        whole_word_mode = whole_word_mode
      changing
        counter = counter
      exceptions
        error_cntl_call_method = 1
        invalid_parameter = 2.
    <b>Parameters</b>      <b> Description</b>    <b> Possible values</b>
    case_sensitive_mode    Upper-/lowercase       false Do not observe (default value)
                                                                       true  Observe
    replace_string                Text to replace the 
                                         occurrences of
                                         SEARCH_STRING
    search_string                 Text to be replaced
    whole_word_mode          Only replace whole words   false Find whole words and                                                                               
    parts of words (default                                                                               
    value)
                                                                               true  Only find whole words
    counter                         Return value specifying how
                                        many times the search string
                                        was replaced
    Regards,
      Jayaram...

  • 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

  • Problem with a blank page at the end.

    Hi,
    I have a report. That comes up with a blank page at the end of the report when the report generates the output in the report builder. Also in pdf file.
    It was created by somebody earlier... and i need to fix this bug.
    Any solutions..?
    Thanks in advance.
    KK
    Message was edited by:
    KK28

    Hi
    there are a number of hits on Metalink for this...
    Subject:      Extra Page Shown At The End Of A Web Report
         Doc ID:      Note:172426.1      Type:      PROBLEM
         Last Revision Date:      04-JAN-2005      Status:      ARCHIVED
    * fact: Oracle Reports Developer 6.0.5
    * fact: Solaris Operating System (SPARC)
    * fact: Microsoft Internet Explorer
    * fact: Adobe Acrobat
    * fact: OAS
    * symptom: Extra Page Displayed At The End Of A Report Viewed on the Web
    * symptom: Only happens on one report
    * symptom: Using Times New Roman
    * symptom: Client/Server configuration works successfully
    * change: Report originally created for client/server application was moved to a web application without making any coding changes in the report.
    * cause: Bug 1386820 : HTML GENERATED ON NT AND UNIX IS DIFFERENT. ADDITIONAL BLANK LINES ON UNIX
    fix:
    Use the Report Builder on Unix to make fine adjustments in the layout to
    improve the HTML output.
    -----x------------------
    Subject:      How to set the number of rows per page dynamically in a report
         Doc ID:      Note:122714.1      Type:      SCRIPT
         Last Revision Date:      07-NOV-2000      Status:      PUBLISHED
    PURPOSE
    This article shows how to set the number of rows per page dynamically according
    to the user parameter specified.
    INSTRUCTIONS
    Follow these steps:
    1. In the Object Navigator under Data Model-->User Parameters, create an user
    parameter P_1 -- this parameter specifies the number of rows you want to
    print per page
    datatype: number.
    2. In the Data Model Editor, create the query and the layout according to your
    requirements.
    Let's assume that we have the following:
    Q_1: Select empno, deptno ename from emp
    order by deptno, ename
    G_1 has the columns empno, deptno, ename
    3. In the Data Model Editor, create the following summary columns:
    CS_numrow will be numbering the rows within the detail group
    (created within G_1).
    Set the following parameters:
    Name: CS_numrow
    Function: count
    Source: <any column that does not accept nulls> for instance, empno
    Reset at: Report
    CS_total_rows will calculate the total of rows retrieved
    (created at the report level)
    Set the following parameters:
    Name: CS_total_rows
    Function: count
    Source: <any column that does not accept nulls> for instance, empno
    Reset at: Report
    4. In the Layout Model Editor, create a Group Frame M_1 within the repeating
    frame, below the fields empno, deptno, and ename. You may have to stretch
    the existing frames to be able to fit this in.
    F_enmpno F_deptno F_ename
    --------------------------------------------- <<<< create the group
    frame here
    5. Set the properties for the Group Frame M_1 as follows:
    Print condition: First
    Object: Enclosing Object
    Sizing:
    Vertical: variable
    Horizontal: fixed
    Check the box "Page Break before".
    6. Create a Format trigger for this frame M_1 as follows:
    function M_1FormatTrigger return boolean is
    /* prints until a row number is product of P_1 */
    /* if row number is 5 and P_1 = 5, MOD is 0 */
    /* then it prints the frame, doing a page break */
    begin
    if :CS_total_rows <> :CS_numrow then -- avoiding blank page at the end
    if mod(:CS_numrow,:P_1) = 0 then
    return (TRUE);
    else
    return(false);
    end if;
    else
    return (false);
    end if;
    end;
    NOTE: This assumes that the report is tabular. If you have a break group, this
    logic can be applied for the detail group.
    REFERENCES
    Information in this article was taken from Oracle Sample Code @ Repository
    Entry #956. In order to request the binary (rdf file or .sql script), please
    log a TAR via Metalink requesting Oracle Sample Code #956
    CAUTION
    The sample program in this article is provided for educational purposes only
    and is NOT supported by Oracle Support Services. It has been tested
    internally, however, and works as documented. We do not guarantee that it
    will work for you, so be sure to test it in your environment before relying
    on it.
    -------x-------------
    the list goes on...
    Hope this helps

  • Replacing # with blank space in Bex Analyser

    Hi All,
    Can any one help me out in replacing # values in Bex analyser with blank space.
    I tried with the macro:
    Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
    ' First Query in the workbook
    If queryID = "SAPBEXq0001" Then
    ' Selects the area where the report query is rendered
    resultArea.Select
    'Replace "" with 0
    Selection.Cells.Replace What:="", Replacement:="0", LookAt:=xlWhole, _ SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=True
    End If
    End Sub
    Means I have include the macro to the Excel, but still it is not working.
    If this macro is the correct solution, then may be I am not using it properly(in the sense I'm not calling with proper syntax).
    Please provide me with the solutiuon to get rid of this problem.

    Hi,
    We are using BEX 7.0.
    I got a macro code which is working. The code is as follows.
    Dim resultArea As Range
    Set resultArea = varname(1)
    Dim c As Range
    For Each c In resultArea.Cells
    If c.Value = "#" Then c.Value = " "
    Next c
    This works fine but the problem is that this macro code should be added each and every time when the query is run.
    Can any one suggest me where the code can be added in Bex Analyzer itself, so that when the query is run the above macro runs along with it and removes the #.
    Thanks and Regards,
    Geetha.

  • Blank lines at the end of SMS - iOS 4

    I've recently upgraded to the iPhone 4 from a 3G and messaging is so much faster, but for some reason occasionally when I send or receive an SMS there is a blank space at the bottom of the message, as if there's a carriage return there. This happens for both messages I send and receive, about every fifth message or so, and seems to be random.
    Anyone else noticed this? I've not had this issue before iOS 4 and although it isn't causing any problems with actually sending and receiving messages, it's quite annoying!

    String#trim() removes all whitespace from both ends of the String.
    The requirement was to remove line breaks from the end of the String only.
    String#replaceAll with a suitable regex would do the trick. Untested regex for this:text.replaceAll("[\\n\\r]+$", "")db

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

Maybe you are looking for

  • How do I delete an old apple id that continues to pop up on my iPad?

    My iPad 2 defaults to an old apple id - I don't remember the password for that id ....I do have a new email id and password however but can't insert it into the text boxes because of this darn pop up that asks me to enter my old id password (which i

  • Missing TXT Alerts in 7.1.1

    I upgraded my iPhone 4 from iOS 5.0.x to 7.1.1 on the weekend and now I no longer get the Alerts, sound/vibration or the red circle notification on the Messages App.... HELP!! I have tried all of the settinsg that I can - turned them on/off even rein

  • Sending to Color

    So I'm trying to send a project to color, but every time I try I get an error saying "XML Export Was Aborted Due to A Critical Error" I've tried to just make an XML, not sending it to color, and still no dice. Anyone have a solution? I'm going insane

  • MDX help needed

    Hi,I have written an MDX query to extract data from Essbase. I am using CrossJoin function for the data to be displayed in Rows from 2 dimensions.The members are displaying seperated by a comma. How to display members with out a comma ? I need the da

  • Mail update status

    Anyone have this problem, and/or a fix.  Whenever I check my email (all inboxex( the "updated" date and time on the bottom bar is frozen several days in the past and won't update.  Also, the "working" icon on the top bar takes forever to turn off.  I