PO data to be sorted in bespoke table

What i'm trying to do is, for certain purchasing groups we need to sort the information in a bespoke table. I am looking for a user exit accessed at PO save that will collect the PO info and sort it in a given table.
I have looked at EXIT_SAPMM06E_012 > ZXM06U43, but this seems to be accessed before the PO number is given.
Is this the correct exit or is there another one.
Thanks

Not to sure about BADi's.
Is there a user exit that can be accessed after the PO number has been assigned?
Thanks

Similar Messages

  • How to read the data from a sorted table

    Hi all,
    How to read data from the sorted tables. Please provide some examples.
    Thanks and regards,
    Lisa

    You can read like this :
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    DO 4 TIMES.
      LINE-COL1 = SY-INDEX.
      LINE-COL2 = SY-INDEX ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    CLEAR LINE.
    READ TABLE ITAB WITH TABLE KEY COL1 = 3
                    INTO LINE TRANSPORTING COL2.
    WRITE:   'SY-SUBRC =', SY-SUBRC,
           / 'SY-TABIX =', SY-TABIX.
    SKIP.
    WRITE: / LINE-COL1, LINE-COL2.

  • Import/insert data from XML into Oracle database tables?

    Hi. (I am using JDeveloper 10.1.3.3.0 and Oracle 10g)
    I have been able to export the data from one of my database tables by using a View Object and .writeXML.
    Now, I want to take an xml file that is formatted in the same way as what is spit out by the writeXML and put that info in my database table. I followed online examples and have tried using .readXML like so:
    Element element = XMLDoc.getDocumentElement();
    vo.readXML(element, -1);
    I know it is sort of working, because at first I got an error message that one of the required attributes was missing. So, I added that attribute to my xml file and ran my code. No errors. But, I checked my database, and the new records were not added.
    Is there something I have done wrong? Or is there perhaps something I left out? I also noticed there were several versions of readXML like readFromXML. Which one should I use and how?
    Thanks.

    KUBA, I changed my code to match your example:
    DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    File xmlFile = new File("C:/myfilehere.xml");
    Document doc = db.parse(xmlFile);
    Element element = doc.getDocumentElement();
    vo.readXML(element, -1);
    vo.getDBTransaction().commit();
    I still get no errors, but my database table has no new records.
    Any ideas why?
    Thanks.

  • Comparison of Data Loading techniques - Sql Loader & External Tables

    Below are 2 techniques using which the data can be loaded from Flat files to oracle tables.
    1)     SQL Loader:
    a.     Place the flat file( .txt or .csv) on the desired Location.
    b.     Create a control file
    Load Data
    Infile "Mytextfile.txt" (-- file containing table data , specify paths correctly, it could be .csv as well)
    Append or Truncate (-- based on requirement) into oracle tablename
    Separated by "," (or the delimiter we use in input file) optionally enclosed by
    (Field1, field2, field3 etc)
    c.     Now run sqlldr utility of oracle on sql command prompt as
    sqlldr username/password .CTL filename
    d.     The data can be verified by selecting the data from the table.
    Select * from oracle_table;
    2)     External Table:
    a.     Place the flat file (.txt or .csv) on the desired location.
    abc.csv
    1,one,first
    2,two,second
    3,three,third
    4,four,fourth
    b.     Create a directory
    create or replace directory ext_dir as '/home/rene/ext_dir'; -- path where the source file is kept
    c.     After granting appropriate permissions to the user, we can create external table like below.
    create table ext_table_csv (
    i Number,
    n Varchar2(20),
    m Varchar2(20)
    organization external (
    type oracle_loader
    default directory ext_dir
    access parameters (
    records delimited by newline
    fields terminated by ','
    missing field values are null
    location ('file.csv')
    reject limit unlimited;
    d.     Verify data by selecting it from the external table now
    select * from ext_table_csv;
    External tables feature is a complement to existing SQL*Loader functionality.
    It allows you to –
    •     Access data in external sources as if it were in a table in the database.
    •     Merge a flat file with an existing table in one statement.
    •     Sort a flat file on the way into a table you want compressed nicely
    •     Do a parallel direct path load -- without splitting up the input file, writing
    Shortcomings:
    •     External tables are read-only.
    •     No data manipulation language (DML) operations or index creation is allowed on an external table.
    Using Sql Loader You can –
    •     Load the data from a stored procedure or trigger (insert is not sqlldr)
    •     Do multi-table inserts
    •     Flow the data through a pipelined plsql function for cleansing/transformation
    Comparison for data loading
    To make the loading operation faster, the degree of parallelism can be set to any number, e.g 4
    So, when you created the external table, the database will divide the file to be read by four processes running in parallel. This parallelism happens automatically, with no additional effort on your part, and is really quite convenient. To parallelize this load using SQL*Loader, you would have had to manually divide your input file into multiple smaller files.
    Conclusion:
    SQL*Loader may be the better choice in data loading situations that require additional indexing of the staging table. However, we can always copy the data from external tables to Oracle Tables using DB links.

    Please let me know your views on this.

  • Sort the internal table based on the vendor field

    hello experts,
    I am stuck with a small problem...
    I am uploading the data for partner association for vendors through lsmw BI program.
    I am collecting all the records in the end of trasaction and downloading all those records on to the apps server.
    I declared one internal table as
    TYPES: BEGIN OF type_erecord,
            mesg(1000) TYPE c,
            END OF type_erecord.
    DATA: t_precord type standard table of type_erecord initial size 0,
                w_precord type type_erecord.
    I am concatenating all the fields and moving to the internal table..
    concatenate zvendor_master-source  zvendor_master-lifnr  blf00-lifnr                   
                      zvendor_master-lname    zvendor_master-parvw
                      zvendor_master-psource  zvendor_master-pname
                      zvendor_master-lifn2        bwyt3-lifn2
                      zvendor_master-ekorg      zvendor_master-werks   
                      w_PLANT-muplant           zvendor_master-defpa
                      v_message
          into w_precord-mesg separated by c_pipe.
          append w_precord to t_precord.
    now at the end I have to sort this internal table t_precord based on blf00-lifnr
    can any one guide me how to do it
    Thanks for your anticipation
    Nitesha

    OK...
    Than you can create one more table and do the process of sorting and than put data into the final table.
    TYPES: BEGIN OF type_erecord,
    mesg(1000) TYPE c,
    END OF type_erecord.
    DATA: t_precord type standard table of type_erecord initial size 0,
    w_precord type type_erecord.
    TYPES: BEGIN OF type_erecord_1,
    mesg(1000) TYPE c,
    lifnr type blf00-lifnr ,  "<<<
    END OF type_erecord_1.
    DATA: t_precord_1 type standard table of type_erecord initial size 0,
    w_precord_1 type type_erecord.
    I am concatenating all the fields and moving to the internal table..
    concatenate zvendor_master-source zvendor_master-lifnr blf00-lifnr
    zvendor_master-lname zvendor_master-parvw
    zvendor_master-psource zvendor_master-pname
    zvendor_master-lifn2 bwyt3-lifn2
    zvendor_master-ekorg zvendor_master-werks
    w_PLANT-muplant zvendor_master-defpa
    v_message
    into w_precord_1-mesg separated by c_pipe.
    w_precord_1-lifnr = blf00-lifnr .  " <<<
    append w_precord_1 to t_precord_1.   " <<<
    SORT T_PRECORD_1 by LIFNR.  " <<
    LOOP AT T_PRECORD_1 into w_precord_1.
      move-corresponing w_precord_1 to w_precord.
      append w_precord to T_PRECORD.
      clear  w_precord .
    endloop.
    Regards,
    Naimesh Patel

  • How to sort an internal table with a header line?

    hi all,
    i have declared table i_bseg type standard table of bseg with header line.
    now i have populated data in i_bseg.
    now i am sorting it by bukrs
    ie i am writing sort i_bseg by bukrs.
    before sorting all i_bseg-belnrs were populated...
    but after sorting the contents of  the i_bseg is changing.
    some of the belnrs are getting deleted..
    is there any special way to sort an internal table with header line...?

    hi,
    <b>SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE].</b>
    The statement sorts the internal table <itab> in ascending order by its key.<b> The statement always applies to the table itself, not to the header line</b>.
    If you have an internal table with a structured line type that you want sort by a different key, you can specify the key in the SORT statement:
    SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE]
                 BY <f1> [ASCENDING|DESCENDING] [AS TEXT]
                    <fn> [ASCENDING|DESCENDING] [AS TEXT].
    <b>this is your sort statement:  sort i_bseg by bukrs.
    you try with this statement:  sort i_bseg by bukrs STABLE.</b>
    regards,
    Ashokreddy

  • Supported date formats for sorting

    Can someone point me to a document describing the supported
    date formats for sorting? I mean, how should I format a date column
    in an XML dataset in order to have this column correctly sorted
    using the Spry framework?
    Thank you and sorry if the question is trivial.

    Thanks, what I have done for the moment as a temporary
    solution is to use the two date formats and have them both inside
    the one cell in the table (the column for the sortable date
    yyyy-mm-dd). In my CSS I have created a style for the first date
    that has it's visibility as hidden. That way it's sorting the Date1
    but only Date2 is being shown to the users as the other cells have
    more than one line of text it doesn't look too off centre.
    <div spry:region="ds2">
    <table width="662">
    <tr>
    <th width="127" class="eventhead"
    spry:sort="Date1">Date</th>
    <th width="151" class="eventhead"
    spry:sort="Type">Type</th>
    <th width="146" class="eventhead"
    spry:sort="Title">Title</th>
    <th width="189" class="eventhead"
    spry:sort="Venue">Venue</th>
    </tr>
    <tr spry:repeat="ds2" spry:setrow="ds2">
    <td height="53" class="event">{Date2}<span
    class="eventhide">{Date1}</span></td>
    <td class="event">{Type}</td>
    <td class="event">{Title}</td>
    <td class="event">{Venue}</td>
    </tr>
    </table>
    </div>
    </div>
    It seems to be working for the moment...

  • Problem - Sort output in table (multiple columns)

    Dear all,
    First of all - Best wishes for 2008.
    I probably have an easy matter, but i can't figure it out, and on this forum very little is mentioned about the sort operator, so therefore this new post.
    I have a dashboard with some input fields (dropdown boxes).
    I have a table (as result of query) and this works fine. The table consists of several columns. (so far no rocket science).
    Generally the structure of the table is like:
    IM SBU | App. Request key | App. Request | etc....
    I want the IM SBU colum to be sorted (assending or decending doenst matter).
    But somehow the second column is the one where the data is sorted (standard).
    My guess this happends because its a key value? or its because it starts with an A (and the other with and I).
    So i insert the sort opperator, add an object (IM SBU) and select up. Then from that opperator i create a table.
    This results in a table with just 1 column (IM SBU).
    So i tried several things.
    I tried to sort on the IM SBU key (this gives the same result).
    I added all colums as an object of the sort opperator...but this still gives the same result of just 1 column.
    Any ideas?
    Regards.
    Bart

    Dear all.
    I'm wondering if  anybody else experienced errors with the sort and the amount of columns shown in a table????
    In general i have a query and want a table as output with 8 columns (sorted by 1 object). I figured out the following and will demonstrate it with 4 situations.
    Situation1 (auto fit table without sort)
    In the properties of the table i select 'frame style'= 'Primary frame' and "fit content" = 'auto'. I run the dashboard and the content of the query is good. All columns are shown and the chart width is auto determined.
    Situation 2 (auto fit table with sort)
    I want to sort on 1 object, so from query i insert a sort (select object), and from sort i create table. Then i select 'frame style'= 'Primary frame' and "fit content" = 'auto'. I run the dashboard and the content of the query is NOT good. I just get to see 1 column. But i selected 8 columns.
    Situation 3 (actual fit table with sort)
    I want to sort on 1 object, so from query i insert a sort, and from sort i create table. Then i select 'frame style'= 'Primary frame' and select "fit content" = 'actual size'. I run the dashboard and the content of the query is good (but not what i want). I get to see all 8 columns. But the table is smaller than i want. I doenst auto fit.
    Situation 4 (fit width table with sort)
    I want to sort on 1 object, so from query i insert a sort (select object), and from sort i create table. Then i select 'frame style'= 'Primary frame' and "fit content" = 'fit width'. I run the dashboard and the content of the query is NOT good. I just get to see 1 column (again). But i selected 8 columns.
    Any suggestions?
    Any known work arounds?
    Or is this an error in VC and should i request a note?
    Regards.
    Bart

  • Sorting the internal table I'm getting ......

    While sorting the internal table I'm getting one of the columns not sorted .... why is that? for example
    A   B   C
    9   2    11
    4   9    10
    8   3    7
    using ---> sort itab by A B C. gives me this
    A   B   C
    4   2    7
    8   9    10
    9   3    11
    please help?

    Hi,
    check this code,
    REPORT ZEX31 .
    data : begin of itab occurs 0,
           f1 type i,
           f2 type i,
           f3 type i,
           end of itab.
    itab-f1 = 9 .
    itab-f2 = 2.
    itab-f3 = 11 .
    append itab.
    clear itab.
    itab-f1 = 4 .
    itab-f2 = 9.
    itab-f3 = 10 .
    append itab.
    clear itab.
    itab-f1 = 8 .
    itab-f2 = 3.
    itab-f3 = 7 .
    append itab.
    clear itab.
    loop at itab.
      write : / itab-f1 , itab-f2 , itab-f3.
    endloop.
    sort itab by f1 f2 f3.
    skip 2.
    loop at itab.
      write : / itab-f1 , itab-f2 , itab-f3.
    endloop.
    sorting will be based on the order u give,
    if u give order f1 f2 f3 then first f1 will be checked and sorted in the order of it.
    o/p will be
    4  9  10
    8  3   7
    9  2  11

  • Examples of sorted hashed  internal tables

    Hello friends
    Can someone give me an example code in which sorted tables and hashed tables have been used.
    Regards

    hi Surya,
    Sorted tables
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
    REPORT ZREPORT_SORTED1.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    DO 4 TIMES.
      LINE-COL1 = SY-INDEX.
      LINE-COL2 = SY-INDEX ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    CLEAR LINE.
    READ TABLE ITAB WITH TABLE KEY COL1 = 3
                    INTO LINE TRANSPORTING COL2.
    WRITE:   'SY-SUBRC =', SY-SUBRC,
           / 'SY-TABIX =', SY-TABIX.
    SKIP.
    WRITE: / LINE-COL1, LINE-COL2.
    The output is:
    SY-SUBRC =    0
    SY-TABIX =       3
             0        9
    REPORT ZREPORT_SORTED2.
    DATA: BEGIN OF LINE,
            COL1 TYPE I,
            COL2 TYPE I,
          END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    DO 4 TIMES.
      LINE-COL1 = SY-INDEX.
      LINE-COL2 = SY-INDEX ** 2.
      INSERT LINE INTO TABLE ITAB.
    ENDDO.
    READ TABLE ITAB WITH KEY COL2 = 16  TRANSPORTING NO FIELDS.
    WRITE:   'SY-SUBRC =', SY-SUBRC,
           / 'SY-TABIX =', SY-TABIX.
    The output is:
    SY-SUBRC =    0
    SY-TABIX =       4
    Hashed tables
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
    REPORT ZREPORT_HASHED1.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE HASHED TABLE OF LINE WITH UNIQUE KEY COL1.
    DO 4 TIMES.
      LINE-COL1 = SY-INDEX.
      LINE-COL2 = SY-INDEX ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    LINE-COL1 = 2. LINE-COL2 = 3.
    READ TABLE ITAB FROM LINE INTO LINE COMPARING COL2.
    WRITE: 'SY-SUBRC =', SY-SUBRC.
    SKIP.
    WRITE: / LINE-COL1, LINE-COL2.
    The output is:
    SY-SUBRC =    2
             2        4
    REPORT ZREPORT_HASHED2.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE HASHED 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.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    READ TABLE ITAB WITH TABLE KEY COL1 = 2 ASSIGNING <FS>.
    <FS>-COL2 = 100.
    LOOP AT ITAB INTO LINE.
      WRITE: / LINE-COL1, LINE-COL2.
    ENDLOOP.
    The output is:
             1        1
             2      100
             3        9
             4       16
    Regards
    vijay

  • Formatted Data from 1 to many relationship tables

    Hi All,
    How can we get data from 1 to many relationship table in a formatted way, for example I have tables:
    Search (Id, title)
    Criteria (Id, searchId, radius, latitude, longitude)
    Results (Id, searched, zip-code, city, state)
    And I want response to look like this:
    "Id":"A86E8DE3-36B0-4DBE-822E-326F84AF8FEE",
    "title":"Untitled",
    "criteria":{
    "Id":"A86E8DE3-36B0-4DBE-822E-326F84GHFUI",
    "searchId":"A86E8DE3-36B0-4DBE-822E-326F84AF8FEE",
    "radius":5,
    "latitude":31.2379068,
    "longitude":-85.456757
    "results":[
    "Id":"A86E8DE3-36B0-4DBE-822E-326F8HKLLKJ",
    "searchId":"A86E8DE3-36B0-4DBE-822E-326F84AF8FEE",
    "zipcode":"36302",
    "city":"Dothan",
    "state":"Alabama"
    One ugly way would be to get search data and then execute two queries against each search one for criteria and one for result. Any other way. Also sometime we to need to increase timeout of Custom API request depending on the complexity
    of it. How to sort it out?
    Thanks,
    Attiqe Ur Rehman

    There are a couple of options:
    Use database views. For an example, see my forum posts on this thread: https://social.msdn.microsoft.com/Forums/azure/en-US/4c056373-d5cf-4ca6-9f00-f152d2b01372/best-practice-for-syncing-related-tables-in-offline-mode?forum=azuremobile#0e23494c-1da2-4ee3-ac5a-6955d0dfed3e. 
    Or, if you using the .NET backend, you can use Automapper to flatten the relationships:
    http://blogs.msdn.com/b/azuremobile/archive/2014/06/18/insert-update-related-data-with-1-n-relationship-using-net-backend-azure-mobile-services.aspx

  • Sorting techinque without using sort statement /Comparing table fields.

    Hi,
    How to achieve sorting techinque without using sort statement in tables.
    Also how to compare fields of 2 custom tables and check their compatability without using code ?

    Hi,
    Refer the below program, it will be helpful.
    types: begin of t_int,
             int type i,
            end of t_int.
    data: it_int type standard table of t_int,
           wa_int type t_int,
           wa_int1 type t_int.
    wa_int-int = 70.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 50.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 20.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 30.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 23.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 23.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 32.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 77.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 99.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 1.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 11.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 90.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 40.
    append wa_int to it_int.
    clear wa_int.
    data: wk_line type i.
    data: cnt type i.
    data: cnt1 type i.
    describe table it_int lines wk_line.
    clear: cnt,cnt1.
    data wk_flag type c.
       clear wk_flag.
    while wk_line gt cnt1.
       cnt = cnt + 1.
       read table it_int into wa_int index cnt.
       cnt1 = cnt + 1.
       read table it_int into wa_int1 index cnt1.
       if wa_int-int lt wa_int1-int.
         modify it_int from wa_int index cnt1.
         modify it_int from wa_int1 index cnt.
         wk_flag = 'X'.
       endif.
       if cnt1 eq wk_line.
         clear: cnt, cnt1.
         if wk_flag eq 'X'.
         clear wk_flag.
         continue.
         else.
           exit.
         endif.
       endif.
    endwhile.
    loop at it_int into wa_int.
       write: / wa_int-int.
    endloop.

  • Sort a Transparent Table

    Hi
    how can i sort a trnsparent table.
    Regards
    Arun

    Hi Arun,
    There's no such a thing as sorting a transparent table. Or any other kind of table in the database for that matter.
    If you want to sort the data, you would most probably be needing to do it for the purpose of a report or some other <i>application</i>. In that case, you would have to fetch the data from the database table into an internal table in your program and then sort the data using the SORT statement on internal table.
    Hope this clears your doubt. But in the future, it would certainly help us respond to your queries if you are more articulate about your requirement.
    Regards,
    Anand Mandalika.

  • Bespoke table technical details

    Hello,
    SAP system 470
    I have created a bespoke table and set the size category to be 5 (300,000 to 600,000). Currently the table has just under 900,000 records and it's only going to get bigger ....
    I have two questions
    1. I want to increase the table size to 600,000 to 24,000,000,, will this cause any problems?
    2. when reading the table currently with table size  (300,000 to 600,000) with 900,000, will this cause system performance issues?
    Currently there is no table buffering  ....
    The table is updated and read frequently.
    Any suggestions would be appreciated
    Regards
    J-J

    Hi J-J,
    The table size category is set just for information purpose for the DB to reserve space for the table in order to avoid fragmentation of data. This settings was espacially for DB 10 years ago, but now the DB Management Systems usually handle the table allocation automaticalyl based on the actual table size and number of read/write operations executed on the table.
    You can increase it to the next level without any issue.
    Regards,
    Marcin

  • Need some input on comparision btw sorted and std table.

    Hi,
    Just a small comparision on using standard table, sorted table, and sorted table using index in a loop with where conditions.
    I just ran this report to find out the time taken and it is quite surprising. Case 3 of the program is quite faster than case2 and of course very fast than case1. any inputs on how this is possible???
    output value :
    try 1: 674, 192, 147 for 100 entries.
    try 2: 603, 53 , 6 for 20 entries.
    *C-- Small report to compare sorted and standard table.
    REPORT  zloopcompare.
    TYPES : BEGIN OF tp_marc,
              werks TYPE marc-werks,
              matnr TYPE marc-matnr,
            END OF tp_marc.
    DATA : t_marc TYPE STANDARD TABLE OF tp_marc.
    DATA : t_marc1 TYPE SORTED TABLE OF tp_marc
    WITH NON-UNIQUE KEY werks matnr.
    DATA : wa_marc TYPE tp_marc.
    DATA : p1 TYPE i,
           p2 TYPE i.
    DATA : l_tabix TYPE sy-tabix.
    DATA : count TYPE i.
    PARAMETERS : p_werks TYPE marc-werks OBLIGATORY.
    SELECT werks matnr FROM marc
    INTO TABLE t_marc1
    UP TO 1000 ROWS.
    t_marc[] = t_marc1[].
    *Case1 - standard table with where condition.
    GET RUN TIME FIELD p1.
    LOOP AT t_marc INTO wa_marc
    WHERE werks EQ p_werks.
    ENDLOOP.
    GET RUN TIME FIELD p2.
    p2 = p2 - p1.
    WRITE : / p2.
    *Case2- sorted table sorted as per the where condition.
    GET RUN TIME FIELD p1.
    LOOP AT t_marc1 INTO wa_marc
    WHERE werks EQ p_werks.
    ENDLOOP.
    GET RUN TIME FIELD p2.
    p2 = p2 - p1.
    WRITE : / p2.
    *Case3- using index to get faster access.
    GET RUN TIME FIELD p1.
    READ TABLE t_marc1 INTO wa_marc WITH KEY werks = p_werks.
    IF sy-subrc EQ 0.
      l_tabix = sy-tabix + 1.
      LOOP AT t_marc1 INTO wa_marc FROM l_tabix.
        IF wa_marc-werks NE p_werks.
          EXIT.
        ENDIF.
      ENDLOOP.
    ENDIF.
    GET RUN TIME FIELD p2.
    p2 = p2 - p1.
    WRITE : / p2.

    HI sharath,
    I just checked and executed the code :
    1. case 1 and 2 are fine.
    2. but 3 is not what u desire.
      <b>(in fact its not looping at all)</b>
    3.  the code in case 3 is :
    IF wa_marc-werks NE p_werks.
    EXIT.
    ENDIF.
    So the loop goes inside ONLY ONCE,
    and so, hence, its LIGHTNING FAST.
    Please note that READ TABLE reads only
    1 record.
    4. ***************
    Instead of NE
    write this, and u will see that its not so fast.
    <b>IF wa_marc-werks = p_werks.</b>
    EXIT.
    ENDIF.
    regards,
    amit m.

Maybe you are looking for

  • Get cell value in Planning Data form and using it in a business rule

    Hi Everybody, if i set the data type of an Account Member as text, is there a way to get the value inserted by the user in a dataform, turning it as dimensional member and using it in a business rule? So, if the user insert the value "USA" in a cell,

  • Change description of Product Type Dropdown in SRM 7.0

    Hello, We are upgrading to SRM 7.0 and have a requirement where we need to rename the decription of Product type (dropdown) "Materials" to "Goods" on the "Describe Requirement " screen. We tried modifying the value table COMC_PR_TYPE_T which stores t

  • Sender RFC adapter High volume messaging

    Hi, This question is related to this thread:RFC connection problem ERP system is sending through 1 RFC dest. (program ID) 20 requests in a minute. And PI starts to hang. ERP is not able tp sent the messages and after a while the request sent from ERP

  • Running iPhone SDK & Leopard on G4 1.42 emac?

    Looking for a cheap entry point to get into developing apps for iphone. I can get the 1.42ghz G4 emac for $200 or G5 PPC 2.0ghz for $775. I've read that the G4 will run leopard, but havent found anyone running leopard and iphone sdx on the G4. I'd li

  • DebugMBean not found when creating EJB3 Entity Manage

    Hi, Got exception when test my ejb3 entity bean out of container. weblogic.jar which I get from weblogic 10.3 has been included in he classpath. I checked the weblogic.jar, it does not have DebugMBean.class. I believe it is a weblogic bug. Can anybod