Total POs and total line items

Hi experts,
Iam trying to extract total number of POs and total number of line items for particular PO for a vendor.
Do i need to make join for EKKO & EKPO?
I want to get some thing like this
Vendor   Total POs      Total line items
1001       20                 50
1002       30                 45
Can any one give me the suggestion....
Reward guaranteed,
Thanks
kaki

Hi,
  I changed the code a little bit and modified my reply...Check the code..I tested it..it is working fine..
  Re-copy the code and check the results..
TABLES: EKKO.
SELECT-OPTIONS S_LIFNR FOR EKKO-LIFNR.
DATA: BEGIN OF T_EKKO OCCURS 0,
LIFNR TYPE LIFNR,
EBELN TYPE EBELN,
EBELP TYPE EBELP,
END OF T_EKKO.
DATA: BEGIN OF T_TOTAL OCCURS 0,
LIFNR TYPE LIFNR,
TOT_PO TYPE INT4,
TOT_LIN TYPE INT4,
END OF T_TOTAL.
SELECT ALIFNR AEBELN B~EBELP
FROM EKKO AS A INNER JOIN EKPO AS B
ON AEBELN = BEBELN
INTO TABLE T_EKKO
WHERE A~LIFNR IN S_LIFNR.
SORT T_EKKO BY LIFNR EBELN EBELP.
DATA: S_EKKO LIKE T_EKKO,
V_EBELN TYPE EBELN,
V_PO TYPE INT4,
V_LIN TYPE INT4.
LOOP AT T_EKKO.
S_EKKO = T_EKKO.
IF V_EBELN <> T_EKKO-EBELN.
V_PO = V_PO + 1.
ENDIF.
V_LIN = V_LIN + 1.
AT END OF LIFNR.
T_TOTAL-LIFNR = S_EKKO-LIFNR.
T_TOTAL-TOT_PO = V_PO.
T_TOTAL-TOT_LIN = V_LIN.
APPEND T_TOTAL.
CLEAR: V_PO, V_LIN.
ENDAT.
V_EBELN = S_EKKO-EBELN.
ENDLOOP.
LOOP AT T_TOTAL.
WRITE: / T_TOTAL-LIFNR,
T_TOTAL-TOT_PO,
T_TOTAL-TOT_LIN.
ENDLOOP.
Thanks,
naren

Similar Messages

  • BAPI to update PO's and Corresponding line items numbers **URGENT**

    Hi All,
    I have a requirement to create a program which will take list of POs and corresponding line item number and update Final invoice indicator for the same. This should be updated in SRM as well as R/3.
    I think, it can be done by a BAPI. Do anyone have idea, which BAPI will be applicable for the same?? You can also share yours views on this.
    Regards,
    Parvez.

    Hi
    We have done this.. This is easily possible using BAPIs.
    Try using SRM BAPIs
    META_PO_GETLIST
    META_PO_GETDETAIL
    <u>Note - SRM system calls BAPI in R/3 backend using RFC Call</u>
    In R/3 backend
    BAPI_PO_CREATE1
    BAPI_PO_CREATE
    BAPI_PO_CHANGE
    Hope this will definitely help.
    Regards
    - Atul

  • Derivation of Profit Centers in case of bank and Cash line items

    We are in the process of configuring the Profit Center Accounting functionality. We are in ECC 6.0 but have not migrated to New G/L.
    We understand that Profit center needs to be derived for each of the items for which it does not flow online in realtime. As regards Bank and Cash Line Items, we are not able to understand how Profit Center Derivation will happen.
    We have posted an FI payment document using Tcode F110 and further to which we executed F.5D and 1KEK. Further to this, we have checked the Profit Center Total records report (2KEE). It updates the vendor line items. But it does not reflect the Bank line item. Unless this happens, we understand that our Profit Center wise Trial Balance will not tally.
    Kindly let us know how bank and Cash line items will update in PCA. In our view, it should derive the Profit center from the offsetting entry in the vendor invoice. Pl. correct me if I am wrong.
    Pl. help.
    Venkat Iyer

    Hi Venkat,
    You may define a derivation rule in 3KEH
    Regarda
    Sachin

  • How to get total numbers and total price in query reports

    Hi,
    how to get total numbers and total price in query reports.for example:
    particular item is issued 3 times a week...I need total quantity of item issued
    my query...
    SELECT T0.[DocNum], T1.[ItemCode], T1.[Quantity], T1.[Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'

    Hi,
    Try this:
    SELECT T1.[ItemCode], SUM (T1.[Quantity]) as [Total Quantity], SUM (T1.[Quantity] * T1.[Price]) as [Total Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'
    Group By T1.[ItemCode]
    Beni.

  • Profit Center population in the Vendor and Customer Line items

    hello
    our client is asking for  getting profit center in the vendor and customer line items  where in the view FBL5n and fbl1n we are not getting the profit center populated - in the new gl i understand that there is a standard report based on the gl account.
    but our business is not satisfied with the report and expecting report at profit center level.
    Can any one suggest any way of doing this.
    regards,
    Vijay

    Dear Vijay,
    Let me provide you my view of solutioning for this. This is an enahcement that needs to be done
    1. You can get the profit center from the given vendor and customer line item at the time of posting, using an enahcement you will be able to capture it.
    2. Existing the profit center field is not populated in the BSIK,BSAK,BSID and BSAD tables
    3. Hence, in the same enhancement once you capture the profit center , you can write the code that profit center is updated in these tables also.
    4. This will help you to do the vendor line item wise selection in the FBL1N,  FBL5N profit center wise.
    Constraints of this solution:
    The only constraint remains where in the for a given document if there are multiple profit center, then the system will do the splitting profit center wise for a vendor line item, which will not populate the profit center in those tables as there is only one field available in the bsid etc.. tables.
    This basically would be the one the soltuion where in as seeen from the end user ther eis no change in the front end interface , the way they are doing always they can do.
    You need to also take care the % of document splitting means cross profit center postings /cross document splitting charactericstics postings and the volume involved in this. so that you can suggest this to your client.
    Regards,
    Bharathi.

  • FBCJ LINE ITEM AND FI LINE ITEMS ARE DIFFERENT

    Dear Expert
    FBCJ LINE ITEM AND FI LINE ITEMS ARE DIFFERENT

    Hi,
    It seems from the screen shot you are seeing different documents as in the first screen shot it clearly shows you have booked the multiple expenses under one see the below screen shot we have circled it
    whereas FB03 screen shows different.
    You can do one thing click on circle item and check the expenses involved in it and accordingly go to FBL3N and display documents for that G/L for the date 05.04.2014.
    Hope your issue has been resolved else revert.
    Regards,
    Tejas.

  • Profit centerwise Vendor and Customer line items view

    Deal ALL,
    We have not activated Business Area.
    We have 10 plant under one company code. Client is booking the vendor and customer invoice as per the cost center and profit center of the plant. Payment and Receipt is also made according the bank maintain for each plant. As one customer or vendor is dealing with all the plants.
    Can any body can help me out how to get the vendor and customer line item display according plant or cost or profit center wise, so we can make or receive payment accordingly.
    Request you all to reply.
    Thanks & Regards,
    Bhadresh

    Hi
    Try the transaction codes for Profit Display by suitable config in TCode O7F1, O7F2, O7F3
    Assign Points if useful
    Regards
    Sanil

  • B2CBasket- Sales Order  How to add Vendor partner and new line item of SO

    Hi,
    I want to add the following BEFORE the sales order creation process starts:
    Add a VENDOR partner
    Add a new line item to ORDERADM_I
    I suspect in BADI CRM_ISA_BASKET_ITEMS and CRM_ISA_BASKET_HEAD. I have user 'HEAD' to add extension fields but cant figure the creation of NEW partners and NEW line item.
    regards,
    Dave

    Thank you for feedback Shantoor,
    The CRM_ORDER_MAINTAIN need not be called as this FM is called immediately following almost all of the CRM_ISA_* BADI's.
    For clarification I just want to expand on the solution..
    In all of these BADI's SAP uses the CT_INPUT_FIELDS parameter. This is where you should enter WHICH fields you have made changes to in the exit. CRM_ORDER_MAINTAIN uses the same parameter.
    However the challenge is .. WHAT do you enter in the CT_INPUT_FIELDS. This is where you have to follow a strategy. I yused the following:
    1. Looked where the structure was used in programs/class to see how SAP used it
    2. Set breakpoints at the call of the BADI. Check what CT_INPUT_FIELDS content is (SAP uses same technique)and try and replicate for your new entries.
    I hope this helps those that, like me, battled a bit with the use of these BADI's.

  • Offsetting account in Vendor, Customer and GL line item report

    Hi All,
    There is one requirement from our client. They want offsetting account in Vendor, Customer and GL line item report.(FBL1n, FBL3n and FBL5n).
    As this field is there in selection screen in lay out setting but field coming as blank no off setting account is coming. It was coming in old SAP 4.7 system but same is not coming in ECC6.0.
    Kindly let me know if any development is requirement, if yes than which tables we have refer for the same.
    Thanks and Regards,
    Abhinav Sharma

    Hi Abhinav,
    There is a SAP not and you can refer to that - SAP OSS note 112312
    T.Code: FIBF
    After entering in above T.code
    Follow Path
    Settings  Products of a customer
    Product   : XXXX
    Text        :  XXXX
    Active     :  Tick it
    Click on Back i.e. F3
    Follow Path
    Settings >P/S Function Modules > of a customer
    Event: 00001650
    Product: XXXX
    Function Module: LINE_ITEMS_GET_GKONT
    Now Go to FBL3N display of any account
    After opening the account display click on Change Layout i.e. CTRL+ F8
    And Select
    Offsetting A/C Type & Offsetting A/C no.
    Regards,
    SAPFICO
    Edited by: SAPFICO on Dec 1, 2010 8:26 AM

  • Customer and vendor line item report FBL5N/FBL1N

    Dear all,
    Could you please let me know, whether there is any way that we can get cost center ans wbs element in customer and vendor line item report FBL1N/FBL5N.
    REgards,
    Suresh Patipati.

    Hi Suresh
    Through BTE1650 you can fetch it . for this you have to  do some development.
    You can add additonal field to FBL*N reports with using BTE exit.
    Regards
    SAP student

  • Profit Center in Customer and Vendor Line item

    Hello Guru
    i have one doubt we have activated the new GL in one of client for profit center level. while posting through any of financial transaction particularly customer and vendor there is no filed for input parameters for profit center. while booking these kind of transaction system pick up the dummy profit center. even our field status group for  gl master data and posting key made as optional PCA filed not displaying.    client want it should be pick up  automatically from line item and should be input parameters.
    how to resolve this issue please let me know.
    waiting for your reply
    Thanks & Regards
    Laxmi narayan

    Hi,
    You are saying that u have activated New G/L, but are u gone for document spliting also or not? if you have activated document spliting customer and vendor line items not at all required any profit center because it will petch the profit center from oppsite line item automatically for giving tallyed balance sheet at profit center leavel, so no question profit center required or going to dummy profit center because dummy profit center will be locked automatcially once u activate document spliting.
    if you have not activated document spliting then customer and vendor line items may require profit center its depends on your field status settings, if you feel that it should not go to dummy profit center then maintain some profit center in 3keh & 3kei settings for customer and vendor reconcliation accounts, so that it will post to that profit center.
    Thanks & Regards
    T N R

  • Profit centre needs to be updated in Vendor and Customer line item reports

    We are using ECC 6. 
    Profit centre is updating for vendor and customer line items in document level.  But the same is to be reflected/updated in profit centre field in FBL1N and Reports.

    hi
    Use this T codes you will get Profit center wise  S_AC0_52000888 Paybles (vendor balances )
    Tcode for Profit center wise receviables S_AC0_52000887  (customer balances )
    Regards
    Babu.k

  • Difference in GL Balance display and GL line item display

    Dear All,
    Can any one help me why the difference between GL display and GL line items display?
    Thanks in advance
    regards
    Elan

    Hi,
    You can do the following:
    1. carryout gl balance carryforward from previous to current year : Use t.code:F.16
             You can cross check the fs10n balance with FBL3N balance from previous years.  Assume these balance are matching for previous year 2007 and 2008, you have this problem only in 2009, then you can carryforward this balance from 2008 to 2009 once again. Some times users may post some adjustment entries as per the auditors recommendations. If this balance is not matching from 2007 itself, then first carryforward the balances to 2008 then 2009.  You can run this transaction no of times.
    2. check the master data of gl account through t.code:FS04, whether any changes has been done to line item display field?
               If you find any changes to line item display field then run the program "RFSEPA01" to get all the line items.
    3.If your issue was not resolved even after the above two activities, then let me know the  sap version you r working.
    all the best
    Prasad

  • FI Open Vendor and Customer Line item

    Dear Experts,
    Do we have to migrate the Tax code in the Vendor and Customer Line Items during data migration?
    I read somewhere that is it not necessary to do so.
    Please advise.
    Thank you.

    Hi ,
         It depends on the legal enviroment and sometimes on the settings used in your system. It is a matter of whether the Tax code information is needed in any circumstance that could arise subsequent to migration.
    Examples where you must migrate the tax codes:-
         i) Deferred VAT is used.
         ii) Prepayments with Gross Display.
        iii) Prompt payment discounts are VAT relevant.
    Kind regards

  • How to read Images associate with Purchase Requisitions and its Line Items

    Hello,
    My scenario: i need to read the Images associated with PR and its line items and pass them as Idoc FM.
    Any idea where are these images stored in the SAP table or they just available till runtime
    Regards,
    Abhishek

    You can have a look at the link here [GOS Contents|http://help-abap.zevolving.com/2009/02/generic-object-services-gos-toolbar-part-5-get-note-attachment-contents/]
    Please note that in your case if its attachments only then pass la_relat-low = 'ATTA*'. if there is no filtering then pass 'NOTE', 'URL', 'ATTA' as required.
    For the business object of PR pass BUS2105 and instance id pass the PR no.
    The tables related to this are srrelroles,srgbinrel,sood etc.

Maybe you are looking for