ABAP script of process char string

Hi ABAP experts,
I would like to write a ABAP script to remove additional spaces present in a string. The additional spaces present in a string will be removed and replaced with one single space character. I am not a ABAPer, so can I have your help?
For example,
String: "abc     def        ghi"   
ABAP Process: remove additional spaces and replace with one single space character.
Expected result: "abc def ghi"
Appreciate your help,

Hi,
  You can try this way.
1.take an Internal table.
2.Split the String at space into internal table.
3.Then condense the Contents of the internal table.
4.Concatenate each row separated by space.
This will solve your problem.
Thanks & Regards,
Vamsi.

Similar Messages

  • Parameter  to shell script using Runtime.exec(string)

    Hi all, ( Speciall hi to dheeraj tak )
    Briefly : How do i pass an arguement to a non - java executible being called using Runtime.exec.
    In detail : i am using Runtime.exec to call a shell script : The code is as follows:
    String callAndArgs[] = {"/home/tom/jakarta-tomcat-4.1.24/webapps/dash/script.sh"};
    try {
    Runtime rt = Runtime.getRuntime();
    Process child = rt.exec(callAndArgs);
    This works properly & calls the shell script which in turn invokes some other executible (c file).
    $HOME/midi/test/build/bin/<C-EXECUTIBLE>
    Here i am specifying the name (say hello.exe ) . So far so good.
    I want to make this happen dynamiclaly. so i need to pass the name of the executible as a parameter to the script.
    To pass a parameter i hav to change the string to :-
    String callAndArgs[] = {"/home/tom/jakarta-tomcat-4.1.24/webapps/dash/script.sh <C-EXECUTIBLE HERE>"};
    and the script to
    $HOME/midi/test/build/bin/$1 --- where $1 refers to argument 1. (C-EXECUTIBLE AGAIN).
    This is giving an IO - Execption. Plz help
    Code will be very helpful.
    Thanx in advance

    some 1 plz tell me the difference :-
    This is the documentation of Runtime.exec that i found :-
    1> exec
    public Process exec(String command) throws IOException
    Executes the specified string command in a separate process.
    The command argument is parsed into tokens and then executed as a command in a separate process. This method has exactly the same effect as exec(command, null).
    Parameters:
    command - a specified system command
    Complete refernce says : Process (String progName) ----- Executes a program specified by programname as a seperate process.
    2> exec
    public Process exec(String cmdarray[]) throws IOException
    Executes the specified command and arguments in a separate process.
    The command specified by the tokens in cmdarray is executed as a command in a separate process. This has exactly the same effect as exec(cmdarray, null).
    Parameters:
    cmdarray - array containing the command to call and its arguments.
    Complete reference says : Process exec(String comLineArray[]) ---- Executes the command line specified bythe string in comLineArray as a seperate process.
    This means that there is provision 4 command line arguments...
    how do u use it then????????????????????????????

  • How can I get an unsigned char string with nulls from a dll into LabVIEW 6i?

    The following ethernet packet data is contained in an unsigned char * string returned from my dll (it's formatted on printing):
    Received A 230 Packet On Adapter 0x008F0070
    Ethernet Dest: 01.E0.BB.00.00.15 Src: 00.E0.BB.00.DD.CC Type: 0x8868
    000000: 01 E0 BB 00 00 15 00 E0 : BB 00 DD CC 88 68 48 41 .............hHA
    000010: 00 E0 BB 00 DD CC 80 B3 : 00 00 FF FF 00 02 00 01 ................
    000020: 01 00 F0 18 FF 7F 7F FF : FF 7F 7F FF FF 7F 7F FF ................etc., etc.
    However, when I read this string into LabVIEW 6i, I only get the following:
    01E0 BB
    Which is the data before the first NULL or 00 information. I found a "Remove Unprintable Chars.vi" but it
    just sees more data before the above string, nothing after, as seen here: 5C30 31E0 BB.
    Anybody have any suggestions for how to get the rest of the string? Is there something I can do to further reformat my dll? The dll I'm using is already a wrapper around another dll so I have some flexibility, but the bottom line is, the data I want is in the format of an unsigned char *.

    Excellent advice, this mostly works so I have some further questions:
    I am just reading network traffic off my ethernet card right now, but here is what I get using my C program to test:
    000000: 01 E0 BB 00 00 15 00 E0 : BB 00 DD CC 88 68 48 41 .............hHA
    000010: 00 E0 BB 00 DD CC 80 B3 : 00 00 FF FF 00 02 00 01 ................
    000020: 01 00 38 3C FF 7F 7F 7F : 7F 7F 7F FF FF 7F 7F FF ..8<............
    000030: FF 7F 7F FF FF 7F 7F FF : 7F 7F 7F FF FF FF FF FE ................
    000040: FE FF FF FF FF 7F 7F 7F : 7F 7E 7E 7F 7F 7E 7E FF .........~~..~~.
    000050: 7F 7F 7F 7F FF 7F 7F 7F : 7F 7F 7F FF FF 7F 7E 7F ..............~.
    000060: 7F 7F 7E 7F 7F 7E 7F FF : FF 7F FF FF FE FF FF FE ..~..~..........
    000070: FF FF FF FF FF 7F 7F FF : FF 7F 7F FF FF FF FF FF ................
    000080: FF 7F 7F FF FF 7F 7F FF : FF 7F 7F FF FF 7F 7F FF ................
    000090: FF 7F 7F 7F FF 7F 7F 7F : 7F 7F 7F FF FF 7F 7F FF ................
    0000A0: FF 7F 7F 7F 7F 7E 7E 7F : 7F 7F FF FF FF FF FF FF .....~~.........
    0000B0: FF FF 7F FF FF 7F 7F FF : 7F 7F 7F FF FF 7E 7F FF .............~..
    0000C0: FF FF 7F FF FF 7F 7F FF : 7F 7F 7F FF FF 7F 7F FF ................
    0000D0: FF 7F 7F FF FF 7F 7F 7F : 7F 7F 7F FF FF FF FF FE ................
    0000E0: FE FF FF FF 00 01 : ................
    And here is what I get using LabVIEW to call the dll:
    0015 00E0 BB00 DDCC 8868 4841 00E0 BB00 DDCC 80B3 0000 FFFF 0002 0001 0100 9600 7F7F 7F7E 7F7F 7F7F 7F7F 7F7F 7F7F 7F00 B405 4300 3300 0000 0000 0000 01E0 BB00 0015 00E0 BB00 DDCC 8868 4841 00E0 BB00 DDCC 80B3 0000 FFFF 0002 0001 0100 9600 7F7F 7F7E 7F7F 7F7F 7F7F 7F7F 7F7F 7F00 F405 1B04 0C04 0000 0000 0000 8000 0000 0000 0000 0800 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    The first thing I notice is that the first 4 bytes are chopped off, and after about 50 bytes, the data is corrupted until the sequence starts to repeat, but this time it starts with the missing 4 bytes and still corrupts after about 55 bytes.
    I am expecting the data in LabVIEW to look very similar to the C data because the network packets I am grabbing are pretty consistant, only a couple bytes will vary between them, not the number I am seeing in LabVIEW.
    Another side effect I'm seeing is that I can only run my labVIEW code once, if I try running it again it crashes with failures such as:
    memory could not be "read"
    For reference, I am opening and closing the network adapter inside the read function of my dll, but the pointer seems like it should be intact...
    Attachments:
    zListAdapters.vi ‏30 KB
    listAdapters.dll ‏201 KB
    Reading.dll ‏213 KB

  • GETWA_NOT_ASSIGNED error while running abap prog in process chain

    Hi.
    I am getting a runtime error GETWA_NOT_ASSIGNED while running an ABAP program in process chain.
    But when i execute pro in SE38 , it's not giving any error.
    Please any one can suggets what will be error.

    Hi,
      i also used to get error for a program executed through process chain but when it is executed in se38 it used to work... that is because my program try to access a application server folder and reads the file from there... the authorisation to this is not proper through process chain ..... once authorisation to the folder was given properly .. i am able to run...
      Such things can happen in your case also... Try to analyse the dump in st22.... what happened ...
    Regards
    vamsi

  • Error "Error in ABAP statement when processing an internal table. table."

    Hello,
    I am facing the error when tried for GR from SRM portal for my shopping cart and for others created shopping cart. The error is
    "Error in ABAP statement when processing an internal table. table."
    I have the central receipient role. Couold any body assist me?
    Thanks,
    Pijush

    Hi Harish,
    Execute the query in RSRT and check whether you have any short dump is in ST22. This would give a clear idea at what might have gone wrong.
    Another thing is to check whether the code for the variable is fine in the user exit.
    Hope this helps.
    Bye
    Dinesh

  • Executing Abap Queries in Abap Code and processing the result

    Hi,
    I want to execute ABAP Queries (designed by sq01) in an abap report and processing the result in an internal table.
    How could it be work?
    Thanks a lot for your responses,
    with kind Regards
    Reinhold Strobl

    Hello,
    GO to SQ01 and select your query. Go to Menu QUERY-->More Functions->Display Report Name.
    You can then take that report name and go to SE38. Copy the code before END-OF_SELECTION and then modify as per your own requirements.
    Regrads
    Saket Sharma

  • Photoshop cs4 file/scripts/image processing settings

    I have recently started freelancing for a local newspaper, as you can imagine i could have up to 100 images to process at the end of the day.
    I started using file/scripts/image processing in photoshop cs4 to automaticly size my images. this is indeed fantastic instead of half an hour or sometime an hour it only takes 5 minutes...But... most newspaper print at 150dpi and the image processor does it automaticly at 72dpi, i need to change this setting to 150dpi in file/scripts/image processing (not to get mixed up with image/image size please).
    Can you help me please.
    Joey

    I think you got the answer elsewhere.
    Make an action to set the size and resolution and run that in the Image Processor or as a batch.

  • PowerShell script to find a string of characters in office documents in Doc Libraries and List Item attachments?

    Hi there,
    For SharePoint 2010 site - Does someone have the PowerShell script to find a string of characters in Office/Word/Excel/PDF documents in document libraries or the ones attached to List Items?
    Thanks so much in advance.

    Hi,
    According to your description, my understanding is that you want to find some specific string character in list items using PowerShell Command.
    $w = Get-SPWeb "http://devmy131"
    $l = $w.GetList("http://devmy131/lists/fieldslist");
    $i = $l.Items[0]["Title"].ToString();
    if ($i -like '*document*')
    Write-Host "Title contains document character" $i;
    More information:
    PowerShell -contains -like
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to integrate an ABAP program in process chain

    Hello Experts :
    I need to call an ABAP program in PROCESS CHAIN from a different system, using Process type "ABAP program", option "scheduled program".
    Sombebody have the step by step or some examples
    Regards,
    Diana

    If you search this forum for RSPC_ABAP_FINISH you will find some good answers such as:
    Start an ABAP program in R/3 from a process chain in BW

  • Call ABAP Program in Process Chain

    Dear BW Gurus,
    I need to call an Process chain which includes ABAP Program.
    The ABAP Program doesn't have the variants but it accepts the inputs from the user and sets into a YXXXX table.
    I am not getting how to proceed in this regard.
    Kindly guide.
    Best Regards,
    Harsh

    hi,
    chk these links below.. they contain the resolution for your query
    Call ABAP Program in Process Chain
    ABAP in Process Chains
    Also chk this relase which ia an entire guiding one to ABAP Program in Process Chain
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7

  • Document level scripting from process workflow

    Hi all,
    is there some way to add a "document level" script from process workflow in Livecycle Workbench?
    That is, I have a script i want to add to a pdf in my process workflow. How can I do that? Is there some service/function/script I can use to do that?
    I'd really appreciate any help.
    Thanks
    Alessio

    Not that I am aware of, could be wrong though

  • ABAP Units for process agents

    I am implementing ABAP Units for process agents.
    I am using abap unit framework for process agents for this.
    I am passing a variant xml with test data, this will create a BO structure, along with xml in the variant, i am also passing the expected bo structure(to be compared).
    But still it dumps...as it says unexpected fields!
    Guide me.
    Thanks a lot.

    Hi Pallavi,
        You can achive this using event based chains.
    1. Create 4 chains to load to 4 CUBEs.
    2. Schedule 4 chains based on 4 events(can create at SM62).
    3. Create an ABAP Program to raise events based on logic and  Create one more process chain and include ABAP program. and schedule this program daily.
    Logic is:
    Based on system data derive quater and correspondingly raise an event.
    <a href="http://sapbwneelam.blogspot.com/2007/09/how-to-start-process-chain-through.html">Sample - how to ... start process chain through an event</a>
    Hope it Helps
    Srini

  • ABAP Script value incorrectly reflected in ADOBE form interface.

    Hi ,
    I have an issue. In ABAP Script, the unit of measure value for VBDPL-VRKME is 'STK'. But it is printed as 'EA' in ADOBE form.
    Would you please suggest me an idea to fix this issue as I am new to SAP not much aware of fixing issues other than debugging.
    Best Regards

    Go to SE11 for table  VBDPL.  Find field VRKME and double-click the data element.  Then double-click the domain...MEINS.  You'll note that MEINS has the CONVERSION routine populated.   After you do a read on the database, call the conversion routine Function module (double-click the conversion field to get the name) to convert the database value to the display value.  This is what SAP programs do when there is a conversion routine...  In this case, you'll probably find that the EA is correct because 'EA' is likely the user-display value for database value STK.
    Edited by: BreakPoint on Oct 1, 2010 9:25 PM

  • Eliminating ###'s after hex reconversion to char string

    This is interesting.
    I was originally required to pass a segment to my subroutine. I had to do so using text literals. The   symbol is not recognizable by text literals. Therefore, I had to convert the entire string to hex.
    I then passed the hex segment to the subroutine, and reconverted it back to char string.
    After this I found a ton of unexpected # symbols in my segment. I tried doing a
    REPLACE '###' WITH '' INTO CHARSTRING.
    , but unsuccessfully. There is not much documentation on hex_to_char conversion, there are 2 FMs on 46, but I cannot get them to work. If anyone knows how to eliminate these unexpected # symbols please let me know.

    DATA: HEXSTRINGER(6000) TYPE 'X'.
    DATA: STRINGER(3000) TYPE 'C'.
    FIELD-SYMBOLS: <FSHEX>, <RECONVERT2>.
    CALL FUNCTION 'ARCHIVE_GET_NEXT_RECORD'
                   EXPORTING
                         ARCHIVE_HANDLE       = READ_HANDLE
                   IMPORTING
                         RECORD               = ARC_BUFFER-SEGMENT
                         RECORD_STRUCTURE     = ARC_BUFFER-RNAME
               MOVE ARC_BUFFER-SEGMENT TO SEGSTER.
               assign SEGSTER to <fsHEX> type 'X'.
               MOVE <fsHEX> to HEXSTRINGER.
    APPEND 'REPORT ZSUBR.' TO CODE.
    APPEND 'FORM DYN1 USING HEXSTRINGER.' TO CODE.
    APPEND 'DATA: SEGSTER2(3000) TYPE ''C''.' TO CODE.
    APPEND 'ASSIGN HEXSTRINGER TO <RECONVERT2> TYPE ''C'' .' TO CODE.
    APPEND 'MOVE <RECONVERT2> TO SEGSTER2.' TO CODE.
    APPEND 'WRITE:/ SEGSTER2.' TO CODE.
    APPEND 'ENDFORM.' TO CODE.
    I write out Segster2 and compare it to segster.
    I've done some variations of this where after I change the char string to hex string I replace 'C' with '7C' into hexstringer and then re-replace it in the subroutine, and then reconvert it to a char string- but actually I don't think that was a necessary step. I believe I can just convert it to hex, and then reconvert it back to hex in the subroutine.

  • ABAP SCRIPTS Examples Programs ,Screen shots ...i need?

    Hi to ALL
    hru?
    Friends
    i need ABAP SCRIPTS Examples Programs and screen shots those are most useful for me and pdf file.
    plz help to me send immid.
    Thanking U
    Murali

    Your imany nterview type questions have all been locked => please read [the rules|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting again.
    Many thanks,
    Julius

Maybe you are looking for

  • Problem with characters from SerialPort

    Hii!! My problem is: How to convert the characters of SerialPort ?? For example, I receive from SerialPort: sESB="U����U����U����+�&#154;&#131;�"DDDDDDDDDDDDDDDDDDZ#�&#142;fffffffffffffffffffffffffffffffffff�" my programa for convert is: public Stri

  • "Finding occurrences" error when editing .mxml file in Flash Builder 4.6 Premium (Trial)

    I am evaluating Flash Builder 4.6.  Windows 7 Ultimate x64 I am trying to go through the Flex in a week training series but I am getting a lot of the "Finding occurrences" errors when editing the mxml files. The error: An internal error occurred duri

  • How do I download 9.5 to install on a Mac with a slow Internet connection?

    Prior to Mavericks and the latest iLife apps, I was able to download installers from Apple support to install on an eligible Mac that has a slow (and tolled by usage) Internet connection. The new App store downloads and installs in one step such that

  • Another Palm TX turn on question

    For the last 2.5 years I have had a Palm TX.  Great product, but suddenly, about 2 weeks ago, it won't start.  It has been plugged into the charger for enough time for a full charge (1-2 days), and when I try a hard restart, the screen would start th

  • GRC UAR without ERM

    Hi Gurus,      In my client we are planning to go for UAR. Currently we are using CUP, RAR and SPM. We are not using ERM. In this case is it possible to go for UAR without ERM. Is it possible to implement UAR only for CUP. Please clarify us. Info: SA