READ statement problem-URGENT.

hai experts,
I am facing problem with read statement.
<b>read table itab with key f1 = '10'."it works.</b>
But,
now i store value '<b>10'</b> in variable <b>f</b> and use it as follows.
<b>read table itab with key f1 = f."it isn't working</b>.
My requirement is as above.I have to read a particular record from a internal table with key value stored in a variable ,key should not be  hardcoded.
Do any one have any idea abt this.
Plz, help me. Its very urgent.
Thanks & Regards.
Shivaa

Hi Shiva
            That isn't a way to access the internal table via variable. Please refer transaction ABAPDOCU to know more information querying internal table(or transparent table) via a Variable and many more..
<b> Helpfull: Reward points </b>
Thanks and Kind Regards
Mohan

Similar Messages

  • READ statement problem

    TYPES : BEGIN OF itab,
             matnr LIKE eban-matnr,
             menge LIKE eban-menge,
           END OF itab.
    TYPES : BEGIN OF itab2,
              maktx LIKE makt-maktx,
            END OF itab2.
    DATA : it_eban TYPE STANDARD TABLE OF itab.
    DATA : it_makt TYPE STANDARD TABLE OF itab2.
    DATA : wa_eban TYPE itab.
    DATA : wa_makt TYPE itab2.
    START-OF-SELECTION.
      SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE
                            it_eban FROM eban.
      SELECT maktx INTO  CORRESPONDING FIELDS OF TABLE
                           it_makt from makt.
    PERFORM display TABLES it_eban it_makt.
    FORM display TABLES eban_tab makt_tab.
    LOOP AT eban_tab INTO wa_eban.
      WRITE :/ wa_eban-matnr, wa_eban-menge.
      READ TABLE makt_tab with key matnr = wa_eban-matnr.
      "here I'm getting error like
      "the specified type has no structure and therefore no component called "MATNR"
      "How can I write READ statement here to read makt_tab.
    ENDLOOP.
    ENDFORM.

    Try that
    TYPES : BEGIN OF itab,
             matnr LIKE eban-matnr,
             menge LIKE eban-menge,
           END OF itab.
    TYPES : BEGIN OF itab2,
              <b>matnr like mara-matnr,</b>
              maktx LIKE makt-maktx,
            END OF itab2.
    DATA : it_eban TYPE STANDARD TABLE OF itab.
    DATA : it_makt TYPE STANDARD TABLE OF itab2.
    DATA : wa_eban TYPE itab.
    DATA : wa_makt TYPE itab2.
    START-OF-SELECTION.
      SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE
                            it_eban FROM eban.
      SELECT <b>matnr</b> maktx INTO  CORRESPONDING FIELDS OF TABLE
                           it_makt from makt.
    PERFORM display TABLES it_eban it_makt.
    FORM display TABLES eban_tab makt_tab.
    LOOP AT eban_tab INTO wa_eban.
      WRITE :/ wa_eban-matnr, wa_eban-menge.
      READ TABLE makt_tab into <b>wa_makt</b> with key matnr = wa_eban-matnr.
      "here I'm getting error like
      "the specified type has no structure and therefore no component called "MATNR"
      "How can I write READ statement here to read makt_tab.
    ENDLOOP.
    ENDFORM.
    Message was edited by:
            Jacek Slowikowski

  • Problem with READ Statement in the field routine of the Transformation

    Hi,
    I have problem with read statement with binary search in the field routine of the transformation.
    read statement is working well when i was checked in the debugging mode, it's not working properly for the bulk load in the background. below are the steps i have implemented in my requirement.
    1. I selected the record from the lookuo DSO into one internal table for all entried in source_packeage.
    2.i have read same internal table in the field routine for each source_package entry and i am setting the flag for that field .
    Code in the start routine
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
         and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp <> 3.
    delete it_zcam where end_dt initial.
    sort it_zcam by surce accno.
    endif.
    field routine code:
    read table it_zcam with key source = source_package-source
                                                 accno  = source_package-accno
                                                 binary search
                                                 transportin no fields.
    if sy-subrc = 0.
    RESULT  = 'Y'.
    else.
    RESULT = 'N'.
    endif.
    this piece of code exist in the other model there its working fine.when comes to my code it's not working properly, but when i debug the transformation it's working fine for those accno.
    the problem is when i do full load the code is not working properly and populating the wrong value in the RESULT field.
    this field i am using in the report filter.
    please let me know if anybody has the soluton or reason for this strage behaviour.
    thanks,
    Rahim.

    i suppose the below is not the actual code. active table of dso would be /bic/azcam_o1100...
    1. is the key of zcam_o11 source and accno ?
    2. you need to get the sortout of if endif (see code below)
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
    and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp 3.
    delete it_zcam where end_dt initial.
    endif.
    sort it_zcam by surce accno.
    field routine code:
    read table it_zcam with key source = source_package-source
    accno = source_package-accno
    binary search
    transportin no fields.
    if sy-subrc = 0.
    RESULT = 'Y'.
    else.
    RESULT = 'N'.
    endif.

  • 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

  • Problem in writing a Read Statement

    Hi,
    In my Table control I have a POSITION button which is used to find the record in the table.
    I have written the following code.
      CALL FUNCTION 'POPUP_GET_VALUES'
        EXPORTING
    *   NO_VALUE_CHECK        = ' '
          popup_title           = 'Find the record'
    *   START_COLUMN          = '5'
    *   START_ROW             = '5'
    * IMPORTING
    *   RETURNCODE            =
        TABLES
          fields                = lt_tab
    EXCEPTIONS
       error_in_fields       = 1
       OTHERS                = 2
    I have five primary keys in my table, so that in the pop up I am getting all the five fields.
    The user will enter any of the five fields , I want to write a read statement based on the fields entered by the user.
    Could anybody help in writing the Read  statement.
    Or could any one help me in writing out the FIND functionality for a table control
    Regards
    Edited by: SAP LEARNER on Jun 15, 2010 1:40 PM

    Hi,
    I do not know what fields will be filled up.
    as there are 5 PK fields so 5! chances will be there for the where condition in the READ statement.
    How can I do it.
    I tried in the following way.
    I created a structure with the primary key fields and I filled the structure with the user filled values.
    Then I used it in the read statement as below, but it did not work.
        LOOP AT lt_tab .
          IF lt_tab-fieldname = 'SOCIEDAD'.
            lw_pk-sociedad = lt_tab-value.
          ENDIF.
          IF lt_tab-fieldname = 'NATURAL_YEAR'.
            lw_pk-natural_year = lt_tab-value.
          ENDIF.
          IF lt_tab-fieldname = 'CICLO_DE_VENTAS'.
            lw_pk-ciclo_de_ventas = lt_tab-value.
          ENDIF.
          IF lt_tab-fieldname = 'MODEL_VERSION'.
            lw_pk-model_version = lt_tab-value.
          ENDIF.
        ENDLOOP.
        DATA:lw_yrwbw010 TYPE ty_yrwbw010.
        READ TABLE t_yrwbw010 INTO lw_yrwbw010 WITH KEY lw_pk.
         IF sy-subrc = 0.
          table-top_line = sy-tabix.
         ENDIF.
      ENDIF.
    @Rob Burbank
    Could you please help me !! I could not find that in F1 help.
    @ Keshav.T         
    Could you please elaborate it please

  • 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

  • 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

  • J2EE StartUp Problem, URGENT.

    Hi all!
    I'm having a problem since friday with the J2EE Engine Startup. The problem is that MMC says me that the server is running but i can access to the server by anyway. The developer trace of the jcontrol process is:
    [Thr 2968] Tue Aug 09 13:59:50 2005
    [Thr 2968] JControlICheckProcessList: process server0 started (PID:1544)
    JStartupStartJLaunch: program = C:\usr\sap\J2E\JC00/j2ee/os_libs/jlaunch.exe
    -> arg[00] = C:\usr\sap\J2E\JC00/j2ee/os_libs/jlaunch.exe
    -> arg[01] = pf=C:\usr\sap\J2E\SYS\profile\J2E_JC00_toshiba-user
    -> arg[02] = -DSAPINFO=J2E_00_sdm
    -> arg[03] = -file=C:\usr\sap\J2E\JC00\SDM\program\config\sdm_jstartup.properties
    -> arg[04] = -nodeName=sdm
    -> arg[05] = -nodeId=2
    -> arg[06] = -syncSem=JSTARTUP_WAIT_ON_2964
    -> arg[07] = -jvmOutFile=C:\usr\sap\J2E\JC00\work\jvm_sdm.out
    -> arg[08] = -stdOutFile=C:\usr\sap\J2E\JC00\work\std_sdm.out
    -> arg[09] = -locOutFile=C:\usr\sap\J2E\JC00\work\dev_sdm
    -> arg[10] = -mode=JCONTROL
    -> arg[11] = pf=C:\usr\sap\J2E\SYS\profile\J2E_JC00_toshiba-user
    -> lib path = PATH=C:\j2sdk1.4.2_08\jre\bin\server;C:\j2sdk1.4.2_08\jre\bin;C:\oracle\WAS\92\bin;C:\oracle\WAS\92\jre\1.4.2\bin\client;C:\oracle\WAS\92\jre\1.4.2\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\j2sdk1.4.2_08\bin;C:\oracle\WAS\92\Appache\perl\5.00503\bin\MSWin32-x86;C:\usr\sap\J2E\SCS01\exe;C:\usr\sap\J2E\JC00\exe;C:\usr\sap\J2E\SYS\exe\run
    -> exe path = PATH=C:\j2sdk1.4.2_08\bin;C:\usr\sap\J2E\JC00\j2ee\os_libs;C:\oracle\WAS\92\bin;C:\oracle\WAS\92\jre\1.4.2\bin\client;C:\oracle\WAS\92\jre\1.4.2\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\j2sdk1.4.2_08\bin;C:\oracle\WAS\92\Appache\perl\5.00503\bin\MSWin32-x86;C:\usr\sap\J2E\SCS01\exe;C:\usr\sap\J2E\JC00\exe;C:\usr\sap\J2E\SYS\exe\run
    [Thr 2968] Tue Aug 09 13:59:51 2005
    [Thr 2968] JControlICheckProcessList: process SDM started (PID:1556)
    [Thr 1188] Tue Aug 09 14:01:01 2005
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] Tue Aug 09 14:01:58 2005
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] JControlMSMessageFunc: receive command:6, argument:1213679940 from Message Server
    [Thr 1188] Tue Aug 09 14:10:25 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    [Thr 1188] Tue Aug 09 14:15:45 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    [Thr 1188] Tue Aug 09 14:20:46 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    [Thr 1188] Tue Aug 09 14:26:06 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    [Thr 1188] Tue Aug 09 14:31:07 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    [Thr 1188] Tue Aug 09 14:36:27 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    [Thr 1188] Tue Aug 09 14:41:28 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    Then i try to login the visual admin gives me a windows error and the msg_server process shuts down alone. Then i restart that node and agregate the following lines to the trace:
    Thr 1188] Tue Aug 09 14:42:25 2005
    [Thr 1188] *** ERROR => MsINiRead: NiBufReceive failed (NIECONN_BROKEN) [msxxi.c      2488]
    [Thr 1188] *** ERROR => MsIReadFromHdl: NiRead (rc=NIECONN_BROKEN) [msxxi.c      1652]
    [Thr 1188] Tue Aug 09 14:42:27 2005
    [Thr 1188] ***LOG Q0I=> NiPConnect2: SiPeekPendConn (10061: WSAECONNREFUSED: Connection refused) [nixxi_r.cpp 8588]
    [Thr 1188] *** ERROR => MsIAttachEx: NiBufConnect to toshiba-user/3601 failed (rc=NIECONN_REFUSED) [msxxi.c      633]
    [Thr 1188] *** WARNING => Can't reconnect to message server (toshiba-user/3601) [rc = -100]-> reconnect [jcntrms.c    295]
    [Thr 1188] Tue Aug 09 14:42:32 2005
    [Thr 1188] *** ERROR => MsIAttachEx: NiBufConnect to toshiba-user/3601 failed (rc=NIECONN_REFUSED) [msxxi.c      633]
    [Thr 1188] *** WARNING => Can't reconnect to message server (toshiba-user/3601) [rc = -100]-> reconnect [jcntrms.c    295]
    [Thr 1188] Tue Aug 09 14:42:38 2005
    [Thr 1188] *** ERROR => MsIAttachEx: NiBufConnect to toshiba-user/3601 failed (rc=NIECONN_REFUSED) [msxxi.c      633]
    [Thr 1188] *** WARNING => Can't reconnect to message server (toshiba-user/3601) [rc = -100]-> reconnect [jcntrms.c    295]
    [Thr 1188] Tue Aug 09 14:42:44 2005
    [Thr 1188] *** ERROR => MsIAttachEx: NiBufConnect to toshiba-user/3601 failed (rc=NIECONN_REFUSED) [msxxi.c      633]
    [Thr 1188] *** WARNING => Can't reconnect to message server (toshiba-user/3601) [rc = -100]-> reconnect [jcntrms.c    295]
    [Thr 1188] Tue Aug 09 14:42:49 2005
    [Thr 1188] JControlMSConnect: reconnected to message server (toshiba-user/3601)
    [Thr 1188] Tue Aug 09 14:48:11 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    [Thr 1188] Tue Aug 09 14:53:12 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    [Thr 1188] Tue Aug 09 14:58:32 2005
    [Thr 1188] JControlMSReadMessage: NiPeek() returns -5 NIETIMEOUT
    I try to login the visual admin again and gives me the following error: "Cannot open connection on host: 191.9.6.22 and port: 50004"
    Looking the log and trace files i see the following errors:
    - SAPEngine_System_Thread[impl:5]_5##0#0#Error#1#/System/Server#Plain###Encomi: failed to connect to toshiba-user/3201(Connection refused: connect)#
    - java.net.SocketException: socket closed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
         at java.net.ServerSocket.implAccept(ServerSocket.java:448)
         at java.net.ServerSocket.accept(ServerSocket.java:419)
         at com.sap.engine.core.port.impl0.ServerSocketListener.run(ServerSocketListener.java:87)
    - erver socket listener opened by service on socket encountered error. The listener will be stopped.#2#p4#ServerSocket[addr=/0.0.0.0,port=0,localport=50004]
    I dont know whats happening, if somebody knows i hope that helps me. Please is urgent.
    Thx and Rgds.
    Gregory

    Hi, thx a lot both.
    Respect the link
    http://<hostname>:50<instanceno>00/sap/monitoring/SystemInfo , i cant access it. I cant access by telnet, by visual admin.
    In the work folder under \usr\sap\<sid>\JC00 i found that the last updated files are:
    - available.txt that contains the following data:
        Unavailable 08.08.2005 10:46:53 - 08.08.2005 10:58:54
        Available   08.08.2005 10:59:54 - 08.08.2005 13:52:54
        Unavailable 08.08.2005 13:53:54 - 08.08.2005 13:53:54
        Available   08.08.2005 13:54:54 - 08.08.2005 14:03:54
        Unavailable 08.08.2005 14:04:54 - 08.08.2005 14:04:54
        Available   08.08.2005 14:05:54 - 08.08.2005 14:34:54
        Unavailable 08.08.2005 14:35:54 - 08.08.2005 14:39:44
        Unavailable 08.08.2005 14:56:17 - 08.08.2005 16:24:13
        Unavailable 08.08.2005 16:28:07 - 08.08.2005 16:29:07
        Unavailable 08.08.2005 16:34:36 - 08.08.2005 17:17:58
        Unavailable 09.08.2005 08:13:36 - 09.08.2005 08:54:33
        Unavailable 09.08.2005 08:57:04 - 09.08.2005 12:46:25
        Available   09.08.2005 12:47:25 - 09.08.2005 13:26:25
        Available   09.08.2005 13:43:56 - 09.08.2005 13:55:56
        Unavailable 09.08.2005 13:56:40 - 09.08.2005 14:04:57
        Available   09.08.2005 14:05:57 - 09.08.2005 16:16:57
        Unavailable 09.08.2005 16:17:57 - 09.08.2005 17:27:12
        Unavailable 10.08.2005 08:10:30 - 10.08.2005 08:35:39
        Available   10.08.2005 08:36:39 - 10.08.2005 09:16:39
        Available   10.08.2005 12:33:51 - 10.08.2005 14:01:51
    - dev_jcontrol that contains the information displayed in the developer trace of jcontrol process(and y mentioned above)
    - dev_dispatcher that contains the following info:
        [Thr 2664] Wed Aug 10 08:33:04 2005
        [Thr 2664] JHVM_RegisterNatives: registering methods in com.sap.bc.proj.jstartup.JStartupFramework
        [Thr 2664] JLaunchISetClusterId: set cluster id 5761000
        [Thr 2664] JLaunchISetState: change state from [Initial (0)] to [Waiting for start (1)]
        [Thr 2664] JLaunchISetState: change state from [Waiting for start (1)] to [Starting (2)]
        [Thr 3320] Wed Aug 10 08:33:21 2005
        [Thr 3320] JLaunchISetP4Port: set p4 port 50004
        [Thr 3528] Wed Aug 10 08:33:26 2005
        [Thr 3528] JLaunchISetTelnetPort: set telnet port 50008
        [Thr 3528] JLaunchISetTelnetPort: set telnet port 50008
        [Thr 3584] Wed Aug 10 08:33:55 2005
        [Thr 3584] JLaunchISetHttpPort: set http port 50000
        [Thr 2664] Wed Aug 10 08:34:02 2005
        [Thr 2664] JLaunchISetState: change state from [Starting (2)] to [Running (3)]
        [Thr 2568] Wed Aug 10 08:34:08 2005
        [Thr 2568] JHVM_RegisterNatives: registering methods in com.sap.mw.rfc.driver.CpicDriver
        [Thr 3660] Wed Aug 10 08:35:07 2005
        [Thr 3660] JLaunchISetP4Port: set p4 port 50004
        [Thr 3600] Wed Aug 10 08:36:34 2005
        [Thr 3600] JLaunchISetHttpPort: set http port 50000
        [Thr 3612] Wed Aug 10 12:43:40 2005
        [Thr 3612] JLaunchISetHttpPort: set http port 50000
        [Thr 3612] JLaunchISetP4Port: set p4 port 50004
        [Thr 3612] JLaunchISetTelnetPort: set telnet port 50008
    - dev_server0 that contains:
        [Thr 2676] Wed Aug 10 08:33:06 2005
        [Thr 2676] JHVM_RegisterNatives: registering methods in com.sap.bc.proj.jstartup.JStartupFramework
        [Thr 2676] JLaunchISetClusterId: set cluster id 5761050
        [Thr 2676] JLaunchISetState: change state from [Initial (0)] to [Waiting for start (1)]
        [Thr 2676] JLaunchISetState: change state from [Waiting for start (1)] to [Starting (2)]
        [Thr 4296] Wed Aug 10 08:34:58 2005
        [Thr 4296] JHVM_RegisterNatives: registering methods in com.sap.mw.rfc.driver.CpicDriver
        [Thr 4296] Wed Aug 10 08:35:00 2005
        [Thr 4296] JHVM_RegisterNatives: registering methods in com.sap.mw.jco.util.SAPConverters
        [Thr 4296] JHVM_RegisterNatives: registering methods in com.sap.mw.jco.util.SAPCharToNUCByteConverter
        [Thr 4296] Wed Aug 10 08:35:01 2005
        [Thr 4296] JHVM_RegisterNatives: registering methods in com.sap.mw.jco.util.SAPNUCByteToCharConverter
        [Thr 2676] Wed Aug 10 08:35:07 2005
        [Thr 2676] JLaunchISetState: change state from [Starting (2)] to [Starting applications (10)]
        [Thr 208] Wed Aug 10 08:36:34 2005
        [Thr 208] JLaunchISetState: change state from [Starting applications (10)] to [Running (3)]
    I still dont know whats happening. And i need to solve the problem urgent. I hope u can help me.
    Thx and Rgds.
    Gregory.

  • 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

  • Switch statement problem

    I am doing a question in which I have to make a simple ATM program that can withraw and deposit money as many times as the user wants. To exit the program the user has to hit "x". I have to use a switch statement. Im getting incompatible type errors after compiling it. Can anyone help me? Sorry if the formattings not too good.
    //ATM.java
    //This program reads in a user's opening balance and performs a withdrawal or a deposit at the request of the user
    import java.text.*;
         public class ATM
         public static void main(String args[])
              int      balance;
              char      withdrawal, deposit, choice;
              //Ask for the opening balance
              System.out.print("Please enter your opening balance");
              balance=UserInput.getInt();
              //Find out what the user wants done
              System.out.print("What would you like to do? (Withdrawal, Depositor Exit(x))");
              choice=UserInput.getChar();
                                                                          switch(choice){     
    case "w":
                                                                          while(balance>0)
                                                                                              System.out.print("How much would you like to withdraw?");
                                                                                              withdrawal=UserInput.getChar();
                                                                                              balance=balance-withdrawal;
                                                                                              System.out.print("Your remaining balance is " + balance);
                                                                                              break;
    case "d":     
    while(balance>0)
                                                                                              System.out.print("How much do you wish to deposit?");
                                                                                              deposit=UserInput.getChar();
                                                                                              balance=balance+deposit;
                                                                                              System.out.print("Your new balance is " + balance);
                                                                                              break;
    case "x":          
                                                                System.out.print("Goodbye and thank you for using this program");
                                                                                              break;
    default:     
                                                                     System.out.print("We were not able to process your request, please try again");
                                                                                              break;
    }

    Type a reply to the topic using the form below. When finished, you can optionally preview your reply by clicking on the "Preview" button. Otherwise, click the "Post" button to submit your message immediately.
    Subject:
    Click for bold      Click for italics      Click for underline           Click for code tags      
      Formatting tips
    Message:
    Add topic to Watchlist:
    Original Message:
    Switch statement problem
    Xivilai Registered: Mar 3, 2007 9:52 AM      Mar 3, 2007 10:06 AM
    I am doing a question in which I have to make a simple ATM program that can withraw and deposit money as many times as the user wants. To exit the program the user has to hit "x". I have to use a switch statement. Im getting incompatible type errors after compiling it. Can anyone help me? Sorry if the formattings not too good.
    //ATM.java
    //This program reads in a user's opening balance and performs a withdrawal or a deposit at the request of the user
    import java.text.*;
    public class ATM
    public static void main(String args[])
    int balance;
    char withdrawal, deposit, choice;
    //Ask for the opening balance
    System.out.print("Please enter your opening balance");
    balance=UserInput.getInt();
    //Find out what the user wants done
    System.out.print("What would you like to do? (Withdrawal, Depositor Exit(x))");
    choice=UserInput.getChar();
    switch(choice){
    case 'w':
    while(balance>0)
    System.out.print("How much would you like to withdraw?");
    withdrawal=UserInput.getChar();
    balance=balance-withdrawal;
    System.out.print("Your remaining balance is " + balance);
    break;
    case 'd':
    while(balance>0)
    System.out.print("How much do you wish to deposit?");
    deposit=UserInput.getChar();
    balance=balance+deposit;
    System.out.print("Your new balance is " + balance);
    break;
    case 'x':
    System.out.print("Goodbye and thank you for using this program");
    break;
    default:
    System.out.print("We were not able to process your request, please try again");
    break;
    }

  • 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.

  • Logic behind read statement and material

    SORT IT_EKBEF BY EBELN EBELP.
    READ TABLE IT_EKBEF INTO WA_EKBEF
                     WITH KEY EBELN = WA_FINAL-EBELN
                              EBELP = WA_FINAL-EBELP BINARY SEARCH.
    IF SY-SUBRC = 0.
    WA_FINAL-MENGE = WA_EKBEF-MENGE.
    ENDIF.
    the above is my code............
    i am not able to read data frfom inetrnal table to WA_ekbef .......if i am not giving material in the selection screen.......
    If i give material for specific po then i am getting data........Pls solve this problem........
    how this read statement is linked with material........
    any suggetions pls??

    Hi,
    I am fetching data inTO  IT_EKBE..............
    FROM IT_EKBE I AM MOVING TO WA_EKBE.......
    FROM WA_EKBE  I AM MOVING TO IT_EKBEF..............
    THEN I AM USING READ STATEMENT WITH KEYWORDS EBELN, EBELP..........
    BUT WHEN I AM FETCHING IT_EKBE I AM FETCHING DATA BASED ON MATERIAL ALSO.........
    IS THAT THE PROBLEM???

  • Read Statement Issue

    HI,
    I am facing problem with read statement, please find below my code and provide the solution.
    My Internal Tables.
    TYPES: BEGIN OF TYP_BSAK,
    BUKRS TYPE BSAK-BUKRS,
    LIFNR TYPE BSAK-LIFNR,
    AUGDT TYPE BSAK-AUGDT,
    GJAHR TYPE BSAK-GJAHR,
    BELNR TYPE BSAK-BELNR,
    BUZEI TYPE BSAK-BUZEI,
    BUDAT TYPE BSAK-BUDAT,
    BLART TYPE BSAK-BLART,
    DMBTR TYPE BSAK-DMBTR,
    SGTXT TYPE BSAK-SGTXT,
    AUGBL TYPE BSAK-AUGBL,
    HKONT TYPE BSAK-HKONT,
    END OF TYP_BSAK.
    DATA : IT_BSAK TYPE STANDARD TABLE OF TYP_BSAK WITH HEADER LINE,
    WA_BSAK TYPE TYP_BSAK.
    READ STATEMENT :
    LOOP AT IT_BSIS INTO WA_BSIS.   -> I am getting data in wa_BSIs
       READ TABLE IT_BSAK INTO WA_BSAK  -> I am Getting record in IT_BSAK bu the same is not populated in WA_BSAK
       WITH KEY BUKRS = S_BUKRS.
       IF SY-SUBRC = 0.
          WA_OUTPUT-SAPSYS    = 'PROBE'.
          WA_OUTPUT-BUKRS     = WA_BSAK-BUKRS.
          WA_OUTPUT-BUKRS     = WA_BSAK-BUKRS.
          WA_OUTPUT-BELNR     = WA_BSAK-BELNR.
          WA_OUTPUT-SGTXT     = WA_BSAK-SGTXT.
          WA_OUTPUT-BUDAT     = WA_BSAK-BUDAT.
          WA_OUTPUT-AUGBL     = WA_BSAK-AUGBL.
          WA_OUTPUT-LIFNR     = WA_LFA1-LIFNR.
          WA_OUTPUT-NAME1     = WA_LFA1-NAME1.
          WA_OUTPUT-STRAS     = WA_LFA1-STRAS.
          WA_OUTPUT-ORT01     = WA_LFA1-ORT01.
          WA_OUTPUT-REGIO     = WA_LFA1-REGIO.
          WA_OUTPUT-PSTLZ     = WA_LFA1-PSTLZ.
          WA_OUTPUT-STCD2     = WA_LFA1-STCD2.
         ENDIF.
    APPEND WA_OUTPUT TO IT_OUTPUT.
       ENDLOOP.
    Thanks and Regards
    VB

    Hi,
    I hope You have use below code solved your problem.
    LOOP AT IT_BSIS INTO WA_BSIS
    READ TABLE IT_BSAK INTO WA_BSAK
    WITH KEY BUKRS = WA_BSIS-BUKRS.
    IF SY-SUBRC = 0.
    WA_OUTPUT-SAPSYS = 'PROBE'.
    WA_OUTPUT-BUKRS = WA_BSAK-BUKRS.
    WA_OUTPUT-BUKRS = WA_BSAK-BUKRS.
    WA_OUTPUT-BELNR = WA_BSAK-BELNR.
    WA_OUTPUT-SGTXT = WA_BSAK-SGTXT.
    WA_OUTPUT-BUDAT = WA_BSAK-BUDAT.
    WA_OUTPUT-AUGBL = WA_BSAK-AUGBL.
    WA_OUTPUT-LIFNR = WA_LFA1-LIFNR.
    WA_OUTPUT-NAME1 = WA_LFA1-NAME1.
    WA_OUTPUT-STRAS = WA_LFA1-STRAS.
    WA_OUTPUT-ORT01 = WA_LFA1-ORT01.
    WA_OUTPUT-REGIO = WA_LFA1-REGIO.
    WA_OUTPUT-PSTLZ = WA_LFA1-PSTLZ.
    WA_OUTPUT-STCD2 = WA_LFA1-STCD2.
    ENDIF.
    APPEND WA_OUTPUT TO IT_OUTPUT.
    ENDLOOP.
    Thanks
    Regards
    I.Muthukumar.
    Edited by: I.Muthukumar on Jun 25, 2010 12:43 PM

  • Dynamic read statement

    Hi Everyone,
    Here is my problem..
    I am dynamically creating an internal table based on select-option table entered by user.
    The key for this table can be determined only at runtime.
    The table entered might have by one field as key field or 10 key fields..
    How can I use the dynamic read in this situation

    Hi,
    This is the form of read statement upto 10 keyfields,
    You can read some std tables/FM to get the key fields of a table.
    Later you can assign the key fields field symbols  as shown:-
    * Loop to assign fieldnames & values to READ TABLE keyfields
             LOOP AT li_keyfields INTO work_area WHERE keyfield EQ 'X' .
               l_index = l_index + 1.
               CASE l_index.
                 WHEN 1.
                   ASSIGN COMPONENT work_area-fieldname OF STRUCTURE work_area TO <fs_c1>.
                   MOVE work_area-fieldname  TO l_key1.
                 WHEN 2.
                   ASSIGN COMPONENT work_area-fieldname OF STRUCTURE work_area TO <fs_c2>.
                   MOVE work_area-fieldname  TO l_key2.
                 WHEN 3.
                   ASSIGN COMPONENT work_area-field OF STRUCTURE work_area TO <fs_c3>.
                   MOVE work_area-fieldname  TO l_key3.
                 WHEN 10.
                   ASSIGN COMPONENT work_area-fieldname OF STRUCTURE work_area TO <fs_c10>.
                   MOVE work_area-fieldname TO l_key10.
               ENDCASE.
             ENDLOOP.
    READ TABLE <fs_itab> ASSIGNING <fs_wa>
                 WITH KEY (l_key1) = <fs_c1>
                          (l_key2) = <fs_c2>
                          (l_key10) = <fs_c10>.

  • 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.

Maybe you are looking for