PLScript: Syntax Definition to Loop over a Table is missing

Hi,
I miss the syntax definition in the SAP HANA Database - SQL Script Guide to loop sequentially
over an table of CREATE TYPE <...> AS TABLE (...);
For Ex:
1) Defineing a Table Type:
CREATE TYPE SHPL.typ_sample13 AS TABLE
( CHANNEL_ID INTEGER
, PROD_ID    INTEGER
, UNIT_COST  DOUBLE
, UNIT_PRICE DOUBLE
2) Wrtite a Query to a Table of Type Table:
CREATE PROCEDURE SHPL.SAMPLE13_TABLE_OUT
( IN v_prod_id INTEGER
, OUT tab_sample13 typ_sample13)
LANGUAGE SQLSCRIPT
AS
BEGIN
tab_sample13  =
select   CHANNEL_ID
       , PROD_ID
       , SUM(UNIT_COST)  UNIT_COST
       , SUM(UNIT_PRICE) UNIT_PRICE
from     SH.COL_COSTS
WHERE    PROD_ID = :v_prod_id
GROUP BY CHANNEL_ID
       , PROD_ID
END ;
3) Looping Sequentially trough the table:
CREATE PROCEDURE SHPL.SAMPLE15_TABLE_OUT_READ_LOOP
LANGUAGE SQLSCRIPT
AS
BEGIN
CALL SHPL.SAMPLE13_TABLE_OUT( 15, :tab_sample13  );
--???FOR  rtab_sample13 as :tab_sample13_ DO
--???insert into sh.RESULTS VALUES (_r_tab_sample13.UNIT_COST ,r_tab_sample13.UNIT_PRICE_ );
--???END FOR;
END ;

One could use cursors to accomplish that, but it's not at all recommended.
Cursor processing (looping row-by-row iteratively) is extremely crippling for performance.
You want to achieve all data processing and manipulation that you possibly need by bulk processing, either through pure SQL (Selects or DML) or SQLScript (using the so called bult-in Hana Calculation Engine Functions).

Similar Messages

  • Looping over fields from internal table

    In a FM I have to check records of two ITABs against each other. Most fields can be checked 1:1 but some must be checked according to some business logic.
    I first want to check field-by-field and then I want to deal with exceptions.
    Question: How can I loop over fields in an ITAB in such a manner that I can compare fields?

    Hi, you can loop thru the columns(fields) of an internal table like so.
    field-symbols: <fs>.
    loop at itab.
    do.
    * Here you can use the field name instead of SY-INDEX
       assign component sy-index of structure itab to <fs>.
       if sy-subrc <>.
       exit.
       endif.
    * Now that you have access to the field via field symbol, you can compare
    * this value.
    Write:/ <fs>.
    enddo. 
    endloop.
    Regards,
    Rich Heilman

  • Why optimizer prefers nested loop over hash join?

    What do I look for if I want to find out why the server prefers a nested loop over hash join?
    The server is 10.2.0.4.0.
    The query is:
    SELECT p.*
        FROM t1 p, t2 d
        WHERE d.emplid = p.id_psoft
          AND p.flag_processed = 'N'
          AND p.desc_pool = :b1
          AND NOT d.name LIKE '%DUPLICATE%'
          AND ROWNUM < 2tkprof output is:
    Production
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          4           0
    Execute      1      0.00       0.01          0          4          0           0
    Fetch        1    228.83     223.48          0    4264533          0           1
    total        3    228.84     223.50          0    4264537          4           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 108  (SANJEEV)
    Rows     Row Source Operation
          1  COUNT STOPKEY (cr=4264533 pr=0 pw=0 time=223484076 us)
          1   NESTED LOOPS  (cr=4264533 pr=0 pw=0 time=223484031 us)
      10401    TABLE ACCESS FULL T1 (cr=192 pr=0 pw=0 time=228969 us)
          1    TABLE ACCESS FULL T2 (cr=4264341 pr=0 pw=0 time=223182508 us)Development
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.00       0.01          0          4          0           0
    Fetch        1      0.05       0.03          0        512          0           1
    total        3      0.06       0.06          0        516          0           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 113  (SANJEEV)
    Rows     Row Source Operation
          1  COUNT STOPKEY (cr=512 pr=0 pw=0 time=38876 us)
          1   HASH JOIN  (cr=512 pr=0 pw=0 time=38846 us)
         51    TABLE ACCESS FULL T2 (cr=492 pr=0 pw=0 time=30230 us)
        861    TABLE ACCESS FULL T1 (cr=20 pr=0 pw=0 time=2746 us)

    sanjeevchauhan wrote:
    What do I look for if I want to find out why the server prefers a nested loop over hash join?
    The server is 10.2.0.4.0.
    The query is:
    SELECT p.*
    FROM t1 p, t2 d
    WHERE d.emplid = p.id_psoft
    AND p.flag_processed = 'N'
    AND p.desc_pool = :b1
    AND NOT d.name LIKE '%DUPLICATE%'
    AND ROWNUM < 2
    You've got already some suggestions, but the most straightforward way is to run the unhinted statement in both environments and then force the join and access methods you would like to see using hints, in your case probably "USE_HASH(P D)" in your production environment and "FULL(P) FULL(D) USE_NL(P D)" in your development environment should be sufficient to see the costs and estimates returned by the optimizer when using the alternate access and join patterns.
    This give you a first indication why the optimizer thinks that the chosen access path seems to be cheaper than the obviously less efficient plan selected in production.
    As already mentioned by Hemant using bind variables complicates things a bit since EXPLAIN PLAN is not reliable due to bind variable peeking performed when executing the statement, but not when explaining.
    Since you're already on 10g you can get the actual execution plan used for all four variants using DBMS_XPLAN.DISPLAY_CURSOR which tells you more than the TKPROF output in the "Row Source Operation" section regarding the estimates and costs assigned.
    Of course the result of your whole exercise might be highly dependent on the actual bind variable value used.
    By the way, your statement is questionable in principle since you're querying for the first row of an indeterministic result set. It's not deterministic since you've defined no particular order so depending on the way Oracle executes the statement and the physical storage of your data this query might return different results on different runs.
    This is either an indication of a bad design (If the query is supposed to return exactly one row then you don't need the ROWNUM restriction) or an incorrect attempt of a Top 1 query which requires you to specify somehow an order, either by adding a ORDER BY to the statement and wrapping it into an inline view, or e.g. using some analytic functions that allow you specify a RANK by a defined ORDER.
    This is an example of how a deterministic Top N query could look like:
    SELECT
    FROM
    SELECT p.*
        FROM t1 p, t2 d
        WHERE d.emplid = p.id_psoft
          AND p.flag_processed = 'N'
          AND p.desc_pool = :b1
          AND NOT d.name LIKE '%DUPLICATE%'
    ORDER BY <order_criteria>
    WHERE ROWNUM <= 1;Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Looping over QoQ Where Clause

    I have two queries. One is a main query that we pull from a form submission. The second is a small query resultset that lists different subgroups in my company and what main group they belong to. I pull several QoQ from the main query. In the main query results, there is a column that holds the subgroup information. I am trying to do a Q0Q where I group the data from the main query into the main groups for analysis. Here is an example...
    Main Query
    record 1 - subgroup 1
    record 2 - subgroup 2
    record 3 - subgroup 3
    Second Query
    Subgroup 1 - Main Group 1
    Subgroup 2 - Main Group 2
    Subgroup 3 - Main Group 1
    So I am trying to loop over a QoQ on the main query where the result set would contain the information only from Main Group 1. So record 2 would be eliminated. I have tried using an IN clause with a cfloop, but I run into syntax trouble with the comma. I also tried looping over the QoQ as a whole and the resulting dump is only the last record.
    If there is anything else you need, let me know.
    Any thoughts?
    Clay
    P.S. Here is a code sampling...
        <cfquery name="rsGroup" datasource="nps">
        SELECT *
        FROM "GROUP"
        WHERE GROUP.PrimaryGroup = '#form.primarygroup#'
        </cfquery>
        rsGroup - <cfdump var="#rsGroup#">
        <cfloop query="rsGroup" startrow="1" endrow="#rsGroup.RecordCount#">
            <cfquery name="rsGroupQoQ" dbtype="query">
            SELECT *
            FROM rsNPS
            WHERE rsNPS.grp = '#rsGroup.group#'
            </cfquery>
        </cfloop>
        rsGroupQoQ - <cfdump var="#rsGroupQoQ#"><cfabort>

    ok...I figured it out. I thought I would post my solution in case anyone else runs into this. Also, if anyone out there has a better way, let me know.
    <!---Dummy array to house 'blank' value for adding of column to main query--->
    <cfset GroupArray = ArrayNew(1)>
    <!---Variable that adds mainGroup column to main query with blank data from dummy array--->
    <cfset addMainGroup = QueryAddColumn(rsNPS,'mainGroup',GroupArray)>
    <!---Loop that sets value on added mainGroup column based off of main query grp column value--->
    <cfloop query="rsNPS" startrow="1" endrow="#rsNPS.RecordCount#">
        <cfif rsNPS.GRP EQ "xxxxx"><cfset rsNPS.mainGroup = "yyyyy"></cfif>
        <cfif rsNPS.GRP EQ "xxxxxxxxxx"><cfset rsNPS.mainGroup = "yyyyyyyyyy"></cfif>
        <cfif ...etc. ...
    </cfloop>

  • Looping over Nested Structure

    Hey Guys,
    I have a component that returns a structure. The structure is
    called ContactQuery. ContactQuery has to elements, one called
    Results, and one called Success. Results contains the data I want
    to loop over. If you try looping over the ContactQuery by using
    CFLoop and specify the ContactQuery as the collection, of course it
    only loops twice (once for Results, once for Success). How can I
    loop over the Results structure withing ContactQuery? You can see
    the dump of the structure at:
    http://www.digitalswordsmen.com/cfschedule/admin/Create_Tokens_Table.cfm
    Attached is the code I have. I am just unsure of the syntax
    for looping over the Results section of the structure.
    Thank you.

    Nope. I am dumb and didn't really think about it. The fact
    that it is a query nested in a structure threw me off. The code
    that works was
    <cfloop query="ContactQuery.Results">
    <tr>
    <td></td><td>#firstname#</td><td>#lastname#</td><td>#email#</td><td>#randrange(10000,9999 9)#</td>
    </tr>
    </cfloop>
    Thanks for the help, sorry about that dumb question.

  • Looping over query by month

    etings,
    I have a query I am pulling that has a date field entitled, "Completed". I am attempting to loop over the query by date to slice and dice the data for a table and chart. Here is what I have done thus far...
    Setup two variables where I am only interested in the month. My plan is to fileter the date by month so I can pull the data out by month.
        <cfset startDate = #DatePart('m','01/01/09')#>
        <cfset endDate = #DatePart('m',Now())#>
    Here is my loop...
        <cfloop from = "#startDate#" to = "#endDate#" index = "i" step = "1">
    Here is one of my QoQs within the loop...
            <cfquery name="NPS0" dbtype="query">
            SELECT *
            FROM rsNPS
            WHERE #DatePart('m',rsNPS.completed)# = #i#
            </cfquery>
    I am having difficulties in getting this to work. Has anyone ever done something like this. I feel like the answer is right in front of me, but I have been staring at this code for a while. If anyone has any thoughts, I would be glad to hear them.
    ~Clay

    fs22 wrote:
             <cfquery name="NPS0" dbtype="query">
            SELECT *
            FROM rsNPS
            WHERE #DatePart('m',rsNPS.completed)# = #i#
            </cfquery>
    QoQ are a separate beast. You cannot use standard CF functions inside them.  AFAIK, QoQ only support a few functions like CAST, UPPER, LOWER, etcetera.  So as Dan suggested, you should peform the date functions in your database query.

  • Looping Over INSERT

    I've got a form. The form asks the visitor their address
    (first name, last name, street address, apartment number, city,
    state, and zip code... each a separate text field). This form is
    repeated 10 times on the page, allowing the visitor to enter
    multiple addresses. I've given each form field a unique name by
    just appending "_1" or "_2" after it. For example, my fields are
    named...
    FIRST FORM BLOCK
    first_name_1
    last_name_1
    SECOND FORM BLOCK
    first_name_2
    last_name_2
    Each form block (address) will be inserted into a table in my
    database as a new row. Is there a quick and easy way to loop over
    the insert 10 times, rather than have 10 separate INSERT statements
    in my code? A CFLOOP would work just fine if not for dynamic form
    field names, but I would have to take into account the "_X". I want
    to say I've done this before; I'm just overthinking.

    <cfloop from="1" to="10" index="i">
    <cfquery ...>
    INSERT INTO ...
    (aCol,bCol,cCol...)
    <!--- The important part, accessing the form structure
    with array
    notation --->
    #form['first_Name_' & i]#,
    #form['last_Name_' & i]#
    </cfquery>
    </cfloop>
    The array notation for a complex variables is a very powerful
    concept.
    Many advance techniques can be used with it.

  • Looping over cfdirectory

    Hello. I am having an issue with looping over cfdirectory.
    What I am trying to do here is grab the size of the files
    associated with the db. So where #current.Dir.Name# = #DB Column#
    update size etc.... What's happening is it is displaying the same
    id about 90 something times...Nice I know. Can anyone help?
    <cfloop query="qLoadFile">
    <cfoutput>
    <cfdirectory
    directory="/test1/test2/test3/0/#qLoadFile.owner_id#" action="list"
    name="currentDir">
    #qLoadFile.owner_id# <!--- This does display my ids
    correctly if I end the loop here but does not display anything in
    my table if I end the loop here and reopen it--->
    </cfoutput>
    <table border="1" bordercolor="#000000" >
    <tr>
    <td>File Name</td>
    <td>File Size</td>
    <td>Directory Location</td>
    <td>File Type</td>
    </tr>
    <cfloop query="currentDir">
    <tr>
    <cfoutput>
    <form name="updateSize" action="
    http://myURL.com/test2.cfm"
    method="post">
    <td><input type="text" name="name"
    value="#currentDir.Name#" /></td>
    <td><input type="text" name="size"
    value="#currentDir.Size#" /></td>
    <td>#right(currentDir.DIRECTORY, 2)#</td>
    <td>#currentDir.Type#</td>
    </cfoutput>
    </tr>
    </cfloop>
    </cfloop>
    </table> <br />
    <input type="text" name="number_of_directories"
    value="<cfoutput>#valuelist(qLoadFile.owner_id)#</cfoutput>">
    <input type="submit" name="submit" value="submit"/>
    </form>

    I just put your query into a random page of mine, changed the
    query to reflect a local database and got this output (all
    formatted correctly though!)
    Since I dont have the directory setup that you have the
    directory structures are empty, however it seems to be looping
    through fine
    59 File Name File Size Directory Location File Type
    60 File Name File Size Directory Location File Type
    61 File Name File Size Directory Location File Type
    62 File Name File Size Directory Location File Type
    63 File Name File Size Directory Location File Type
    64 File Name File Size Directory Location File Type
    65 File Name File Size Directory Location File Type
    Is this what you are looking for?

  • Looping over a structure of arrays

    Hi Guys, I am trying to loop over a structure of simple
    arrays. The structure's second column contains a 1 dimentional
    array.
    I can't seem to get the proper syntax for my loop.

    I want to be able to dynamically loop over my query and
    decrypt it as I pass it into my structure. I have figured the code
    out to loop over the query and pass it to the structure. My problem
    now is whn I go to decrypt it I get this Error.
    There has been an error while trying to encrypt or decrypt
    your input string: Input length (with padding) not multiple of 16
    bytes.
    How can I fix this?
    Here is my code could it be because my varchar columns were
    not long enough. Here is my code.

  • Checkboxes remain set when looping over screen

    Hi there,
    I have got a problem with some checkboxes on a BSP with MVC.
    I am creating an extension for cProjects within a single tabStrip.
    My BSP constist of several checkboxes and I want to loop over this screen for some times to collect data. For every call of the BSP I create a new instance, set page attributes and call the view in DO_REQUEST. The page attributes cause some checkboxes to be set. This works fine so far.
    My problem is that checkboxes that were selected on the previous screen remain selected.
    I think this happens because the checkboxes have the same names as those on previous screens.
    How can I disable this behaviour? I would appreciate your help.

    Hi Raja,
    thanks for your friendly welcome!
    My BSP is already stateless. It is for assigning test
    types to components in a production project and for
    assigning standards to these test types. So there are
    some nested groups with checkboxes.
    First I loop over some existing test types and standards which will be displayed as 'checked' and the checkboxes are disabled. This works great so far.
    <%@page language="abap" %>
    <%@extension name="bsp" prefix="bsp" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <%@extension name="xhtmlb" prefix="xhtmlb" %>
    <%@extension name="phtmlb" prefix="phtmlb" %>
    <xhtmlb:overflowContainer>
      <htmlb:button id      = "test_comp_next"
                    text    = "Next"
                    tooltip = "Go to next step in Task Wizard"
                    onClick = "test_comp_next"
                    design  = "EMPHASIZED" />
      <br />
      <htmlb:textView text   = "Component Validation"
                      design = "EMPHASIZED" />
      <br />
      <htmlb:group>
        <htmlb:groupHeader>
      <htmlb:textView text   = "<%= ms_component-task_descr %>"
                      design = "EMPHASIZED" />
        </htmlb:groupHeader>
        <htmlb:groupBody>
          <table cellpadding="5" valign="TOP" >
          <tr>
          <%
      mv_counter = 0.
      loop at mt_test_types_available into ms_test_type_available.
      read table mt_test_types into ms_test_type with key task_type = ms_test_type_available-test_type.
      if ms_test_type is not initial.
      mv_counter = mv_counter + 1.
          %>
          <td valign="TOP">
          <htmlb:group width="110px" >
            <htmlb:groupHeader>
          <htmlb:textView text   = "<%= ms_test_type-task_type %>"
                          design = "EMPHASIZED" />
            </htmlb:groupHeader>
            <htmlb:groupBody>
              <%
      loop at mt_standards_available into ms_standard_available.
      if ms_standard_available-test_type = ms_test_type-task_type and ms_component-task_type = ms_standard_available-task_type.
      read table mt_standards into ms_standard with key task_type = ms_standard_available-product_std parent_guid = ms_test_type-task_guid.
      if ms_standard is not initial.
              %>
              <htmlb:checkbox id       = "<%= ms_standard-task_type %><%= mv_counter %>"
                              text     = "<%= ms_standard-task_type %>"
                              checked  = "TRUE"
                              disabled = "TRUE" />
              <br />
              <%
      clear ms_standard.
    After displaying the already existing standards I also display other standards that are available for a component and might be selected.
    else.
              %>
              <htmlb:checkbox id   = "<%= ms_standard_available-product_std %><%= mv_counter %>"
                              text = "<%= ms_standard_available-product_std %>"
                              key  = "<%= ms_test_type-task_type %>" />
              <br />
              <%
      endif.
      endif.
      endloop.
              %>
              </td>
            </htmlb:groupBody>
          </htmlb:group>
          <%
      else.
    After that I also loop over test types that are not existing yet. They and their corresponding standards can be selected in addition.
    mv_counter = mv_counter + 1.
          %>
          <td valign="TOP">
          <htmlb:group width="110px" >
            <htmlb:groupHeader>
          <htmlb:textView text   = "<%= ms_test_type_available-test_type %>"
                          design = "EMPHASIZED" />
            </htmlb:groupHeader>
            <htmlb:groupBody>
              <%
      loop at mt_standards_available into ms_standard_available.
      if ms_standard_available-test_type = ms_test_type_available-test_type and ms_component-task_type = ms_standard_available-task_type.
              %>
              <htmlb:checkbox id   = "<%= ms_standard_available-product_std %><%= mv_counter %>"
                              text = "<%= ms_standard_available-product_std %>"
                              key  = "<%= ms_test_type_available-test_type %>" />
              <br />
              <%
      endif.
      endloop.
              %>
              </td>
            </htmlb:groupBody>
          </htmlb:group>
          </td>
          <%
      endif.
      endloop.
          %>
          </tr>
          </table>
        </htmlb:groupBody>
      </htmlb:group>
    </xhtmlb:overflowContainer>
    Message was edited by:
            Stefan Grosskinsky
    Message was edited by:
            Stefan Grosskinsky
    Message was edited by:
            Stefan Grosskinsky
    Sorry I have got some problems with formatting my code.
    Message was edited by:
            Stefan Grosskinsky
    Message was edited by:
            Stefan Grosskinsky

  • Loop over hashMap (c:forEach for JSF)

    Hi,
    is there anything like c:forEach for JSF?
    i need to loop over a hashmap.
    i cant use jstl cause ive to use the jsf taglib inside the loop.
    thanks,
    seb

    The h:dataTable can iterate over maps. Tomahawk's t:dataList is an option if you rather want lists instead of tables.
    Accessing a map in EL isn't that hard:"#{myBean.map.key}"resolves tomyBean.getMap().get("key");

  • Error looping at a table

    Greetings Abapers
    Im trying to loop at a table for certain criteria. My code is:
    Loop at the relationships table and get dates for each salescode BP
       loop at lt_hrp1001 where lt_/ccdev01/a2scode-partner EQ lt_hrp1001-sobid
       and lt_hrp1001-sclas EQ 'BP'.
    I get the following error though:
    "No component exists with the name lt_/ccdev01/a2scode-partner"
    -partner is a field in my local table and all tables have been declared. Please help.

    Don't put the table name in the loop where clause
    loop at lt_hrp1001
      where sobid = lt_/ccdev01/a2scode-partner
         and sclas EQ 'BP'.

  • BRF : Looping through a table (e.g. Do Until or While, etc..)

    Hello Colleagues,
    In BRFPLus I understand we can create Loop Expressions that allow you to loop through a table and perform different Actions based  on the retrieved contents of the table.
    We are not using BRFPLus (but the old BRF instead). Does anyone know how to build Loop Expressions in BRF without the use of ABAP Function Modules?
    Your feedback would be really appreciated.
    Thanks in advance.
    Regards,
    Ivor M.

    Hello Colleagues,
    In BRFPLus I understand we can create Loop Expressions that allow you to loop through a table and perform different Actions based  on the retrieved contents of the table.
    We are not using BRFPLus (but the old BRF instead). Does anyone know how to build Loop Expressions in BRF without the use of ABAP Function Modules?
    Your feedback would be really appreciated.
    Thanks in advance.
    Regards,
    Ivor M.

  • Declaring a message in abap and looping at a table

    Greetings all
    I would like to display an error message once some sort of validation is done. The code for my method is as follows:
    method if_ex_hrbas00infty~before_output.
    *Data declaration
    data: lt_hrp1001 type table of hrp1001,
    lv_sobid type sobid,
    lv_sclas type sclas,
    lv_rsign type rsign,
    lv_relat type relat,
    lv_otjid type otjid.
    Clear the local table and local variables
    refresh lt_hrp1001.
    clear: lv_sobid, lv_sclas, lv_rsign, lv_relat, lv_otjid.
    *Store the separated strings
    lv_sclas = old_innnn-vdata+0(2).
    lv_sobid = old_innnn-vdata+2(10).
    lv_rsign = old_innnn-subty+0(1).
    lv_relat = old_innnn-subty+1(3).
    lv_otjid = old_innnn-otype.
    *Check for existing relationships with other external objects
    select * from hrp1001 into table lt_hrp1001
    where plvar = old_innnn-plvar
    and sobid = lv_sobid
    and sclas = lv_sclas
    and rsign = lv_rsign
    and relat = lv_relat
    and otjid = lv_otjid.
    *Loop through the table and compare the existing relationship with the new one
    loop at lt_hrp1001 where.
    old_innnn-sobid = hrp1001-sobid.
    old_innnn-sclas = hrp1001-sclas.
    old_innnn-rsign = hrp1001-rsign.
    old_innnn-relat = hrp1001-relat.
    old_innnn-otjid = hrp1001-otjid.
    If statement to compare the start and end dates
    if lt_hrp1001-begda > old_innnn-endda
    or old_innnn-endda < lt_hrp1001-begda
    *Issue a warning informing the user about the overlap
    message 'ZEXERCISE' type 'E' number '000'.
    endif
    endloop.
    break lmandimika.
    endmethod.
    Ive created my message class which is ZEXERCISE but i have to declare the message somewhere using MESSAGE-ID ZEXERCISE. The only problem is that i cant declare it within this method. Any help as to where i can declare it.
    In addition to that, my loop at doesnt work because it tells me LOOP AT itab one of the additions INTO, ASSIGNING or TRANSPORTING NO FIELDS is required. I want to loop through the local table lt_hrp1001 and compare old_innn with all the entries in the table.
    Any help would be greatly appreciated.

    1. create a workarea like
    *Data declaration
    data: lt_hrp1001 type table of hrp1001,
            wa_hrp1001 type hrp1001 .
    in ur code                *Loop through the table and compare the existing relationship with the new one
    loop at lt_hrp1001 where.
    old_innnn-sobid = hrp1001-sobid.
    old_innnn-sclas = hrp1001-sclas.
    old_innnn-rsign = hrp1001-rsign.
    old_innnn-relat = hrp1001-relat.
    old_innnn-otjid = hrp1001-otjid.
    here u r checking this only for one time ,
    better u write like
    loop at lt_hrp1001 into wa_hrp1001 .
    *now check the condition .
    if                 old_innnn-sobid = wa_hrp1001-sobid     AND
                      old_innnn-sclas = wa_hrp1001-sclas        AND
                      old_innnn-rsign = wa_hrp1001-rsign         AND
                      old_innnn-relat = wa_hrp1001-relat          AND
                     old_innnn-otjid = wa_hrp1001-otjid       .
    *another  If statement to compare the start and end dates
    if lt_hrp1001-begda > old_innnn-endda
    or old_innnn-endda < lt_hrp1001-begda
         here give a message like
    message i001(ZEXERCISE).          " No need of defining message class in report
    endif.
    ENDIF.
    clear wa_hrp1001.
    endloop.
    2 . here we have to compulosry use a workarea , while making use of loop - Endloop .
    3 . You had not specified wether  "  old_innnn  "  is a table or just fields defined separately .
    Thanks ,
    reward poins if helpful.

  • How can i loop over treeview selected nodes and then to delete each node if it's a directory or a file ?

    I have this code:
    if (s == "file")
    file = false;
    for (int i = 0; i < treeViewMS1.SelectedNodes.Count; i++)
    DeleteFile(treeViewMS1.SelectedNode.FullPath, file);
    I know it's a file and it is working if it's a single file.
    On the treeView i click on a file right click in the menu i select delete and it's doing the line:
    DeleteFile(treeViewMS1.SelectedNode.FullPath, file);
    And it's working no problems.
    But i want to do that if i selected some files togeather multiple selection then to delete each file.
    So i added the FOR loop but then how do i delete from the SelectedNodes each node ?
    The treeView SelectedNodes dosen't have FullPath like SelectedNode also doing SelectedNodes[i] dosen't have the FullPath property.
    Same as for if i want to delete a single directory or multiple selected directories:
    This is the continue of the code if it"s not a "file" (else) it's null i know it's a directory and doing:
    else
    file = true;
    RemoveDirectoriesRecursive(treeViewMS1.SelectedNode, treeViewMS1.SelectedNode.FullPath);
    Also here i'm using SelectedNode but if i marked multiple directories then i how do i loop over the SelectedNodes and send each SelectedNode to the RemoveDirectoriesRecrusive method ?
    My problem is how to loop over SelectedNode(multiple selection of files/directories) and send each selected file/directory to it's method like i'm doing now ?

    foreach (TreeNode n in treeViewMS1.SelectedNodes)
    // Remove everything associated with TreeNode n here
    I don't think it's any harder than that, is it?
    If you can multi-select both an item and one of its descendents in the tree, then you'll have the situation that you may have deleted the parent folder and all of its children by the time you get around to deleting the descendent.  But that's not such
    a big deal.  A file can get deleted externally to your program too - so you'll just have to deal with it having been deleted already (or externally) when you get around to deleting it yourself.

Maybe you are looking for

  • Can I use a different wall charger for my iPod

    can I use a different wall charger for my iPod

  • How do I delete photos in an album downloaded off my computer?

    So i recently downloaded photos off my computer to my iOS 7.1.1 running 5s, and I don't want some photos on it. But, when I try to delete them, there is no trashcan symbol , and If i wanted to, there's not even an album delete/clear button when i hit

  • Scheduled refresh of Discoverer Portlet is failed

    Hello Experts, I am now facing an issue while refreshing the Oracle Discoverer Portlets. thay are scheduled to run at specific intervals. I am getting the following errors Main Error for some portlets 5014> Element not found for: {cn=cf_a104, wbf=1,

  • Historic benchmarks

    Please help, I have recently crossed to the dark side from the land of OpenVMS and Alpha's. A long time ago in an office far far away - well the US, so far enough for me. Our organisation did some CPU benchmarks of our product using Netra T1405 with

  • IOS8 update bricked dead my iphone 4s (error 29) - restore to 7.1.2 not working

    IOS 8.0 update OTA to my 4S has killed the device. After the initial attempt failed I tried via iTune Restore and got Error 29. Attempts to restore to an older version (7.1.2) failed as well. Same error. The phone is stuck in the familiar "connect to