Read table with syntax error

I would like to have this in my report in ABAP 7:
          READ TABLE ti_prococolos WITH KEY
                               protocol = lc_protocol
                               status    = 'abc'
                               status    = 'ced'.
But I receive the following error, when verifying the syntax:
Key field "STATUS" has been used more than once. This is not allowed .     
How can I solve this?
Thanks!

The READ statement is used to read a specific row of the internal table, in this case it appears that you are saying that you want a record if the STATUS is either abc or def.  You can't do that with the READ.  You would need to use the LOOP.
Loop at ti_prococolos where protocol = lc_protocal
                                    and ( status = 'abc' or status = 'ced' ).
* do what ever here, and EXIT after since you only want one row.
EXIT.
endloop.
Regards,
RIch Heilman

Similar Messages

  • Compiles a procedure with syntax error

    In the script tab, try to compile a procedure with syntax errors.
    The message displays procedure compiled !!!
    It should display that procedure compiled with errors.

    Hi Kris,
    I searched through the threads, but did not come across a similar question and that is why i raised the query. It'll be helpful if you could answer the query.
    regards,

  • Error reading table TOBJ - System Error when accessing Analysis of Change Requests

    Hi Experts,
    When I am trying to access Status Report or Processing time I get the following errors:
    Error reading Table TOBJ - system error, An error occurred when getting data from the
    processor and Log not found (in main memory).
    I am not sure how this table gets populated or how to check for inconsistencies.
    We have already checked the patch levels and they are on the same level for all environments.
    We never had these errors in our Dev and Qa environments. We recently got a new TREX environment, could that be causing any of these errors.
    Any ideas how to troubleshoot this problem?
    Thanks
    Riaan

    For info. The problem was revolved with 2 notes.
    1668882  and then apply the NWBC runtime 1963267.

  • Replacemnt for read table with key binary search

    as read table with
    READ TABLE gt_INT_CURR_VALUE into gs_int_curr_value
               WITH KEY gs_FS_EINA_KEY  BINARY SEARCH.
    the statement read tabel with key is absolute in ecc 6 so how to replace it .

    Hi subratt,
    internal tables with header lines are obsolete and in oo context (CLASS / METHOD code) forbidden.
    OK, you'd better use SORTED TABLE and FIELD-SYMBOLS to gt optimal code::
    READ TABLE gt_INT_CURR_VALUE into gs_int_curr_value
    WITH KEY gs_FS_EINA_KEY BINARY SEARCH.
    may be replaced with
    DATA:
      gt_INT_CURR_VALUE_SORTED LIKE SORTED TABLE OF  gs_int_curr_value
        WITH [NON-]UNIQUE KEY <fields of  gs_FS_EINA_KEY>.
    FIELD-SYMBOLS:
      <nt_curr_value> LIKE gs_int_curr_value.
    gt_INT_CURR_VALUE_SORTED = gt_INT_CURR_VALUE.
      READ TABLE gt_INT_CURR_VALUE_SORTED ASSIGNING <nt_curr_value>
        WITH TABLE KEY <key1> = gs_FS_EINA_KEY-<key1> ..  <keyn> = gs_FS_EINA_KEY-<keyn>.
    Regards,
    Clemens

  • Adobe reader met with unexpected error

    Hi all,
    I've been bombed with this problem for so long, I'd greatly appreciate it if anyone can give any suggestion. The problem is: My adobe reader 7.0.8 or 8.0 are constantly met with unexpected errors. It just doesn't work, I can't open any files with it. Did anyone have similar problems before? Is there any hidden files I have to delete before installing a newer version or something else?
    thanks!!

    Here are more details:
    I had adobe reader 6.0, the only version that was working on my mac, in my application library. I tried to upgrade it to version 8.0. I downloaded and installed adobe reader 8.0 alright, no problems there. But after installation was complete, the Reader restarted itself and crashed, showing me the message "The adobe reader met with unexpected error." and could not even function, not to mention opening any files. It happened with 7.0.8 before as well. I had no other way but to change it back to 6.0. But it's really bugging me because compared to the latest versions, 6.0 isn't really that good. So please help! thanks
    I'm using powerpc G4 ibook tiger 10.4.8

  • Read Table with Key in a Deep Structure

    Hello,
    I'd like to read a table while comparing a value in a deep structure.  So in the following code the key ID is a deep structure within cs_purchase_order_message-purchase_order-item-value.
    For some reason code check returns no errors with the following code, but I get a short dump with a syntax error on id-value when I execute the code.
    read table cs_purchase_order_message-purchase_order-item assigning <fs_xml_item> with key id-value = <fs_item>-number_int.
    How do I use "with key" when the value is in a deep structure?
    Thanks,
    Matt

    Refer to example link below:
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/read-deep-structure-736023.
    Regards,
    Venkat.

  • Field symbols and READ TABLE with system code 4

    Hi,
    I have a hashed table and I am using field symbols to point to it to retrieve the field content. I then use it in the READ TABLE statement in the following way:
    Loop at x_data assign <fs>.
    ASSIGN COMPONENT 'xxx' OF STRUCTURE <fs> TO <c1>.
    ASSIGN COMPONENT 'xxx' OF STRUCTURE <fs> TO <c2>.
    READ TABLE ZZZZ assign <fs> with table key a1 = <c1>
                                               a2 = <c2>.
    If sy-subrc = 0.
    endif.
    I ran the debugger and I keep getting a 4. I am not able to get the value from a1 and a2 to see what it is and why it is causing a 4 sy-subrc. I know the value from the hashed table and the values c1 and c2 are the same, so the sy-subrc should be 0.
    How would I read a hashed table using field symbols? I know that usig a standard table, I have to sort the table on the key fields() before I actually can do the READ TABLE using the binary search.
    Please advise. Thanks
    RT

    Hai Rob
    Go  through the following Code
    Field-Symbols are place holders for existing fields.
    A Field-Symbol does not physically reserve space for a field but points to a field, which is not known until run time of the program.
    Field-Symbols are like Pointers in Programming language ‘ C ‘.
    Syntax check is not effective.
    Syntax :
    Data : v1(4) value ‘abcd’.
    Field-symbols <fs>.
    Assign v1 to <fs>.
    Write:/ <fs>.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    FIELD-SYMBOLS <FS> LIKE LINE OF ITAB.
    DO 4 TIMES.
    LINE-COL1 = SY-INDEX.
    LINE-COL2 = SY-INDEX ** 2.
    APPEND LINE TO ITAB.
    ENDDO.
    READ TABLE ITAB WITH TABLE KEY COL1 = 2 ASSIGNING <FS>.
    <FS>-COL2 = 100.
    READ TABLE ITAB WITH TABLE KEY COL1 = 3 ASSIGNING <FS>.
    DELETE ITAB INDEX 3.
    IF <FS> IS ASSIGNED.
    WRITE '<FS> is assigned!'.
    ENDIF.
    LOOP AT ITAB ASSIGNING <FS>.
    WRITE: / <FS>-COL1, <FS>-COL2.
    ENDLOOP.
    The output is:
    1 1
    2 100
    4 16
    Thanks & regards
    Sreenivasulu P

  • BODS 4.2 Cannot import the metadata table, RFC_ABAP_INSTALL_AND_RUN syntax error

    Hi all, we installed BODS 4.2 server to substitute a 4.1, but we are facing the error:
    Error: Cannot import the metadata table <name=T001>
    RFC CallReceive error <Function /BODS/RFC_ABAP_INSTALL_AND_RUN: RFC_ABAP_RUNTIME_FAILURE -(Exception Key: Syntax error in program /BODS/SAPLBODS....
    We already tried the solution for when people get the error related to unicode.
    Also, we are able to pull data via extractors, it only fails when loading Tables....
    Any help is greatly appreciated.

    Dear,
    You will have to import the new ABAP Function Group "BODS/BODS".
    Here are some details:
    Installing Functions on the SAP Server
    SAP BusinessObjects Data Services provides functions that support the use of the ABAP, BAPI, and
    IDoc interfaces on SAP servers. You will need some or all of these functions in the normal operation
    of the software in an SAP environment. These functions perform such operations as dynamically loading
    and executing ABAP programs from Data Services, efficiently running preloaded ABAP programs,
    allowing for seamless metadata browsing and importing from SAP servers, and reporting the status of
    running jobs. Some of these functions read data from SAP NetWeaver BW sources.
    You must upload the provided functions to your SAP server in a production environment. It is
    recommended that you always upload the functions to your SAP server whether you are in a
    development, test, or production environment. The functions provide seamless integration between
    Data Services and SAP servers.
    The default installation places two function module files for SAP servers in the ...\Data
    Services\Admin\R3_Functions\transport directory. You then upload these files to SAP servers
    using the SAP Correction and Transport System (CTS) or manually. Using CTS allows for version
    control as the functions evolve across releases.
    The installation provides two versions of transport files (depending on the server version you are using)
    to install the functions on the SAP server. To obtain the names of the latest transport files for installing
    or upgrading these SAP server functions, see the readme.txt file
    And I've found those files and text files in the local install folder....in:
    Program Files\SAP BusinessObjects\Data Services\admin\R3_Functions
    (that's where I've installed it).
    There you'll find some descriptive txt as how to proceed.
    After installing, it might happen that the executing user is missing some authorizations.
    Here my authorizations team helped me by tracing the user and then adding the necessary rights.
    Sure hope this will help you.

  • Read Table with condition

    Hi,
    can i write a Read table like for example,
    read table itab into wa_itab with key matnr ne '4'.
    as its giving me an error.
    can suggest any other way to write the Read Table statement.
    Thanks in advance.
    Robert

    Hi,
    it is not possible.
    try this way..
    "delete the material which is not equal to 4 ..now itab contains values matnr ne4
    delete table itab where matnr ne '4'.
    or
    loop at itab into wa_itab wher matnr ne '4'.
    "move to another table
    endloop.
    or
    loop at itab into wa_itab .
    if wa_itab-matnr ne '4'.
    continue
    "move to another table
    else.
      delete itab index sy-tabix.
    endif.
    endloop.
    prabhudas

  • Read Table with key field - question

    Hi,
    Can you use the same key field more than once?
    For example:
      READ TABLE I_TVKWZ INTO I_TVKWZ_2 WITH KEY WERKS = '1004'
                                                                                    Werks = '1002'.
    I get an error when trying this.
    Is there an alternative?
    Thanks,
    John

    Hi John,
    try this:
    DATA: begin of itab occurs 0,
            werks like mseg-werks,
            i     type i,
          end   of itab.
    itab-werks = '1000'. itab-i = itab-i + 1. append itab.
    itab-werks = '1000'. itab-i = itab-i + 1. append itab.
    itab-werks = '2000'. itab-i = itab-i + 1. append itab.
    itab-werks = '3000'. itab-i = itab-i + 1. append itab.
    itab-werks = '5000'. itab-i = itab-i + 1. append itab.
    itab-werks = '5000'. itab-i = itab-i + 1. append itab.
    itab-werks = '7000'. itab-i = itab-i + 1. append itab.
    itab-werks = '7000'. itab-i = itab-i + 1. append itab.
    itab-werks = '9000'. itab-i = itab-i + 1. append itab.
    itab-werks = '9000'. itab-i = itab-i + 1. append itab.
    itab-werks = '9000'. itab-i = itab-i + 1. append itab.
    loop at itab where werks = '1000' or werks = '9000'.
    write: / itab-werks, itab-i.
    endloop.
    Regards, Dieter

  • Assistance with syntax error please

    this line of AS is giving me a syntax error and I cannot
    figure out the reason, requesting assistance please
    var mclListener.onLoadInit =
    function(target_mc:MovieClip):Void {
    target_mc.setMask(mask_mc);
    TIA

    thanks that resolved my error, but the script isn't working
    as expected. I am practicing from a book with AS 2.0 tutorials and
    this code is supposed to produce a mask from a movie clip over an
    image, but doesn't for me.
    I create a square on frame 1, make it a movie clip with the
    instance name of mask_mc and add this AS to frame 1.
    System.security.allowDomain.allowDomain("
    http://www.helpexamples.com");
    this.createEmptyMovieClip("img_mc", 10);
    mclListener.onLoadInit = function(target_mc:MovieClip):Void {
    target_mc.setMask(mask_mc);
    var my_mcl:MovieClipLoader = new MovieClipLoader();
    my_mcl .addListener(mclListener);
    my_mcl .loadClip("
    http://www.helpexamples.com/flash/images/image1.jpg",
    img_mc);
    my external jpg isn't getting masked by the MC....any
    ideas?

  • ICR: program FBICRC_GENERATE_CUST with syntax error

    Hi,
    in our Development system, the auto config program for ICR "FBICRC_GENERATE_CUST" is not working due to syntax error. It works in testsystem and productive system but not in development.
    Anyone experienced the same issue i.e. short dump when running FBICRC_GENERATE_CUST ?
    The following syntax error occurred in program "FBICRC_GENERATE_CUST " in
    include "FBICRC_GENERATE_CUST_F03 " in
    line 51:
    "The data object "LS_FBICRC01000" does not have a component called "HID"
    "E_DCURR"."
    Error analysis
        The following syntax error was found in the program FBICRC_GENERATE_CUST :
        "The data object "LS_FBICRC01000" does not have a component called "HID"
        "E_DCURR"."
    Thanks
    Stephane
    TRIUMPH ASIA

    HI  Eli,
    actually the problem only occurs after we implemented OSS note 1172591 with the SAP delievered transport P3EK049760
    So before having this transport: FBICRC_GENERATE_CUST  works fine
    AFTER the transport P3EK049760 contained in OSS note 1172591  -> syntax error.
    The field "hide_dcurr" is missing in table FBICRC01000
    Cheers
    Stephane

  • Xinitrc comes up with syntax error

    I was trying this setup for an xinitrc file:
    DEFAULT_SESSION=awesome
    case $1 in
    kde) exec startkde;;
    xfce4) exec startxfce4;;
    wmaker) exec wmaker;;
    blackbox) exec blackbox;;
    awesome) exec awesome;;
    openbox) exec openbox;;
    musca) exec musca;;
    wmii) exec wmii;;
    enlightenment) exec e16;;
    ratpoison) exec ratpoison;;
    etoile) exec etoile;;
    compiz) exec compiz;;
    ) exec $DEFAULT_SESSION
    *) exec $1;;
    esac
    Seems like it should work right? Well I guess Bash doesn't like the null case, and throws it out as a syntax error. Anyone know of a way around this?
    The reason I wanted to do this is because sometimes I'll just want to add a WM to /etc/slim.conf just to test it out.

    http://tldp.org/LDP/Bash-Beginners-Guid … 07_03.html
    Each case is an expression matching a pattern. The commands in the COMMAND-LIST for the first match are executed. The "|" symbol is used for separating multiple patterns, and the ")" operator terminates a pattern list. Each case plus its according commands are called a clause. Each clause must be terminated with ";;". Each case statement is ended with the esac statement.

  • StartupItem with syntax error (sh script)

    I'm comfy on the cli but still green with scripting it. I've followed the Apple tut on making a StartupItem, but I am getting simple (I hope) sh syntax errors when I run it. The three *Service functions are required, as they're called by the RunService function (from the sourced rc.common script) ... all per the Apple tutorial.
    In any case, the error I get is:
    line 7: syntax error near unexpected token `}'
    /Library/StartupItems/blah/blah: line 7: `}'
    The complaint is about the bracing earlier in execution than the 'tricky' stuff. I hope that suggests the problem is here and not in my Boot.bash script. I'll post that too if, as I'm noticing with scripting, the complaints about eofs and bracing and such are not where the real problem lies. I'm a bash person though so, especially if this is just an sh syntax misuse, feel free to give me what for.
    Any thoughts, fixes, or straight advice appreciated,
    Joel
    #!/bin/sh
    . /etc/rc.common
    StopService() {
    # nothing to kill
    RestartService() {
    StopService
    StartService
    StartService() {
    /bin/bash /Library/Management/Boot.bash
    RunService "$1"

    Hi Joel,
       I've actually read a scripting guide that recommends defining functions with the "function" keyword and the norm is to put a space before and after the "()". However, your syntax is valid. In fact I see no errors at all; the script should work.
       Thus, the problem is most likely something invisible. It's time to investigate the text editor you used to create the script. You should open the script in a UNIX text editor, like vim, and look for hidden characters or Mac line endings. An even better solution might be to get the free text editor TextWrangler, (or BBEdit if you have it) open the file and set it to show invisible characters. It will also tell you what kind of line endings are used in the file. You might also post a long listing of the StartupItem script.
    Gary
    ~~~~
       He's just a politician trying to save both his faces...

  • GPIB read/wrire cause syntax error in HP 8341 sweeper

    I am using GPIB write/read/recieve function to communicate with HP 8341B synthesized sweeper through HP 8757A saclar network analyzer.
    Somtimes it works. Sometimes it always shows HP-IB syntax error on the 8341B indicator. Then the program is hold. why?
    Wei Tong

    Yes, you right. The VISA doesn't work yet.
    It puzzled me.
    Two months ago, the program worked very well.
    Now I use it again, it gives problem.  It seems nothing changed. (computer, system, instruments, programs  are the same as before.)
    Attached please check the program library. The main program is "scanFreq_NetAnalyzer.vi", others are SubVI called by this VI.
    This program is to aquire a trace of data from Analyzer. Often, the errors happens when subvi "get trace parmtrs-Tong.vi" running.
    Sometimes, the data is still acquired even the error happens.  Most of times, nothing obtained.
    Attachments:
    scanFreq_NetAnalyzer.llb ‏180 KB

Maybe you are looking for

  • Application Category view in Finder

    I rather like the Application category view in Finder but it is not currently of much use because so many of my applications fall into the 'Other' category. I assume this is an attribute of the file and can be found and changed somehow. Does anyone k

  • SUBTOTAL TEXT IN ALV GRID

    HI ALL, could any one  send me how to display the subtotal Text  in ALV grid output with code sample. with thanks. kannan

  • Best Flat Screen Monitor for G4 and iMovie?

    Since spending so many hours in front of the computer monitor editing my iMovie project, I have developed serious neck, shoulder, and arm pain and my back doesn't feel so great either. I feel this is directly related to the angle of my monitor and th

  • How to make a key in OM Custom infotype

    Hello everyone,                     I have created the custom infotype in OM. I need to make one of the field in include HRI9xxx as Key field. Is any one know how to do this.

  • Where Can I Point My Bus Areas, folders, etc.

    I haven't gotten fancy on pointing folders to different database and schemas before, so let me ask a question on what I think I can do. Can I have a folder in a business area point to database D1, schema S1, database view V1 and another folder in a b