Oracle Hint on Table MKPF and MSEG : force index MSEG~M to be utilize

Hi Experts, I'm quite new to ABAP performance tuning, I try to put details as much as I can in my question below, just to have a quick overview of my problem below, I want to use/force in my SQL below to force the utilization of index MSEG~M.
added an Oracle Hint forcing index MSEG~M
  SELECT MATNR BWART MENGE
  FROM   MKPF
  INNER JOIN MSEG
     ON MKPFMANDT EQ MSEGMANDT
    AND MKPFMBLNR EQ MSEGMBLNR
    AND MKPFMJAHR EQ MSEGMJAHR
   INTO CORRESPONDING FIELDS OF TABLE T_MSEG2
  WHERE MKPF~BUDAT IN S_GSTRP    "(index bud should be used)
   AND  MSEG~MJAHR IN R_DOCYEAR
   AND  BWART IN ('931', '932',
                  '901', '902',
                  '701', '702',
                  '703', '704',
                  '707', '708',
                  '711', '712',
                  '713', '714',
                  '715', '716',
                  '717', '718',
                  '551', '552',
                  '553', '554',
                  '555', '556') "ZZCHK: Constants Not Applicable
         AND  MATNR IN R_MATNR3
         AND  MATNR IN R_COMPNTS
         AND  WERKS EQ P_WERKS
  %_hints oracle u2018INDEX(u201CMKPFu201D u201CMSEG~Mu201D)u2019.
Note: I'm assuming that you'll take not some comments on further enhancement:
- " INTO CORRESPONDING FIELDS "
- use of field symbols
- I didn't modify it yet since my focus if for MSEG~M
- cannot make material number as mandatory field
Objective: Force to use index MSEG~M
Problem:
After adding the Oracle Hint, I did the analysis in ST05 and it seems like index M is still not being forcefully
utilize instead MSEG~0 is being used.
I replaced the Oracle Hint with:
  %_hints oracle u2018INDEX(u201CT_01u201D u201CMSEG~Mu201D)u2019.
In ST05, I can get see that index MSEG~M is now being utilize BUT worst thing happened after applying this, the program timed out.
I already take a look on the following Notes: 129385, 130480, 772497, 162034, 818321 but nothing seems to be helpful in my problem.
Questions:
1.  In syntax %_hints oracle u2018INDEX(u201CT_01u201D u201CMSEG~Mu201D)u2019. T_01 stands for MKPF right which is the first table, do you what's the reason for the program time out after adding this Oracle Hint?  Is this the proper syntax?
2.  How can I force in my code to use index MSEG~M without any program timeout?
For the whole source code of my question above, please see the link:
http://rapidshare.com/files/211740852/ZDXX0028.txt.html

Hi Thomas, thanks with the prompt reply (even if it's Saturday )
Yes, MKPF~BUD is being used.
The budat selection is narrowed to 28 days though users can input any date range, a warning message will just be displayed if budat selection exceeded.
Yes, optimizer usually chooses the right index; I'm not in as the same experience as you are though, but I find it interesting that after I added the Oracle hints (several combination) the performance of the program was optimize up to 40% to 50%.
I uploaded a detailed SQL trace and the ABAP change done in my program, if you'll notice in the summary of the changes, after adding some hints, the duration of the program was improved..
(SQL Trace Summary of my program) this worth taking a look
http://rapidshare.com/files/211870091/ZD28_SQL_Trace.zip.html
I made a custom index in MSEG, but unfortunately I doubt that it will be approve by our performance capacity team.  But I somehow have a hunch that this will further optimize the program.
MSEG~Z03
MANDT     Client
WERKS     Plant
BWART     Movement Type (Inventory Management)
LGORT     Storage Location
What do you think Thomas and SAP experts?
**Sorry for pasting the whole ST05 result
     SELECT STATEMENT          ( Estimated Costs = 131.250 , Estimated #Rows = 450 )
                    6          FILTER
                    Filter Predicates
                    5          NESTED LOOPS
                    ( Estim. Costs = 131.249 , Estim. #Rows = 450 )
          Estim. CPU-Costs = 1.885.249.948 Estim. IO-Costs = 129.700
                    2          TABLE ACCESS BY INDEX ROWID          MKPF
                    ( Estim. Costs = 14.442 , Estim. #Rows = 288.570 )
               Estim. CPU-Costs = 206.401.140 Estim. IO-Costs = 14.272
               1          INDEX RANGE SCAN          MKPF~BUD
                    ( Estim. Costs = 655 , Estim. #Rows = 519.426 )
          Search Columns: 2
          Estim. CPU-Costs = 30.640.783 Estim. IO-Costs = 630
          Access Predicates          Filter Predicates
                    4          TABLE ACCESS BY INDEX ROWID          MSEG
                    Estim. CPU-Costs = 5.818 Estim. IO-Costs = 0
          Filter Predicates
          3          INDEX RANGE SCAN          MSEG~0
               Search Columns: 3     
     Estim. CPU-Costs = 1.564 Estim. IO-Costs = 0
     Access Predicates          Filter Predicates

Similar Messages

  • Tables MARDH and MSEG - daily stock position

    Hi gurus of MM.
    I'm from BW and posted a thread about data from MM:
    Thread: 1876587
    As I understand, I can calculate the stock for a given date directly from tables MKPF (field BUDAT) and MSEG.
    MSEG has normal movement and also the initial stock value (posted as movement type: field BWART = 561), so this is possible.
    But I still didn't understand what's the logic to fill the different types of stock: fields LABST (unrestricted), UMLME (in transfer), INSME (quality inspection), EINME (restricted), SPEME (blocked) and RETME (returns).
    With MSEG I arrived to the total value.
    Which is coherent with the values that I found in MARD and MARDH  (the sum of these types of stock).
    What's the logic to distribute total value among these types of stock ???
    Thanks in advance.
    César Menezes

    Dear Amit
    I'm looking for technical information.
    But if you can also indicate some documents that explain the business rules I'd appreciate.
    The technical question is:
    Using tables MKPF and MSEG (basically fields BUDAT, MENGE and SHKZG) I can arrive to the values in tables MARD and MARDH.
    But until now I can arrive only to the totals of MARD and MARDH (the sum of fields LABST, UMLME, INSME, EINME, SPEME and RETME).
    The question is: what's the logic to arrive to each type of stock: LABST (unrestricted) and so on.
    I'm doing this because I need a daily stock position.
    MARD has a position at the moment, I can't use it to a report like: stock at day 10 plus movement of day 11 equal stock at day 11.
    MARDH has a montly, not a daily position.
    And I saw that I can arrive to daily stock position using only MKPF and MSEG.
    Thanks
    César Menezes

  • LIS Info Structure with table MKPF/MSEG

    Hi Gurus,
    I have a view made up of table MKPF/MSEG (74 fields in totals). Based on my requirement (loading archived and non archived marerial movements data) I am looking to create an Info structure with the same 74 fields - to connect the LIS infostructures to BW.
    I need to create a char. as KF fields catalog.
    my issue is while doing that I am not able to have the 74 fields I am looking for (I am just getting around 50).
    I know how to create an Infostructure/ Catalogue (Transaction MC21/MC18)
    Any Idea how to Create an Info Structure that would have all the fields from table MKPF and MSEG?
    Regards
    Edited by: Blaiso on Jun 2, 2011 6:10 PM

    Hi,
    Steps in LIS EXTRACTION:
    T.code u2013 :MC18 u2013 create field catalog
    1. Characteristic Catalog
    Application-01-Sales and Distribution, 02-Purchasing, 03-Inventory Controlling, etc..
    Catalog category 1. Characteristic catalog, 2. Key figures catalog 3. Date catalog Select characteristic catalog and enter, click on characteristic select the source table and it will be display the relevant source field and select the source field, copy + close, copy.
    Save, similarly create key figures catalog
    T.code : MC21 u2013 create infostructure
    Example u2013
    Inforstructure : S789
    Application u2013 01
    Choose characteristic select the catalog, select the fields, copy + close Choose key figures catalog select the key figures ,copy + close, save and generate
    T.code u2013 MC24 u2013 create updating
    Infostructure : S789
    Update group : 01- Sales document, delivery, billing document ,enter Select the key figures click on rules for key figures give suggest rules, copy save and generate Click on updating (activate updating) Select the infostructure set periodic split 1. Daily, 2. Week, 3. Month, 4. Posting period Updating u20131)No updating,2)Synchronous updating (V1), 3)As synchronous updating (V2), 4)As synchronous updating (V3),
    T.code u2013 LBW0 u2013 Connection of LIS Information structures to SAPBW Information structure : S786 Select the radio button-Setup LIS environment and Execute.
    Select the radio button-Generate data source and Execute.
    For Delta update:
    Select the radio button-Generate updating and Execute Select the radio button -Activate / deactivate and Execute.
    T.code u2013 SBIW u2013 Display IMG (implementation guide) Setting for applications specific data source u2013 logistics u2013 Managing transfer information structure u2013 setup of statistical data u2013 applications specific setup of statistical data u2013perform statistical setup u2013 sales.
    Choose activity
    Setup u2013 Orders, deliveries, billing
    Choose the activities enter the infostructure (S789), give name of the run, date of termination, time of termination, No. of tolerated faulty documents. Then execute
    T.code u2013 RSA3 u2013 Extractor checker
    Give the data source name eg. 2LIS 01S789 and execute, result will get some records Go to BW side replicate data source u2013 Assign infosource u2013 Create infocube u2013 Create update rules u2013 create infopackage and schedule the package with initialize delta process.
    For delta update :
    In R/3 side
    T.code u2013 MC25, set update (V1) or (V2) or (V3)
    T.code u2013 LBW0, choose generate updating and execute then choose activate / deactivate and execute
    BW side u2013 create infopackage and schedule the package with delta update.
    First time if your scheduling the infopackage -in R/3 side T.code :MC25 -Udating set to No update,insted of selecting the update V1,V2,V3.
    If your doing the Delta update:in R/3 side T.code :MC25-Updating set to either V1 or V2 or V3. and the to T.code :LBW0 -Select the radio button Active/deactivate and Execute.
    and schedule the infopackage with delta update.
    Modules for LIS : SD,MM, PP,QM.
    Deltas for LIS:
    After setting up the LIS environment, 2 transparent tables and 1 extract structure is generated for this particular info structure. Within transaction SE11 you can view the tables u2018SnnnBIW1u2019, u2018SnnnBIW2u2019 and the structure u2018SnnnBIWSu2019 and the InfoStructure itself u201ASnnnu2018
    The tables S5nnnBIW1 & SnnnnBIW2 are used to assist the delta update process within BW.
    Extract structure u2018SnnnnBIWCu2019 is used as an interface structure between OLTP InfoStructure and BW
    The OLTP system has automatically created an entry in the control table u2018TMCBIWu2019. Within transaction u2018SE16u2019 youu2019ll see, that for your particular InfoStructure the field u2018BIW activeu2019 has the value u2018Xu2019 and the field u2018BIW statusu2019 is filled with value u20181u2019 (refers to table SnnnBIW1).
    The orgininal LIS update program u201ARMCX#### will be enhanced within the form routines u201Aform Snnnbiw1_update_u2026.u2018 and u201Aform Snnnbiw2_update
    With the transaction u2018SE38u2019 youu2019ll see at the end of the program starting at line 870 / 1006, that the program is enhanced within a u2018BIW delta updateu2019 coding
    Within the flag u201AActivate/Deactivateu2018 the update process into the delta tables (SnnnBIW1/Sn5nnBIW2) is swichted on/off. In the table u201ATMCBIWu2018 is defined, which table is active for delta update.
    Regards,
    Prakash

  • Info about mkpf and mseg

    I need to modify a report that brings all the production of all our materias for a given period of time.
    The code joins both tables mkpf and mseg and ask for the date:
    mkpf-budat between s_budat-low and s_budat-high
    This query is taking A LOT of time and I need to optimize it. All of the fields needed are in the mseg, but the date is in mkpf. In mseg there is a field called production date (hdat) Is this field the same than the budat located in mkpf (I want to query only one table)?  If not, what do I have to do to optimize my query????
    TIA
    Query:
    select smblnr smjahr sbwart smatnr swerks smenge  
    appending  corresponding fields of table t_mseg  
    from  mseg as s inner join mkpf as k             
    on smblnr = kmblnr and                       
    smjahr = kmjahr                           
    where                                           
    ( sbwart eq lit_101 or sbwart eq lit_102 )
    and s~matnr in s_matnr                          
    and s~werks in s_werks_full                     
    and k~budat between s_budat-low and s_budat-high
    and s~bukrs = p_bukrs.

    Well MSEG has an index on MATNR and WERKS. Try changing the order of the where:
    select s~mblnr s~mjahr s~bwart s~matnr s~werks s~menge
    appending corresponding fields of table t_mseg
    from mseg as s inner join mkpf as k
    on s~mblnr = k~mblnr and
    s~mjahr = k~mjahr
    where s~matnr in s_matnr
    and s~werks in s_werks_full
    and ( s~bwart eq lit_101 or s~bwart eq lit_102 )
    and k~budat between s_budat-low and s_budat-high
    and s~bukrs = p_bukrs.
    Also - make sure s_matnr is not empty.
    Also make sure s_matnr is either 'I'ncluding either ranges or single values. Indexes don't work very well with 'E'xcluding, patterns or NE.
    Rob
    Message was edited by: Rob Burbank

  • Link B/w MKPF and BKPF

    is there any link B/W  tables MKPF and BKPF

    hii
    refer link
    Link between Accounting Header (BKPF) amd Goods Reciepts Header (MKPF)
    you can do following way too
    select MJAHR & MBLNR fields from MKPF table
    CONCATENATE these fields into one variable like wa_val.
    now use
    SELECT * from BKPF where BKPF-AWKEY = wa_val
    regards
    twinkal

  • Optimization of Join statement between MKPF and MSEG table for improving pe

    Hi All,
    I had a issue where we are executing one custom report and it is getting timed out after 45 minutes. We further executed with trace on and got to the conclusion with the help of BASIS that about 42 minutes of the 45 minutes tracetime are spent by a join over the tables  MKPF en MSEG.
    This join is done by the abap statement:
      SELECT mkpf~mblnr
             mkpf~mjahr
             mkpf~bldat
             mkpf~blart
             mseg~matnr
             mseg~werks
        INTO CORRESPONDING FIELDS OF TABLE i_matdoc_we
        FROM mkpf INNER JOIN mseg ON mkpfmblnr = msegmblnr
                                 AND mkpfmjahr = msegmjahr
    FOR ALL entries IN i_list
       WHERE mkpf~mblnr BETWEEN lv_interval-fromnumber
                            AND lv_interval-tonumber
         AND mkpf~blart = 'WE'
         AND mkpf~bldat LE gv_last_day_fisc_period
         AND mseg~matnr = i_list-matnr
         AND mseg~werks IN s_werks.
    Here, I_LIST comprises of stock for specific period as entered in the selection screen for that particular Material and plant
    LV_INTERVAL is range of all goods receipts for material and gv_last_day_fisc_period is current date.
    During the tracetime this statement was executed  more than 20.000 times, until the transaction timed out.
    The individual executions of this select stmnt  varied (roughly) between 50 and 1200 miliseconds. (depends wheter the requested database block is in the buffercache or must be read from disk).
    The acesspath used to execute the query ( see below) is optimal, given the present indexes.
    Index MSEG~M is covering al the specified selection criteria for  MSEG.
    Index MKPF-0 is used  to search the specified MBLNR criterium in MKPF.
    The  remaining selection criteria MKPF-BLART and MKPF-BLDAT are not indexed, and imho this would also not make sense for this query.
    BLART has only 3 different values n the MKPF table, and the selected value 'WE' has more than 1 million occurences.
    BLDAT is selected with =<20110903, so this is not distinctive as well.
    Can any one suggest some better way to write this query.
    Regards,
    Subhajit

    Actually there are 2 select statements where JOIN have been introduced and especially the time out is occurring in the second JOIN.
    Find all goods receipts for material
      PERFORM get_number_range_matdoc USING '03'
                                   CHANGING lv_interval.
      SELECT mkpf~mblnr
             mkpf~mjahr
             mkpf~bldat
             mkpf~blart
             mseg~matnr
             mseg~werks
        INTO CORRESPONDING FIELDS OF TABLE i_matdoc_we
        FROM mkpf INNER JOIN mseg ON mkpfmblnr = msegmblnr
                                 AND mkpfmjahr = msegmjahr
    FOR ALL entries IN i_list
       WHERE mkpf~mblnr BETWEEN lv_interval-fromnumber
                            AND lv_interval-tonumber
         AND mkpf~blart = 'WE'
         AND mkpf~bldat LE gv_last_day_fisc_period
    AND mseg~matnr = i_list-matnr
        AND mseg~werks IN s_werks.
      CLEAR lv_interval.
      PERFORM get_number_range_matdoc USING '02'
                                   CHANGING lv_interval.
    Find all goods issues for material
      SELECT mkpf~mblnr
             mkpf~mjahr
             mkpf~bldat
             mkpf~blart
             mseg~matnr
             mseg~werks
        INTO CORRESPONDING FIELDS OF TABLE i_matdoc_wa
        FROM mkpf INNER JOIN mseg ON mkpfmblnr = msegmblnr
                                 AND mkpfmjahr = msegmjahr
    FOR ALL entries IN i_list
       WHERE mkpf~mblnr BETWEEN lv_interval-fromnumber
                            AND lv_interval-tonumber
         AND ( mkpfblart = 'WA' OR mkpfblart = 'WI' )
         AND mkpf~bldat LE gv_last_day_fisc_period
    AND mseg~matnr = i_list-matnr
         AND mseg~bwart NE '561'
         AND mseg~bwart NE '562'
         AND mseg~bwart NE '961'
    AND mseg~bwart NE '962'
    AND mseg~werks IN s_werks.
    Mainly the second JOIN is creating the problem... In the backend ORACLE is being used as database.
    Please suggest how I can improve the performance of these joins as its taking more than 45 mins..

  • Performance of MSEG table with MKPF and LIKP

    Hi,
    I am having an Issue with MSEG table. It has 6.5 lakh (= 650,000) records in Production System.
    Can anyone help me with its performance. The code I am using now is.
    SELECT MBLNR mjahr BLDAT BUDAT LE_VBELN FROM MKPF INTO TABLE IT_MKPF WHERE
           BUDAT IN S_POSDAT and
           MBLNR IN S_GRNUM.
    IF NOT IT_MKPF[] IS INITIAL.
    SELECT mblnr mjahr bwart lifnr FROM MSEG INTO TABLE IT_MSEG FOR ALL ENTRIES IN IT_MKPF
      WHERE bwart eq p_movtyp and
                   lifnr in S_VENDOR and
                   mblnr eq it_mkpf-mblnr and
                   mjahr eq it_mkpf-mjahr.
    IF NOT IT_MSEG[] IS INITIAL.
    SELECT vbeln lfdat verur lifnr FROM LIKP INTO TABLE IT_LIKP FOR ALL ENTRIES IN IT_MKPF
      WHERE verur in S_REFER  and
                   lifnr in S_VENDOR and
                   vbeln eq it_mkpf-le_vbeln.
    Is there any other field which I can give for MSEG-LIKP or MSEG-MKPF combination tables to increase the performance.
    Edited by: Thomas Zloch on Apr 19, 2011 2:22 PM - please do not use local units

    Hi
    try this way the performance is better ...
    for MSEG,BKPF and BSEG tables try to use SELECT...ENDSELECT instead of for all entries...
    SELECT MBLNR mjahr BLDAT BUDAT LE_VBELN FROM MKPF INTO wa_MKPF WHERE
            BUDAT IN S_POSDAT and
            MBLNR IN S_GRNUM.
    SELECT mblnr mjahr bwart lifnr FROM MSEG INTO wa_MSEG
       WHERE bwart eq p_movtyp and
                    lifnr in S_VENDOR and
                    mblnr eq it_mkpf-mblnr and
                    mjahr eq it_mkpf-mjahr.
    SELECT vbeln lfdat verur lifnr FROM LIKP INTO wa_LIKP
                WHERE verur in S_REFER  and
                    lifnr in S_VENDOR and
                    vbeln eq it_mkpf-le_vbeln.
    "APPEND to final table
    ENDSELECT.
    ENDSELECT.
    ENDSELECT.
    Prabhudas

  • MKPF and MSEG table

    What is diff between MKPF and MSEG table ?

    Dear Balaji,
    In MKPF you will get to know the transaction code which was used for posting the material document.
    In MSEG,you will get to know the the item details from which it was posted along with the quantity and amount in LC.
    Regards
    Mangalraj.S

  • Oracle Ignores hint in One Instance and uses the hint in another instance

    Hi Oracle World,
    I am experiencing a strange problem in Oracle.
    We have two oracle servers: one for Test and one for Production.
    We have exactly the same code for a view in both the systems:
    The code is as follows:
    CREATE OR REPLACE FORCE VIEW V_FT(...................)
    AS
    SELECT /*+ star_transformation fact (FT) */
    FT.*, AH.ACCT_1, LH.REGION, FH.FNCT_1
    FROM
    LOCATION_HIERARCHY LH,
    ACCOUNT_HIERARCHY AH,
    FUNCTIONAL_HIERARCHY FH,
    FACT_TABLE FT
    WHERE
    LH.COMPANY = FT.COMPANY
    AND AH.ACCOUNT = FT.ACCOUNT
    AND FH.FUNCTIONR = FT.FUNCTION;
    When I see the execution path:
    In Test box the Explain plan is as expected: It takes the Star_transformation hint into account, converts all three reference table joins to bitmap and performance is good.
    But In Production, It tatally ignores the table name from the hint.
    Also it converts all the tables names to lower case: though it shouldn't impact, I have also tried to give the table names in lower case and then tried. Same issue.
    Tried with NO_MERGE hint. It was pretty good in Test but same issue in Production: it ignoes the table name from hint.
    I have taken out the table name from test and then tested. Now both the explain plans match. That proves oracle ignores the table name in Production.
    We have compared all the parameters in both. They are 100% same. All indexes are analyzed. Can anyone please help what could be the fundamental difference that causes this difference?
    Production takes 8 minutes for a specific query whereas Test returns the same query in 45 secs. Data volume is also not very much different except few hundreds.
    Any pointers please?
    Thanks & Regards
    Saswati

    It is enabled. As I have mentioned we have compared all the parameters in both.
    All v$parameter, init.ora settings everything is same.

  • MKPF & MSEG Performance issue : Join on table  MKPF & MSEG  taking too much time ..

    Hello Experts,
    I had a issue where we are executing one custom report in which  i used inner join on table  MKPF & MSEG,  some time join statement  took  9-10 min to excute and some time execute within  1-2 min with same test data .
    i am not able to understand what the actaully happing .
    please help.
    code :
       SELECT f~mblnr f~mjahr f~usnam f~bktxt  p~bukrs
        INTO TABLE itab
        FROM mkpf AS f INNER JOIN mseg AS p
            ON f~mblnr = p~mblnr AND f~mjahr = p~mjahr
         WHERE f~vgart = 'WE'
           AND f~budat IN p_budat
           AND f~usnam IN p_sgtxt
           AND p~bwart IN ('101','105')
           AND p~werks IN p_werks
           AND p~lgort IN p_lgort.
    Regards,
    Dipendra Panwar.

    Hi Dipendra,
    if you call a report twice after another with the same test data for data selection, then the second run should be faster, because some data are remaining in memory and needn't to be caught from database. This will be also for the following third und further runs, until the data in the SAP memory will be removed by other programs.
    For performance traces you should try to test with a first run.
    Regards,
    Klaus

  • Querry for MKPF and MSEG

    Hi,
    In mY report,
    I have BUDAT as select-options and
             WERKS as select-options.
    Based on MBLNR, MJAHR from MKPF into table it_mkpf where Budat in s_BUDAT.
    after that I am fetching MSEG data using for all entries in it_mkpf where werks in s_werks.
    for low date range it is working fine.
    For higher date range ,I am getting around 2 Lacs of records in MKPF , but while fetching MSEG ,Its getting dump with message endless Loop.
    How can increase my performance.
    Is there any Function Module to fetch data.
    Can anybody suggest me.
    Thanks
    kumar n

    Hi Kumar,
    I have the same situation,
    where I will have 1.5 lakhs minimum records from MKPF every month,,,
    now my total database is nearly 35 million records till date from 1998.
    and getting records from MKPF is not difficult its very easy even 35 million records,,,
    But after getting from MSEG by MKPF is Hell,,,,
    but I see Joins are far better , best in these cases,,,
    So after that i have written a Code snippet in "Code-gallery" in SAP -Wiki, with title Joins are Better in some cases
    Author: Dileep Kumar
    Submitted: 11.02.2009
    Description  : Join Statement is the best in some cases as shown below than For All Entries. So Dont Forget about Joins Simply. Keep trying with joins
    sometimes, where you can get a better performance.
    Dont forget about joins simply like that due to performances. Now in this case(A Business Requirement) Joins is the best than FOR ALL ENTRIES.
    TYPES: BEGIN OF TY_MKPF ,
            MBLNR TYPE MKPF-MBLNR,          "Material document
            MJAHR TYPE MKPF-MJAHR,
            BUDAT TYPE MKPF-BUDAT,          "Posting Date in the document
          END OF TY_MKPF.
    TYPES: BEGIN OF TY_MSEG1 ,
            MJAHR TYPE MKPF-MJAHR,
            BUDAT TYPE MKPF-BUDAT,          "Posting Date in the document
            MBLNR TYPE MSEG-MBLNR,          "Material document
            MATNR TYPE MSEG-MATNR,          "Material Number
            ZEILE TYPE MSEG-ZEILE,          "Item in material document
            BWART TYPE MSEG-BWART,          "Movement Type
            CHARG TYPE MSEG-CHARG,          "Batch Number
            EBELN TYPE MSEG-EBELN,          "PO #
            SHKZG TYPE MSEG-SHKZG,          "Debit/Credit Indicator
            MENGE TYPE MSEG-MENGE,          "Quantity
            MEINS TYPE MSEG-MEINS,          "UOM
            DMBTR TYPE MSEG-DMBTR,          "Amount in local currency
            WAERS TYPE MSEG-WAERS,          "Currency Key
          END OF TY_MSEG1.
    TYPES: BEGIN OF TY_MSEG ,
            MBLNR TYPE MSEG-MBLNR,          "Material document
            MATNR TYPE MSEG-MATNR,          "Material Number
            ZEILE TYPE MSEG-ZEILE,          "Item in material document
            BWART TYPE MSEG-BWART,          "Movement Type
            CHARG TYPE MSEG-CHARG,          "Batch Number
            EBELN TYPE MSEG-EBELN,          "PO #
            SHKZG TYPE MSEG-SHKZG,          "Debit/Credit Indicator
            MENGE TYPE MSEG-MENGE,          "Quantity
            MEINS TYPE MSEG-MEINS,          "UOM
            DMBTR TYPE MSEG-DMBTR,          "Amount in local currency
            WAERS TYPE MSEG-WAERS,          "Currency Key
          END OF TY_MSEG.
    DATA : IT_MSEG TYPE TABLE OF TY_MSEG, WA_MSEG LIKE LINE OF IT_MSEG.
    DATA : IT_MKPF TYPE TABLE OF TY_MKPF, WA_MKPF LIKE LINE OF IT_MKPF.
    DATA : IT_MSEG1 TYPE TABLE OF TY_MSEG1, WA_MSEG1 LIKE LINE OF IT_MSEG1.
    SELECT-OPTIONS :
       S_BUDAT FOR MKPF-BUDAT," OBLIGATORY,       " Posting Date.
       S_MATNR FOR MSEG-MATNR," OBLIGATORY.       " Material No.
       S_WERKS FOR MSEG-WERKS." OBLIGATORY,       " Plant
    Start-of-Selection.
    *<<<<<<<<<<<<<<<<<<<<
        SELECT MBLNR MJAHR BUDAT
          INTO TABLE IT_MKPF
          FROM MKPF
          WHERE BUDAT IN S_BUDAT.
      IF IT_MKPF IS NOT INITIAL.
        SELECT MBLNR MATNR ZEILE BWART CHARG EBELN SHKZG MENGE MEINS DMBTR WAERS
          FROM MSEG
          INTO TABLE IT_MSEG
          FOR ALL ENTRIES IN IT_MKPF
          WHERE MBLNR = IT_MKPF-MBLNR AND
                MJAHR = IT_MKPF-MJAHR AND
                MATNR IN S_MATNR AND
                WERKS IN S_WERKS .
      ENDIF.
    *compared to the above For all entries, below Join can perform well &
    *Good for 2nd & third runs are much faster as they store data in Buffer memory..
    *<<<<<<<<<<<<<<<<<
      SELECT  AMJAHR  ABUDAT BMBLNR BMATNR BZEILE BBWART B~CHARG
              BEBELN BSHKZG BMENGE BMEINS BDMBTR BWAERS
              INTO TABLE IT_MSEG1
              FROM MKPF AS A INNER JOIN MSEG AS B ON AMBLNR = BMBLNR AND
                                                     AMJAHR = BMJAHR
              WHERE A~BUDAT IN S_BUDAT AND
                    B~MATNR IN S_MATNR AND
                    B~WERKS IN S_WERKS .
    *<<<<<<<<<<<<<<<<<<
    Thanks & regards,
    Dileep .C

  • Linking tables MKPF MSEG MBEW EKKO EKBE EKBZ BSEG TCURR

    Hello everyone, I need help with linking all these tables:
    MKPF, MSEG, MBEW, EKKO, EKBE, EKBZ, BSEG, TCURR...
    what is the best way to link them in order to run a report??
    any ideas?

    Refer to this MM and FI tables flow, ths might help you
    http://www.sapgenie.com/abap/tables_mm.htm
    http://www.sapgenie.com/abap/tables_fi.htm
    http://www.sapgenie.com/abap/tables_mm.htm#Purchasing%20Tables
    Regds
    Manohar

  • Is any difference in oracle 11i and oracle 12 interfaces tables

    Dear All,
    Can someone tells me .. Is any difference in oracle 11i and oracle R12 interface tables?? My company want to upgrade Oracle 11i to EBS R12
    PS
    Edited by: PS on Jul 13, 2012 3:07 PM

    Please also see:
    Identifying Data Model Changes Between EBS 12.1.3 and Prior EBS Releases
    https://blogs.oracle.com/stevenChan/entry/ebs_data_model_1213
    EBS File Comparison Report Now Available
    https://blogs.oracle.com/stevenChan/entry/ebs_file_comparison_report_now
    EBS Seed Data Comparison Reports Now Available
    https://blogs.oracle.com/stevenChan/entry/ebs_seed_data_comparison_reports
    Thanks,
    Hussein

  • Extract tables from "Oracle Apss 11.0.3" and load it to "Oracle Apps 11i"

    Hi hussein,
    I am tasked to extract the following tables from Oracle Apps 11.0.3 and load it to Oracle Apps 11.5.10.2.
    PO_VENDORS
    PO_VENDOR_SITES_ALL
    Can I use export / import?
    Thanks a lot

    Hi,
    I believe export/import of individual apps tables is not supported due to objects dependency and refrential integrity.
    Regards,
    Hussein

  • Oracle can not support upto 32 characters table name and field name ?

    hi
    oracle up limitation ?
    create table aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(a char);
    Error
    ORA-00972:identifier too long
    or
    create table a (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa char);
    Error
    ORA-00972:identifier too long
    Oracle can not support upto 32 characters table name and field name ?
    It is true?
    null

    Hello All
    It's been a year after those posts about the limit of identifiers in Oracle Database. Does anybody know what can be done to get rid of that primitive limit? We are developing using Application Servers, Java, generated Code and a very nice object model, in which we can't just use abreviations because of early database age memory shortcomings.
    We are currently using 8i in a very large organization. Is there any chance this version can be configured to allow larger identifiers? Is upgrading to 9i going to solve this problem? Is Oracle Databases really doomed forever because of a 20-year-ago limitation?
    Please, I do like Oracle Databases. I don't want to be flooded with quick answers like "just use 32 character identifiers". I would like to hear a serious solution. Is anybody there still locked in the 8.3 filename paradigm of MS/PC-DOS? Does anybody has to fit an entire Enterprise System in segmented 640Kb of memory? Does anybody has to use monochrome character mode interfaces? Of course not those in the mainstream.
    I also know that other hadrware and software products have lots os limitations. Take Windows 2000. Its command line has a limit of 255 characters! You can't have more than 4GB of memory in a PC! However, one can't expect one mistake to justify others.
    I wish I were very wrong in this respect, and all it should be necessary is to turn on some kind of configuration parameter in 8i to allow us to develop high quality code.
    Thanks for your attention.
    Please, feel free to contact me if you have a solution.
    [email protected]

Maybe you are looking for

  • Production Order Cost Analysis - Goods Receipt

    I have been assigned to create analysis of production orders.  I need to show the volume variance as well as the cost variance using both the initial planned costs as well as the actual costs when the production order is completed.  All this informat

  • Do you want to completely separate application logic from presentation logi

    There is solution! http://javaby.sf.net JavaBY Template Engine is a general template engine used for generating any type of text document from a template. JavaBY Template Engine is used mostly for generating HTML from servlets but it can also be used

  • Ibot download report data

    Hi everyone! We uses ibot schedule report , when user logon then they can click alter and directly download this report data into cvs file not use open this report,how can do it ? Thanks & Regards Edited by: user1529789 on 2009-4-27 下午11:00

  • CS4 not recognize MOV. File ???

    I just moved to a new machine (WIN7 64 bit). I installed Premiere CS4 and AE CS4. Now I'm trying to load one of my PP projects that I did on my old machine on the new one. When I try loading a file that was rendered in AE (mov. file that worked fine

  • How do I install Flash 10 so that it will work in all user accounts?

    I have added an account for an 8-year old boy to access DisneyXD, Nick, etc. The problem is that I can only get Flash to work from my account. I am running Windows XP and IE Explorer 8.0. I've tried the following: * Giving administrator privilege to