Multiple Contracts VBAK-VBPA-VBPA2

Firslty, ,I am new to this site so please tell me (politely) if I have posted in the wrong place !
My operation is to extract Quanity Contract data, to use outside of SAP.
For any given Ship-to/Material, report the Quanity Contract data.
I have identified my Quantity Contracts from VBAK, VBAP, VEDA.
I have joined my ContractPartners VBPA, VBPA2.
Taken into account those partners at header level, and those at line.
From this, I now have a report listing Ship-to, Material against  related contract lines.
Problem is, I have multiple contract lines for some Ship-to/Materials.
I have checked ItemCategory, Rejected Contract Lines, Start/end dates.
Using Transaction VA43, I can see that it is not my SQL, but SAP itself recognises multiple contract lines.
However, looking into Document Flow, I can see that only 1 contract is being used for billing.
The missing link for me is this, given 'duplicate' contract lines, how does SAP determine which COntract/Line to use for billling ?
Hope someone can throw some light, or point me in the right direction ?
Many Thanks
Simon

Hi,
Try debugging the code and after the select query and sort just check the gt_sel table if it contains any duplicate entries, if it is so, then there is some problem in inner join and left outer join and left outer join takes all the entries from left hand tables and only selected entries from right hand table so if the right hand table contains 3 to 4 entries then the same records from the left hand table is repeated for 3 to 4 times due to which you feel that the records are repeated.
just check with the query and instead of using joins which is very costly statement try separating the query for each table and then using different internal tables you can collaborate the data into one single and avoid repetation.
Regards,
Ravi

Similar Messages

  • Creation of multiple contracts in ERP backend from 1 GOA in SRM

    Hello fellow SRM'ers, we are on SRM 5.5 and we have a scenario where we create a GOA in SRM and it get's created as a contract in the ERP backend system.  This is working fine.  Now our client would like to have multiple contracts created in the backend, one for each company when the GOA is saved.  I found OSS note 646903, statement #2 that explains how to code the badi bbp_ctr, but is this all that is required to do this?  It seems to me that the code in BBP_CTR will only create 1 contract/idoc.  Can anyone tell me how we generate an idoc/contract that we want to create in ERP backend?  Or is this how it's done?
    Points will be rewarded for usefull answers.  I have read most of the posts on this forum and have not found any answers yet.
    Thanks,
    Marty

    Hi,
    Please go through the below explanation from SAP documentation which says the no of contracts that would be created in the backend depends on
    --If you activate grouping logic for locations in GOA from SPRO under cross aplication settings, items belonging to the same release-authorized purchasing organization, but different locations, can be grouped together into one backend contract. This requires a 1:1:1 relationship between an item, the release-authorized purchasing organization, and the location. This means that for each item, you can only assign one release-authorized purchasing organization, and one location, in order to release the GOA.
    If you do not select this indicator to activate the grouping logic for location, a separate backend contract is created for each item belonging to the same release-authorized purchasing organization, but with different locations. Only items referring to the same release-authorized purchasing organization and location can be combined into one backend contract.---
    So the bottomline is by default, when we distribute one separate contract is created for each location.
    Hope this clarifies.
    Regards,
    RRK

  • One order with reference to multiple contracts

    Hi,
    As we create one invoice(consolidated invoice) for multiple orders where condition is header data should be same for all the orders.In the same way can we create one order with reference to multiple contracts?
    Please suggest.
    Regards,
    SATYA

    Hi,
    Thanks alot for the information.
    Is this the only way to create one order for multiple contract? Why i am asking because in SAP we are creating contracts but the release order we are getting it uploaded from other software.I am in a service industry project where we do DP91(resource related billing) for all the contract.But in dp91 we can give only one contract at a time.
    But we want to create order where multiple contract can be used .
    And where in order we can see the contract number?
    In the table it is visible as ref doc but not in the order.
    Regards,
    SATYA

  • Copying multiple contract's data to sales orders via BAPI.

    Hello Experts,
    We have a requirement to copy contract data into the sales order, reference multiple contracts and copy all data from referenced contract to the SO.The scenario is that a seperate contract is being refrenced at the header level and different contract is referenced to the line items.All the data needs to be copied to the header or item from the doucment being referenced.
    The standard BAPI available for creating the SO (CREATEDAT2) references the contract doucment, but doesnt copy all the data from the referencing doucment to the SO, as the copy control are not called.We also tried using the BAPI 'BAPI_SALESDOCUMENT_COPY', which copies all the data but only does this for a single contract reference at a time.The BAPi doesnt allow the specific items to be copied or doesnt allow the reference of multiple contracts at the line item level.
    Any BAPI which can be used or pointers to resolve this issue, will be very helpful.
    Thank you.
    Best Regards,
    Gaurav Bhardwaj.

    Better try to follow this
    [Read This Before Closing your Threads |Read This Before Closing your Threads;
    thanks
    G. Lakshmipathi

  • How to create multiple Contracts using BAPI_BUSPROCESSND_CREATEMULTI?

    Hi Experts,
    I m trying to create multiple service contracts using BAPI_BUSPROCESSND_CREATEMULTI. I can create single transaction in one go but program is failing to create multiple service contracts in one go. It does create the multiple contracts but messes up with products and product related information. As when there is same product in two different contracts, the record in item internal table has same values for both contracts as we are not passing header guid to the intem related internal table 'ITEM', 'SCHEDULELINE' etc.
    How to use this BAPI to create mulitple service contracts in one go?
    Thanks and Regards.

    Any guideline?
    Thanks and Regards,

  • SRM Contract Download - Multiple contracts in one shot

    For one contract we can click on Download button while viewing the contract (Use Firefox instead if IE6 or 7. Does not work in IE) to download contract to Excel.
    Is there any mechanism by which we can download a bunch of contracts in one shot to Excel ( I have > 150 contracts that need to be download). Going one by one is a time consuming affair.
    Thanks

    Hello Ajay,
    There is no standard feature to download multiple contracts in one shot.
    You will have to develop it by yourself.
    Take care about performance if you download 150 contracts at same time.....
    Rgds
    Christophe

  • Copying multiple contract's data to sales order

    Hello Experts,
    We have a requirement to copy contract data into the sales order, reference multiple contracts and copy all data from referenced contract to the SO.The scenario is that a seperate contract is being refrenced at the header level and different contract is referenced to the line items.All the data needs to be copied to the header or item from the doucment being referenced.
    The standard BAPI available for creating the SO (CREATEDAT2) references the contract doucment, but doesnt copy all the data from the referencing doucment to the SO, as the copy control are not called.We also tried using the BAPI 'BAPI_SALESDOCUMENT_COPY', which copies all the data but only does this for a single contract reference at a time.The BAPi doesnt allow the specific items to be copied or doesnt allow the reference of multiple contracts at the line item level.
    Any BAPI which can be used or pointers to resolve this issue, will be very helpful.
    Thank you.
    Best Regards,
    Gaurav Bhardwaj.

    Hi PeteA,
    I dont get any message, the problem is I dont see the contract no field on the screen.
    I copied the SM01 order type to ZM01 and did the required configuration, now when I use the ZM01 order type I cannot see the contract field but when I use SM01 the same is appearing.
    I saw some screen config for order types in Basic Order view but SM01 does not have any entries there.
    Thanks,
    Sarath.c

  • Contract Importer - Uploading Multiple Contract Documents for the same MA

    Is it possible to upload multiple contract documents against the same master agreement when using the contract importer tool.
    If so, what is the format for specifying the various filenames that represent these documents.
    Thanks,
    Tanmaya

    Hi,
    Yes this is feasible.
    What we had done is uplaoded the MA first and then loaded a separate csv for Attachments. This can then be placed on the desired location and picked up via the attachment importer mapping file. Just FYI, this can be configured in the System properties to import the file into E-Sourcing.
    Hope this is helpful,
    Vikram

  • GOA Distribution to backend - Multiple Contracts

    Hi,
      We are trying to create multiple local contracts (one for different company code) in ECC for a given GOA. I reviewed note 646903 and the sample code given for item 2 there. It appears the code there only creates one local contract for a given GOA. How can I create multiple local contracts.
    Thanks,
    SG

    Resolved. Had to put in mapping code in BBP_CTR from location to company.

  • How to get partner count from VBAK & VBPA

    Hello Experts,
    In the sales orders, there are several type of partners "AG" "ZS" "VE"....
    I want to put following info into one report, how should I do it? I tried many ways, on universe level and report level, but still don't have it....
    Sales Person (VBPA partner type VE, get from table PA002),
    Customer NO (from VBAK),
    Count of ZS type partner for specific sales person and customer combination (VBPA partner type ZS)
    Thank you thank you!

    could you please eloborate your requirement

  • Multiple contract creation in ECC from a single GOA

    Hi Experts,
    I am working on a solution regarding to GOA in SRM - Contract in ECC creation and i am wondering about the following scenario:
    Create 1 GOA in SRM 5.0 for a central/global purchasing organization and when the appropriate BADI going to transfer it into ECC, it creates contracts for all company codes.
    At my current client they use GOA but until now they created 1 GOA for a specific p.org and the BADI transferred (and created) contract in ECC for the specific company code (they donu2019t have kind of central/global purch organization unit in ppoma). In the future they would like to create GOAs which are usable for all companies, but instead of creating (and changing) them manually (N GOA in SRM for N contract in ECC) they want to have an automatism.
    Does any of you have any experience on this? That would be really good if you can share with me some high level overview about concept.
    Thanks in advance for your help!
    Best Regards,
    Attila

    Hi,
    Let me correct if i am right:
    - Central Contract -> new concept of SRM 7.0. 1 contract which is visible and usable from ECC and SRM as well. (not available in SRM 5.0 - agree)
    - GOA -> it exist in SRM 5.0 for sure! (we are currenlty using it for ECC procurement).
    The solution what you are mentioned is good...but as you said only for SRM 70...we are in SRM 5.0 and we need solution for here. Do you have any idea?
    Currently i am thinking about a new solution based on "standard" functionalities: if a GOA need to be created for mulitple company, it has to be populated in Header distribution (all company will have the same contract header). It item detail all the required information need to be poupulate in SRM (i.e.: item 1 for p.org1/comp.cod1; item 2 for p.org2/comp.cod2).
    When this is done, the BADI need to check the informatoin in SRM GOA and create contract according to that -> in this case 1GOA is created, but the 2 items for totally different p.org/comp.code, the BADI needs to create 2 different contract in ECC (i would like to avoid using reference purchasing organization in ECC!
    Thanks in advance!
    Best Regards,
    Attila

  • Multiple contract assignment using document flow

    hello
    i need to attach mulitiple contracts to diffrent lines items of the service order using document flow.
    One needs to attach contract header at the service order header and contract item at the service order item.
    This works fine if you try to attach single contract to single line item in servie order.
    But when you try to attach another contract to different line item  of the service it gives dump.
    The system issues an error  message CRM_DOC_FLOW 010 and gives dump.
    Has anybody faced this issues before.
    Pls advice.
    Regards
    Meghana

    Hi Shaik i have a similar requirement but in my case iam using BAPI_ACTIVITYCRM_CREATEMULTI to create activities and
    i want these activities to be link to campaign element,i had a look at structure BAPIBUS20001_DOC_FLOW_INS and i see there are few fields in this structure like OBJKEY_A- Identification of a Reference Object for Items,OBJKEY_B-Identification of a Reference, i feel this were we have to pass some values if you wanna to link the activity with campaign element, i donno when to use
    OBJKEY_A and when to use OBJKEY_B, can you please help me how can i do this is it possible to do it in same program while creating activity or has to be done seperately after the activity is created.
    any more ideas you have please
    Thanks

  • Track multiple contracts with multiple vendors

    I am currently looking to track all my HP CarePacks and be alerted when they are expiring. I see that you can create a vendor and you can create a start and end date, but dont see how to make say a contract or anything under the vendor that has a start and end date, am i missing something?
    This topic first appeared in the Spiceworks Community

    I am currently looking to track all my HP CarePacks and be alerted when they are expiring. I see that you can create a vendor and you can create a start and end date, but dont see how to make say a contract or anything under the vendor that has a start and end date, am i missing something?
    This topic first appeared in the Spiceworks Community

  • SAP UCES - One BP having multiple Contract Accounts

    Hi,
    I understand there is a way to display a list of contract accounts that the contract partner has after UCES logon.
    The same screen can also be accessed by Menu link Switch Account. But is this  a standard feature of UCES or does it require any customization or configuration? If yes, then any details will be very helpful.
    Thanks,

    Hi,
    there are no customizing settings to be done. Please check your webbase-config.xml file. It should contain sth like the following code:
    <webaction path="/logon" class="com.sap.fin.fscmbase.LogonAction">
       <mapping result="accswitch" screen="accswitch"/>
    </webaction>
    Pls also check the startEBPP webaction:
    <webaction path="/startEBPP" class="com.sap.fin.isu.base.IsuStartAction">
       <mapping result="accswitch" screen="accswitch"/>
    </webaction>
    Be sure to have also a screen elemnt for accswitch within your webbase-config.xml (you should have that):
    <screen name="accswitch">
       <path>/jsp/content_accswitch_html.jsp</path>
    </screen>
    Stefan
    Edited by: Stefan Szalowski on Jul 8, 2010 2:43 PM

  • Optimizer not picking preferred vendor out of multiple contracts

    We need to use outline agreements in APO. We are doing the following:
    CIFing the outline agreement(s) to APO
    T-lane(s) created from Vendor to destination location
    Running Optimizer
    Purchase requisitions created with suitable source of supply.
    Problem:
    If there are more than single vendors for a material , there is a preferred vendor that needs to be picked by the system. We set the t-lane priorities acc. to preferred vendor and it works fine with heuristic. But for optimizer, we are not able to determine a method for the system to determine the preferred vendor and pick it during optimizer run.
    Could you please share your thoughts or best practices regarding above.
    Thanks.

    Thanks Umesh..
    I tried with transportation cost and it is working fine... but then how do we be sure that optimizer would work as expected because it tries to find an optimal solution with minimum
    overall cost (that includes all the costs).
    Plz advise.
    Regards,
    Shweta

Maybe you are looking for

  • Hp printer can't scan to hp touchsmart lost connection

    I recently purchased and connected successfully a new HP Photosmart6520 printer, all functions worked fine including scan to my HP Touch Smart, however recently I have been unable to scan to my PC. I can scan to my Acer Laptop without a problem so I

  • Flv player to play swf

    I have a simple swf animation that I would like to post on my website and I am looking for an swf player. I tried using the one bundled with flash professional but it seems that it only accept flv files. So is there any way around this. I could creat

  • Save drag and dropped layout?

    Hi, Lets say that I setup a view with multiple containers that the user can drag an drop and order the containers how they wish. Now is it possible to save that layout they create and everytime they load the app, it comes up how they want it. If it i

  • Doubt about Alerts Out-of-Band 2012 R2.

    Hi All, I´ll deploy Out-of-Band of SCCM 2012 R2. I have computers with v-PRO last version, a doubt if in SCCM alters painel can receive hardware issues. For exemple hard disk failed and so on. regards.

  • Premiere Pro CS4: Exporting

    First of all, thank you to everyone who has helped me so far. I am not really "into" video editing and therefore do not know very much about it. I am however trying to make a film to document my wifes pregnancy (our first born). I have really learned