LOOP and Read statements

Hi abapers,
                    I want to know the difference between statements.
SELECT MATNR MAKTX FROM MAKT INTO TABLE IT_MAKT.
SELECT EBELN EBELP ... ..... ..... FROM EKPO INTO IT_EKPO WHERE MATNR = IT_MAKT-MATNR.
1st statement
LOOP AT IT_MAKT INTO WA_MAKT.
READ TABLE IT_EKPO INTO WA_EKPO WITH KEY MATNR = IT_MAKT-MATNR.
2ND Statement
LOOP AT IT_EKPO INTO WA_EKPO.
READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR  = IT_EKPO-MATNR.
Frnds , can anyone please help me to understand the exact difference between the above statements.
Thanks,
satish

Hi,
SELECT MATNR MAKTX FROM MAKT INTO TABLE IT_MAKT.
collects matnr and maktx form makt and stores in it_makt
SELECT EBELN EBELP ... ..... ..... FROM EKPO INTO IT_EKPO WHERE MATNR = IT_MAKT-MATNR.
endselect.
selects ebeln and ebelp from  ekpo and stores in it_ekpo
1st statement
LOOP AT IT_MAKT INTO WA_MAKT.
READ TABLE IT_EKPO INTO WA_EKPO WITH KEY MATNR = IT_MAKT-MATNR.
endloop.
looping at it_makt compares matnr from it_makt with it_ekpo. reads and stores in work area wa_makt with primary key as index
2ND Statement
LOOP AT IT_EKPO INTO WA_EKPO.
READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR = IT_EKPO-MATNR.
endloop.
looping at it_ekpo compares matnr from it_makt with it_ekpo . reads and stores in work area wa_ekpo with primary key as index
regards

Similar Messages

  • How to loop and read repeating table data of infoPath form in Visual studio workflow.

    Hi,
    I am trying to read info Path form repeating table data in Visual studio workflow.
    could anyone elaborate me in brief how to loop through repeating table and read all rows value one by one in workflow.
    any help would be more then welcome. 
    Thanks...

    Hi Rohan,
    According to your description, my understanding is that you want to create a Visual Studio workflow to get data from info path repeating table.
    I suggest you can submit Repeating Table to a SharePoint List and then you can create a .NET workflow to read data from the SharePoint List.
    Here are some detailed articles for your reference:
    Codeless submitting InfoPath repeating table to a SharePoint list
    Create a Workflow using Visual Studio 2010
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Nested loops and if statements

    I have four schemas with a problem category table "gppcat" that
    has problem categories and problem descriptions. I need to
    output these categories and descriptions to a csv file. while
    doing this I need to make sure I don't include duplicate
    records. I use schema 1 as a system of record. I want to select
    pcode "category" from schema 1 and loop through to compare each
    record in the other schemas and write each unique record once to
    the file. I have included the code I am writing. I son't have
    much experience in PL/SQL, I usually write in ABAP or Java so
    the looping and if logic may seem incongruent as I have never
    implemented this in PL/SQL before. Thanks in advance, all the
    answers I have gotten fomr this forum have been great.
    CURSOR C1
    IS
    SELECT PCODE, PDESC FROM gpcomp1.gppcat;
    CURSOR C2
    IS
    SELECT PCODE, PDESC FROM gpcomp2.gppcat;
    CURSOR C3
    IS
    SELECT PCODE, PDESC FROM gpcomp3.gppcat;
    CURSOR C4
    IS
    SELECT PCODE, PDESC FROM gpcomp4.gppcat;
    -- error handling routine. we will handle all file access errors
    -- and data access errors in this procedure err_processing
    PROCEDURE err_processing (p_errFileHandle UTL_FILE.FILE_TYPE,
    p_lineNum PLS_INTEGER,
    p_errText VARCHAR2)
    IS
    BEGIN
    lv_errorFile := UTL_FILE.FOPEN(p_errDir,p_errFile,'W');
    UTL_FILE.PUT_LINE( lv_errorFile, lv_initErrorLog );
    UTL_FILE.FFLUSH(lv_errorFile);
    UTL_FILE.FCLOSE(lv_errorFile);
    UTL_FILE.FCLOSE_ALL;
    END err_processing;
    -- Retreive data into cursors
    BEGIN
    catFileHandle := UTL_FILE.FOPEN(p_dirName,p_fileName,'W');
    Here we need to loop through 4 companies and write all Problem
    Codes (pcode) and
    Problem Descriptions (pdesc) without writing duplicates. In this
    case we are using
    the same logic in the old extract by using the US company as the
    driving table.
    We compare the pcode, record by record in eanch 4 companies.
    When we find a unique
    record we write it to the file.
    FOR catLine1 IN C1
    LOOP
         FOR catLine2 IN C2
         LOOP
         IF catLine2.pcode = catLine1.pcode THEN
         writeLine:= (catLine1.pcode) || ',' ||
    (catLine1.pdesc);
              UTL_FILE.PUT_LINE( catFileHandle, writeLine );
         ELSE
         writeLine:= (catLine2.pcode) || ',' ||
    (catLine2.pdesc);
              UTL_FILE.PUT_LINE( catFileHandle, writeLine );
         END IF;
         END LOOP;
         FOR catLine3 IN C3
         LOOP
         IF catline3.pcode = catLine1.pcode THEN
         writeLine:= (catLine1.pcode) || ',' ||
    (catLine1.pdesc);
              UTL_FILE.PUT_LINE( catFileHandle, writeLine );
         ELSE
         writeLine:= (catLine3.pcode) || ',' ||
    (catLine3.pdesc);
              UTL_FILE.PUT_LINE( catFileHandle, writeLine );
         END IF;
         END LOOP;
         FOR catLine4 IN C4
         LOOP
         IF catline4.pcode = catLine1.pcode THEN
         writeLine:= (catLine1.pcode) || ',' ||
    (catLine1.pdesc);
              UTL_FILE.PUT_LINE( catFileHandle, writeLine );
         ELSE
         writeLine:= (catLine4.pcode) || ',' ||
    (catLine4.pdesc);
              UTL_FILE.PUT_LINE( catFileHandle, writeLine );
         END IF;
         END LOOP;
         EXIT WHEN C1%NOTFOUND;
         UTL_FILE.PUT_LINE( catFileHandle, writeLine );
    END LOOP;
    UTL_FILE.FFLUSH(catFileHandle);
    UTL_FILE.FCLOSE(catFileHandle);
    Thanks again.
    -Pat

    The easiest way of doing this is to use the UNION operator.
    You just have one cursor, viz:
    CURSOR C1
    IS
    SELECT PCODE, PDESC FROM gpcomp1.gppcat
    UNION
    SELECT PCODE, PDESC FROM gpcomp2.gppcat
    UNION
    SELECT PCODE, PDESC FROM gpcomp3.gppcat
    UNION
    SELECT PCODE, PDESC FROM gpcomp4.gppcat;
    This will return only unique rows (to get duplicates you use
    UNION ALL). Then you can use a single CURSOR LOOP structure to
    write out the result set:
    FOR lrec IN C! loop
    utl_file.put_line(C1.pcode);
    END LOOP;
    HTH, APC

  • Loop and read issue

    Hi Experts
    I am trying to do basically as shown below
    LOOP AT T_EDID4 INTO WA_EDID4 WHERE DOCNUM = T_EDIDC-DOCNUM .
    READ TABLE T_EDID4 WITH KEY DOCNUM = T_EDIDC-DOCNUM
                                SEGNAM = 'E1KNVVM'
    if sy-subrc eq 0 .
    endif.
    endlloop.
    If there are more than 1 E1KNVVM for idoc number , how can i make sure not to read the segnam which has already been read

    Sanju,
      While extracting the  data into T_EDID4 take the data of  "SEGNUM" column from EDID4 table.
    SORT : T_EDIDC BY DOCNUM,
                T_EDID4 BY DOCNUM SEGNAM SEGNUM.
    LOOP AT  T_EDIDC.
       LOOP AT T_EDID4 INTO WA_EDID4 WHERE DOCNUM = T_EDIDC-DOCNUM
                                                                 AND   SEGNAM = 'E1KNVVM'
                                                                 AND   SEGNUM =  T_EDID4-SEGNUM.
          if sy-subrc eq 0 .
           endif.
    endlloop.
    Don't forget to reward if useful...

  • All entries and read statement not working

    Hi Experts,
    I am doing a report on material history,
    First I get the entire matnr from mara then I go to eket  and mard to take some details  and then to ekpo to take open Po's (ebeln) for the particular matnr .....
    I am displaying my o/p like : for a single matnr there will be many ebeln.
    But I am facing problem in displaying eban~banfn for the particular matnr ...can any one
    please advice me how to display it such that other details which I have already displayed should not get affected.
    I tried ALL ENTRIES FROM EBAN connecting only MATNR and WERKS then  used READ its just reading the first record.
    Please advice if there is any other logic.
    Thanks
    Karthik

    Here,
    SELECT MARA~MATNR MARA~MTART MARD~WERKS MARD~LABST MARD~INSME MARD~SPEME    FROM MARA INNER JOIN MARD ON MARA~MATNR EQ MARD~MATNR
      INTO CORRESPONDING FIELDS OF TABLE IT_MARA
    WHERE MARA~MATNR IN MATNR  
    AND MARD~WERKS IN   WERKS                                                                               
      LOOP AT IT_MARA.
        MOVE IT_MARA-MATNR TO IT_TAB-MATNR.
        MOVE IT_MARA-WERKS TO IT_TAB-WERKS.
        MOVE IT_MARA-LABST TO IT_TAB-LABST.
        MOVE IT_MARA-INSME TO IT_TAB-INSME.
        MOVE IT_MARA-SPEME TO IT_TAB-SPEME.
        COLLECT IT_TAB.
      ENDLOOP.
    IF NOT IT_TAB IS INITIAL.
        SELECT * FROM EKPO INTO CORRESPONDING FIELDS OF TABLE IT_EKPO
           FOR ALL ENTRIES IN IT_TAB WHERE MATNR EQ IT_TAB-MATNR
           AND WERKS EQ IT_TAB-WERKS AND PSTYP EQ '0' AND BSTYP EQ 'F'
           AND ELIKZ EQ ' '.
      ENDIF.
    LOOP AT IT_TAB.
        MOVE-CORRESPONDING IT_TAB TO IT_FIRST.
        LOOP AT IT_EKPO WHERE MATNR EQ IT_TAB-MATNR
                          AND WERKS EQ IT_TAB-WERKS.
          MOVE IT_EKPO-EBELN TO IT_FIRST-EBELN.
          MOVE IT_EKPO-EBELP TO IT_FIRST-EBELP.
          APPEND IT_FIRST.
          CLEAR IT_FIRST."-LABST.
        ENDLOOP.
      ENDLOOP.
    And now I am facing problem in the below querry
    SELECT * FROM EBAN INTO CORRESPONDING FIELDS OF TABLE IT_EBAN FOR ALL
      ENTRIES IN IT_FIRST WHERE MATNR = IT_FIRST-MATNR
      AND WERKS = IT_FIRST-WERKS AND STATU IN ('N','A').
    LOOP AT IT_FIRST.
        READ TABLE IT_EBAN WITH KEY MATNR = IT_FIRST-MATNR
                                    WERKS = IT_FIRST-WERKS.
        MOVE IT_EBAN-BANFN TO IT_FIRST-BANFN.
        MODIFY IT_FIRST.
    *    CLEAR IT_EBAN.
      ENDLOOP.
    Please advice
    Karthik

  • SAP QUERY LOOPS AND INTERNAL TABLE

    Hi All, I have a query which i have made. It runs from Table EKPO which has PO details and what I want to do is now via ABAP Code pull through the total of goods receipt for the PO and Line Item into a field. Sounds Easy enough..Problem now,
    The table which contains the GR data is EKBE which agains a PO and Line Item can have many 101 movements and 102 movements so what I want is an ABAP Statent to basically sum up the total of 101 for the PO & LINE ITEMS and then minus this from the total of 102 for the PO & LINE ITEMS and post the result in to this new field I have created.
    I am pretty decent with ABAP Code in Querys I.e Select statements etc but from what I can see i need to create an internal table and do a loop and collect statement but I keep on failing due to not enough knowledge. Please can some one help me with this and provide me with the code and explanation as i would like to understand,
    POINTS WILL BE REWARDED
    Thanks
    Kind Regards
    Adeel Sarwar

    Hi,
    This is the full code i have entered but its not working. Any help would be appreciated. If you could rectify the code and internal tables that would be great.
    Thanks
    TABLES: EKBE.
    DATA: PurO LIKE EKPO-EBELN,
          POLI LIKE EKPO-EBELP.
    *New Table and Vars defined
    DATA:   BEGIN OF IT_EKBE,
              IT_EKBE LIKE EKBE,
            END OF IT_EKBE.
    DATA:  BEGIN OF IT_SUM OCCURS 0,
              EBELN TYPE EBELN,
              EBELP TYPE EBELP,
              DMBTR TYPE DMBTR,
              MENGE TYPE MENGE,
          END OF IT_SUM.
    CLEAR: QTYD.
    MOVE: EKPO-EBELN TO PurO,
          EKPO-EBELP TO POLI.
    SELECT * FROM EKBE INTO IT_EKBE
        WHERE EBELN = PurO
        AND   EBELP = POLI
        AND   BEWTP = 'E'
    LOOP AT IT_EKBE.
      MOVE CORRESPOING IT_EKBE TO IT_SUM.
      IF IT_EKBE-BWART = '102'.
        IT_SUM-DMBTR = IT_SUM-DMBTR * -1.
        IT_SUM-MENGE = IT_SUM-MENGE * -1.
      ENIDF.
      COLLECT IT_SUM.
      CLEAR IT_SUM.
    ENDLOOP.
    ENDSELECT.
    If sy-subrc = 0.
      QTYD = IT_SUM.
    ELSE.
      QTYD = 0.
    ENDIF.

  • Read Statement antwork

    Hi All,
    I am having one record in it_vbrk table and in it_vbrp table i am having three records with same vbeln with three items.
    Loop at it_vbrk into wa_vbrk.
    Move: XXXX to XXXX
    Read table it_vbrp into wa_vbrp with key vbeln = wa_vbrk-vbeln.
    if sy-subrc = 0.
    move: XXXX to XXX.
    endif.
    endloop.
    here in the above code i am getting only one record output. but i need three records as output with all the three item details of it_vbrp.
    i am not suppose to use loop inside a loop.
    Please suggest with code example.
    Regards,
    Kumar

    Some optimizations guidance :
    - Try Parallel Cursor method : look at wiki sample at [Copy of ABAP Code for Parallel Cursor - Loop Processing |http://wiki.sdn.sap.com/wiki/display/Snippets/CopyofABAPCodeforParallelCursor-Loop+Processing]
    - Reverse the order of table processing, using the item table in the external LOOP and READ to get the header table, but only if each and every header has a least one item, else you will miss some header records.
    - Use a LOOP in another LOOP if the internal table is a SORTED or HASH (as of Release 7.0) one and the WHERE criteria are the key of the table (check LOOP  [WHERE log_exp |http://help.sap.com/abapdocu_70/en/ABAPLOOP_AT_ITAB_COND.htm#&ABAP_ADDITION_3@3@] online documentation)
    Regards,
    Raymond

  • How to write select statement before the loop and how to use read statemnt

    Hi,
    Recently our system has changed from 4.6 to ECC6.
    As its migrated its showing lots of errors like in between loop and endloop there should be no select statemnt........
    Can any one please tell how to write that coding in ECC6 , how can i change the code......
    In between loop and endloop i am having lots of select statemnts.....ple tell thye coding how can i select before the loop starts and
    how to read that internal table in loop.

    Hi Deepthi,
    You can do as per below:
    1) Select the required entries from the tables you need (VBAK, VBAP, KNA1, etc)
    SELECT VBELN ERDAT KUNNR
        into table it_vbak
        from VBAK
    where VBELN = S_VBELN. "Selection criteria
    If sy-subrc = 0.
    SELECT VBELN POSNR MATNR
        into table it_vbap
        from VBAP
    for all entries in it_vbak
    where VBELN = it_vbak-vbeln
    SELECT KUNNR NAME1
        into table it_vbak
        from VBAK
    where VBELN = it_vbak-vbeln.
    endif.
    2) Loop at the entries, and read internal table it-kna1 for customer info.
    Loop at it_vbak into wa_vbak.
    read table it_kna1 into wa_kna1 with key kunnr = wa_vbak-kunnr.
    if sy-subrc = 0.
    endif.
    loop at it_vbap into wa_vbap where vbeln = wa_vbak-vbeln.
    endloop.
    endloop.
    This is the basic idea and short example of how to extract entries and read internal table.
    Hope this helps.
    Regards,
    Patrick

  • Sy-tabix in relation to LOOP AT and READ TABLE

    Hi All,
    As per SAP documentation,
    1) While looping through an internal table (LOOP AT), sy-tabix contains the index number of current row(for standard and sorted tables)
    2)When successfully reading from an internal table(READ TABLE), sy-tabix is set to the index of the result row.
    But what happens when READ TABLE is used while looping through another internal table?
    i.e. Loop at TAB1...
    write sy-tabix.
    READ TABLE TAB2...
    write sy-tabix.
    endloop.
    If we are looping through 1st row of TAB1 and the result of read statement is found in 3rd row of TAB2, I expected that sy-tabix before READ would be 1 and after the READ be 3.
    But, I found that sy-tabix remains unchanged at 1. Can someone expalin why?
    Thanks,
    Jagan

    Hi
    If after reading the table TAB2 the system variable SY-TABIX has still the previous value, that menas the READ TABLE fails or it was read the first record of TAB2.
    After READ TABLE TAB2 try to check the SY-SUBRC:
    LOOP AT TAB1.
       WRITE: / 'TAB1 index:', SY-TABIX.
       READ TABLE TAB2 .........
       IF SY-SUBRC = 0.
         WRITE: 'TAB2 index:', SY-TABIX.
    Try this:
    DATA: BEGIN OF ITAB OCCURS 0,
            FIELD1,
          END   OF ITAB.
    DATA: BEGIN OF ITAB2 OCCURS 0,
            FIELD1,
          END   OF ITAB2.
    DATA: INDEX TYPE I.
    DO 10 TIMES.
      APPEND ITAB.
    ENDDO.
    DO 10 TIMES.
      APPEND ITAB2.
    ENDDO.
    LOOP AT ITAB.
      WRITE: / 'ITAB:', SY-TABIX.
      INDEX = SY-TABIX + 2.
      READ TABLE ITAB2 INDEX INDEX.
      IF SY-SUBRC = 0.
        WRITE:  'ITAB2:', SY-TABIX.
      ENDIF.
    ENDLOOP.
    Max

  • Doubt in loop.......endloop  and Read..........

    Hi,
          the current syntax  we are using for looping a internal table is
    1. loop at itab
      assigning <fs_itab>.
    if <fs_itab> is assigned.
    endif.
    endloop. 
    My TL suggested me that if the field symbol is not  assigned then it will not move into the loop. So there is no need for checking if the field symbol is assiged or not. I am not sure please suggest.
    2. One more question current read syntax we are using
        read itab assigning <fs_itab>............
             if <fs_itab> is assigned.
             endif.
    instead of checking if the field symbol is assigned can check the sy-subrc.
    will there be any case in which even if the field symbol is not assigned there is chance of sy-subrc eq 0. Please suggest

    Hi,
    For ur first question field symbol check is not required as the field symbol will get assigned only if the itab contains the data.
    But for ur second question, it is better to check with SY-SUBRC as the field symbol always contains the data of the internal table for every iteration. It could be a problem if  u r reading the data with some where clause as the the field symbol will not get refreshed and contains the previous record data irrelevent to the success of the READ statement.
    U need to perform some operation only if the read statement is successfull. If u r using READ statment then it is always better to use SY-SUBRC instead of checking with destination one.
    Reward points if this is helpful for u.
    Chandrasekhar K

  • Performance syntax loop at  and read table

    in the routine , for reading one line in a internal table  , the syntaxe
      loop at  xxx where   and read tabl exxx   with key     XXXX
    has a great difference on performance or not?

    Loop at statement is used only for processing multiple records.Read table is used for reading a particluar record of an internal table.If you just need to check whether record exists in internal table, use can sort and use binary search with TRANSPORTING NO FIELDS addition. Also, try to use field symbols so that performance is increased.

  • ABAP Loop/read statement

    Hello All-
    I'm writing a loop and a read statement between two tables.  What I am trying to do is flag certain records that exsist in one table but NOT in the other.  For example, I have table /BIC/PG_ICODE  which is the P table for Global ICODE and I also have a "z" table which hold all "valid" icodes. My logic is as follows: If an icode exsists in the P table AND also exsists in the "Z" table then I don't want to do anything with this record. But if it exsists in the P table but NOT in the "z" table then I want to insert this ICODE into an E_T_RANGE table.  What I have done here is created a FM which will be called in a QUERY that I have built.  The problem is that after the code is executed and I look at the records in the E_T_RANGE table, I find some icodes that exsist both in the P table and "z" table.  The E_T_RANGE table should only contain icodes that exsist in the P table and NOT the "z" table. Can someone please have a look at my code and tell me what I am doing wrong?
    DATA : L_S_RANGE LIKE E_T_RANGE,
           IT_ICODE TYPE standard table of /BIC/TG_ICODE,
           IT_PTABLE TYPE standard table of /BIC/PG_ICODE,
           it_ZVALID_ICODES TYPE standard table of   ZVALID_ICODES,
           wa_ZVALID_ICODES TYPE ZVALID_ICODES,
           l_sign type c value 'I',
           wa type /BIC/TG_ICODE,
           wa2 type /BIC/PG_ICODE.
    SELECT /BIC/G_ICODE FROM /BIC/PG_ICODE INTO
        CORRESPONDING FIELDS OF table IT_PTABLE where /BIC/G_ICODE like
    'I%'.
    sort IT_PTABLE by /BIC/G_ICODE.
    SELECT /BIC/G_ICODE FROM ZVALID_ICODES INTO
        CORRESPONDING FIELDS OF table IT_ZVALID_ICODES.
    sort IT_ZVALID_ICODES by /BIC/G_ICODE.
    loop at IT_PTABLE into wa2.
    read table IT_ZVALID_ICODES with key
    /BIC/G_ICODE = wa2-/BIC/G_ICODE into wa_ZVALID_ICODES.
    if sy-subrc ne 0.
            L_S_RANGE-LOW = wa_ZVALID_ICODES-/BIC/G_ICODE.
            L_S_RANGE-SIGN = l_sign.
            L_S_RANGE-OPT = 'EQ'.
    DELETE ADJACENT DUPLICATES FROM E_T_RANGE.
          APPEND L_S_RANGE TO E_T_RANGE.
    endif.
    endloop.
    ENDFUNCTION.

    Hi try the following code...
    DATA : L_S_RANGE LIKE E_T_RANGE,
    IT_ICODE TYPE standard table of /BIC/TG_ICODE,
    IT_PTABLE TYPE standard table of /BIC/PG_ICODE,
    it_ZVALID_ICODES TYPE standard table of ZVALID_ICODES,
    wa_ZVALID_ICODES TYPE ZVALID_ICODES,
    l_sign type c value 'I',
    wa type /BIC/TG_ICODE,
    wa2 type /BIC/PG_ICODE.
    SELECT /BIC/G_ICODE FROM /BIC/PG_ICODE INTO
    CORRESPONDING FIELDS OF table IT_PTABLE where /BIC/G_ICODE like
    'I%'.
    sort IT_PTABLE by /BIC/G_ICODE.
    DELETE ADJACENT DUPLICATES FROM IT_PTABLE.
    SELECT /BIC/G_ICODE FROM ZVALID_ICODES INTO
    CORRESPONDING FIELDS OF table IT_ZVALID_ICODES.
    sort IT_ZVALID_ICODES by /BIC/G_ICODE.
    DELETE ADJACENT DUPLICATES FROM IT_ZVALID_ICODES.
    loop at IT_PTABLE into wa2.
    read table IT_ZVALID_ICODES with key
    /BIC/G_ICODE = wa2-/BIC/G_ICODE into wa_ZVALID_ICODES
             binary search.
    if sy-subrc ne 0.
    L_S_RANGE-LOW = wa_ZVALID_ICODES-/BIC/G_ICODE.
    L_S_RANGE-SIGN = l_sign.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    endif.
    endloop.
    sort e_t_range.
    DELETE ADJACENT DUPLICATES FROM E_T_RANGE.
    ENDFUNCTION.
    Regards,
    Suresh Datti

  • Dynamic internal table and dynamic read statements.

    Hi,
    My Scenario :
    I have two dynamic internal tables.
    I am looping at one internal table and trying to read another table.
    In the read statement how do I mention the key dyamically.
    Example code below :
      LOOP AT <dyn_table> ASSIGNING <dyn_wa>.
    read second  dynamic internal table.
      enloop.
    The key which I want use for reading say it is keyed in the selection criteria....
    Also based on the value I read I want to modify the first internal table field value.
    Remember I dont want to explicity mention the key
    How do I do that?
    Thanks
    Krishna.

    Hi
    U need to use the field-symbol, but u can't use a WHERE option, but u need to use the CHECK statament into the second loop:
    LOOP AT <dyn_table> ASSIGNING <dyn_wa>.
        LOOP AT <DYN_TABLE2> ASSIGNING <DYN_WA2>.
            ASSIGN COMPONENT <COMPONENT> OF STRUCTURE   <DYN_WA2> TO <FS>.
            CHECK <FS> IN (=) .......
                ASSIGN COMPONENT <COMPONENT> OF STRUCTURE   <DYN_WA> TO <FS2>.
                <FS2> = .......
                EXIT.
        ENDLOOP.
    ENDLOOP.
    Max

  • Closing a serial port after executing a for loop of write and reads.

    Hello,
    Labview is opening and then closing each write to the port. I have tried to leave the close outside of the for loop, but labview wont allow it. What do I need to change to make all the writes and reads execute on 1 open and close of the serial port.?
    Thanks.
    Attachments:
    Controller.vi ‏27 KB

    J_es--
         The program that you posted looks to be ok for the most part, you might consider putting an open after your configure (but that's trivial). The other thing that is a minor issue is the loop tunnel coming out of your for loop is currently being auto-indexed.  This function is used to index data for each interation of the loop.  You are using a static address (not an array) and so you don't need this.  If you right-click and remove the auto-index the broken wire will go away. Other than that it should be ok.
         I would suggest looking at one of the shipping examples that come with LabVIEW.  "Basic Serial Read and Write" is essentially the same thing that you are doing and is tested here and might save you a bit of time.  Anyway, take a look if you have a second. Best of luck with your application!
    John H.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • When installing adobe reader on my mac it states that the installation is complete, but on same screen it states the there is an internal server error and reader will not work

    when installing adobe reader on my mac it states that the install is complete, but on same screen its sets thaw an internal server error has occurred and reader will not work

    Hi,
    I have exactly the same problem on one of my Macs (MBP 15 Mid-2010 / OS X Yosemite): Both reader and Acrobat Pro download without a hitch. Both also install with no problem.
    But once you click the program to open, they both return "an internal error occurred".  
    I tried downloading three separate copies, and still get the same error message when I install and launch.  I've also uninstalled the previous installations via CleanMyMac2 to make sure it's no longer in the SSD.  Same results.
    Am using a new SSD as internal boot drive, with fresh / clean installation of OS X and Apps (previous internal HDD crashed) -- And am seeing errors not only with Acrobat, but also with LR5 which always comes up with a "An error occurred when attempting to change modules" -- inspite or uninstall, download and reinstall.  Not sure if it's a registry issue? (Not even sure if that's the case with OS X).
    Do I need to reformat the whole SSD? I hope not!
    Thanks
    Edwin

Maybe you are looking for

  • Field Length issue in ALV Report

    Hi, I am using FM REUSE_ALV_GRID_DISPLAY to display few fields. Among them I have a field with length 200 characters text. During ALV report display I am able to see only 128 characters, But when I download it and see the field, the it is showing com

  • Installation error on rhel 5

    hi firends i got problme  when i am installing  sap on  rhel 5.0 with oralce 10g ,ecc 6.0 in 19 phase create secure store  i have issue see below ERROR 2009-04-21 12:21:45 CJS-30050  Cannot create the secure store; see output of log file SecureStoreC

  • Reg. DMS

    Hii Experts..                             I have given one scenario.. in which i have to create one webdynpro application in which the user can upload files from the page and that files should store in the DOCUMENT MANAGEMENT SYSTEM (DMS) IN ECC.  As

  • Can Oracle and Sybase Coexist on Sun Box ??

    Hello Everybody, I an trying to find out if Oracle and Sybase can coexist on same Sun Solaris box ??. I would really appreciate your help. Thanks,

  • Hi first time mac user here, how can i open up more than one email account (hotmail) without merging them? I have merged 2 already Th.

    Hi, how can i open up more email accounts (hotmail)? I have accidentally merged 2 - not sure how but urgently need to access others and cannot run this risk!  thx