How about implement queryResult.size() by "select count(*)..."

Since the size() method often occupies much resource and slow down speed
greatly, why not implement it by "select count(*) from ..." instead of
"resultSet.last()"?
I think when executing a query, a Query will remember the actual SQL
executed, and modify it to some "select count(*)..." like SQL when the
related result collection's size() method is called.

Since the size() method often occupies much resource and slow down speed
greatly, why not implement it by "select count(*) from ..." instead of
"resultSet.last()"?Unfortunately, there are lots of issues with this approach. Basically there
are just many situations in which it can report bad numbers.

Similar Messages

  • I have 4 equal oblong shape created with borders How do I go about knowing what size the selection area is so that I can crop an image to fit. I don't want to use paste in then adjust the bounding box to suit

    I have 4 equal oblong shape created with borders How do I go about knowing what size the selection area is so that I can crop an image to fit. I don't want to use paste in then adjust the bounding box to suit

    What do you mean a moderator

  • How to determine the size of selected text

    Hi
    I'd like to draw a box around some selected text (a textRange), however I can't figure out how to detemine the size or position of the text.  The overall size of a textFrame is possible to find (not sure about position), but when you've got just a few characters selected I don't see any way to get the size or position.  Any ideas?

    You may have to do some testing of your own with this… I tested here and 'think' its OK but could have overlooked something… For me the best way to get this data is to outline the type store the info in a variable then undo the outlining process… You can then continue your script with info in hand… An example that draws a box over each selected character… I cheated with only the one text frame but you can resolve that? You could easy use math.min & math.max to draw around an array of bounds… I didn't bother with a load of tests it expects selected text range as is… have fun…
    #target Illustrator
    textBoxer();
    function textBoxer() {
              var i, doc, sel, start, end, spaceB4, spaceInc, mat, grp, count, boxes;
              doc = app.activeDocument;
              sel = doc.selection;
              start = sel.characterOffset-1; // Not zero based…
              end = start + sel.length;
              doc.selection = null;
              spaceB4 = doc.textFrames[0].contents.substr( 0, start );  // Cheated here you will need to find parent frame…
              mat = spaceB4.match( /\s/g ); // Resolve the lost of white space characters before selection
              mat != null ? spaceB4 = mat.length : spaceB4 = 0;
              spaceInc = doc.textFrames[0].contents.substr( 0, end );  // Here too…
              mat = spaceInc.match( /\s/g ); // Resolve the lost of white space characters in selection
              mat != null ? spaceInc = mat.length : spaceInc = 0;
              grp = doc.textFrames[0].createOutline(); // Items in new group are last to first order
              app.redraw();
              count = grp.compoundPathItems.length;
              boxes = Array();
              for ( i = 0; i < count; i++ ) {
                        boxes.push( grp.compoundPathItems[i].visibleBounds );
              boxes.reverse(); // Fix the order
              app.undo(); // Bounce back…
              app.redraw();
              start = start - spaceB4;
              end = end - spaceInc;
              for ( i = start; i < end; i++ ) {
                                  doc.pathItems.rectangle( boxes[i][1], boxes[i][0], boxes[i][2]-boxes[i][0], -boxes[i][3]- -boxes[i][1], false );
              app.redraw();

  • How to find total size of selected items in library

    My library contains much more than my 2GB Nano can hold. I frequently change the content of the Nano with songs and books. How can I keep track of the total size of items I'm selecting for the next Nano update to speed my update? Presently I can only guess what to unselect if the selections are of greater size than my Nano will hold.

    There is no direct way to accumulate total file size when selecting a subset of songs within the Library or a Playlist.
    The only way you can manage this is to create an empty Playlist that you can drag songs into. It will accumulate the total size of the songs as you deposit them into it (as described by StarDeb above).
    If you get to a size greater than the nano will hold, then remove one or more songs from that Playlist.
    There is no 'running-total' of only the selected items like Windows Explorer does. Sorry.

  • How to reduce screen size when selecting images??

    I clicked on something wrong today, and my settings have been
    screwed up. When I am selecting an image (for example:
    Behaviors>Set Nav Bar>Open, the screen that followed (that
    held all my images) took up about half the screen. And it was easy
    to make this larger or smaller, in the usual grab-a-corner-and-drag
    way. Obvious, and easy. But now that I've done something wrong,
    this last window takes up my entire 22" screen. There is a grab bar
    in the lower-right corner, but it has no effect. In other words,
    it's impossible to make this screen smaller. As it is; it's
    impossible to use DW effectively. I tried quitting and re-starting
    DW. No luck. Tried rebooting the entire computer. Again, no luck.
    Tried uninstalling the entire DW programme and re-installing it.
    Oddly, even when I did this, it did not reset to its original
    settings. The window still opens up and covers the entire screen,
    and it's still impossible to shrink this window down. This is true
    in "Set Nav Bar Image", "Swap Image," etc..
    Anyone have *any* suggestions??

    sounds like you maximized the page interface. just select the
    square box in windows, or the green + button in mac osx. It's going
    to save your preferences, so restarting isn't going to do it. And
    good grief, don't reinstall the program. See if resizing the
    interface helps.

  • How to implement limit restrisction for select

    I want to select only a max row number of a DB table as
    select * from DBTABLE
             limit 200 (inly the firt 200 rows).
    Any suggest?

    hi..
      You can use keyword <b>upto</b>  or <b>package size</b> to restrict the number of records.
    regards,
    veeresh

  • Package size in select query

    Hi all,
    Can any body help for how to use package size in select statemtent.
    I want to seletc record in lot of 300 form 10k records.
    And i am using 4.6c version and wnat to know this statement (package size) is there in 4.6c.
    I know it is in 6.0.

    Hi
    Package size in SELECT statements
    Package size can be used to retreive a spcific number of records at a time. This can be used if you
    for example only want tofinish  processing a limited amount of data at a time due to lack of memory.
    The exampel below  read 50 records at a time from VBAK into an internal table, and selects the
    corresponding entries from vbap into an internal table. Then the two internal tables can be
    processed, and the next 50 records from VBAk can be read. remeber to reinitialize tha tables before
    the next read.
    Note the usage of SELECT - ENDSELECT !
    REPORT  z_test                        .
    TYPES:
    BEGIN OF t_vbak,
    vbeln LIKE vbak-vbeln,
    erdat LIKE vbak-erdat,
    END OF t_vbak,
    BEGIN OF t_vbap,
    posnr  LIKE vbap-posnr,
    matnr  LIKE vbap-matnr,
    meins  LIKE vbap-meins,
    END OF t_vbap,
    BEGIN OF t_report,
    vbeln LIKE vbak-vbeln,
    erdat LIKE vbak-erdat,
    posnr  LIKE vbap-posnr,
    matnr  LIKE vbap-matnr,
    meins  LIKE vbap-meins,
    END OF t_report.
    DATA:
    li_vbak   TYPE t_vbak OCCURS 0,
    l_vbak    TYPE  t_vbak,
    li_vbap   TYPE t_vbap OCCURS 0,
    l_vbap    TYPE t_vbap,
    li_report TYPE t_report OCCURS 0,
    l_report  TYPE t_report.
    START-OF-SELECTION.
    SELECT vbeln erdat
    FROM vbak
    INTO TABLE li_vbak PACKAGE SIZE 50.
    SELECT posnr matnr meins
    FROM vbap
    INTO TABLE li_vbap
    FOR ALL ENTRIES IN li_vbak
    WHERE vbeln = li_vbak-vbeln.
    IF sy-subrc = 0.
      Now you have the two internal tables li_vbak and liÆ_vbap filled with data.
      Do something with the data - remember to reinitialize internal tables
    ENDIF.
    ENDSELECT.
    All of the  product names here are trademarks of their respective companies.  The site
    www.allsaplinks.com no way affiliated with SAP AG. We have made every effort for the content
    integrity.  Information used on this site is at your own risk.
              +
    REWARD IF USEFULL+ 

  • For the life of me, I can't find out what size a photo is in terms of inches or how to change the size of the photo[s] so I can print them. I think I read somewhere to click edit, then click adjust. Nothing there about sizing.

    For the life of me, I can't find out what size a photo is in terms of inches or how to change the size of the photo[s] so I can print them. I think I read somewhere to click edit, then click adjust. I don't see anything about re-sizing when I click the adjust tab: only saturation and tint levels. Thank you.

    With respect to digital images, there really is no size in inches. The size is given as number of pixels horizontally and vertically. In iPhoto '09 you click the little "i" inthe lower right side of the window and it will display information related to the selected photo, including the pixel dimensions. I do not have iPhoto '11 installed so I don't know if it is the same there.
    In some applications, such as preview, it has something additional called Dots per Inch (DPI) which you would think would allow you to convert the pixel dimensions to inches. It is not a real thing, though. The DPI is determined by how large or small you have chosen to print your photo and the capabilities of your printer. 
    There is also something called Aspect Ratio, which is usually expressed in inches x inches such as 6x9 but that doesn't mean the size on the screen or when printed is 6x9.  It is the ratio of the pixel dimensions.  When cropping your photos, you will have several standard aspect ratios to choose from plus any custom ones you create.
    In iPhoto '09, after you choose Print, in the Print Setting window are the settings for the size you want the photo printed. You want to shoose a setting with the same aspect ratio of your photo. Otherwise, iPhoto will resize and/or crop your photo to fit the size you have chosen. 

  • How about get item count of table in formGroup.vm

    JHeadstart Team:
    I want change maxColumns=" 1" or" 2" by item count of table .but I do not know how about get item count of table .
    #if (${JHS.current.group.columns} > 10)
    #set ($majin = 2)
    #else
    #set ($majin = 1)
    #end
    <af:panelForm rows="1" maxColumns="$majin" width="${JHS.current.group.formWidth}" id="${JHS.current.group.shortName}FormItems">
    majin
    #FORM_ITEMS()
    </af:panelForm>

    You can do this using the following syntax:
    #if (${JHS.current.itemContainer.items.size()}>10)
    maxColumns="2"
    #else
    maxColumns="1"
    #end
    Steven Davelaar,
    Jheadstart Team

  • How do I calculate the total size of selected folders?

    Hello
    My question is:
    How do I calculate the total size of selected folders?
    Thank you

    It does show the aggregate size.
    Command-Option-I opens the Inspector window. (Or open the File menu and hold the Option key. Get Info turns into Show Inspector.) The Inspector is similar to the Get Info window but it shows aggregate info for multiple selections. It is also dynamic — if you change the selection while the Inspector is open, the info changes to reflect the current selection.

  • How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO?

    How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO? It appears as if the Digital I/O modules for CompactRIO are much slower than this.
    Thank you,
    --Ray

    Hi Ray,
    The highest frequency input we offer for C Series modules is 20 MHz if you are doing LVTTL and 10 MHz for 5 V TTL.  These modules are the 9402 and 9401, respectively.  Unfortunately, there is no 80 MHz input on this form-factor.
    Regards,
    Chris E.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • Select Count(*) from Sample_table - how to get the count using JDBC?

    Hi All,
    It would be glad if anyone could help me with this. The problem is that I have to get the 'count' of records selected from a arbitrary table say, 'sample_table'. Is that possible to form the SQL in JDBC as
    Select Count(*) from Sample_table
    and get the value of the count? If yes, how?
    Thanks in advance
    Prabz

    stmt = con.createStatement();
    ResultSet recordcnt_rs = stmt.executeQuery("Select Count (*) as record_ctr From Sample_table");
    recordcnt_rs.next();     
    record_ctr = recordcnt_rs.getInt("record_ctr");
    hope this helps.

  • How to implement select all files (Ctrl-A) in open file dialog??

    I successfully created file open dialog. However, in most windows file open dialog,
    if you press "Ctrl-A," it will select all the files in the directory. If you press "Ctrl"
    key with arrow key, it will highligh the files you want. ie. It allows users to open
    more than one files at the same time. How to implement it in Java??

    For doing this, you have to enable the file multiselection.
    If you have created a JFileChooser as :
    JFileChooser fileChooser = new JFileChooser();
    Add the following statement to set the multiselection property.
    fileChooser.setMultiSelectionEnabled(true);
    Manish.

  • How about this implementation of BOM Explosion(simulate stack)

    REPORT  YZWX00301_06 LINE-SIZE  142
                         LINE-COUNT 65
                         MESSAGE-ID YM1
                         NO STANDARD PAGE HEADING .
    INCLUDE
    INCLUDE: YXXI00050.
    *TABLES use table define
    TABLES: MARA,        " Material General Table
            MARC,        " Plant Data for Material
            MDMA,        " MRP Area table
            EORD,        " Vendor table
            A018,        " Vendor material mapping table
            KONP,        " Vendor condition table
            MAST,        " Material BOM table
            STPO,        " Material BOM Component table
            STAS.        " Material BOM Component table detail
    *CONSTANTS define
    CONSTANTS:
      C_DAT_X        TYPE C VALUE 'X',
      C_MODE         LIKE dxfields-fileoper VALUE 'R',
      C_MASK         LIKE dxfields-filemask VALUE '.',
      C_FLG_LOCATION TYPE C VALUE 'A',
      C_DFPATH(15)   TYPE C VALUE '\bmwx\'.
    Work Area Define
    ---- build stack structure -
    DATA: BEGIN OF WK_STACK,
            LEVEL(1)      TYPE C,            "Save Level
            QUANT         TYPE I,            "Save Quantity
          END OF WK_STACK.
    ---- BOM work area -
    DATA: BEGIN OF WK_BOM,
             LEVEL(1)     TYPE C,            "BOM LEVEL
             MATNR        LIKE MARC-MATNR,   "MATERIAL      18
             POSTP        LIKE STPO-POSTP,   "ITEM CATEGORY  1
             MENGE        LIKE STPO-MENGE,   "BOM COMPONENT 13
             DATUV        LIKE STPO-DATUV,   "VALID FROM    10
             DATUB        LIKE STPO-DATUV,   "VALID TO      10
    END OF WK_BOM.
    ---- DATA work area -
    DATA: BEGIN OF DATAITEM,
             LEVEL(1)     TYPE C,            "BOM LEVEL
             MATNR        LIKE MARC-MATNR,   "MATERIAL
             POSTP        LIKE STPO-POSTP,   "ITEM CATEGORY
             MENGE        LIKE STPO-MENGE,   "BOM COMPONENT
             DATUV        LIKE STPO-DATUV,   "VALID FROM!!!
             DATUB        LIKE STPO-DATUV,   "VALID TO
             EKGRP        LIKE MARC-EKGRP,   "PURCHASE ORG
             LIFNR        LIKE EORD-LIFNR,    "Vendor code     10
             MARK(1)      TYPE C,             "Mark
             KBETR        LIKE KONP-KBETR,    "Rate price      11
             KONWA        LIKE KONP-KONWA,    "Currency        5
             KPEIN        LIKE KONP-KPEIN,    "Unit Qty        5
             KMEIN        LIKE KONP-KMEIN,    "Condition Unit  3
             DATAB        LIKE A018-DATAB,    "Condition from  10
             DATBI        LIKE A018-DATBI,    "Condition to    10
           END OF DATAITEM.
    ---- File Line work area -
    DATA: BEGIN OF LINE,
             WERKS(4)     TYPE C,                               "Plaint   4
             MATNR(18)    TYPE C,             "Material Number 18
             EKGRP(3)     TYPE C,             "Purchase Group  3
             LIFNR(10)    TYPE C,             "Vendor code     10
             VDATU        LIKE EORD-VDATU,    "Vendor valid from 10
             BDATU        LIKE EORD-BDATU,    "Vendor valid to   10
             MARK(1)      TYPE C,             "Mark
             KSCHL(4)     TYPE C,             "Condition type  4
             KBETR(18)    TYPE C,             "Rate price      11
             KPEIN(5)     TYPE C,             "Rate unit       5
             KONWA(5)     TYPE C,             "Currency        5
             KMEIN(3)     TYPE C,             "Condition Unit  3
             DATAB        LIKE A018-DATAB,    "Condition from  10
             DATBI        LIKE A018-DATBI,    "Condition to    10
           END OF LINE.
    *Local Data Object Define
    DATA:  WK_CNT TYPE I,                   "Count variable
           WK_LVL TYPE I,                   "BOM level
           WK_QTY TYPE I.                   "BOM component qty
    DATA: WK_LIFNR LIKE EORD-LIFNR,
          WK_MATNR LIKE MARC-MATNR.
    *Internal Table define
    DATA TAB_STACK LIKE STANDARD TABLE OF WK_STACK.   "STACK TABLE
    DATA TAB_BOM   LIKE STANDARD TABLE OF WK_BOM.     "FOR BOM
    DATA TAB_DATA  LIKE STANDARD TABLE OF DATAITEM.   "FOR ALL
    Parameter in Block1
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.         "TITLE TEXT-001.
    PARAMETERS:
      P_WERKS LIKE MARC-WERKS DEFAULT 'WX01',              "Plant
      P_STLTY LIKE STPO-STLTY DEFAULT 'M',                 "BOM Category
      P_MATNR LIKE MARC-MATNR OBLIGATORY,                  "Material
      P_STDAT LIKE EORD-VDATU OBLIGATORY DEFAULT SY-DATUM. "Standard Date
    SELECTION-SCREEN END OF BLOCK B1.
    Parameter in Block2
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: P_SCREEN RADIOBUTTON GROUP R1.     "Screen output
    SELECTION-SCREEN COMMENT 03(21) TEXT-001.
    SELECTION-SCREEN POSITION 32.
    PARAMETERS: P_FILE RADIOBUTTON GROUP R1.       "NTFILE output
    SELECTION-SCREEN COMMENT 34(17) TEXT-002.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    Parameter in Block3
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME.
    PARAMETERS:
    P_NTFILE(45)  TYPE C    LOWER CASE OBLIGATORY.
      P_PCFILE      LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN END   OF BLOCK B3.
    INITIALIZATION
    INITIALIZATION .
      CLEAR :  WK_CNT,
               WK_LVL,
               WK_QTY,
               WK_MATNR,
               WK_STACK,
               WK_BOM,
               DATAITEM.
      WK_LVL = 0.
      WK_QTY = 1.
      REFRESH: TAB_STACK,
               TAB_DATA,
               TAB_BOM.
    *&      AT SELECTION-SCREE ON VALUE-REQUEST
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_NTFILE.
    PERFORM F_SHOW_FILE_POPUP CHANGING P_NTFILE.       "Popup display
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PCFILE.
      PERFORM F_FILENAME_GET USING P_PCFILE
                          CHANGING P_PCFILE.
    *&      Form  F_FILENAME_GET
      --> ST_DAT_PATH     : Preset path
      <-- ST_DAT_FILENAME : Selected file name
    FORM F_FILENAME_GET USING st_dat_path
                     CHANGING st_dat_filename.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_filename     = SPACE
          def_path         = st_dat_path
          mask             = ',.,.,'
          mode             = '0'
          title            = 'TXT-file select'
        IMPORTING
          filename         = st_dat_filename
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
        MESSAGE s002(yf1) WITH 'F_FILENAME_GET' sy-subrc.
      ENDIF.
    ENDFORM.                    "F_FILENAME_GET
    MAIN PROCESS
    START-OF-SELECTION.
    ---- Check material -
      PERFORM CHECK_PROD.
    ---- get vendor data -
      PERFORM GET_VENDOR_DATA.
    ---- output screen/file -
      IF P_SCREEN = 'X'.
        PERFORM SET_OUTPUT.            "Output to screen directly
      ELSEIF P_FILE = 'X'.
        IF P_PCFILE <> ''.
          PERFORM DOWNLOAD_DATA.       "Write data into ntfile
        ELSE.
          MESSAGE E007(00) WITH 'P_PCFILE'.
        ENDIF.
      ENDIF.
    END-OF-SELECTION.
      ULINE (142).
      WRITE: /002 'Component Material Count:', WK_CNT.
    TOP-OF-PAGE
    TOP-OF-PAGE.
      WRITE: /002 'Product:', 013 P_MATNR,
              030 '****** BOM Price List ******',
              070 SY-DATUM,
              095 'PAGE:',
              100 SY-PAGNO.
      ULINE (142).
      WRITE: /001   '|Level',
              007   '|Material',
              026   '|Cat',
              030   '|Quantity',
              044   '|From',
              055   '|To',
              066   '|PurG',
              071   '|Vendor',
              082   '|MK',
              085   '|Price',
              101   '|Crncy',
              107   '|UnitQty',
              115   '|Unit',
              120   '|From',
              131   '|To',
              142   '|'.
      ULINE (142).
    *&FORM CHECK_PROD
    text
    -->p1      text
    <--p2      text
    FORM CHECK_PROD.
      SELECT SINGLE * FROM MARC
                     WHERE WERKS = P_WERKS           " Plant
                     AND   MATNR = P_MATNR           " Material
                     AND   DISPR IN ('F100','F200'). " Product
      IF SY-SUBRC = 0.
        PERFORM CHECK_BOM1 USING MARC-MATNR MARC-WERKS. " CHECK_BOM1
      ELSE.
        MESSAGE E022.
      ENDIF.
    ENDFORM.                                         " CHECK_PROD
    *&FORM CHECK_BOM1
    text
    -->p1      text
    <--p2      text
    FORM CHECK_BOM1 USING VALUE(FP_MATNR) VALUE(FP_WERKS).
      SELECT SINGLE * FROM  MAST
                      WHERE MATNR = FP_MATNR     AND      "Material
                            WERKS = FP_WERKS.             "Plant
      IF SY-SUBRC = 0.
        PERFORM PUSH_STACK USING WK_LVL WK_QTY.   "Save parent attribute
        PERFORM CHECK_BOM2 USING MAST-STLNR.                    "Check BOM2
      ENDIF.
    ENDFORM.                                                    "CHECK_BOM1
    *&FORM CHECK_BOM2
    text
    -->p1      text
    <--p2      text
    FORM CHECK_BOM2 USING VALUE(FP_STLNR).
      SELECT * FROM  STPO
               WHERE STLTY = P_STLTY        AND        "BOM category
                     STLNR = FP_STLNR.                 "BOM number
        PERFORM POPOUT_WK.                  "Pop out to work area
        WK_BOM-LEVEL = WK_LVL.              "Current BOM level
        WK_BOM-MATNR = STPO-IDNRK.          "Material number
        WK_BOM-POSTP = STPO-POSTP.          "ITEM Category
        WK_QTY       = STPO-MENGE * WK_QTY. "For Stack
        WK_BOM-MENGE = WK_QTY.              "BOM Component qty
        PERFORM CHECK_BOM3 USING STPO-STLTY STPO-STLNR STPO-STLKN.
        PERFORM CHECK_BOM1 USING STPO-IDNRK P_WERKS.
      ENDSELECT.
      PERFORM POPOUT_STACK.
    ENDFORM.                                                    "CHECK_BOM2
    *&FORM CHECK_BOM3
    text
    -->p1      text
    <--p2      text
    FORM CHECK_BOM3 USING VALUE(FP_STLTY) VALUE(FP_STLNR) VALUE(FP_STLKN).
      SELECT SINGLE * FROM  STAS
                      WHERE STLTY = FP_STLTY        "BOM category
                      AND   STLNR = FP_STLNR        "BOM number
                      AND   STLKN = FP_STLKN        "BOM item
                      AND   DATUV <= P_STDAT        "Valid from
                      AND   LKENZ = ' ' .           "Valid
      IF SY-SUBRC = 0.
        WK_BOM-DATUV = STAS-DATUV.                  "Valid from
      ENDIF.
      SELECT SINGLE * FROM  STAS
                      WHERE STLTY = FP_STLTY        "BOM category
                      AND   STLNR = FP_STLNR        "BOM number
                      AND   STLKN = FP_STLKN        "BOM item
                    AND   DATUV > P_STDAT         "Valid from
                      AND   LKENZ = 'X' .           "Invalid
      IF SY-SUBRC = 0.
        SELECT SINGLE * FROM  STAS
                       WHERE STLTY = FP_STLTY        "BOM category
                       AND   STLNR = FP_STLNR        "BOM number
                       AND   STLKN = FP_STLKN        "BOM item
                       AND   DATUV > P_STDAT         "Valid from
                       AND   LKENZ = 'X' .           "Invalid
        IF SY-SUBRC = 0.
          WK_BOM-DATUB = STAS-DATUV.          "Valid to
          APPEND WK_BOM TO TAB_BOM.
        ENDIF.
      ELSE.
        WK_BOM-DATUB = '99991231'.          "Manul input
        APPEND WK_BOM TO TAB_BOM.
      ENDIF.
    ENDFORM.                                                    "CHECK_BOM3
    *&FORM PUSH_STACK
    text
    -->p1      text
    <--p2      text
    FORM PUSH_STACK USING VALUE(FP_LVL) VALUE(FP_QTY).
      WK_STACK-LEVEL = FP_LVL + 1.
      WK_STACK-QUANT = FP_QTY.
      APPEND WK_STACK TO TAB_STACK.    "Push stack
      SORT TAB_STACK BY LEVEL.         "Sort table by level
    ENDFORM.                           "PUSH_STACK
    *&FORM PUSH_STACK
    text
    -->p1      text
    <--p2      text
    FORM POPOUT_STACK.
      DESCRIBE TABLE TAB_STACK LINES WK_CNT.
      IF WK_CNT > 0.
        DELETE TAB_STACK INDEX WK_CNT.     "Popout stack
        SORT TAB_STACK BY LEVEL.           "Sort table by level
      ENDIF.
    ENDFORM.                               "POPOUT_STACK
    *&FORM POPOUT_WK
    text
    -->p1      text
    <--p2      text
    FORM POPOUT_WK.
      DESCRIBE TABLE TAB_STACK LINES WK_CNT.
      IF WK_CNT > 0.
        READ TABLE TAB_STACK INTO WK_STACK INDEX WK_CNT.   "Popout stack
        IF SY-SUBRC = 0.
          WK_LVL = WK_STACK-LEVEL.                         "Current Level
          WK_QTY = WK_STACK-QUANT.                         "Parent Qty
        ENDIF.
      ENDIF.
    ENDFORM.                    "POPOUT_WK
    *&FORM DOWNLOAD_DATA
    text
    -->p1      text
    <--p2      text
    FORM DOWNLOAD_DATA.
      DATA: L_RETURN     TYPE   SY-SUBRC.
      PERFORM GUI_DOWNLOAD
                  TABLES
                     TAB_DATA
                  USING
                     P_PCFILE
                     'X'
                  CHANGING
                     L_RETURN.
      IF L_RETURN <> 0.
        MESSAGE S020.
      ELSE.
        MESSAGE S021.
      ENDIF.
    ENDFORM.                    " DOWNLOAD_DATA
    *&FORM GET_VENDOR_DATA
    text
    -->p1      text
    <--p2      text
    FORM GET_VENDOR_DATA.
      LOOP AT TAB_BOM  INTO WK_BOM.
        CLEAR DATAITEM.
        SELECT * FROM MARC
                WHERE WERKS = P_WERKS             "Plant
                  AND MATNR = WK_BOM-MATNR.       "Material
          DATAITEM-EKGRP = MARC-EKGRP.
          SELECT SINGLE * FROM  MARA
                          WHERE MATNR = MARC-MATNR    AND   "Material number
                                MTART IN ('1211','1221').
          IF SY-SUBRC = 0.
            SELECT COUNT(*) FROM  EORD
                           INTO  (WK_CNT)
                     WHERE WERKS  = P_WERKS        AND  "Plaint
                           MATNR  = WK_BOM-MATNR   AND  "Material
                           VDATU <= P_STDAT        AND  "Valid-From
                           BDATU >  P_STDAT.            "Valid-To
            IF WK_CNT > 1.
              DATAITEM-MARK = '*'.
            ELSEIF WK_CNT = 0.
              MOVE-CORRESPONDING WK_BOM TO DATAITEM.
              APPEND DATAITEM TO TAB_DATA.
            ENDIF.
            SELECT * FROM  EORD
                     WHERE WERKS  = P_WERKS        AND  "Plaint
                           MATNR  = WK_BOM-MATNR   AND  "Material
                           VDATU <= P_STDAT        AND  "Valid-From
                           BDATU >  P_STDAT.            "Valid-To
              MOVE-CORRESPONDING WK_BOM TO DATAITEM.
              DATAITEM-LIFNR  = EORD-LIFNR.             "Vendor code
              SELECT  * FROM  A018
                        WHERE LIFNR  =  EORD-LIFNR  AND  "Vendor code
                              MATNR  =  EORD-MATNR  AND  "Material
                              EKORG  =  EORD-EKORG  AND  "Purchase org
                              DATAB <=  P_STDAT     AND  "Valid-from
                              DATBI >   P_STDAT.         "Valid-to
                DATAITEM-DATAB = A018-DATAB.    "Condition From
                DATAITEM-DATBI = A018-DATBI.    "Condition To
                IF SY-SUBRC = 0.
                  SELECT * FROM  KONP
                           WHERE KNUMH = A018-KNUMH   AND   "Cnd Number
                                 KSCHL = A018-KSCHL   AND   "Cnd Type
                                 KAPPL = A018-KAPPL.        "Cnd Cat
                    DATAITEM-KBETR = KONP-KBETR.            "Price
                    DATAITEM-KONWA = KONP-KONWA.            "Currency
                    DATAITEM-KPEIN = KONP-KPEIN.            "Price Unit
                   DATAITEM-KMEIN = KONP-KMEIN.            "Unit of Material
                    APPEND DATAITEM TO TAB_DATA.            "Append TAB_DATA
                  ENDSELECT.
                ENDIF.
              ENDSELECT.
            ENDSELECT.
          ELSE.
            MOVE-CORRESPONDING WK_BOM TO DATAITEM.
            APPEND DATAITEM TO TAB_DATA.
          ENDIF.
        ENDSELECT.
        IF SY-SUBRC <> 0.
          MOVE-CORRESPONDING WK_BOM TO DATAITEM.
          APPEND DATAITEM TO TAB_DATA.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "GET_DATA
    *&      Form  SET_OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM SET_OUTPUT .
      CLEAR WK_CNT.
      LOOP AT TAB_DATA INTO DATAITEM.
        WRITE: /001   '|', 002 DATAITEM-LEVEL,   "Material Number
                007   '|', 008 DATAITEM-MATNR,   "Purchase Grp
                026   '|', 027 DATAITEM-POSTP,   "Item category
                030   '|', 031 DATAITEM-MENGE,   "BOM Component qty
                044   '|', 045 DATAITEM-DATUV,   "BOM valid from
                055   '|', 056 DATAITEM-DATUB,   "BOM valid to
                066   '|', 067 DATAITEM-EKGRP,   "Purchase Org
                071   '|', 072 DATAITEM-LIFNR,   "Vendor
                082   '|', 083 DATAITEM-MARK,    "Mark flag
                085   '|', 086 DATAITEM-KBETR,   "Price
                101   '|', 102 DATAITEM-KONWA,   "Currency
                107   '|', 108 DATAITEM-KPEIN,   "Unit Qty
                115   '|', 116 DATAITEM-KMEIN,   "Unit OM
                120   '|', 121 DATAITEM-DATAB,   "Cnd From
                131   '|', 132 DATAITEM-DATBI,   "Cnd To
                142   '|'.
        WK_CNT = WK_CNT + 1.
      ENDLOOP.
    ENDFORM.                    " SET_OUTPUT

    Prabhu Peram,
    Thanks very much.
    I want to show an idea of BOM explosion by constructing a stack.
    BOM explosion uses first-root-searching and pushes the "root" material into stack.If the "root" has no left-child,pops out the "root" material and searchs the right-child....and completes the entire BOM explosion.
    Message was edited by:
            Mic chen
    Message was edited by:
            Mic chen

  • How to allocate space for headers in reports through line size r line count

    hi ,
    may i know how to allocate space for a header ( we do the same for footer through line-count ( footer space ) ) through line size or line count in reports...
    thanks in advance..

    Hi..,
    There is no need to reserve any space for the header. TOP-OF-PAGE can by default allocates the space for the header.
    If you still having confusion just  go ahead with this link. This is the research on same thing in defferent way.
    [Link|lines reservation for TOP-OF-PAGE & END-OF-PAGE;
    Thanks,
    Naveen.I

Maybe you are looking for

  • Trying to add Firebox B Addon, tells me I need 3.6 but am running 4, help please

    I would like to install the Firefox B Add on but when I do to 'add to firefox it tells me the following:- this Persona requires Firefox 3.6. You are currently using Firefox 3.0.13. But I downloaded and installed Firefox 4.0.1 which is confirmed when

  • Need Help setting up SRC Professional and ENUFF Advisor on  terminal server

    I'm the analyst responsible here at Adena Health System for SRC.  I have received a request to setup the products listed above on the terminal server.  Can anyone direct me to documentation or at least point me in the right direction to get this task

  • I need Help with Some CSS

    I am in the process of making a new template for my site. I can't really provide any code and here's why, I need help finding the code that I need to change. The new template is actually being designed here. If you scroll over the home link you will

  • Copying Solution Manager 3.2 on WAS 6.20 running Oracle 9.2.

    Hi, I'm trying to copy my Solution Manager system version 3.2 to a different test server in order to test the upgrade to version 4.0. In the Homogeneous and Heterogeneous System Copy Guide for SAP Systems Based on SAP Web Application Server 6.20 on p

  • Calling another java file

    I have a main class ( packet.java for example) and I need to call another file (filter.java) to display a dialog box. Both files are in the same package, but all I want to do is when a button is clicked in packet.java, I want it to display the dialog