From  Mseg to Bseg ( table linking )

Hai gurus ,,
        I am doing Goods Reciept Register.
     I need a small table linking   from Mseg to Bseg.
( If suppose from Bseg to mseg mean we can Fetch the data like
select  '.. . . .
where
Mseg-mblnr = bseg-awkry+0(10).
In Bseg-awkey first 10 No. will be Material DOcu No.
But how to fetch the data from Mseg to Bseg..
Plz send the code Its too urgent.

hi this is the relation between the keyfiels of these tables...
mesg    bseg
where condition...
it_mseg-parbu  =  it_bseg-BUKRS
it_mseg-MBLNR = it_bseg-BELNR
it_mseg-MJAHR = it_bseg-GJAHR
it_mseg-BUZEI   = it_bseg-BUZEI
reward points if useful,
venkat.
Edited by: venkat  appikonda on Mar 29, 2008 1:56 PM

Similar Messages

  • Fetching data slow from MSEG and BSEG table

    Dear Experts,
    Out  MSEG and BSEG are major tables which are very slow and taking 5-10 minutes in fetching just 20/30 records.
    Why this table taking more time and how I can fatch fast  data from these table.
    regards

    > Out  MSEG and BSEG are major tables which are very slow and taking 5-10 minutes in fetching just 20/30 records.
    > Why this table taking more time and how I can fatch fast  data from these table.
    Do you select on key fields or on indexed fields? How do you select?
    If not, then the database must read the full table and check which of the entries are valid for your selection.
    Do an SQL trace using ST05, run the command, stop the trace and check the explain.
    Markus

  • Data fetching from BSEG table

    Hi,
    I have used smartforms for generating suppler payment statement for financial department. more time duration is taken by the program when it is generating.
    I think this problem comes while data fetching from BSEG table. because, it has more records for one vendor ID.
    I want reduce this time duration.
    Please guide me.

    Have you tried this selection in se16? I'm quite sure that It will take
    a long time.
    The problem has been explained in this group before and I think you
    should search for bseg in the answers given.
    As a hint: It has to do with the selection universe. You are restricting
    only bukrs from the primary key (all the other restrictions in your
    where clause are filters that are applied on SAP's side (not on the
    database side)). The problem is that bseg isn't stored as separated
    fields in the RDBMS, but as a table with the primary key and a stream of
    bits in a raw field.
    You should review and change the logic you're using before reading bseg.
    It's the only way you'll improve the performance of this select. (for
    example, you could use one or more secondary index tables - bi or ba
    to retrieve belnr and access bseg with a better where clause).

  • Latest record to get from MSEG Table

    Hi frnds,
    I am getting multiple records against material no. i want single record and latest one.
    SELECT DISTINCT MBLNR MATNR LIFNR
            FROM MSEG
            INTO TABLE IT_MSEG
            WHERE MATNR IN S_MATNR
            ORDER BY MATNR MBLNR DESCENDING.
    S_MATNR = multiple matnr
    eg: matnr   mblnr lifnr
          test     1        abc
          test     2        abc
          test2   4        xyz
          test3   3        abc
          test3   5        vvvv
    I want in my ITAB.
    eg: matnr   mblnr lifnr
          test     1        abc
          test2   4        xyz
          test3   5        vvvv
    Here I am sorting with mblnr to pick latest record.
    How i will get.
    Regards.

    Hi,
        just do one thing if after sorting you are getting first record of latest record in each material then use
    delete adjacent duplicates from itab comparing matnr.
    Regards
    Vijay dwivedi

  • Down load from BSEG Table

    Hi
    Friends
    we have around 50 millions records in the Bseg table.
    i need to down load only 5 fields .
    one our friend suggested using ABAP code we can down load.
    But i would like to know from you is there any Transcation code to down load only 4 or 5 fields from bseg fro all the company codes since we have around 50 million Records inthe table.
    Thanks in advance.

    Hi Ravindra,
    Good afternoon and greetings,
    In SE16 itself you can down only the selected field by choosing the User Parameters...Alternatively, you can create a query using SQVI and select only those fields for displaying and downloading.
    If you require any assistance on SQVI, please let me know.
    Points awarded is highly appreciated, if the above mentioned solution meets your requirement.
    Thanking you
    With kindest regards
    Ramesh Padmanabhan
    Consultant

  • Performance tuning for extraction of data from MSEG table

    Hello experts,
    I m trying to extract data via select query from MSEG table based on non-primary keys, which affects my performance.
    Below is my select query  :
    SELECT SINGLE menge
    FROM mseg
    INTO w_rejqty
    WHERE ebeln = it_mseg-ebeln AND
          ebelp = it_mseg-ebelp AND
          bwart = '122'.   
    Kindly suggest some alternative way for it apart from creating secondary index on table MSEG which would be my last option because already four secondary index are created in my present situation and also is it advisable to create fifth secondary index for my problem?? Would it affect my database performance?
    Thanks in advance
    Raj

    Hi Raj,
    is that possible to use this query below ? You might ask to Functional whether is possible or not.
    SELECT SINGLE belnr gjahr buzei INTO w_ekbe FROM ekbe
        WHERE ebeln = it_mseg-ebeln
        AND     ebelp = it_mseg-ebelp
    SELECT SINGLE menge FROM mseg INTO w_rejqty
       WHERE mblnr EQ w_ekbe-belnr
       AND   mjahr EQ w_ekbe-gjahr
       AND   zeile EQ w_ekbe-buzei
    Best Regards
    Fernand

  • How to delete a record from BSEG table

    Dear Experts,
    How to delete a record from BSEG table.
    If there possible to delete some records from transparent table ?
    Please help.
    Regards,
    Tan

    Hi,
    Deleting a record from a standard table can be done only if table maintenance exists - Cehck tcode - SM30.  But it is not advisable to delete records, coz the records may be dependent on many other tables.  If u delete in a single place, there may be chance that inconsistency in the data happens and hence will affect ur financial statements.
    Pls. assign points, if useful
    Regards,
    Sridevi

  • FM to read data from MSEG table

    Hi all,
    can any one provide me the Function Module to fetch data from MSEG table by giving inputs
    1) materail doc number (MBLNR)
    2) MJAHR Doc year.
    or is there any other method to fetch data with high performance.

    itabh is mkpf header table.
    if not itabh is initial.
    SELECT fielname(s)
    INTO TABLE ITAB FROM MSEG
    FOR ALL ENTRIES IN ITABH
    WHERE MBLNR EQ ITABH-MBLNR
    AND MJAHR EQ ITABH-MJAHR
    AND WERKS EQ PR_WERKS
    AND LGORT IN PR_LGORT
    AND BWART IN ('261','262')
    and AUFNR IN S_AUFNR
    endif.
    Avoid using select * try to mention the field name which are required.
    try to use all key fields.
    and before writing FOR ALL ENTRIES make sure the table ITABH is not empty.

  • Reading data from BSEG table with Non-key fields in where clause

    Hi All,
        I have to read data from BSEG table based on WBS element field (PROJK). As I'm not passing key fields to WHERE clause system couldnt run the select statement. Since BSEG is a cluster table I cant even create secondary index on PROJK field.
       Could you please tell me, how to improve its performance.
    Regards
    Jaker.

    SELECT bukrs
                 belnr
                 gjahr
                 shkzg
                 dmbtr
                 hkont
                 lifnr
                 matnr
                 werks
                 menge
                 meins
                 ebeln
            FROM bseg
            INTO TABLE it_bseg
            PACKAGE SIZE 10
            FOR ALL ENTRIES IN it_final
            WHERE  bukrs EQ it_final-bukrs
               AND belnr EQ it_final-belnr
               AND gjahr EQ it_final-gjahr
               AND buzei EQ it_final-buzei
               AND hkont EQ it_final-hkont
               AND werks IN s_werks.
    By using package and fetch from BSEG table. gathering all other information to a final internal table.This will reduce the hit to database.And also try to put that data in hashed internal table which is it_bseg....then definetly improve the performance.
    <REMOVED BY MODERATOR>
    Dara.
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 12:47 PM

  • Data Retrival from BSEG Table

    Hi,
    Can any one tell me how to retrive the partial payment accounting documents from BSEG table as I
    Can't use REBZG field of BSEG which is not a primary key ?
    Regards,
    Krishnam Raju

    Hi
    U need to get all payments and check if they are partial payment.
    I don't know which kind of items (vendor or customer) u need to control, but if u need to check the customer payments:
    - A) Select the payments from cleared items (BSAK table)
    - B) Check if the field  REBZG is filled
    Max

  • Can we get the raw materials for a classified Material from MSEG table?

    Hi All,
    Can we get the raw materials for a classified Material from MSEG table using Order number?
    If yes How we can find it out for Past month only? As well how we can get the std price for this raw material.
    Please help me out,
    Thanks,
    Ravi

    Field STPRS (Standard price) From Table MBEW.
    Kanagaraja L

  • Link between Anep and bseg table.

    How are ANEP and BSEG table related functionally? I am using the ANBTR field from ANEP table and retrieving the HKONT(G/L account) field from BSEG. I want to ask if entry for some assete exists in ANEP table then is it necessarty to have G/L account in BSEG table corresponding to this asset in ANEP. I am joining the two tables on BUKRS, BELNR, BUZEI and GJAHR fields.

    Hi
    For BSEG you cannot inner join. Its a cluster table and u dont have option to inner join. Instead take neccessary record in BSEG with valid condition.

  • Block stock calculation from mseg table for any given date.

    I am calculating stock from mseg table for any given date. Not just month end stock or current stock. It could be back date also. It is tallying also with MB5B stock report of that date. Now I have to bifurcate that stock into unrestricted stock, quality stock and block stock.
    I have checked INSMK and ZUSTD field in mseg table, but could not concluded. Should I check movement type wise? Block/ Quality stock could be transferred into unrestricted stock also. That also I have to take care.
    Can anyone clearly explain how the stock type posting takes place in mseg table when goods receipt as block / quality stock and when the same goods transferred in unrestricted stock, what are the reference indication.

    DATA : LIST_TAB TYPE TABLE OF ABAPLIST.
    DATA: BEGIN OF VLIST OCCURS 0,
          FIELD1(5)  TYPE C,
          FIELD2(19) TYPE C,
          FIELD3(16) TYPE C,
          FIELD4(17) TYPE C,
          FIELD5(25) TYPE C,
          FIELD6(24) TYPE C,
          FIELD7(25) TYPE C,
          FIELD8(25) TYPE C,
          END OF VLIST.
    TYPES : BEGIN OF ITAB,
           MATNR(18) TYPE C,
           WERKS(5) TYPE C,
           END_MENGE(20) TYPE C,
           END OF ITAB.
    DATA : ITAB TYPE STANDARD TABLE OF ITAB WITH HEADER LINE,
            WA_TAB TYPE ITAB.
    ----submit command to run mb5b in the background and -
    ----push the data into an internal table -
    " Calling MB5B for displaying the Closing Stock
    SUBMIT RM07MLBD USING SELECTION-SCREEN  '1000'
                    WITH DATUM BETWEEN S_DATE-LOW AND S_DATE-HIGH
                    WITH MATNR IN S_MATNR WITH WERKS IN S_WERKS
                    WITH BWART-LOW = '601' EXPORTING LIST TO  MEMORY
                    AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        LISTOBJECT = LIST_TAB
      EXCEPTIONS
        NOT_FOUND  = 1
        OTHERS     = 2.
    CALL FUNCTION 'LIST_TO_ASCI'
      EXPORTING
        LIST_INDEX         = -1
      TABLES
        LISTASCI           = VLIST
        LISTOBJECT         = LIST_TAB
      EXCEPTIONS
        EMPTY_LIST         = 1
        LIST_INDEX_INVALID = 2
        OTHERS             = 3.
    LOOP AT VLIST WHERE FIELD1 CS '|'.
    CHECK SY-TABIX GE 4.
    MOVE :  VLIST-FIELD1+1(4) TO ITAB-WERKS,
            VLIST-FIELD2+1(18) TO ITAB-MATNR,
            VLIST-FIELD8 TO ITAB-END_MENGE.
    APPEND ITAB.
    ENDLOOP.
    This is the program to call MB5B and the standard program and use the following settings for the closing stock opening stock and block stock

  • Create a Logical Database Based on Mseg and Bseg

    Hi,
      how can i create a Logical database using bkpf,bseg,mkpf,mseg. i need to know , which table is a root node ?
    could any one help me?
       Thanks

    Hi Amit,
           While I am Creating the Logical Database by selection MKPF as root node, i have one problem.
       my selection-screen is,
        Plant  Bseg-werks,
        G/Laccount Bseg-Hkont,
        Fin year bseg-gjahr,
        Grn Date Bkpf-Budat,
        Vendor No Bseg-lifnr,
        Po        Bseg-ebeln,
        MatNr     Bseg-matnr.
      My LDB structure is
             MKPF
    Mseg
    BKPF
    Bseg.
      My Doubt is, how can I access the glaccount details from bseg and How can i fetch the data from Mseg and Mkpf
    (Grn details) .
      If you give the Source code it is very useful to me.
      Thanks,
      Neptune.M

  • Fields comming from which data base tables

    Hi Experts,
    Every extractor should fetch data from some data base table. For generic data source and LO data source I know to see but could you please tell me, how I can find for business content (ex: 0FI_GL_4) data source which field data coming from which data base table. 
    Regards
    Lokanatha.

    Hi,
      We can get from SAP help about the tables being used in each business content extractor.
    For Eg-0fi_gl_4, data coming from BKPF,BSEG tables.
    Go thru this link which tells the table for the above extractor..
    http://help.sap.com/saphelp_nw70/helpdata/en/8b/02f93abb013b0de10000000a114084/content.htm
    Hope this helps..
    Thanks & Regards,
    Pradeep

Maybe you are looking for

  • Satellite P200-17C - Upgrade from Vista to Windows 7

    Am looking to upgrade from Vista to Windows 7, anybody done this? And was thier any problems with drivers etc? Thanks

  • OS X Web Server log

    Hello, I would like to install mod_jk (1.2.40) on OS X Server (10.10.2), Server(4.0.3) I compiled mod_jk succesfully After I add configure for mod_jk LoadModule jk_module libexec/apache2/mod_jk.so JkWorkersFile /private/etc/apache2/workers.properties

  • Can I test the control lines of a 6534 DAQ device in a C++ environment?

    The signals going into the control lines (REQ and PCLK) of my 6534 DAQ card are becoming quite distorted (longer rise time, decreased amplitude and ringing around 2.5-3 V). I have tried buffering them from my peripheral device without success. I am u

  • Uploading images with jsp-PLEASE HELP

    Hi I would like to allow users to upload images(photos) from the website im doing. i was gonna use perl which seems quite easy. Since everything else i used was jsp i thought i might try to do uploader in jsp (though its seems more difficult) id like

  • [Perl] Slic3r compilation failed (solved)

    Hi, I tried to install Slic3r from git, installing dependencies according to this : https://github.com/alexrj/Slic3r/wiki/R … -GNU-Linux But it fails, without a very explicit message. I don't understand what goes wrong... Here's the output : All prer