Reg table relation BSIK and BSAK to EKKO and EKPO tables

hi all,
can u plz let me know how to relate BSIK and BSAK with the corresponding POs??

Try this:
  SELECT belnr gjahr
    FROM ekbe
    INTO TABLE ekbe_int
    UP TO 100 ROWS
    WHERE ebeln = ebeln
    AND vgabe IN ('1', '2').                      "1 - GR, 2 - IR
  CHECK sy-subrc = 0.
  SORT ekbe_int.
  DELETE ADJACENT DUPLICATES FROM ekbe_int.
  LOOP AT ekbe_int INTO ekbe_wa.
    v_objectkey+00(10) = ekbe_wa-belnr.
    v_objectkey+10(10) = ekbe_wa-gjahr.           "BELNR+YEAR
    IF ekbe_wa-vgabe = '1'.
      v_reference = 'MKPF'.
    ELSE.
      v_reference = 'RMRP'.
    ENDIF.
* Uses index BKPF~4 (4.7)
    SELECT SINGLE bukrs belnr gjahr               "Accounting Doc Header
      FROM bkpf
      INTO doc_int
      WHERE awtyp =  v_reference
        AND awkey =  v_objectkey.
    IF sy-subrc = 0.
      APPEND doc_int.
    ENDIF.
  ENDLOOP.
This will give you the document header. You can easily get anything else you need from BSEG.
Rob

Similar Messages

  • Need to create an ABAP query on 2 tables BSIK and BSAK

    Hi,
      I need to create an ABAP query which has the fields document no, doc date, amount in doc currency and some other fields from 2 tables BSIK and BSAK. Is it possible to write a single abap query to fetch the data from both the tables.
    The selection screen fields are doc number, date and doc type.
      I need to display invoices for open items and cleared items together.
      Please let me know if this is possible.
    Thanks and Regards,
    Ajith

    See if this is anything like what you need:
    REPORT ztest MESSAGE-ID 00.
    TABLES: bkpf, bseg.
    SELECT-OPTIONS: s_bukrs FOR bkpf-bukrs,
                    s_belnr FOR bkpf-belnr,
                    s_gjahr FOR bkpf-gjahr,
                    s_blart FOR bkpf-blart,
                    s_budat FOR bkpf-budat.
    DATA: BEGIN OF bkpf_int OCCURS 0.
            INCLUDE STRUCTURE bkpf.
    DATA: END   OF bkpf_int.
    DATA: BEGIN OF bseg_int OCCURS 0.
            INCLUDE STRUCTURE bseg.
    DATA: END   OF bseg_int.
    DATA: BEGIN OF bsik_int OCCURS 0.
            INCLUDE STRUCTURE bsik.
    DATA: END   OF bsik_int.
    SELECT  *
      FROM  bkpf
      INTO  TABLE bkpf_int
      WHERE bukrs  IN s_bukrs
        AND belnr  IN s_belnr
        AND gjahr  IN s_gjahr
        AND blart  IN s_blart
        AND bldat  IN s_budat.
    SORT bkpf_int BY bukrs belnr gjahr.
    SELECT  *
      FROM  bseg
      INTO  TABLE bseg_int
      FOR ALL ENTRIES IN bkpf_int
      WHERE bukrs = bkpf_int-bukrs
        AND belnr = bkpf_int-belnr
        AND gjahr = bkpf_int-gjahr
        AND koart = 'K'.
    SORT bseg_int BY bukrs belnr gjahr buzei.
    LOOP AT bseg_int.
      MOVE-CORRESPONDING bseg_int TO bsik_int.
      READ TABLE bkpf_int WITH KEY
        bukrs = bseg_int-bukrs
        belnr = bseg_int-belnr
        gjahr = bseg_int-gjahr
        BINARY SEARCH.
      IF sy-subrc = 0.
        MOVE-CORRESPONDING bkpf_int TO bsik_int.
        APPEND bsik_int.
      ELSE.
        MESSAGE e001 WITH 'Error during read'.
      ENDIF.
    ENDLOOP.
    Rob

  • Relation  between BSIK,BSIK  and BSEG

    Hi  all ,
    1. what we mean by  the open items table (BSIK) and  item table (BSAK).
    2. What  is the realtion between BSIK,BSAK  with mm tables ..please give me the realtionship.
    3. when we post  in FB01 which are tables are updated
    4. IF BSEG is the superset of all the tables then why we need this..as we have smaller tables 
    5. what is relation ship between bSIK,BSAK and BSEG

    Hi.
    There are a series of related tables which are quite easy to understand if you look at the table name prefixes and suffixes... the BSI prefixed tables are open items and BSA are cleared items... and the suffix is like the account type field, KOART i.e. K = "Kreditor" (vendor), D - "Debtor" (customer) items, and S = GL (can't remember the German equivalent)... thus BSAD = Cleared "Debtor" (Customer) items.
    Their purpose is to act as index tables for searches - BSEG is a cluster table that cannot have indexes created directly in the database so these other tables provide access paths to the BSEG data for specific searches. They contain a blend of data from BSEG (line data) and BKPF (header data). Each pair of tables is similar to each other, and has an extensive primary key to allow access from the relevant master record i.e. you would normally only go to BSIK if you know the company & vendor number, BSAS if you have the company & GL... you would not go to BSIK if you already had the BSEG entry because the data is already available to you in BSEG (plus BKPF).
    BSIK - Contains Open line items of vendors
    BSAK - for vendor cleared item

  • Update Z field from BSIK into BSAK when closing

    Hi,
    I have created Z field in BSIK table using "Append structure" option. I also created identical field via same option in table BSAK. When I clear open item system "delete" that item in table BSIK and create identical item in table BSAK (BSIK - open items; BSAK-closed items), BSIK and BSAK have same structure because of this trensfer of open items from BSIK to BSAK during open item clearing. My problem - when open item is cleared and item is transferd from BSIK to BSAK my Z field is not updated by system. Is it possible to set this in customizing or is there another way to update this Z field in BSAK when someone clear open items - user exit, modification or ???.
    Thanks in advance.
    Sasa

    Hi Andreas,
    than you for your responce.
    I tried to find out suitable event for this in fibf but withouth success. Could you suggest event that will be suitable for this purpuse.
    One more thing - if I reverse clearing (via transaction FBRA) system will transfer closed item from BSAK to BSIK and during that process Z field will not be updated so I also need event to update this field durind reverse clearing.
    Thank you in advance.
    Kind regards,
    Sasa

  • Find out the relation from vbrk and ekpo

    hi
    i want the relation field from vbrk and ekko or ekpo apart from kunnr and lifnr.
    ple give me the field

    Check ThisLink
    Relation between the tables ekko and vbrk
    Ranga

  • Link Between KONV and EKPO/EKKO (RFQ)

    Hi Experts!
    We are developing a canvass sheet and the customer requires that the discount amount (both item and header) be displayed in the report. We know that the table for conditions is KONV. However we cannot find the link between KONV and EKPO/EKKO (RFQ). Can you help us with this.
    Will really appreciate if you can help us in this. Thanks! =)

    Hi Shakir,
    Thanks for your immediate response. We have tried looking at that field but for RFQ, the field KNUMV is blank even if a condition is maintained for the RFQ. Is there any other way to connect EKKO/EKPO and KONV? Or how do we code our program to compute for the item and header discounts in RFQ?
    Thanks in advance! =)

  • MCE3 and EKPO table

    Hi all,
    I created a query to see amount of PO's that have been created along with the value using table EKPO, EBKN and EKKO
    Fields
    EKPO-EBELP
    EKPO-EBELN
    EKPO-AEDAT
    EKPO-BRTWR
    EKPO-NETWR
    EBKN-ERNAM
    I run the query within a date range and get a result.
    I then run MCE3 with the same date range and expect to get the same results but I am getting something completely different.
    Any ideas why the two reports would be differnt?
    Thanks in advance.

    Hi Peter,
    Please try to fetch KNUMV from EKKO for the respective PO.
    Now the field KNUMV will be entered in the table KNOV.
    From KNOV table sum of KWERT will give the total net value.
    Hope that it address your concern
    Regards,
    Kannan

  • Relational schema and difference berween relational schame and data base schema ?

    Hi ,
    Am new to Database
    Can u help me to understand relational schema and data base schema ?
    thanks

    Hi Neil,
    I'm not good with the relational schema, which is being deprecated. Given your results though, you might try
    doing a count of distinct GIDs in the index table and compare it with the number of distinct geometries to make sure
    your index is complete.
    Also, if you have quadtree indexes at the same level in both Object-relational and relational then you can compare the
    number of index entries in both models.
    Hope this helps,
    Dan

  • Difference between relational integrity and data intigrity

    hi
    could anybody tell me
    what is the difference between
    relational integrity and data intigrity
    tahnx
    kals.

    hi,
    Data Integrity
    Data integrity means, in part, that you can correctly and consistently navigate and manipulate the tables in the database. There are two basic rules to ensure data integrity; entity integrity and referential integrity.
    The entity integrity rule states that the value of the primary key can never be a null value (a null value is one that has no value and is not the same as a blank). Because a primary key is used to identify a unique row in a relational table, its value must always be specified and should never be unknown. The integrity rule requires that insert, update, and delete operations maintain the uniqueness and existence of all primary keys.
    The referential integrity rule states that if a relational table has a foreign key, then every value of the foreign key must either be null or match the values in the relational table in which that foreign key is a primary key.
    What is a Relational Integrity?
    A relational database contains tables of data which are related to each other. For example, articles are related to the author who wrote them, and conversely, authors are related to the articles they wrote. (Sounds obvious, and it is.) That's the relational part.
    When we work with a relational database, we naturally expect that data in related tables stay related. For example, articles written by MartinB should always be related to MartinB and never be confused with articles written by any other author. That's the integrity part.
    Relational Integrity is also called Referential Integrity, perhaps because the mechanism for ensuring integrity is implemented by the way the tables reference each other. Both terms are okay with me. I usually just say RI anyway.
    Regards,
    Sourabh

  • What is the difference between relational database and NoSql DB

    HI,
    i never work with any nosql db. so i like to know What is the difference between relational database and NoSql DB ?
    in relational db sql server we can create relation between table by PK and FK. so is it possible in NoSql db like Mongo db ?
    sql server db use to in big data for any organization. does Mongo db like nosql db use for same purpose ?
    i like to know in what kind of situation people use Mongo db or any NoSql db. please tell me few sample scenario where people like to use Mongo db or any NoSql. thanks

    Here are some good links that describe the differences:
    http://www.mongodb.com/nosql-explained
    https://blog.udemy.com/nosql-vs-sql-2/
    http://www.thegeekstuff.com/2014/01/sql-vs-nosql-db/
    Mark as answer or vote as helpful if you find it useful | Igor

  • When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....

    When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....
    Could some one give help and let me know where I can probably find the settings option that allows me to change and switch to previous situation where it was possible to decide time to time how to proceed either opening the file or saving it ??
    Thanks in advance
    David

    What is your operating system?
    Open a PDF from where?  If online, in what browser?

  • Order-related billing and Dlv-related Billing in single Invoice

    Say in a single order or order type say OR there can be two materials with different item categories say TAN and ZTAN.
    TAN with billing relevance as A( delivery related billing) and ZTAN with billing relevance as B (order related billing )
    If that happens the billing will be split
    In VOV8 we mention for OR the order related billing as F1 and delivery related billing as F2 in the billing tab
    Now in billing TAN will pick F2 as it is delivery related billing
    and
    ZTAN will pick F1 as it is order related billing.
    Now my question:
    In VOV8, i maintained OR order type for Order-realted Billing as F2 and Delivery-related Billing as F2 as well.
    Then will there still be an billing split ?   There will be two F2 invoices TAN will pick one F2 invoice and ZTAN will pick another F2 invoice...?
    And i want to know whether this an right way of doing things??   IF not, what is the right way of doing things?
    Thank you very much.

    Hello,
    Yes that is the right way.
    You can create Single Invoice for Order Related Items & Delivery Related Items.
    E.g. You are Selling Air Conditioner & also installing the same at Customer Location. Now you will Invoice the Customer for Air Conditioner & Installation in the same Billing Correct? Now Air Conditioner is Delivery Related Billing & Installation is Order Related Billing.
    It is in such scenario Order Releted & Delivery Related Items can be Invoiced in same Billing Document.
    While create Invoice enter the Delivery Number & the Sales Order Number, select both the LIne Items & Execute... You will see the system will pick items from both Order & Delivery.
    Hope this helps,
    Thanks,
    Jignesh Mehta

  • Is it possible to have 2 mail programmes on my macbook pro? one for business related emails and one personal. I dont want all the emails in one mail programme!

    Is it possible to have 2 mail programmes on my macbook pro? one for business related emails and one personal. I dont want all the emails in one mail programme. At the moment i have 2 personal email address being sent to my mail but because of receiving huge numbers of work emails it would be good to keep them seperate, what is the best way of doing this?

    if i use the one mail programme can it separate the incoming mail from the different email accounts into 2 folders without me having to do it manually?
    Yes, you can.  Nearly all email software can do this.  It involves creating two folders and a Rule for each folder.
    Maybe call one folder Personal Mail, the other Work Mail (Apple Mail calls folders Mailboxes).  One Rule would route all mail from your personal email account into the Personal Mail folder; the other Rule would route all mail from your work email account into the Work Mail folder.  It's actually easy to do, all you have to do is click a few things and the rule is set up.  Once the Rule is written you can also apply it to existing messages already downloaded to your Mac.
    In Apple Mail, Rules are under Preferences > Rules.  Follow the prompts to create a rule like this:
    If = Any
    Account = my Personal account (select the name of your personal email account)
    Perform the following actions: Move Message to Mailbox = my Personal Mail (select the name of your Personal Mail folder (aka mailbox))
    This rule says,  "take any message that comes in from my Personal Account and move it to my Personal Mail mailbox (folder)"
    Create a similar rule for your Work email.

  • Resource related billing and periodic billing and milestone billing

    Hi friends,
        Any one having resource related billing and periodic billing and milestone billing
    documents are any config documents and any more details.
    Waiting for reply urgently,
    Regards.
    kishore

    Hi Kishore,
    Pl. check these links :
    <a href="http://help.sap.com/saphelp_47x200/helpdata/en/31/03953401024735e10000009b38f83b/frameset.htm">Periodic Billing</a>
    <a href="http://www.sap-img.com/sd006.htm">Milestone Billing</a>
    <a href="http://help.sap.com/saphelp_47x200/helpdata/en/4a/ac853478616434e10000009b38f83b/frameset.htm">Resource related billing</a>
    Reward if useful.
    Thanks & Regards
    Sadhu Kishore

  • SAP HR related IDOC and BAPI with description

    Hi,
    This is regarding SAP HR. Here I need some help from you guys.
    It would be great if you could provide list of SAP HR related IDOC and BAPI with description.
    If you have any document then please forward same to [email protected]
    Thanks,
    Sunil Bhavsar

    hello Sunil ,
    to find BAPIs realted to HR,use transaction BAPI and there u have to look for personnel management,time etc ,these all are HR related.
    HR related Idocs shud be having Message type like HR*.
    hope thts wht u needed.
    amit

Maybe you are looking for

  • Item Category Issue

    Dear Experts, While i create packaging in Handling unit ther is a tab  of Additional Data in Sales and distribution.In that we have Item Category - Issue is i am inputing manual item category TAN but i want to pick automatically. I am unable to find

  • PDF File Management

    At work we were recently told we had to submit all our documents to another department in PDF format. We have Acrobat Pro 8 to create and combine the PDF documents as needed. However, we manage about 20,000 case files per year, and several different

  • Require fallowing files due to corrupt download

    My download got corrupt because of some network issues/power failure, so require below files. windows_ia32_jrockit_160_05_R27.6.2-20_jrockit.zip ( from Oracle WebLogic Server 11gR1 (10.3.1) + OEPE - Package Installer link http://download.oracle.com/o

  • Create slide show - help needed to transfer from iPhoto

    I am an editing novice but a skilled Mac user with a programing background. I am trying to create a 20-30 minute slide show of approximately 250 photos to run in the background at my son's bar mitzvah on 61 inch plasmas. I have selected the photos an

  • IChat Signs off of AIM all the time.

    I am constantly getting kicked off of AIM through iChat. I have tried downloading AIM for mac through their site and with there software I still get kicked off constantly. My roommate has the same MacBook as I do and he never gets kicked off AIM thro