ABAP String processing using normal methods

I have a string like this:
A:12345;B:34324;C:443232;
Question 1)
How do I extract B:34324 from the above string?
Note: I can only use methods provided in ABAP programming (BC-ABA) such as split, CO, CA,etc
Question 2)
How do I know how many ';' characters the string contains?
Question 3)
How do I know the position of "B:" in the string?
Please help.
Thanks and best regards,

Hi,
Question 3)
How do I know the position of "B:" in the string?
Check this
DATA a TYPE string value  'A:12345;B:34324;C:443232'.
DATA c TYPE i.
DATA d TYPE c.
DATA e TYPE i VALUE 0.
DATA f TYPE i VALUE 0.
c = STRLEN( a ).
DO c TIMES.
  d = a+e(1).
  e = e + 1.
  f = f + 1.
  IF d EQ 'B'.
    EXIT.
  ENDIF.
ENDDO.
WRITE f.
Thanks

Similar Messages

  • System copy for ABAP+JAVA system using SAPINST method

    Dear support,
    We have recently upgraded to ECC 6.0 system and we have been still doing system copy by using backup and restore method. I know its<b> wrong</b>.
    which involves below steps , this old methos works fine for ABAP engine and evreything looks ok.But java engine will not work.
    So we need to use SAPINST method as described in note 785848 and system copy guide available on OSS. But i am really not able to understand sequence
    for tasks to be carried out in this SAPINST method.
    <b>Can anybody list few sequence along with step by step procedure as i mentioned below for old system copy procedure.</b>
    Is it really difficult to make that for <b>SAPINST</b>  as everybody says refer to standard guide and note ?
    Anybody if possible can make the same way as i did below , i think it would rather be small as far as my understanding after reading those docs.
    Simple old system copy procedure works for ABAP is as:
    Run the following command on source system.
    a. Login as <sid>adm
    b. svrmgrl
    c. connect internal
    d. alter database backup controlfile to trace;
    e. exit;
    f. Above command will generate a .trc file in /oracle/P01/saptrance/usertrace directory.
    g. Copy the text from CREATE CONTROLFILE until the ( and paste it in to any new .sql or controlfile.sql file.
    h. Copy the controlfile.sql to target system.
    i. Edit the file and replace the entire source SID to target SID.
    j. Edit the reuse database command with the set database command
    Copy the aft generated during the backup file from the source system to target system. (/oracle/<SID>/sapbackup)
    a. Change all the source <SID> to target <SID>.
    b. Only don't change the backup volume name it must be target system <SID>.
    c. Copy the above aft file name line from the source back<SID>.log to target<SID>.log file.
    5. Shutdown the target server instance.
    6. From this onwards all the command on the target system only.
    a. Login as <SID>adm
    b. run the SAPDBA
    c. select J (Restore/Recovery)
    d. select B (Full restore and recovery)
    e. select A (Select backup of type)
    f. Select the offline backup which you want to restore.
    g. It will take some time to restore.
    h. Once the database is restored login as <SID>adm and run the
    i. svrmgrl
    j. connect internal;
    k. startup nomount (if the database is already mounted shutdown it using the shutdown command)
    l. run the following command
    m. @controlfile.sql (file name of the control file contains the CREATE CONTROLFILE statement)
    n. After the run the above command it should give the "Statement Processed)
    o. alter database open resetlogs.
    I am really looking forward to see anybody take some time out to prepare this kind of step by step procedure.
    It would be of greate help for all of us for performing system copy with sapinst method.
    Looking forward for your support.
    Best Regards,
    AjitR

    Hi,
    As per the guide you need to do source system Technical Preparations, in that running the export preparation is also one. You need to run this first before you start the export, if and only if export will successful if preparation is successful.
    Yes you need to create the export directory to take the export copy of source system, it may be any where in your server. It should be having 6 to 8 GB free space.No need to create the export directory in target system, after export is completed in the source system you copy the export directory to the target system.
    <b>Target system</b>
    Yes you need to take the back up file system and delete all the contents of the directory.
    Yes it can be considered as fresh system installation but copy of source system.
    Yes the process follows after you giving the export directory path .
    Next screen you will get the database drop and recreate screen chouse the drop and recreate method
    Next J2EE user name and password
    Next DDIC password
    Next you have to give kernel and oracle client dvd path
    Next Parameter checking screen here if you are selected database drop and recreate you have to revise the oracle database system option
    If you are selecting review next screen is database advance option you have to select the advanced option
    Next you have to select following option to recreate
    1 Sapdata directory mapping
    2 Database instance file system
    3 Create database parameter
    4 Create tablespace
    Next screen sapdata directory creating
    Next screen you can just click next no need to change any setting
    Next table creation
    Next screen specify oracle instance directories
    Next again parameter checking and last this is last screen
    Next will be the execution screen
    Reward points if usefull

  • ABAP List Faxing using BCS  method ( Business communication service )

    Experts,
    I have a requirement where we are faxing the ABAP list as it gets generated .
    I am using NEW-PRINT ON and NEW-PRINT OFF , to get the ABAP list in a spool request , and then  get the spool contents using function module : 'RSPO_RETURN_SPOOLJOB'
    I then use  Class / methods provided by Business communication service  , such as :
    cl_cam_address_bcs=>create_fax_address  ,to send this spool content to Fax gateway  .
    My fax goes , but the fax output  list is in X_65_255  format,  whereas i want the fax output to be in X_65_132 ..
    My  REPORT  statement does have X_65_132  as line count / line size BUT somehow the  Fax output does not take this list format  .. ANY IDEA's ????
    Would appreciate your reply .
    Ashutosh

    Naimesh,
    I have passed page format  X_65_132  in GET_PRINT_PARAMETERS ,  in export paramter ' Layout '  ... See code below :
    write a list into spool
      call function 'GET_PRINT_PARAMETERS'
        exporting
          line_count = sy-linct
          line_size  = sy-linsz
          layout     = 'X_65_132'   <<< Page format
          mode       = 'BATCH'
          immediately = ' '
          list_text   = htext_spool
          list_name   = 'ZV46 FAX'
          no_dialog   = 'X'
        importing
          out_parameters         = print_parameters
          valid                  = valid
        exceptions
          archive_info_not_found = 1 .
    BUT still  the fax coming out of our fax machine is compressed  because i believe the outgoing fax is using  page format  X_65_255 .
    Any idea why ????
    Would appreciate your reply .
    Ashutosh

  • Problem in Storing ByteArray(Value) with String (Key) using put method

    Hello Folks:
    I wish to store a byte array with associated with a String. For this I use the put method in Java which stores put(Object key, Object value). I have written a piece of code which works but I am not able to understand it. Its not outputing what I want but something else.
    I guess, I have some ignorance.
    When I compile using
    $javac testing.java propsput.java
    $java testing
    I get the following output.
    Bytes Array:[B@1372a1a
    I understand that B stands for Bytes array. Also, If I change the String I get the same thing. If I modify the code for Integer array
    and store some Integer array I get [I@1372a1a.
    I fail to understand why I am getting this 1372a1a again and again.
    Instead where is my array.
    May be I am not using the method getValue correctly.
    Thank You very much for your help
    Regards
    //testing.java
    import java.io.*;
    import java.util.*;
    public class testing{
    public static void main(String args[]){
    propsput headers=new propsput();
    String s="Let me See how you do it";
    byte buf[]=s.getBytes();
    headers.put("Bytes Array",buf);
    //propsput.java
    import java.util.*;
    import java.io.*;
    public class propsput{
    public void put (String key, byte[] value) throws IllegalArgumentException{
    HashMap _props =new HashMap();
    _props.put(key, value);
    Set set =_props.entrySet();
    Iterator i=set.iterator();
    while(i.hasNext())
    Map.Entry me=(Map.Entry) i.next();
    System.out.print(me.getKey()+":");
    System.out.println(me.getValue());
    ----------------------------------------------------------------

    Hi Thanks for your help.
    But I have included your method in the propsput class and also using it like this in the propsput class.
    while(i.hasNext())
    Map.Entry me=(Map.Entry) i.next();
    System.out.print(me.getKey()+":");
    byte a[]=me.getValue();
    showBytes(a);
    But while compiling with javac I get the following error:
    propsput.java:24: incompatible types
    found : java.lang.Object
    required: byte[]
    byte a[]=me.getValue();
    Please let me know how should I use it so as to print my String.
    Well, its still not clear in the previous code (my First Message) that why I am gettinng "1372a1a" everytime. (Even if I change the String. When I change the array to be an Integer array I get [I@1372a1a )
    Othewise in the case of Strings I get ( [B@1372a1a)
    Bytes Array:[B@1372a1a
    Thanks and Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to stop specific query attached with other query in same process using With method

    Would it be possible to stop one query out of two queries attached to single process...because i see it is returning one IDisposable inteface...if i call dispose() method...two queries are stopped/killed...
    So how to stop specific query which is combined with other queries in a  same process at runtime i.e., attach or detach kind of thing?
    Thanks in advance
    Satish

    Yes, the overloading of the term "Process" can be confusing. In SI, depending on your edition of StreamInsight, a process can run on one or more threads from a pool of threads and are scheduled together. Don't think of a process necessarily as a single
    thread or multiple processes as a method of multi-threading.
    As for a limit on the number of queries, there isn't a hard limit that I'm aware of. However, there will be a practical limit that will vary based on the complexity of the query, the event rate and your hardware (# of cores). If you are using Standard Edition,
    this limit is much smaller as you only have a single scheduler thread. With Premium Edition, you have a scheduler thread for each core on the machine so you can get higher throughput and lower latency. But if you have, say, 4 cores on the machine (don't count
    hyperthreaded cores, just real cores), 100 queries and a target throughput of 100K events/second, you'll likely have some problems. At 1K events/sec, you'd likely be fine though. With 32 cores and Premium Edition, you'd probably be OK with 100K events/sec.
    So ... like I said, it depends.
    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)
    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

  • Help! PowerBook G4 will not shut down using normal methods!

    Recently, my PowerBook G4 Aluminum (1.5/1.67 GHz) will not shut down. It has recently started doing this. When I choose any of the shut down, restart, log out items in the  (apple) menu, it will not bring up a dialog. Same with pushing power button. I have to do sudo reboot in the Terminal to make it shut off, or otherwise I can just hold the power button. Tried resetting PRAM. Recently downloaded a few apps. Can anyone help?
    -The Mac Bot

    It's been a long time since I've revisited this...
    Reinstalled OS due to main account getting corrupted. Could not log in.
    That did not resolve the corrupted account, so I booted up with command-S and issued a few commands to reset and force the Setup Assistant to run. That worked, allowed me to login and start fresh.
    That did not solve the not shutting down problem.
    I am able to "lock" the system (using MacLoc) and shut down from the login window.
    Or if I have Fast User Switching enabled I can choose "Login Window..." from the menu, and shut down from there.
    A long time ago, I edited a few .nib files inside /System/Library/CoreServices/loginwindow/Contents/Resources.
    A reinstall replaced those files with the originals.
    Still cannot shut down by pressing power button and clicking Shut Down, or choosing log out, shut down, or restart from the apple menu.
    Important clue: If I press Shift-Command-Q (the log out hotkey) the window I am working with dims as if another window popped up, but no other window popped up.

  • Spawn a java process using runtime.exec() method

    Hi,
    This is my first post in this forum. I have a small problem. I am trying to spawn a java process using Runtime.getRuntime().exec() method in Solaris. However, there is no result in this check the follwoing program.
    /* Program Starts here */
    import java.io.*;
    public class Test {
    public static void main(String args[]) {
    String cmd[] = {"java", "-version"};
    Runtime runtime = Runtime.getRuntime();
    try{
    Process proc = runtime.exec(cmd);
    }catch(Exception ioException){
    ioException.printStackTrace();
    /* Program ends here */
    There is neither any exception nor any result.
    The result I am expecting is it should print the following:
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
    Please help me out in this regard
    Thanks in advance
    Chotu.

    Yes your right. It is proc.getInputStream() or proc.getErrorStream(). That is what I get for trying to use my memory instead of looking it up. Though hopefully the OP would have seen the return type of the other methods and figured it out.

  • Dynamic configuration in integration process using abap mapping

    Hi everybody,
    i have the following scenario:
    file adapter -> integration process -> file adapter
    The integration process uses an ABAP mapping and sets the filename in dynamic configuration as follows:
    *-- Set Parameter
        clear ls_dyn_record.
        ls_dyn_record-name      = gc_dyn_config_name.
        ls_dyn_record-namespace = gc_dyn_config_ns.
        ls_dyn_record-value     = <new_file_name>
    *-- Write configuration
        ir_dyn_config->add_record( ls_dyn_record ).
    But now the new filename is not reflected in the file adapter (receiver). In the integration monitor (SXMB_MONI) i still find the old filename.
    Whats wrong?
    Elko

    The ABAP mapping is more complex, setting filename in Dyn. Conf. is just one step in mapping.
    If I check the Workflow protocol of the Integration Process, I find the following in the Trace of the ABAP-Mapping:
    The filename has been set to 3233340.SWNF00HW.P10I. The Suffix P10I has been added in the ABAP mapping.
    When I check the subsequent message in SXMB_MONI I find:
    The added suffix is missing in the filename !!
    Elko

  • How to print a string with out using main method??

    how to print a string with out using main method??
    if we can tell me with example?
    thanks in adavance
    raja

    Hi,
    actually there's none. The UITableView class needs to "know" the tableView's height so either it can calc <number of rows> times <row height> or it has to sum the height of each single row.
    If the row which needs to be of different size always is the first or the last row you can user a tableHeader or tableFoot view.
    Regards
    Dirk

  • What is the use of passing String[] args in main() method?

    what is the use of passing String[] args in main() method?
    Is there any specific use for this ?

    actually my sir asked me the same question & I gave
    the same reply as given by you........but he further
    asked what is the use of this also??
    ie accepting cmd line args at runtime??is there any
    specific purpose ??Apart from the one you just mentioned? No

  • How to use set_encoding method to set encoding in ABAP Mapping

    Hi All,
      Can anyone please let me know how to use set_encoding method in ABAP Mapping to set encoding.
      Any help would be greatly appreciable.
    Regards,
    Dinakar

    Hi Stefan,
    Thanks for your info. Let me try in ABAP Forum.
    Regards,
    Dinakar

  • Invoking a batch processing using ABAP proxy

    Hi guys,
    I need to develop a scenario where in the target a proxy starts a function module (or ?), but I need to run this function module then in a separate "thread", so the proxy processing would be finished. You know what I mean? Is it possible somehow?
    Thank you, Andrzej

    Hi Andrzej,
    You can Call the Function using Tasks in the ABAP Proxy.
    See:
    [http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPparallelprocessingusingRFC]
    [http://wiki.sdn.sap.com/wiki/display/Snippets/Easilyimplementparallelprocessinginonlineandbatchprocessing]
    [http://wiki.sdn.sap.com/wiki/display/ABAP/Parallel+Processing]
    Best Regards.

  • Dynamic parallel processing of the same object using asynchronous method

    Hi,
    Please can anyone help me?
    I have to send the same DMS document to several agents for parallel processing. The number of agents is not known until runtime. Each of them should process the document and at least change the status of it. In next step I check if he has changed it.
    I use dynamic parallel processing of subworkflows. Key task of this subworkflow uses standard method of object DRAW - DOCUMENT.EDIT  (standard transaction CV02N) which is asynchronous. The task is finished by event DOCUMENT.CHANGED. 
    During the parallel processing the appropriate number of workitems is generated. However, when the agent who processes the document as first completes his workitem the event DOCUMENT.CHANGED is generated and all parallel workitems are completed, even those of other agents that were not processed yet.
    Any help would be appreciated.
    Thanks.
    Eva Vahalova

    Hi all,
    The process is used to approve incoming invoices. Each scanned invoice is attached to a DMS document and than sent to one or several agents in parallel. People from several departments can approve the same invoice for instance energy or mobile phone costs. We have no HR module fully implemented. Each agent may write some remarks and has to sets the document status to either approved or rejected. This status is temporary therefore the others see the original status for approving.
    The process of incoming invoices was implemented by SAP consultants in 2003 on 4.6B and now runs on our 4.7 system.  Now new company was established running on a new SAP system ECC 6.0 and our accountant department and some agents will deal with invoices in both systems. Therefore, the process should appear the same or at least very similar. The majority of the old process was realized by programming while I would like to use workflow features that are available now and reduce the programming part.
    As I see, I will have to choose one of the solutions that Arghadip suggested.
    I wonder if there is a possibility to use asynchronous method and control the end of each work item by means of u201CComplete Work Itemu201D or u201CComplete executionu201D Conditions. I have never used them and I do not know how they work and what condition to use. Maybe program exit might be used as well. While controlling the agents I think I will have to do some programming anyway because the work item can be finished by a substitute too.
    Thanks for your help.
    Eva

  • I do not achieveto transfer the files from my PC using the W.M.A. The whole process is normal up to the point where every machine must recognize the numerical code. After that indicates that he is inspecting the computer and no more. Sugerences?

    I do not achieve to transfer the files from my PC using the W.M.A. The whole process is normal up to the point where every machine must recognize the numerical code. After that the assistant indicates that he is inspecting the computer and not show the list of transference (files, emails, etc.). In this point nothing is parked and done any more. Which can be the problem? Thank you.

    I think you posted to the wrong place.  This if for iMacs 2006 & older.  I asked the host to mover you to Lion.
    What version of X are you running?
    Here is how to find out what version of Mac OS you are running:
    Click on the blue apple in the upper left hand of the screen.
    click on this icon
    Click on the first line, "About This Mac"
    Most of these are numbers & that's what we want.
    What version & Processor do you have?

  • Back ground process using abap program

    Hi,
    How to create background process using job_open,Job_submit,job_close function modules

    DATA: lv_job_name         LIKE tbtco-jobname,
    lv_job_nr           LIKE tbtco-jobcount,
    lv_job_released     TYPE c,
    lv_job_start_sofort TYPE c,
    lv_print_parameters TYPE pri_params.
    lv_job_name = 'Z_BGPROGRAM'.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname          = lv_job_name
        IMPORTING
          jobcount         = lv_job_nr
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 4.
      IF syst-subrc = 0.
    " submit job with all the selection screen params...
        SUBMIT (lv_job_name)
            WITH applfile = applfile " these are the parameters of the background program
            WITH p_lines = p_lines
            USER syst-uname " you must use this
           VIA JOB lv_job_name NUMBER lv_job_nr AND RETURN.
        IF sy-subrc = 0.
          CALL FUNCTION 'JOB_CLOSE'
            EXPORTING
              jobcount             = lv_job_nr
              jobname              = lv_job_name
              strtimmed            = 'X'
            IMPORTING
              job_was_released     = lv_job_released
            EXCEPTIONS
              cant_start_immediate = 1
              invalid_startdate    = 2
              jobname_missing      = 3
              job_close_failed     = 4
              job_nosteps          = 5
              job_notex            = 6
              lock_failed          = 7
              OTHERS               = 8.
          IF syst-subrc <> 0.
            MESSAGE i162(00) WITH
            'An error occured while closing the background job.'.
            STOP.
          ENDIF.
        ENDIF.
      ENDIF.
      SKIP 1.
      WRITE: / 'Background process', lv_job_name , 'called successfully' NO-GAP.
      WRITE: / 'You can check the job in transaction SM37'.

Maybe you are looking for

  • How to find all the tables associated for a particular transaction

    Hi- May I know how to find all the tables, related(foreign key) tables for a transaction within SAP GUI? Up to my technical knowledge, this can be achieved by looking database diagrams from DB level. But that would be for entire database as a whole.

  • Fill IDOC segment, E1IDBW1. For PEXR2002 Basic Type

    Hello Team. We send the IDOC for the Basic Type PEXR2002, Message Type PAYEXT. This IDOC doesn't fill the Segment E1IDBW1 (IDoc header - special instructions (INP) ) I'm review some notes(1164524) and said to fill this segment it's neccesarie config

  • Cursor drag pop up info-nothing comes up without clicking

    Okay, so my problem is not major, but annoying and I don't know how to take care of it. Hopefully someone can help. When I drag the cursor over something, for example the hidden dock, it doesn't do anything unless you click, the dock doesn't pop up,

  • Unable to change NLS_TIMEZONE_FORMAT

    The only place I can get the NLS_TIMEZONE_FORMAT to change is in SQLPlus. I created a PFile from my SPFile and added this line: *.NLS_TIMEZONE_FORMAT='YYYY-MM-DD HH24:MI:SS' Then created a new spfile from the pfile with that line. It appears in the s

  • 'Optical out' audio drop out on Mac Book Pro

    This is driving me INSANE! First of all I'll give you my mac book pro details: Mid/late 2010 MBP 2.66 i7 with 8GB RAM, on snow leopard 10.6.8 Here's the problem. Basically, my audio keeps dropping out. Upon a bit of research I can see the output devi