Internal table -Select statement -2nd plant is not being filled

Hi,
Second field for plant WERKD is not getting filled in this table.I am using into corresponding fields of table ITAB statement.
I need both plants and in single select statement.
Any ideas?
DATA: BEGIN OF T_STOF OCCURS 0,
    VBELN LIKE LIPS-VBELN,
    ERNAM LIKE LIPS-ERNAM,
    WERKS LIKE LIPS-WERKS,
    NTGEW LIKE LIPS-NTGEW,
    GEWEI LIKE LIPS-GEWEI,
    EBELN LIKE EKKO-EBELN,
    WERKD LIKE EKPO-WERKS,
    LGORT LIKE EKPO-LGORT,
    EBELP LIKE EKPO-EBELP,
    MATNR LIKE EKPO-MATNR,
    TXZ01 LIKE EKPO-TXZ01,
    AEDAT LIKE EKPO-AEDAT,
    KNUMV LIKE EKKO-KNUMV,
    END OF T_STOF.
  SELECT  LIKPVBELN LIKPERNAM LIPSWERKS LIPSNTGEW LIPS~GEWEI
  EKKOEBELN EKPOWERKS EKPOLGORT EKPOEBELP EKPOMATNR EKPOTXZ01 EKPOAEDAT EKKOKNUMV
  INTO CORRESPONDING FIELDS OF TABLE T_STOF
  FROM LIKP
  INNER JOIN LIPS
  ON LIKPVBELN EQ LIPSVBELN
  INNER JOIN EKKO
  ON LIPSVGBEL EQ EKKOEBELN
  INNER JOIN EKPO
  ON EKKOEBELN EQ EKPOEBELN
  WHERE LIKP~VBELN IN S_VBELN
  AND LIKP~ERNAM IN S_ERNAM
  AND LIPS~WERKS IN S_WERKS
  AND EKKO~EBELN IN S_EBELN
  AND EKPO~WERKS IN S_WERKD
  AND EKPO~LGORT IN S_LGORT
  AND EKPO~MATNR IN S_MATNR
  AND EKPO~AEDAT IN S_AEDAT
  AND BSART = 'UB'.
Or am i doing in wrong?
Regards
Praveen

Hi,
If you use INTO CORRESPONDING then the fieldname in the internal table has to match the selecting field name..
To avoid this you can use INTO TABLE...
SELECT LIKPVBELN LIKPERNAM LIPSWERKS LIPSNTGEW LIPS~GEWEI
EKKOEBELN EKPOWERKS EKPOLGORT EKPOEBELP EKPOMATNR EKPOTXZ01 EKPOAEDAT EKKOKNUMV
<b>INTO TABLE T_STOF</b>
Thanks,
Naren

Similar Messages

  • Error on extend an internal table, but the required space was not available

    Hi All,
    I am trying to retrieve cost data from COVP tables, as well as the quantity, cost centre, and price unit fields from MSEG / BSEG tables. Thing is, if the AWTYP value in COVP table = 'MKPF', i have to get the data from MSEG, otherwise, I need to get it from BSEG table.
    I kept getting this error message:
    <i>You attempted to extend an internal table, but the required space was not available.</i>
    Anyone have any idea how to make my codes more efficient?
    Please help. Thanks!
    Regards,
    Cecilia
    REPORT  ZMISCY004.
    TABLES : COVP, BSIS, BSEG, MSEG, MAKT, CSKU.
    PARAMETERS :
    P_FILE(300) DEFAULT '\sapdcdatasaprptoh.txt' LOWER CASE.
    DATA MSG_TEXT(50).
    DATA :
    XKOKRS LIKE COVP-KOKRS,
    XBELNR LIKE COVP-BELNR,
    XBUZEI LIKE COVP-BUZEI,
    XGJAHR LIKE COVP-GJAHR,
    XPERIO LIKE COVP-PERIO,
    XWKGBTR LIKE COVP-WKGBTR,
    XWTGBTR LIKE COVP-WTGBTR,
    XREFBN LIKE COVP-REFBN,
    XREFBZ LIKE COVP-REFBZ,
    XKSTAR LIKE COVP-KSTAR,
    XBEKNZ LIKE COVP-BEKNZ,
    XMATNR LIKE COVP-MATNR,
    XBUKRS LIKE COVP-BUKRS,
    XREFGJ LIKE COVP-REFGJ,
    XREFBK LIKE COVP-REFBK,
    XLTEXT LIKE CSKU-LTEXT,
    XMAKTX LIKE MAKT-MAKTX,
    XAWTYP LIKE COVP-AWTYP,
    XTWAER LIKE COVP-TWAER,
    XSGTXT LIKE COVP-SGTXT,
    BSEG_KOSTL LIKE BSEG-KOSTL,
    BSEG_MEINS LIKE BSEG-MEINS,
    BSEG_MENGE LIKE BSEG-MENGE,
    MSEG_KOSTL LIKE MSEG-KOSTL,
    MSEG_MENGE LIKE MSEG-MENGE,
    MSEG_MEINS LIKE MSEG-MEINS.
    DATA : BEGIN OF ITAB_COVP OCCURS 10,
    KOKRS LIKE COVP-KOKRS,
    BELNR LIKE COVP-BELNR,
    BUZEI LIKE COVP-BUZEI,
    GJAHR LIKE COVP-GJAHR,
    PERIO LIKE COVP-PERIO,
    WKGBTR(15) TYPE C,
    WTGBTR(15) TYPE C,
    REFBN LIKE COVP-REFBN,
    REFBZ(3) TYPE C,
    KSTAR LIKE COVP-KSTAR,
    BEKNZ LIKE COVP-BEKNZ,
    MATNR LIKE COVP-MATNR,
    BUKRS LIKE COVP-BUKRS,
    REFGJ LIKE COVP-REFGJ,
    REFBK LIKE COVP-REFBK,
    LTEXT LIKE CSKU-LTEXT,
    MAKTX LIKE MAKT-MAKTX,
    AWTYP LIKE COVP-AWTYP,
    TWAER LIKE COVP-TWAER,
    SGTXT LIKE COVP-SGTXT,
    BSIS_WRBTR(13) TYPE C,
    BSEG_KOSTL LIKE BSEG-KOSTL,
    BSEG_MEINS LIKE BSEG-MEINS,
    BSEG_MENGE LIKE BSEG-MENGE,
    MSEG_KOSTL LIKE MSEG-KOSTL,
    MSEG_MENGE LIKE MSEG-MENGE,
    MSEG_MEINS LIKE MSEG-MEINS.
    DATA : END OF ITAB_COVP.
    SELECT M1~KOKRS
           M1~BELNR
           M1~BUZEI
           M1~GJAHR
           M1~PERIO
           M1~WKGBTR
           M1~WTGBTR
           M1~REFBN
           M1~REFBZ
           M1~KSTAR
           M1~BEKNZ
           M1~MATNR
           M1~BUKRS
           M1~REFGJ
           M1~REFBK
           M1~AWTYP
           M1~TWAER
           M1~SGTXT
           M4~KOSTL
           M4~MENGE
           M4~MEINS
    INTO (XKOKRS,
          XBELNR,
          XBUZEI,
          XGJAHR,
          XPERIO,
          XWKGBTR,
          XWTGBTR,
          XREFBN,
          XREFBZ,
          XKSTAR,
          XBEKNZ,
          XMATNR,
          XBUKRS,
          XREFGJ,
          XREFBK,
          XAWTYP,
          XTWAER,
          XSGTXT,
          MSEG_KOSTL,
          MSEG_MENGE,
          MSEG_MEINS
    FROM COVP AS M1
    LEFT OUTER JOIN MSEG AS M4
    ON M1~REFBN = M4~MBLNR AND M1~REFBZ = M4~ZEILE AND M1~REFGJ = M4~MJAHR
    WHERE M1~SCOPE = 'OCOST' AND M1~AWTYP = 'BKPF'
      OR M1~SCOPE = 'OCOST' AND M1~AWTYP = 'MKPF'
      OR M1~KSTAR = '972022'.
    IF XAWTYP = 'BKPF'.
    SELECT KOSTL MENGE MEINS INTO (BSEG_KOSTL, BSEG_MENGE, BSEG_MEINS) FROM
    BSEG WHERE BELNR = XREFBN AND BUZEI = XREFBZ AND GJAHR = XREFGJ AND
    BUKRS = XREFBK.
    ENDSELECT.
    MOVE BSEG-KOSTL TO BSEG_KOSTL.
    MOVE BSEG-MEINS TO BSEG_MEINS.
    MOVE BSEG-MENGE TO BSEG_MENGE.
    ELSE.
    MOVE ' ' TO BSEG_KOSTL.
    MOVE ' ' TO BSEG_MEINS.
    MOVE ' ' TO BSEG_MENGE.
    ENDIF.
    *GET LTEST
    SELECT LTEXT INTO XLTEXT
    FROM CSKU
    WHERE KTOPL = 'COAA' AND SPRAS = 'EN'.
    *GET MAKTX
    IF XMATNR <> ' '.
    SELECT SINGLE * FROM MAKT WHERE MATNR = XMATNR.
    MOVE MAKT-MAKTX TO XMAKTX.
    ELSE.
    MOVE ' ' TO XMAKTX.
    ENDIF.
    MOVE : XKOKRS TO ITAB_COVP-KOKRS,
           XBELNR TO ITAB_COVP-BELNR,
           XBUZEI TO ITAB_COVP-BUZEI,
           XGJAHR TO ITAB_COVP-GJAHR,
           XPERIO TO ITAB_COVP-PERIO,
           XWKGBTR TO ITAB_COVP-WKGBTR,
           XWTGBTR TO ITAB_COVP-WTGBTR,
           XREFBN TO ITAB_COVP-REFBN,
           XREFBZ TO ITAB_COVP-REFBZ,
           XKSTAR TO ITAB_COVP-KSTAR,
           XBEKNZ TO ITAB_COVP-BEKNZ,
           XMATNR TO ITAB_COVP-MATNR,
           XBUKRS TO ITAB_COVP-BUKRS,
           XREFGJ TO ITAB_COVP-REFGJ,
           XREFBK TO ITAB_COVP-REFBK,
           XLTEXT TO ITAB_COVP-LTEXT,
           XMAKTX TO ITAB_COVP-MAKTX,
           XAWTYP TO ITAB_COVP-AWTYP,
           XTWAER TO ITAB_COVP-TWAER,
           XSGTXT TO ITAB_COVP-SGTXT,
           BSEG_KOSTL TO ITAB_COVP-BSEG_KOSTL,
           BSEG_MEINS TO ITAB_COVP-BSEG_MEINS,
           BSEG_MENGE TO ITAB_COVP-BSEG_MENGE,
           MSEG_KOSTL TO ITAB_COVP-MSEG_KOSTL,
           MSEG_MENGE TO ITAB_COVP-MSEG_MENGE,
           MSEG_MEINS TO ITAB_COVP-MSEG_MEINS.
    APPEND ITAB_COVP.
    CLEAR ITAB_COVP.
    ENDSELECT.
    ENDSELECT.
    OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE.
    IF SY-SUBRC NE 0.
       WRITE: 'File cannot be opened. Reason:', MSG_TEXT.
       EXIT.
    ENDIF.
    LOOP AT ITAB_COVP.
    TRANSFER ITAB_COVP TO P_FILE.
    ENDLOOP.
    CLOSE DATASET P_FILE.

    Cecilia - I think your problemn is a nested select:
    *GET LTEST
      SELECT ltext INTO xltext
      FROM csku
      WHERE ktopl = 'COAA' AND spras = 'EN'.
    *GET MAKTX
        IF xmatnr <> ' '.
          SELECT SINGLE * FROM makt WHERE matnr = xmatnr.
          MOVE makt-maktx TO xmaktx.
        ELSE.
          MOVE ' ' TO xmaktx.
        ENDIF.
        MOVE : xkokrs TO itab_covp-kokrs,
                     etc.
              mseg_meins TO itab_covp-mseg_meins.
        APPEND itab_covp.
        CLEAR itab_covp.
      ENDSELECT.
    Do you need to do the inner select for every cost element text?
    Rob

  • Internal tables & select query for clasical report

    hello all,
           i am a novice in ABAP.i need to retrive data from 4 DB tables to do a classical report. i declared internal tables as below and then retrieved the data as per the below select statements. is there any other way in which i can do the same with a comparitively lesser amt of code.
    data: begin of i_vbak occurs 0,
          vbeln like vbak-vbeln,
          kunnr like vbak-kunnr,
          waerk like vbak-waerk,
          end of i_vbak.
    data: begin of i_vbap occurs 0,
          vbeln like vbap-vbeln,
          kwmeng like vbap-kwmeng,
          posnr like vbap-posnr,
          vrkme like vbap-vrkme,
          netpr like vbap-netpr,
          end of i_vbap.
    data: begin of i_lips occurs 0,
          vbeln like lips-vbeln,
          vgpos like lips-vgpos,
          vrkme like lips-vrkme,
          lfimg like lips-lfimg,
          end of i_lips.
    data: begin of i_vbep occurs 0,
          vbeln like vbep-vbeln,
          posnr like vbep-posnr,
          edatu like vbep-edatu,
          end of i_vbep.
    data: begin of i_out occurs 0,
          kunnr like vbak-kunnr,
          vbeln like vbak-vbeln,
          kwmeng like vbap-kwmeng,
          netpr like vbap-netpr,
          waerk like vbak-waerk,
          vrkme like vbap-vrkme,
          lfimg like lips-lfimg,
          posnr like vbep-posnr,
          edatu like vbep-edatu,
          end of i_out.
          RETRIVING THE DATA INTO INTERNAL TABLE                         *
    select vbeln kunnr waerk from vbak into table i_vbak where kunnr in
    s_kunnr and vbeln in s_vbeln.
    select vbeln kwmeng posnr vrkme netpr from vbap into table i_vbap for
    all entries in i_vbak where vbeln = i_vbak-vbeln.
    select vbeln vgpos vrkme lfimg from lips into table i_lips for all
    entries in i_vbak where vbeln = i_vbak-vbeln and vgpos in s_vgpos.
    select vbeln posnr edatu from vbep into table i_vbep for all entries in
    i_vbak where vbeln = i_vbak-vbeln.
    <b>Points are guaranteed for good answers.</b>
    Thanks in advance
    seenu

    Hi,
    If u will use in ALV means  how many tables u want u can put it. After that u can maintain one internal table that's enough. Afterthat  put select queries after that display the internal table fileds.
    If u will ALV  report means u have to code same coding for every report slight changes only there.
    Herewith i am sending sample ALV REPORT it is useful for u.
    REPORT CODING:
    REPORT  YMS_COLOURALV NO STANDARD PAGE HEADING.
    TYPE-POOLS: SLIS, ICON.
    DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA: BEGIN OF IMARA OCCURS 0,
              LIGHT(4) TYPE C,
              MATNR TYPE MARA-MATNR,
              MTART TYPE MARA-MTART,
              MAKTX TYPE MAKT-MAKTX,
              COLOR_LINE(4) TYPE C,
              TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,  "cell
          END OF IMARA.
    DATA: XCOLOR TYPE SLIS_SPECIALCOL_ALV.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      PERFORM WRITE_REPORT.
    Get_Data
    FORM GET_DATA.
      WRITE ICON_GREEN_LIGHT AS ICON TO IMARA-LIGHT.
          IMARA-MATNR = 'ABC'.
          IMARA-MTART = 'ZCFG'.
          IMARA-MAKTX = 'This is description for ABC'.
      APPEND IMARA.
      WRITE ICON_YELLOW_LIGHT AS ICON TO IMARA-LIGHT.
          IMARA-MATNR = 'DEF'.
          IMARA-MTART = 'ZCFG'.
          IMARA-MAKTX = 'This is description for DEF'.
      APPEND IMARA.
      WRITE ICON_RED_LIGHT AS ICON TO IMARA-LIGHT.
          IMARA-MATNR = 'GHI'.
          IMARA-MTART = 'ZCFG'.
          IMARA-MAKTX = 'This is description for GHI'.
      APPEND IMARA.
      LOOP AT IMARA.
        IF SY-TABIX = 1.
          IMARA-COLOR_LINE = 'C410'.     " color line
        ENDIF.
        IF SY-TABIX = 2.                "  color CELL
          CLEAR XCOLOR.
          XCOLOR-FIELDNAME = 'MTART'.
          XCOLOR-COLOR-COL = '3'.
          XCOLOR-COLOR-INT = '1'.       " Intensified on/off
          XCOLOR-COLOR-INV = '0'.
          APPEND XCOLOR TO IMARA-TCOLOR.
        ENDIF.
        MODIFY IMARA.
      ENDLOOP.
    ENDFORM.                    "get_data
    WRITE_REPORT
    FORM WRITE_REPORT.
      DATA: LAYOUT TYPE  SLIS_LAYOUT_ALV.
      LAYOUT-COLTAB_FIELDNAME = 'TCOLOR'.
      LAYOUT-INFO_FIELDNAME = 'COLOR_LINE'.
      PERFORM BUILD_FIELD_CATALOG.
    CALL ABAP LIST VIEWER (ALV)
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          IS_LAYOUT   = LAYOUT
          IT_FIELDCAT = FIELDCAT
        TABLES
          T_OUTTAB    = IMARA.
    ENDFORM.                    "write_report
    BUILD_FIELD_CATALOG
    FORM BUILD_FIELD_CATALOG.
      DATA: FC_TMP TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
      CLEAR: FIELDCAT. REFRESH: FIELDCAT.
      CLEAR: FC_TMP.
      FC_TMP-REPTEXT_DDIC    = 'Status'.
      FC_TMP-FIELDNAME  = 'LIGHT'.
      FC_TMP-TABNAME   = 'IMARA'.
      FC_TMP-OUTPUTLEN  = '4'.
      FC_TMP-ICON       = 'X'.
      APPEND FC_TMP TO FIELDCAT.
      CLEAR: FC_TMP.
      FC_TMP-REPTEXT_DDIC    = 'Material Number'.
      FC_TMP-FIELDNAME  = 'MATNR'.
      FC_TMP-TABNAME   = 'IMARA'.
      FC_TMP-OUTPUTLEN  = '18'.
      APPEND FC_TMP TO FIELDCAT.
      CLEAR: FC_TMP.
      FC_TMP-REPTEXT_DDIC    = 'Material Type'.
      FC_TMP-FIELDNAME  = 'MTART'.
      FC_TMP-TABNAME   = 'IMARA'.
      FC_TMP-OUTPUTLEN  = '10'.
      APPEND FC_TMP TO FIELDCAT.
      CLEAR: FC_TMP.
      FC_TMP-REPTEXT_DDIC    = 'Material'.
      FC_TMP-FIELDNAME  = 'MAKTX'.
      FC_TMP-TABNAME   = 'IMARA'.
      FC_TMP-OUTPUTLEN  = '40'.
      FC_TMP-EMPHASIZE = 'C610'.   " color column
      APPEND FC_TMP TO FIELDCAT.
    ENDFORM.                    "build_field_catalog
    Thanks,
    Shankar

  • BELNR not being filled in PTRV_DOC_IT

    Hi Experts!!
    We have a travel expense created with 5 receipts (line items). Now we have implemented BADI TRIP_POST_FI to change a few fields in PTRV_DOC_IT. However, to relate line items in PTRV_SADD (receipts) and PTRV_DOC_IT, we are using fields RECEIPTNO and BELNR respectively. We implemented the BADI and tested successfully. Now, after 2 months, when we try, this is not working. And it's found that BELNR is not being filled in with receiptno in PTRV_DOC_IT table, at all.
    Can somebody help me figuring out, why it's happening so now? Should there be some settings done?
    When will this BELNR be filled normally? Please help me out.
    Your help is highly appreciable.

    Solved.
    In PRFI selection screen, under Size/Summarization, we should select first radiobutton (per Travel Doc.) under Cust/Vend Accoutn Summariz. and Expense/Account Summariz. This will automatically fill in BELNR.
    Thanks.

  • BPM Correlation from Dynamic Configuration not being filled

    Hey guys,
    I'm having the following problem with BPM correlation.
    In my correlation definition, I have 2 fields: one which is filled with information from the message payload, and another one which is filled with a context object (which was created with adapter metadata and filled with dynamic configuration, as refered here: /people/michal.krawczyk2/blog/2006/10/09/xi-dynamic-configuration-in-adapter-modules--one-step-further).
    All instances of BPM are with error status. And when I go into the workflow log for these processes, if I check the correlation object, it is like this:
    <?xml version="1.0" encoding="utf-8" ?>
    <CorrelationKey Version="001">
    <Field1 />
    <Field2>123456789</Field2>
    </CorrelationKey>
    Field1 is the one read from context object, and is not being filled (thus I think the error comes from here). Field2 is from payload and is being normally filled.
    Any ideas on this matter?
    Maybe the problem is not from the correlation. If not, what else could be the case? The BPM crashes on the very first step (one more reason to think that the correlation is the issue).
    Thanks in advance,
    Henrique.

    HI,
    In general Correlation , concept, whatever we configured in Correlation editor , i mean in runtime which xml element should filled with which element of which interface ..as you said you have configured the local correlation to block, in block it is the first receive step, while receiving the first message which is relevent to first recieve step , i mean if it receives the one message which is related to first receive step inteface .. the respective element data will be filled in correlation id and it will assign on giud for processing , so while assign the runtime data to correlation element ( imean filling stage) check you said two elements in correlation does the first message contains these two elements ??
    if so ok , no then check , and try to use the IM before calling the IP to fill the payload.
    Regards
    Chilla
    Oh closed!!
    Message was edited by:
            Chandra Sekhar Chilla
    Message was edited by:
            Chandra Sekhar Chilla

  • Internal table - select if in range ?

    Hello ABAP Experts,
    I have a internal i_gl_account table which has some of the following fields:
    glacctfrom, glacctto, flag
    i have to select a record from this internal table based on a fixed gl_account_fix.
    i cannot write this statement
    read table i_gl_account with key
               glacctfrom >= gl_account_fix
               glacctto <= gl_account_fix
    since read does not allow the '>' or '<' operators.
    one alternative possible is:
    loop i_gl_account.
      if ( glacctfrom >= gl_account_fix and
           glacctto <= gl_account_fix).
      exit.
      endif.
    endloop.
    This solutions, lookups at each and every record one by one and then does the if comparisions. Incase the i_gl_account is large then this is huge cost and processing.
    wondering if there is any other possible method of achieving the same with lesser processing and cost.
    Any suggetions are appreciated.
    Thanks,
    BWer

    You could also something simular to this sample program.  If know that the start point is in the table.  Here the program is reading the first line where the start value is =,  then it is reading each line after that untill it reaches the end point.  But it is not reading the entire internal table.
    report  zrich_0001.
    data: begin of itab occurs 0,
          field1(10) type c,
           field2(10) type c,
           field3(10) type c,
          end of itab.
    itab-field1 = 'A'.
    itab-field2 = '1'.
    itab-field3 = '001'.
    append itab.
    itab-field1 = 'A'.
    itab-field2 = '2'.
    itab-field3 = '123'.
    append itab.
    itab-field1 = 'A'.
    itab-field2 = '3'.
    itab-field3 = '124'.
    append itab.
    itab-field1 = 'A'.
    itab-field2 = '4'.
    itab-field3 = '125'.
    append itab.
    itab-field1 = 'A'.
    itab-field2 = '5'.
    itab-field3 = '999'.
    append itab.
    sort itab ascending by field1 field2 field3.
    data: index type sy-index.
    data: start like itab-field3 value '123'.
    data: end like itab-field3 value '125'.
    read table itab with key field3 = start.
    if sy-subrc  = 0.
      write:/ itab-field1, itab-field2, itab-field3.
      index = sy-tabix + 1.
      while sy-subrc = 0.
        read table itab index index.
        if sy-subrc = 0
            and itab-field3 <= end.
          write:/ itab-field1, itab-field2, itab-field3.
        else.
          sy-subrc  = 4.
        endif.
        index = index + 1.
      endwhile.
    endif.
    Regards,
    Rich Heilman

  • Internal table Read statement

    Hi,
    AM using Read statement to read internal table as below.
    Read itab into wa with key x = y.
    if sy-subrc eq 0.
    do some thing.
    endif.
    However the work area wa is not useful to me in my program. when am doing extended check it is issueing warning saying wa is not used. HOW TO CLOSE THIS WARNING.
    Regards,
    AAkash

    just before read statement do
    CLEAR WA.
    This should remove the error.
    Cheers
    VJ

  • Internal Table : occurs statement

    What is the meaning of using "occurs" statement in Internal Table. What does it imply?
    DATA: BEGIN OF ITAB OCCURS 10,
             END OF ITAB.
    What difference it will make if suppose I use "OCCURS 0" or "OCCURS 10" ?

    Hi yogesh for more clearification
    difference b/w occurs 0 & occurs n
    The number <N> indicate how many lines has to have the table in initialization time: i.e. when the program is loaded in memory, the space for the table depends on the initialization numbers of the records.
    AT run time if the table needs more space, this'll automatically be enhanced.
    But If you know your table can have a certain numbers of records, you can indicate it in the defination, what'll improve the performance:
    all the space the table needs is taken at the beginin, so it doesn't need to enhance the space at run time.
    When this initial area is full, the system makes twice as much extra space available up to a limit of 8KB. Further memory areas of 12KB each are then allocated.
    You can usually leave it to the system to work out the initial memory requirement. The first time you fill the table, little memory is used. The space occupied, depending on the line width, is 16 <= <n> <= 100.
    It only makes sense to specify a concrete value of <n> if you can specify a precise number of table entries when you create the table and need to allocate exactly that amount of memory (exception: Appending table lines to ranked lists). This can be particularly important for deep-structured internal tables where the inner table only has a few entries (less than 5, for example).
    To avoid excessive requests for memory, large values of <n> are treated as follows: The largest possible value of <n> is 8KB divided by the length of the line. If you specify a larger value of <n>, the system calculates a new value so that n times the line width is around 12KB."
    and it is better to use occus 0 inplace of occurs  n    because of above specified reasons
    while it is not recommended to use occurs for internal table declaration  and it has become obselete
    reward if helpful

  • ABAP Select statement performance (with nested NOT IN selects)

    Hi Folks,
    I'm working on the ST module and am working with the document flow table VBFA. The query takes a large amount of time, and is timing out in production. I am hoping that someone would be able to give me a few tips to make this run faster. In our test environment, this query take 12+ minutes to process.
        SELECT vbfa~vbeln
               vbfa~vbelv
               Sub~vbelv
               Material~matnr
               Material~zzactshpdt
               Material~werks
               Customer~name1
               Customer~sortl
          FROM vbfa JOIN vbrk AS Parent ON ( Parentvbeln = vbfavbeln )
                 JOIN vbfa AS Sub ON ( Subvbeln = vbfavbeln )
                 JOIN vbap AS Material ON ( Materialvbeln = Subvbelv )
                 JOIN vbak AS Header ON ( Headervbeln = Subvbelv )
                 JOIN vbpa AS Partner ON ( Partnervbeln = Subvbelv )
                 JOIN kna1 AS Customer ON ( Customerkunnr = Partnerkunnr )
          INTO (WA_Transfers-vbeln,
                WA_Transfers-vbelv,
                WA_Transfers-order,
                WA_Transfers-MATNR,
                WA_Transfers-sdate,
                WA_Transfers-sfwerks,
                WA_Transfers-name1,
                WA_Transfers-stwerks)
          WHERE vbfa~vbtyp_n = 'M'       "Invoice
          AND vbfa~fktyp = 'L'           "Delivery Related Billing Doc
          AND vbfa~vbtyp_v = 'J'         "Delivery Doc
          AND vbfa~vbelv IN S_VBELV
          AND Sub~vbtyp_n = 'M'          "Invoice Document Type
          AND Sub~vbtyp_v = 'C'          "Order Document Type
          AND Partner~parvw = 'WE'       "Ship To Party(actual desc. is SH)
          AND Material~zzactshpdt IN S_SDATE
          AND ( Parentfkart = 'ZTRA' OR Parentfkart = 'ZTER' )
          AND vbfa~vbelv NOT IN
             ( SELECT subvbfa~vbelv
               FROM vbfa AS subvbfa
               WHERE subvbfavbelv = vbfavbelv
               AND   subvbfa~vbtyp_n = 'V' )           "Purchase Order
          AND vbfa~vbelv NOT IN
             ( SELECT DelList~vbeln
               FROM vbfa AS DelList
               WHERE DelListvbeln = vbfavbelv
               AND   DelList~vbtyp_v = 'C'             "Order Document Type
               AND   DelList~vbelv IN                  "Delivery Doc
                  ( SELECT OrderList~vbelv
                    FROM vbfa AS OrderList
                    WHERE OrderList~vbtyp_n = 'H' )    "Return Ord
          APPEND WA_Transfers TO ITAB_Transfers.
        ENDSELECT.
    Cheers,
    Chris

    I am sending u some of the performance isuues that are to be kept in mind while coding.
    1.Donot use Select *...... instead use Select <required list>......
    2.Donot fetch data from CLUSTER tables.
    3.Donot use Nested Select statements as. U have used nested select which reduces performance to a greater extent.
      Instead  use  views/join .
    Also keep in mind that not use join condition for more for more than three tables unless otherwise required.
    So split select statements into three or four and use Select ......for all entries....
    4.Extract  the data from the database  atonce consolidated upfront into table.
      i.e. use INTO TABLE <ITAB> clause instead of using
    Select----
    End Select.
    5.Never use order by clause in Select ..... statement. instead use SORT<itab>.
    6.When  ever u need to calculate max,min,avg,sum,count use AGGREGATE FUNCTIONS and GROUP BY clause insted of calculating by userself..
    7.Donot use the same table once for Validation and another time for data extraction.select data  only once.
    8.When the intention is for validation use Select single ....../Select.......up to one rows ......statements.
    9.If possible always use array operations to update the database tables.
    10.Order of the fields in the where clause select statement  must be in the same order in the index of table.
    11.Never release the object unless throughly checked by st05/se30/slin.
    12.Avoid using identical select statements.

  • Reg : internal table & Perform statement

    hi all
         i have 3 internal tables ,
    *     in first internal table i have mark-1 ,*
    *     in 2nd internal table i have mark-2 ,*
    *     using "PERFORM"  i have to add mark 1 & mark 2*
    *     and i need to display the total in  3rd internal table.*
    *     how to do by using "PERFORM" .*
                    Kindly clarify.
    with kind regards
    vel

    Raghupathy is right you just have to write:
    porgram code......
    perform sum_of_tables tables itab1
                                               itab2
                                               itab3.
    program code....
    definition of form:
    form_sum_of_tables tables itab1
                                          itab2
                                          itab3.
    definiton type of witab1, witab2, witab3.
    loop itab1 into witab1.
    loop itab2 into witab2.
    witab3-total = witab1-mark1 plus witab2-mark2.
    append witab3 to itab3.
    endloop.
    endloop.
    endform.
    It will return itab3 which is sum of itab1 and itab2.

  • Internal table select query

    Hi Experts,
    I have one internal table with some values like
    PLNNR           PLNAL                ZAEHL
    5000021            01                      01
    5000021            01                      02
    5000021            01                      03
    5000021            01                      04
    5000021            01                      05
    I want to fetch greatest value from ZAEHL column.
    Can any one pls help me.
    Thanks,
    Madhu.

    Hi Gordan,
    I am getting error like " itab is not defined in the ABAP Dictionary as a table , projection view or database view."
    Can you pls guide me .
    Thanks,
    Kaladhar.

  • Unicode error:a line of internal table and a data object are not mutually c

    Hi Friends,
        This is the issue in upgradation from 4.6c to ECC6.0
        I have an internal table itab which has include structure say 'xyz' . In xyz there is a field of type int4 as third field. I have a field as l_line which is a string.
    data : begin of itab occurs 0.
             include structure zxyz.
    data: end of itab.
    data: l_line type string.
    In the program I am getting the unicode error as:
    " A line of "itab" and "l_line" are not mutually convertible in unicode program." at he following line.
    loop at itab into l_line.
    endloop.
    Thanks,
    Ali.

    Hi Narendran,
    I did the same earlier, but the field l_line is again used in the another line as follows
    IF l_line CS w_group.----
    (1)
    where     w_group         LIKE zstr-cctr_group.
    here zstr-cctr_group is same as one of the fields of structure xyz.
    in line 1 it is giving warning as
    l_line is incompatible and it must be C,N,D,T or string.
    Thanks,
    Ali

  • Ipod shuffle (2nd Generation) is not being recognized by my MacBook Pro or itunes:

    I was recently given my friends old ipod shuffle, but it is not being recognized by my computer at all, is there something that I can do?

    What have you tried so far in terms of troubleshooting? Did he give you the cable that was originally included witht the Shuffle? I ask because if you are using a 3G/4G cable it will not work with the 2G Shuffle.
    Have you worked through all the sugguestions here as necessary?
    iPod not recognized in iTunes and Mac desktop
    B-rock

  • Component and Object are not being filled automatically when filling IBase

    Hello all,
    When filling the Ibase number in a Service Order (Reference Objects), the component and the object ID are not deing filled automatically. But if I fill the component instead of the IBase ID, the Ibase and the object are being filled.
    Can anyone help me with this issue, please? I would need the component and the object being filled automatically when entering the Ibase number.
    Thank you and Regards.

    Hi,
    Do you have the component assign to a client?
    Best regards,
    Rui Mariano

  • Creator  Tomcat MySQL Deployment Table Not being filled by  DB

    Hi All,
    I am deploying a Creator app called test3.war which uses a MySQL db called RemoteFocalPoint.
    When I try to browse to the url : http://65.99.196.145:8080/test3/ The page wont load I have also had the error JasperException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
    I can get the table to be filled from the RemoteFocalPoint db on a sun pointbase server running locally with the following parameters :
    Data Source Name : RemoteFocalPoint
    User ID : root
    Password ; ****************
    Data base URL jdbc:mysql://65.99.196.145/RemoteFocalPoint
    Driver Class : org.gjt.mm.mysql.Driver
    Validation table : Validation
    I have installed Tomcat Administrator for the production Tomcat (v5.5) environment.
    The settings I have on Tomcat Administrator for http://65.99.196.145:8080/test3/ are
    JNDI Name: jdbc/RemoteFocalPoint
    Data Source URL: jdbc:mysql://localhost/RemoteFocalPoint
    JDBC Driver Class: org.gjt.mm.mysql.Driver
    User name jim
    Password *****************
    Max. Active Connections: 4
    Max. Idle Connections: 2
    Max. Wait for Connection: 5000
    Validation Query: SELECT ALL VALIDATION.Test FROM VALIDATION
    If anyone could shed any light on this I would be grateful. There is a lot of contradictory information on the web about this issue.
    Regards
    Jim Ascroft

    I think that his has been answered better than I can elsewhere in the forum and
    on the web. It's something that people frequently run into.
    But effectively, I think you need to edit a <project>/web/META-INF/context.xml
    file, adding something like this:
    (replace "oms" with your project name).
    Unfortnately, posting xml just doesn't work for me, but you ought to be able to google
    for context.xml, tomcat, resource and maybe database.
    I believe Dion Almaer has a post in his blog about it.
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/oms" >
    <Resource
            auth="Container"
            description="Nrg database"
            name="postgres/nrgdb"
            type="javax.sql.DataSource"
            driverClassName="org.postgresql.Driver"
            url="jdbc:postgresql://localhost/nrgdb"
            username="dms"
            password=""
            maxIdle="2"
            maxWait="5000"
            validationQuery="select * from users;"
            maxActive="4"
            removeAbandoned="true"
            removeAbandonedTimeout="30"
            logAbandoned="true"
        />
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
        <WatchedResource>META-INF/context.xml</WatchedResource>
    </Context>

Maybe you are looking for

  • The new firmware V30.0.019 of N82

    Guys please advice me in this thread that what's new in this FW? V10.0.046-V30.0.046 Please tell me in detail whats main changes made in this FW? Is is a good decision to update my phone to V30? Please guide me.. Please reply for my posts also! Thank

  • Understanding of PCR Rule based on calendar days

    I wrote below pcr 8000/31 days = 258 It should add 258 to wage type 1400 but it is throwing an error

  • Where is Sleep Mode on MX882?

    My PIXMA MX882 has started falling asleep lately. The control panel goes dark all except for the WiFi button. When I try to print wirelessly, I get "printer not connected." The printer works fine after I turn it off and turn it back on. It sounds to

  • Youtube downloading on ATV very slow and I can't view movie trailers

    I am not sure if both these items are related or not. I am using the Airport Extreme as well as 1 Airport Express for my network. The connection speed according to 2 laptop tests in the room the ATV is in shows my speedtest at approximately 3000 kbps

  • Volver a descargar versión de prueba en otro ordenador

    Si ya me descargué hace tiempo una versión de prueba de Premiere Pro CS6, no puedo volver a instalarme una versión de prueba pero en otro ordenador? No me deja ni cambiando de usuario.