Problem in using read statement.

i am using the read statement as follows :
read table tekpo with key werks = '1001'.
it is not reading the corresponding record.
though it reads or not it is returning the sy-subrc value 0.
plz let me know why it is happening as soon as possible.
points will be awarded.

Hi Srinivas rao,
You can use this example program and make the changes in your program as well:
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
I think you have satisfied.
Thanks and regards
Vipin Das

Similar Messages

  • Problem in using modify statement inside a Perform

    Hi Experts,
    loop at t_data into wa_data.
    IF wa_data1-zbukrs IS INITIAL.
            wa_data1-zstat = 'E'.
            w_messg =  'Company code is blank in upload data'.
            CONCATENATE wa_data1-zbukrs w_messg INTO w_msg
              SEPARATED BY space.
              CONCATENATE w_msg  wa_data1-zmsg INTO w_msg
    SEPARATED BY
    '|'.
              wa_data1-zmsg = w_msg.
              MODIFY t_data1 FROM wa_data1.
    endif.
    IF wa_data1-zfwcd IS INITIAL.
             wa_data1-zstat = 'E'.
             w_messg =  'Forwarder code is blank in upload data'.
            CONCATENATE wa_data1-zfwcd w_messg INTO w_msg
              SEPARATED BY space.
              CONCATENATE w_msg  wa_data1-zmsg INTO w_msg
    SEPARATED BY
    '|'.
              wa_data1-zmsg = w_msg.
              MODIFY t_data1 FROM wa_data1.
    endif.
    IF wa_data1-zinvno IS INITIAL.
              wa_data1-zmsg = w_msg.
              MODIFY t_data1 FROM wa_data1.
       wa_data1-zstat = 'E'.
             w_messg =  'Invoice number is blank in upload data'.
            CONCATENATE wa_data1-zinvno w_messg INTO w_msg
              SEPARATED BY space.
              CONCATENATE w_msg  wa_data1-zmsg INTO w_msg
    SEPARATED BY
    '|'.
              wa_data1-zmsg = w_msg.
              MODIFY t_data1 FROM wa_data1.
    endif.
    endloop.
    My doubt is:
            wa_data1-zstat = 'E'.
            w_messg =  'Company code is blank in upload data'.
            CONCATENATE wa_data1-zbukrs w_messg INTO w_msg
              SEPARATED BY space.
              CONCATENATE w_msg  wa_data1-zmsg INTO w_msg
    SEPARATED BY
    '|'.
              wa_data1-zmsg = w_msg.
              MODIFY t_data1 FROM wa_data1.
    i want write the above code to be written in a perform statement
    becos iam using the above code in multiple places in my program.
    but the problem iam facing is modify not working in perform statement.
    Regards,
    Raj.

    hi Raj,
       use FIELD-SYMBOLS so that you don't have to use MODIFY statement.
    FIELD-SYMBOLS: <fs> like line of T_data.
    loop at t_data ASSIGNING <fs>.
    IF  <fs>-zbukrs IS INITIAL.
    <fs>-zstat = 'E'.
    w_messg = 'Company code is blank in upload data'.
    CONCATENATE <fs>-zbukrs w_messg INTO w_msg
    SEPARATED BY space.
    CONCATENATE w_msg <fs>-zmsg INTO w_msg
    SEPARATED BY   '|'.
    <fs>-zmsg = w_msg.
    endif.
    IF <fs>-zfwcd IS INITIAL.
    <fs>-zstat = 'E'.
    w_messg = 'Forwarder code is blank in upload data'.
    CONCATENATE <fs>-zfwcd w_messg INTO w_msg
    SEPARATED BY space.
    CONCATENATE w_msg <fs>-zmsg INTO w_msg
    SEPARATED BY '|'.
    <fs>-zmsg = w_msg.
    endif.
    endloop.

  • How to use read statement on a select options

    Hi all,
    I am trying to read the all the values on user selection screen select options.
    I have an internal table loaded with data.
    So while looping this internal table, I need to check the table certain tank field (lgort) against the select options tank values entered by user.
    It is fine when user uses the multiple values on the select options since I use the "READ" statement on the select options and get the matching values.
    Example: when user uses the multiple value selection on a select-options to enter values A554 and A555
    The select-options table will be:
    sign   option    low         high
    I          EQ       A554
    I          EQ       A555
    LOOP AT gt_output_location INTO gw_output.
      READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.
        IF sy-subrc = 0.
        * append row to another table.
        ENDIF.
    ENDLOOP.
    Problem:
    Example: when user uses range on a select-options to enter values A554 and A555
    sign   option    low         high
    I          BT      A554       A555
    The read statement can only get matching value A554.  
    LOOP AT gt_output_location INTO gw_output.
      READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.
        IF sy-subrc = 0.
        * append row to another table.
        ENDIF.
    ENDLOOP.
    Anyone have any idea on this?? Thanks!!

    Hi all, I need to consider each and every lines of the gt_output_location as there are other fields need to consider also. Basically I am checking each and every lines of this table to see which lines I need to append to another table.
    That is why I did not use  "LOOP AT gt_output_location INTO gw_output WHERE lgort IN s_lgort"
    The full gt_output_location:
    LOOP AT gt_output_location INTO gw_output.
    *      IF p_lgort = space AND p_umlgo = space.
           IF gv_lines_lgort = 0 AND gv_lines_umlgo = 0.
    *       only append those from tank <> to tank
             IF gw_output-lgort <> gw_output-umlgo.
               APPEND gw_output to gt_output.
               CLEAR gw_output.
             ELSE. "from tank == to tank
    *         append those from plant <> to plant
               IF gw_output-werks <> gw_output-umwrk.
                 APPEND gw_output to gt_output.
                 CLEAR gw_output.
               ENDIF.
             ENDIF.
    *      ELSEIF p_lgort = space AND p_umlgo <> space.
           ELSEIF gv_lines_lgort = 0 AND gv_lines_umlgo > 0.
    *        IF gw_output-umlgo = p_umlgo.
             READ TABLE s_umlgo INTO gw_umlgo WITH KEY low = gw_output-umlgo.
             IF sy-subrc = 0.
    *         only append those from tank <> to tank
               IF gw_output-lgort <> gw_output-umlgo.
                 APPEND gw_output to gt_output.
                 CLEAR gw_output.
               ELSE. "from tank == to tank
    *           append those from plant <> to plant
                 IF gw_output-werks <> gw_output-umwrk.
                   APPEND gw_output to gt_output.
                   CLEAR gw_output.
                 ENDIF.
               ENDIF.
             ENDIF.
    *      ELSEIF p_umlgo = space AND p_lgort <> space.
           ELSEIF gv_lines_umlgo = 0 AND gv_lines_lgort > 0.
    *        IF gw_output-lgort = p_lgort.
             READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.
             IF sy-subrc = 0.
    *         only append those from tank <> to tank
               IF gw_output-lgort <> gw_output-umlgo.
                 APPEND gw_output to gt_output.
                 CLEAR gw_output.
               ELSE. "from tank == to tank
    *           append those from plant <> to plant
                 IF gw_output-werks <> gw_output-umwrk.
                   APPEND gw_output to gt_output.
                   CLEAR gw_output.
                 ENDIF.
               ENDIF.
             ENDIF.
           ELSE.
    *        IF gw_output-lgort = p_lgort AND gw_output-umlgo = p_umlgo.
             READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.
             IF sy-subrc = 0.
    *         only append those from tank <> to tank
               IF gw_output-lgort <> gw_output-umlgo.
                 APPEND gw_output to gt_output.
                 CLEAR gw_output.
               ELSE. "from tank == to tank
    *           append those from plant <> to plant
                 IF gw_output-werks <> gw_output-umwrk.
                   APPEND gw_output to gt_output.
                   CLEAR gw_output.
                 ENDIF.
               ENDIF.
             ENDIF.
             READ TABLE s_umlgo INTO gw_umlgo WITH KEY low = gw_output-umlgo.
             IF sy-subrc = 0.
    *         only append those from tank <> to tank
               IF gw_output-lgort <> gw_output-umlgo.
                 APPEND gw_output to gt_output.
                 CLEAR gw_output.
               ELSE. "from tank == to tank
    *           append those from plant <> to plant
                 IF gw_output-werks <> gw_output-umwrk.
                   APPEND gw_output to gt_output.
                   CLEAR gw_output.
                 ENDIF.
               ENDIF.
             ENDIF.
           ENDIF.
           CLEAR gw_lgort.
           CLEAR gw_umlgo.
         ENDLOOP.

  • Problem with using read() method of BufferedInputStream

    Hi,
    I m using BufferedInputStream for reading from a socket and I m using read() method for getting data character by character from it . It runs successfully for sometime and then blocks indefinitely and hangs the application. Maybe , when it does not find any data to be read from socket or the LAN connection is broken, it keeps on trying and blocks further processing.
    Is there any way to solve this problem so that it does not hangs the application and comes out gracefully ?
    Thanx and regards,
    Aartee Goyal

    Most read-methods are blocking, if there is nothing to read.
    If you don't want, that your application is blocking, too, the read method has to run in a thread.
    The second possibility is, to ask, whether there is something to read
    BufferedInputStream bis = ...
    if (bis.available() > 0) {
       int b = bis.read();
    else {
       // sleep or break or ???
    }

  • Using read statement

    Hi experts
    how should i modify this statement
    'select single parnr from ihpa into g_parnr' inorder to improve the performance.
    can i use 'read' if yes can u plz give me the code for that
    regards
    siri

    Hii
    use identical select statements.
    Therefore, SORT the table and use READ TABLE WITH KEY BINARY SEARCH.
    USE THE FOLLOWING
    sort IT_VBAP BY MATNR .
    LOOP AT IT_VBAP.
    <b>READ TABLE IT_MAKT KEY MATNR = IT_VBAP-MATNR        
    TRANSPORTING MAKTX binary search .</b>
    IF SY-SUBRC NE 0.
    <b>SELECT MATNR MAKTX FROM MAKT
    APPENDING TABLE IT_MAKT-MAKTX
    WHERE MATNR EQ IT_VBAP-MATNR.</b>
    ENDIF.
    MOVE: IT_MAKT TO IT_VBAP-MAKTX.
    ENDLOOP.
    <b>Instead of:      </b>
    LOOP AT IT_VBAP.
    SELECT SINGLE MAKTX INTO IT_VBAP-MAKTX
    FROM MAKT
    WHERE MATNR EQ IT_VBAP-MATNR.
    ENDLOOP.
    reward points if helpful .
    Regards
    Naresh

  • Please help me urgently (Problem in using delete statement)

    Hello,
    I want to run delete query where table name should come from a variable .I have written the following procedure but its not working .Could you please help me
    DECLARE
    processtemplatename VARCHAR2(64);
    CURSOR T1Cursor IS
    select Process_template_name from ProcessTemplate
    where PROCESS_template_ID in
    ( select PROCESS_template_ID from PROCESSINSTANCE
    where process_instance_id in
    (select process_instance_id from processinstance where STATUS = 'PI_COMPLETED' OR STATUS = 'PI_REMOVED' ));
    BEGIN
    OPEN T1Cursor;
    LOOP
    FETCH T1Cursor INTO processtemplatename;
    EXIT WHEN T1Cursor%NOTFOUND;
    DELETE FROM processtemplatename WHERE process_instance_id in
    ( select process_instance_id from PROCESSINSTANCE where STATUS = 'PI_COMPLETED' OR STATUS = 'PI_REMOVED' );
    END LOOP;
    CLOSE T1Cursor;
    END;
    I am getting the error
    ERROR at line 19:
    ORA-06550: line 19, column 27:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 19, column 15:
    PL/SQL: SQL Statement ignored
    even when i used
    DECLARE
    processtemplatename VARCHAR2(64);
    BEGIN
    processtemplatename := 'example1';
    DELETE FROM processtemplatename WHERE process_instance_id in
    ( select process_instance_id from PROCESSINSTANCE where STATUS = 'PI_COMPLETED' OR STATUS = 'PI_REMOVED' );
    END;
    I am still getting the same error message
    Thanks,
    Salam.

    And BTW you do not need that clumsy CURSOR c.. OPEN c.. FETCH c INTO... CLOSE c etc. It is "reserved" for more complex cases when you cannot use:
    <pre>
    FOR P IN
         select Process_template_name
              from ProcessTemplate
              where PROCESS_template_ID in
                   (select PROCESS_template_ID
                        from PROCESSINSTANCE
                        where process_instance_id in
                             (select process_instance_id
                                  from processinstance
                                  where STATUS = 'PI_COMPLETED'
                                       OR STATUS = 'PI_REMOVED'
    LOOP
         EXECUTE IMMEDIATE
              'DELETE FROM ' || P.Process_template_name ||
                   ' WHERE process_instance_id in
                        (select process_instance_id
                             from PROCESSINSTANCE
                             where STATUS = ''PI_COMPLETED'' OR STATUS = ''PI_REMOVED''
    END LOOP;
    </pre>

  • How to pass select-options in key while using Read Statement.

    Hi SAP gurus,
    I was using a select stmt. with were clause of Select-options it was working fine,
    now my scenerio is changed i need to read an internal table
    with key of select-options....
    how to read internal table with key S_MATNR (Select-options).

    Hi,
    We can certainly do this.
    We need to loop the internal table with select-options condition.
    Example  :
    LOOP AT ITAB WHERE FIELD =  S_FIELD.
    ENDLOOP.
    This should solve your problem.
    Plz reward if useful.
    Thanks,
    Dhanashri.

  • Problem while using reading USB Port : using JSR80

    i want to read the data comming from a usb keyboard.
    So i looked for the api's in java and could find jUSB and JSR80.
    when i tried using jUSB, i could detect the device connected to the usb port
    but for that i had to do many things, whih included editing the registry to make a generic JSUB driver. so this implementation is not acceptable to my current requirement which is a web application..and the java program to detect the usb device come in an applet. so we cannot go to each client machines accessing the page and configure the driver and make regisrty edits.
    So i moved to JSR80..which was telling abt a complete implementation in Linux.
    but what i want is for windows. JSR80 also have an uncertified windows support. so i tried usig it.
    i downloaded the following files
    http://javax-usb.cvs.sourceforge.net/javax-usb/javax-usb-libusb/lib/jsr80_windows.jar?view=log
    javax.usb.properties
    jsr80.jar
    jsr80_ri.jar
    jsr80_windows.jar
    downloaded libusb-win32-filter-bin-0.1.10.1.exe from
    http://libusb-win32.sourceforge.net/
    and created an eclipse project added the jars using the javabuildpath menu.
    copied the location of javax.usb.properties in classpath system variable.
    insatlled the exe for libusb.
    now i wrote the following code.
    it didn't show any compile error so i assumed what i did with the jars are correct.
    import java.util.Properties;
    import javax.usb.UsbException;
    import javax.usb.UsbHostManager;
    import javax.usb.UsbHub;
    import javax.usb.UsbServices;
    public class SampleUSBTest {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              SampleUSBTest obj=new SampleUSBTest();
         public SampleUSBTest()
              UsbServices services;
              try {
                   services = UsbHostManager.getUsbServices();
                   UsbHub vroothub = services.getRootUsbHub();
                   String s=vroothub.toString();
                   System.out.println(s);
              } catch (SecurityException e) {
                   e.printStackTrace();
              } catch (UsbException e) {
                   e.printStackTrace();
    }But when i ran the code it showed the following runtime error.
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
         at com.mcreations.usb.windows.JavaxUsb.<clinit>(JavaxUsb.java:65)
         at com.mcreations.usb.windows.WindowsUsbServices.<init>(WindowsUsbServices.java:46)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at javax.usb.UsbHostManager.createUsbServices(Unknown Source)
         at javax.usb.UsbHostManager.getUsbServices(Unknown Source)
         at SampleUSBTest.<init>(SampleUSBTest.java:23)
         at SampleUSBTest.main(SampleUSBTest.java:16)can anyone please give suggestions on this.
    sample code with steps to configure and the links for reference will be really appreciated.
    thank u

    I am also facing the same problem with the code and getting errors while running my application in Eclipse is this some version problem or any other isues are afftecting my application to run successfully.
    I get following errors while running my application inspite of having all the jars and libusb for windows:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
         at com.mcreations.usb.windows.JavaxUsb.<clinit>(JavaxUsb.java:65)
         at com.mcreations.usb.windows.WindowsUsbServices.<init>(WindowsUsbServices.java:46)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at java.lang.Class.newInstance0(Class.java:350)
         at java.lang.Class.newInstance(Class.java:303)
         at javax.usb.UsbHostManager.createUsbServices(Unknown Source)
         at javax.usb.UsbHostManager.getUsbServices(Unknown Source)
         at org.symphony.embedded.ShowTopology.getVirtualRootUsbHub(ShowTopology.java:56)
         at org.symphony.embedded.FindUsbDevice.main(FindUsbDevice.java:29)

  • Problem with using Callable Statements via JDBC/JSP

    Hi Pals,I have this scenario;
    If a stored procedure has being created for me on Oracle database and i need
    to execute the stored procedure via my JSP ,where i capture some parameters in
    my JSP,send this parameters to the Stored Procedure . Then the Stored procedure decides if its an Update or Insert depending on the PL/SQL(Stored Procedure) code on database.
    How do i go about this using The CallableStatement java API and obviously JDBC.
    All suggestions will be appreciated and codes as well.
    Cheers.

    This is a basic question about how a CallableStatement works in JDBC. Read the documentation on CallableStatement in the JDK. If you are having trouble understanding something in the JDK, come back here and ask a specific question.

  • Problems in using SQL statement

    Is that a way that i could use java sql statement for COUNT or SUM SQL Statement
    String query = "SELECT S.Name,COUNT(TS.NoOfPoints) AS Points FROM TeamS,TeamStatistics TS WHERE S.TeamID = TS.TeamID ORDER BY TS.NoOfPoints DESC";
    i am trying to count the num of points for each team.
    I have eror message,execute the sql statement
    is the sql statement correct.

    String query= "SELECT S.TeamName,COUNT(TS.NoOfPoints) FROM Team T,TeamStatistics TS GROUP BY T.TeamName HAVING T.TeamID = TS.TeamID";
    Statement statement = connection.createStatement();
    ResultSet rs = statement.executeQuery(query);
    while(rs.next())
    System.out.println(rs.getString("TeamName"));
    System.out.println(rs.getString("NoOfPoints"));
    The sql doesn't work, i really dun konw what to do

  • Problem while using read(char[]) method of stream

    Hi I am trying to read different xml files, , hence i am using a buffered reader, and the read(char[]) method in the bufferereader.
    //rawContent - is the xml file content
          BufferedReader br = new BufferedReader(new InputStreamReader(rawContent,
              ENCODING_FORMAT));
          int ascii = 0;
          char ch[]= new char[200];
          while((ascii = br.read(ch)) != -1) {       
            rawContentBuffer.append(ch);
          }This is the error that i get when i execute the above piece of code. I have checked the files they have no white spaces after the xml contents.
    Please tell me how i can overcome this.
    2006-02-17 19:43:52,826 ERROR [com.test.web.taglib.LightTag] - Error in parsing the XHTMLContent is not allowed in trailing section.
    org.xml.sax.SAXParseException: Content is not allowed in trailing section.
          at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
          at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
          at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
          at com.test.web.taglib.LightTag.renderField(LightTag.java:293)
          at com.test.web.taglib.LightTag.doStartTag(LightTag.java:128)

    Maybe it isn't. I don't know what 'rawContentBuffer' is, but you're assuming that 'ch' is always full when you call rawContentBuffer.append(ch). You need to call rawContentBuffer.append(ch,0,ascii) or some such form if there is one, or make some other arrangement for handling short reads.

  • Reg : Read statement using Binary Search....

    I have an Internal Table as below
    Value           Description
    100               Product
    2008             Production Year
    05                 Production Month
    I am using Read statement with Binary Search for getting Production Month.
    Read table itab with key Description = 'Production Month' binary search.
    I am getting sy-subrc as 4 eventhough data is present in the table for Production Month.
    What may be the problem.

    Hi suganya,
    use
    sort table itab ascending by <production month>.    
    Read table itab with key description = <production month> binary search.
    Remember always, while using binary search always sort the internal table.
    Regards,
    Sakthi.

  • Problem in read statement

    hi,
    my code is ;
    select vbeln audat kunnr auart
            from vbak
            into table  t_vbak2
            for all entries in t_vbfa2
            where vbeln = t_vbfa2-vbelv
            and audat in r_daterange
            and kunnr = partner_number.
            if not t_vbak2[] is initial.
              sort t_vbak2 by vbeln audat auart.
            endif.
    now if i use read statement :
    read table t_vbak2 into wa_vbak2
            with key  vbeln = wa_vbfa1-vbelv
                      audat in r_daterange
                      kunnr = partner_number binary search.
    i get a syntax error.
    can any one help me with this..
    Thanks,
    Challa.

    You can't use the IN operator in your READ statement, only  =  as you are trying to read with key.  In your case, you must use the LOOP statement.
    Loop at t_vbak2 into wa_vbak2
              where vbeln = wa_vbfa1-vbelv
                 and audat in R_daterange
                 and kunnr = Partner_Number.
    * Do whatever you need to do
    Exit.   " This is so you only read one record.
    Endloop.
    Regards,
    RIch Heilman

  • Read statement giving problem

    Dear Experts,
    I am making monthly consumption report, In which i am getting monthly data column wise for different month , here firstly i am fetching header mblnr  date according to date from mkpf then i am fetching data from mseg.....
    I have same mblnr in both tables..... Now i am using read statement like this.......
    sort lt_mkpf by mblnr.
    SORT lt_mseg BY mblnr.
    LOOP AT lt_mkpf INTO lw_mkpf.
    READ TABLE lt_mseg INTO lw_mseg WITH KEY mblnr = lw_mkpf-mblnr
                                                mjahr = lw_mkpf-mjahr
                                                        BINARY SEARCH.
    When I am debugging i am getting data in lw_mkpf but sy-subrc = 4 is coming  and getting wrong data in final table by using these above statements..........
    where as if i am using loop like this:
    SORT lt_mkpf BY mblnr.
    SORT lt_mseg BY mblnr.
    LOOP AT lt_mkpf INTO lw_mkpf.
    v_mkpf = lw_mkpf-mblnr.
    LOOP AT lt_mseg INTO lw_mseg WHERE mblnr EQ v_mkpf.
    with this i am getting right data........ But it takes lot of time to execute..........
    Can you please guide me am i using read statement by wrong method. which one is the correct method which one shoul be used.........

    Hello Shelly,
    To solve the issue of read table being failed, Sort the internal table by mblnr and mjahr. say sort lt_mseg by mblnr mjahr but read the internal table mseg will give you only one data. What about the other line items. MSEG is material document line item table. So for one record in MKPF there can be more than one record in MSEG. So to consider all the line items, you need to loop on the MSEG internal table instead of read table.
    LOOP AT lt_mkpf INTO lw_mkpf.
    v_mkpf = lw_mkpf-mblnr.
    LOOP AT lt_mseg INTO lw_mseg WHERE mblnr EQ v_mkpf.
    This statement will take time and create performance issue. So rewrite the statement as
    LOOP AT lt_mseg INTO lw_mseg.
    read table lt_mkpf with key lw_mkpf binary search.
    Regards
    Farzan

  • Problem using insert statement....?

    I am facing problem while using insert statement.
    It is not updating the database table though the same code is working very well on another server.
    Please tell what could be the problem.......?

    Hi Vijendra ,
    You need to check few parameters while creating the table
    1. Table Manitainance
    2.Buffering
    Also , as per you , if ur insert statement is working perfectly fine in another serve..
    , it is highlt possible that table created has 'mandt ' filed , which means this table is client dependent.
    Also , another reason is that , you may not this table at all in the new server .
    So , check onall thiese parameters.
    Ihope this solves ur problem.
    Regards.
    Note: Rewad if useful

Maybe you are looking for

  • I am having a weird problem while attempting to re-install iTunes, is there anyone who can help?

    Its kind of an odd problem, never happened to me before, but my old iTunes was very outdated because my updater was not working, and today having to actually use iTunes but it was very outdated, I read on the apple support site that the only way to u

  • How to  Initiate Demantra Workflw from EBS SPP ?

    Hi , I need to know ; 1. How to kick start a "Demantra Workflow " from within EBS ? ( A step wise approach is appreciated) ( opening Demantra workflow manager and manually doing starting is workflow is not an option for me) 2. When we kick start the

  • Answer request error

    hi i have been practicing obiee 10.1.3.2.1 tutorial Creating Interactive Dashboards and Using Oracle Business Intelligence Answers_ http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/biee/r1013/saw/saw.html in the subtopics To add a fil

  • Tabular form - How to add a G_USER column?

    Hi All, I have a tabular form that shows records form a table. the form allows updates only, not inserts/deletes. I want to add a column to hold the user who last updated the record. I know I can use APEX_APPLICATION.G_USER function but I am not sure

  • Konica Minolta 2590MF Scanner Mac Compatible Software?

    I bought this nice, new printer/fax/scanner combo for $350, including shipping, and it really does print beautifully. I've even gotten the fax working to my satisfaction. The scanner is another matter. Vuescan and Silverfast(?) don't have this item o