Logic  req. using innerjoin for vendor

plz help  me,
tell me req . select statements useing innorjoins.give me logic.
tables:
MARA, MARC, MARD, MAKT, MAPF, MSEG, LFA1
input fields:
The end user will select a list of materials and vendors within a date range.
output fields:
The report should display   vendor name,
                                       actual Creation Date,
                                       payment terms
                                       prices,
                                       Material Number,
                                      Storage Location,
                                      Unit of Measure,
                                      description ,
                                      group totals.
thank you,
venki

hi ,
here is a simple inner join see this ..but inner jions is not good at performance..
report test .
tables: pa0002,pa0008,pa0021.
data: begin of it_pa0002 occurs 0,
      pernr like pa0002-pernr,
      begda like pa0002-begda,
      endda like pa0002-endda,
      vorna like pa0002-vorna,
      nachn like pa0002-nachn,
      end of it_pa0002.
data: begin of it_pa0008 occurs 0,
      pernr like pa0008-pernr,
      ansal like pa0008-ansal,
      lga01 like pa0008-lga01,
      bet01 like pa0008-bet01,
      end of it_pa0008.
data: begin of it_pa0021 occurs 0,
      pernr like pa0021-pernr,
      famsa like pa0021-famsa,
      fanam like pa0021-fanam,
      favor like pa0021-favor,
      end of it_pa0021.
data: begin of it_final occurs 0,
      pernr like pa0002-pernr,
      begda like pa0002-begda,
      endda like pa0002-endda,
      vorna like pa0002-vorna,
      nachn like pa0002-nachn,
      ansal like pa0008-ansal,
      lga01 like pa0008-lga01,
      bet01 like pa0008-bet01,
      famsa like pa0021-famsa,
      fanam like pa0021-fanam,
      favor like pa0021-favor,
      end of it_final .
select-options:s_pernr for pa0002-pernr.
select a~pernr
       a~begda
       a~endda
       a~vorna
       a~nachn
       b~ansal
       b~lga01
       b~bet01
       c~famsa
       c~fanam
       c~favor
       from  ( ( pa0002 as a inner join pa0008 as b  on apernr = bpernr )
       inner join pa0021 as c  on apernr = cpernr and bpernr = cpernr )
       into table it_final
       where a~pernr in s_pernr.
sort it_final by pernr begda descending.
loop at it_final.
write:/ it_final-pernr,
it_final-begda,
it_final-endda,
it_final-vorna,
it_final-nachn,
it_final-ansal,
it_final-lga01,
it_final-bet01,
it_final-famsa,
it_final-fanam,
it_final-favor.
endloop.
regards.
venkat.

Similar Messages

  • Why do we use dunning for vendors

    Hi All...
    We create dunning for customer to send them reminders for payment....But why do we use dunning for vendors (in Vendor Master Data)??
    Txk,
    Umesh

    Hi,
    If you dun customers who are also vendors and want to clear the items, the dunning program lists both the overdue customer items and the overdue vendor items in the dunning proposal, and determines a joint balance.When you dun a customer who is also a vendor, only the master record information of the customer is relevant.The items can only be cleared if the same dunning procedure has been defined in the standard dunning area for both customer and vendor.
    Hope this helps you. let me know if you need anyother information.
    Rgds
    Manish
    ===========================================================================

  • In what case, we need to use PI for vendor replication in MM-SUS?

    Dear Experts,
    In what scenarios, we need to use or configure the PI settings for vendor replication between MM and SUS? The SAP configuration guide for SRM 7.01 mentions about the PI settings for vendor replication from ECC to SUS.
    However, we are able to replicate the vendor from ECC to SUS using the program BBPGETVD in SUS client?
    In what circumstances, we need to configure the PI settings for vendor replication when we are able to do so in a much simpler way?
    Thanks in advance,
    Ranjan
    Ranjan Sutradhar

    Hi Ranjan,
    In all circumstances you need to replicate vendors from MM to SUS via PI. BBPGETVD is not the right way to replicate vendors to SUS because the information like vendor class, assignment of this vendor class to an object and the vendor classification cannot be transferred via BBPGETVD.
    Hence you will have to use PI. You can try sending a PO from MM to SUS and the PO will fail in SUS with a message like 'Vendor not present in SUS' if you use BBPGETVD.
    Regards,
    Nikhil

  • Using Trex for Vendor Search in SRM

    Experts,
       Please let me know if you used TREX to optimize the vendor search in SRM 7.0, ECC 6.0 EP4.
       Please let me know any tips or suggestions regarding the implementation.
    Thanks in advance
    Regards,
    Scott

    Hi Scot
    the below is for goa . try for BP too.. Why you require TREX search . std search dont enough. since
    TREX helps only if you want to enable  full text search for long texts and attachments in contracts.You need to instal  the trex server and configure the settings:-
    1.create RFC destination of type TCP/IP server using TCODE SM59
    2.MAINTAIN ENTRY IN back end systems settings
    3. Activate full text search y executing the program BBP_TREX_INDEX_ADMIN .
    bUSINESS oBJECT : - bus2000113
    subtype usiness object :- cc for GOA or blank for operational contracts
    Action for SRM TREX index :- select the appropriate value from search help . for example , you would specify A for the initial index generation.
    bundle size for indexing : enter "10." bundle size affects performance. The size indicates the number of docuemnts that will be updated in one pass.if there are a large number of documents, then the size may be reduced to improve performance

  • Wht r the standard tables for vendor customer and sales order report/

    Hi wht r the standard tables for vendor and customer reports and is how in normal we cannot use them for vendor reporting and etc ?

    Hi
    Customer is related to Sales Module
    So for a customer we fetch the reports of Sales orders , Deliveries and Billing doc's
    CUstomer and Vendor related tables with important fields:
    KNA1: Customer Master-General(KUNNR,NAME1,LAND1)
    KNB1: Customer Master(Company Code)(KUNNR,BUKRS,PERNR)
    KNC1: Customer Master Data (Transaction Figures)(KUNNR,BUKRS,GJAHR)
    KNVK: Customer Master Contact Partner(PARNR,KUNNR,NAME1)
    KNVV: Customer Master sales data(KUNNR,VKORG,VTWEG,KDGRP)
    KNBK: Customer Bank Details(KUNNR,BANKS,BANKL,BANKN)
    KNVH: Customer Hierarchy (HITYP,KUNNR,VKORG,VTWEG,SPART)
    KNVP: Customer Master Partner Functions(KUNNR,PARVW,KUNN2)
    KNVS: Customer Shipment data(KUNNR,VSTEL,TRANS)
    KNVI: Customer Tax data(KUNNR,ALAND,TATYP)
    LFA1: Vendor Master-General (LIFNR,NAME1,ORT01)
    LFB1: Vendor Master(Company Code)(LIFNR,BUKRS,PERNR)
    LFC1: Vendor Master (Transaction Figures)(LIFNR,BUKRS,GJAHR)
    Sales related Tables for a customer
    VBAK: Sales Document(Header Data) (VBELN, KUNNR)
    VBAP: Sales Document(Item Data) (VBELN,POSNR,MATNR,ARKTX,CHARG)
          Enquiry, Quotation, Sales Order are differentiated based on Doc.
          Type(VBTYP field) in VBAK,VBAP Tables( for Enquiry VBTYP = A,
          for Quotation 'B' & for Order it is 'C'.)
    LIKP: Delivery Table (Header Data)(VBELN,LFART,KUNNR,WADAT,INCO1)
    LIPS: Delivery Table (Item Data)(VBELN,POSNR,WERKS,LGORT,MATNR,VGBEL)
          (LIPS-VGBEL = VBAK-VBELN, LIPS-VGPOS = VBAP-POSNR)
    VTTK: Shipment Table (Header Data)(TKNUM)
    VTTP: Shipment Table (Item Data)( TKNUM,TPNUM,VBELN)
          (VTTP-VBELN = LIKP-VBELN)
    VTFA: Shipping Document Flow(TKNUM,VBELV,VBELN)
    VTPA: Shipping Partners data(VBELN,PARVW,KUNNR,PERNR)
    VTTS: Stages in Shipment(TKNUM,TSNUM,TSTYP)
    VTSP: Transport Stage/Shipment Item Allocation(TKNUM,TSNUM,TPNUM)
    VEKP: Handling Unit: Header(Packing)(VENUM,VSTEL)
    VEPO: Handling Unit: Item (Packing)(VENUM,VEPOS,VBELN)
    VBRK: Billing Table(Header Data)(VBELN,FKART,BELNR)
    VBRP: Billing Table(Item Data)(VBELN,POSNR,FKIMG,NETWR,VGBEL,VGPOS)
          (VBRP-AUBEL = VBAK-VBELN, VBRP-VGBEL = LIKP-VBELN)
          Apart from these tables there are lot of other tables which starts with
          ‘V’, but we use the following tables frequently.
    VBUK: All Sales Documents status & Admn. Data(Header)(VBELN,VBTYP)
          VBTYP= ‘C’(Sales Order) VBTYP=’J’(Delivery) VBTYP=’M’(Invoice) 
    VBUP: Sales Documents status & Admn. Data(Item)(VBELN,POSNR)
    VBEP: Sales Doc. Schedule Lines Data(VBELN,POSNR,EDATU,WMENG)
    VBKD: To get sales related Business data like Payment terms etc.(VBELN,ZTERM)
    VBFA: sales document flow data(VBELV,VBELN,POSNV,VBTYP)
    VBPA: Partner functions Data(VBELN,PARVW,KUNNR,LIFNR)
    VEDA: Contract Data(VBELN,VPOSN)
    VEDAPO: Contract Data(VBELN,VPOSN)
    Vendor related MM tables
    EBAN-- Pur.Reqn. Data (BANFN,BNFPO,BADAT,MATNR)
    EBKN-- Purchase Requisition Account Assignment(BANFN,BNFPO,VBELN)
    EINA—- Purchase Info.Record (General Data)(INFNR,MATNR,LIFNR)
    EINE-- Purchase Info.Record (Pur.Orgn Data )(INFNR,EKORG)
    ELBK-- Vendor Evaluation Header Data(LIFNR,EKORG,KLASS)
    EKKO-- Purchase Order Data (Header)(EBELN,BSTYP,BSART)
    EKPO-- Purchase Order Data (Item)(EBELN,EBELP,MATNR)
           RFQ and PO are differentiated by Doc Type(BSTYP)in EKKO table.
           For RFQ it is ‘A’ and for PO it is ‘F’.
    MKPF-- GRN Data (Header) (EBELN,BLDAT,BUDAT,XBLNR,BKTXT)
    MSEG-- GRN Data (Item)(MBLNR,BWART,LIFNR,MATNR,EBELN)
           Apart from this there are lot of tables which begin with 'M'& 'E', but we
           use the following very often.
    EKBE--PO History Data (EBELN,EBELP,BELNR,BLDAT,MATNR,VGABE)
    EKBZ--PO History with delivery Costs(EBELN,BELNR,LIFNR,XBLNR)
    EKET--Schedule lines data of a PO (EBELN,EINDT,SLFDT)
    EKES--Vendor Confirmations Data(EBELN,EBTYP,EINDT,XBLNR)
    Reward points if useful
    Regards
    Anji

  • Payment block rerlease for vendor/customers

    Hi Gurus
    which t-code we used for  payment block rerlease for vendor/customers
    regards
    Mallikarjuna

    Hi,
    For more clear Use FK05 for vendors
    Give company code and Vendor account no
    enter
    You get screen where you should deselct payment block either code / all company codes
    For customers FD05
    Same procedure
    If it is useful please assing points
    Thanks
      RAM

  • BAPI_ACC_INVOICE_RECEIPT_POST for vendor invoice posting

    Hi ,
    I am using  BAPI_ACC_INVOICE_RECEIPT_POST for vendor invoice posting, I have made the header , and account paybale table
    , can any body give link for the sample code or give me sample code.

    continue....
    FORM build_bapi_parameters2.
    *Build account GL data for BAPI
      wa_accountgl-itemno_acc   = 2.             " Line Item Number
      wa_accountgl-gl_account   = '0000720300'.  " GL Account Number
      wa_accountgl-comp_code    = '0050'.        " Company Code
      wa_accountgl-pstng_date   = '12012006'.    " Posting Date
      wa_accountgl-doc_type     = 'KQ'.          " Document Type
      wa_accountgl-fisc_year    = '2006'.        " Fiscal Year
      wa_accountgl-fis_period   = '12'.          " Fiscal Period
      wa_accountgl-item_text    = ''.            " Item Text
      APPEND wa_accountgl TO accountgl.
      CLEAR wa_accountgl.
    *Build currency data for BAPI
      wa_curramount-itemno_acc   = 2.             " Line Item Number
      wa_curramount-curr_type    = '00'.          " Currency Type
      wa_curramount-currency     = 'USD'.          " Currency Key
      wa_curramount-currency_iso = 'USD'.         " ISO Code
      wa_curramount-amt_doccur   = '5000.00'.     " Amount
      wa_curramount-amt_base     = ''.            " Base Amount
      APPEND wa_curramount TO curramount.
      CLEAR wa_curramount.
    ENDFORM.                    " build_bapi_parameters
    FORM build_bapi_parameters3.
    *Build account GL data for BAPI
      wa_accountgl-itemno_acc   = 3.             " Line Item Number
      wa_accountgl-gl_account   = '0000256166'.  " GL Account Number
      wa_accountgl-comp_code    = '0050'.        " Company Code
      wa_accountgl-pstng_date   = '12012006'.    " Posting Date
      wa_accountgl-doc_type     = 'KQ'.          " Document Type
      wa_accountgl-fisc_year    = '2006'.        " Fiscal Year
      wa_accountgl-fis_period   = '12'.          " Fiscal Period
      wa_accountgl-item_text    = ''.            " Item Text
      APPEND wa_accountgl TO accountgl.
      CLEAR wa_accountgl.
    *Build currency data for BAPI
      wa_curramount-itemno_acc   = 3.             " Line Item Number
      wa_curramount-curr_type    = '00'.          " Currency Type
      wa_curramount-currency     = 'USD'.          " Currency Key
      wa_curramount-currency_iso = 'USD'.         " ISO Code
      wa_curramount-amt_doccur   = '-1000.00'.     " Amount
      wa_curramount-amt_base     = ''.            " Base Amount
      APPEND wa_curramount TO curramount.
      CLEAR wa_curramount.
    ENDFORM.               " build_bapi_parameters
    Edited by: krupa jani on Aug 12, 2009 1:45 PM

  • LSMW for Vendor master

    Hi All,
    I am trying to use LSMW for Vendor Master upload.
    I have gone through all the steps and it is showing correct data in "Display Read Data".
    Also the data in "Display Converted Data" is correct.
    However when i am running step "Create Batch Input Session" , it is giving following errors:
    (1) Transaction XK01 is not supported
    (2) editing ws terminated.
    Wt could be possible reason for this,I am using standard Batch method for object 0040 and program name RFBIKR00.
    ("Maintain Object Attributes" details).

    hello,
    in the field mapping step, check whether tcode field has been assigned as XK01 properly.
    Reward Points if it is Useful.
    Thanks,
    Manjunath MS

  • The standard SAP data transfer program for vendors

    Hi Experts,
    Could u please tell me that wt is the program which is  <b>"the standard SAP data transfer program for vendors"</b>?
    could you plz tell me what exactly is it?
    and itz tcode..
    is it the "XK01" only or anything other?
    thnx
    Message was edited by: sey ni

    Hi,
    Pl use RFBIKR00 for Vendor Matser upload. Th eProgram documentation is very useful too.
    Regards,
    Suresh Datti

  • Can v run dunning for vendors

    Hi ,
    where can v link dunning area and dunning procedure
    and how can v use dunning for vendors
    Points wil b assigned
    Umesh

    Hi Mahesh,
    Yes we can dunn the vendor also. Vendors with debit balances are subject to dunning. Debit balances are the result of credit memos posted to the vendor account due to circumstances such as returned goods.Once vendor credit memos exceed vendor invoices, the payment due will be shifted back to the vendor. Therefore, dunning will be run to check for delinquent balances.
    Menu Path
    From the SAP R/3 screen, select the path:
    Accounting >> Financial accounting >> Accounts payable >>
    (new menu) Periodic processing >> Dunning
    Fast Path
    At the Command Line, enter: /NF150.
    Regards,
    shashikanth.
    Assign points if usefull.

  • Classification set up for Vendor Master

    I plan on using Classifications for Vendors to assign a status.  I need to define the Class and assign to Class type as well as define the Characteristics and assign the values.  Can anyone tell me where this is done?
    Any help is appreciated.
    Thanks
    DZ

    Looks like CL02 will create the class and CT04 will create the characteristics and values.

  • Calculate Withholding taxes for VEndor Invoices using ABAP program.

    Hi All,
    I have to upload Vendor Invoices using FB60/Fb01 tcodes. I am able to post the Invoices using FB01/Fb60
    but I have to calculate extended withholding taxes also using this program for the Invoices.
    Is it possible to upload vendor Invoices and calculate withholding taxes using Program?
    If yes,
    Does anyone has any idea how do you calculate extended withholding taxes using any BAPI's?
    I have used these two BAPI's
    BAPI_ACC_DOCUMENT_POST
    BAPI_acc_invoice_receipt_post
    they are working fine but without withholding tax.
    This is a requirement for country India.
    Regards,
    Sushil

    Hi,
    Imho, you need to get (meaning, extract into separate fields) the different supplier types from Table1 first. Your key for Table1 is the vendor no, which is also the key in Table2 (or the key for Table2 is Vendor no & Type).
    For better performance, better select multiple/all required entries from Table1 instead of doing a select endselect.
    Depending on the format of the vendortypes in Table1, put them in a new itab (for our purpose named Table1New where vendor no & type are the only 2 fields. For example, if the type length is fixed to 2 chars, or divided by space,... use your coding accordingly.
    Next step is to select all vendor no's in Table2 which you have selected in Table1. If in Table2, the vendor no is the only key (and the all vendor types are filled in a single record), then loop check the vendor types from Table1New against the types in Table2.
    If the key of Table2 is vendor no & vendor type, then do a read table for the key.
    The logic in pseudo-code:
    Select from Table1 into table. If you'd like to limit the selection size, add package size statement.
         extract the vendor types in to itab Table1New.
         Select the vendor & types from Table2 by using the for all entries option (better performance).
         loop at Table1New
              check in Table2:
                   if the unique key is vendor no: check all fields for the vendor type from Table1New
                   if the unique key combo is vendor no & type: check by using a read table.
              If not found => add entry to Table2
         endloop.
    endselect Table1 (when using package size)
    I guess the most difficult step is to extract the types from Table1 into separate fields, all the rest seems straight forward. Please keep in mind the itab type definitions for a better performance.
    Good luck!
    Best regards,
    Zhou

  • Logical database for vendor cleared items

    Hi,
    What is the logical database for vendor cleared items.  KDF is giving me only open items. 
    Actually I am preparing a report which uses vendor cleared items and trying to get the list from BSAK table.  Which would be the better way (faster process for better performance)
    a) directly fetching data from database table like BSAK or
    b) by using logical database
    any ideas please.
    regards,
    mallik

    If  just display of all cleared items in a report,  then i would suggest you to go for Query development instead of a z report and use BSAK. Being Index table and query, we can reduce several errors in logic/easy to develop/less time.
    If you need Z report only, then also, you can go for BSAK. Where as BASK is secondary index table which helps to fetch data fast.
    In one way, BSEG - BSIK = BSAK for your case!
    Regards
    Sridevi

  • F110 for vendor invoices which are debits and for credits BVTYP are used

    Dear all,
    I have the following situation:
    - 1 vendor with many documents to pay
    - some documents have 1 line item that is a debit (positive value in FBL1N)
    - this vendor has 2 bank accounts in master data and I would like to pay the second one, so the Partner Bank Type (BVTYP) field is filled with number 1 and 2
    - before payment at FBL1N, I execute the mass modification of all documents putting the number 2 at the BVTYP field
    - but when I execute the proposal at F110, only the documents with debit have error: No pymt possible because items with a debit bal, but the total is credit for vendor
    I have seen that when I do not fill the BVTYP field in the documents, the F110 is executed normally, I mean, it considers debits and credits (we have previously created a new payment form for this kind of vendors, one that could consider debits and credits).
    PS: at FBL1N, when I open the document with the debit item, it doesn't show the field BVTYP.
    Is there any kind of configuration that I have to make to F110 start considering the filled BVTYP field?
    Thanks in advance.
    Kathia Tsuboi

    Hi Abhi,
    I have created some queries for the same. COuld you help me if I am going in the rite direction.
    I have created a query to find the suppliers which are not being used in the POs for the past one year by using the below query: But for invoices and payments to be included, I am finding it a bit difficult....need help..............
    --FINAL QUERY                                  
    SELECT vendor_id, vendor_name, creation_date, last_update_date
    FROM po_vendors v
    WHERE v.end_date_active IS NULL
    AND v.enabled_flag = 'Y'
    AND NOT EXISTS (
    SELECT 1
    FROM po_headers_all h
    WHERE h.vendor_id = v.vendor_id
    AND h.creation_date(+) BETWEEN (SYSDATE - 365) AND (SYSDATE))
    ORDER BY vendor_id DESC
    Is it possible to send me the program so that it would be helpful for me to use it.
    email: [email protected]
    Help Greatly appreciated.
    Thanks
    Aman

  • Data upload for vendor balances using BDC

    hi abap experts,
    I have a requirement on data uploading using BDC.
    For the vendor balances ie. for transaction FBL1N  ( I was given a template for vendor balance upload and need to write a BDC program for that ) I need upload the exsisting transaction data to the system. is recording necessary for this?
    can u pls help me with step by step process for vendor balance uploading.
    Thanks,
    Hema.

    Hi
    Please follow the following Steps:
    Steps for recording:
    Step1: Goto TCODE SHDB
    Step2: Click on New Recording
    Step3: Give the necessary Details such as TOCDE, Desc, ...
    Step4: Do the screen by screen recording.(Please avoid extra screen to appear)
    Step5: Save the recording.
    Step6. Select the recording and click on Program button on toolbar.
    Step7: Give the Program name and click on radio button Transfer from recording.
    Step 8: It will open a new session with SE38 and a program with the recoding.
    Step 9: then just add the basic code for BDC.
    Regards,
    Lokesh

Maybe you are looking for