Bapi to delete BP role ( eg : customer , prospect )

Hi ,
Could you please provide me with FM or bapi to delete role of BP ( like customer role, prospect role ..etc ) .
Your help is appreciated.
Thank you

Hi Deepa ,
If you want to delete roles or business partners based on the role of the accounts then you can use the badi CRM_ACC_SEARCH.
1. Goto SE19, and create a new implementation for the badi
CRM_ACC_SEARCH, Name it ZCRM_ACC_SEARCH
2. Implement the Query method of the above implementation.
3. Here you have the ct_partner_keys. Loop over this internal table
and delete the contact persons.
4. You can use the BAPI 'BUPA_ROLES_GET' to identify the account
5. If the partner has the role 'BUP001' (contact person), then you
can delete the same.
6. Save and activate the above implementation.

Similar Messages

  • BAPI FOR Deleting a Schedule Line Item from EKES and EKET tables

    Dear All,
    I would like to for deleting one of the line item from EKES (Po Confirmation ) and the respective line item from the EKET(PO Schedule Line Item Table).
    Assume that am allowing the user to select the lineitem from zprogram screen and collecting the PO and Its LIne Item details in an internal table.
    Can i Use
    <b>BAPI_PO_Change</b> , if so , can anybody tell me the steps to follow to use this bapi for deleting the PO lineItems, since i m going to try BAPI for First time.
    pls help me out
    Message was edited by: Raja K.P

    Hi raja ,
    loop at iekko1.
        w_index = sy-tabix.
        item-po_item   = itemx-po_item   = iekko1-ebelp.
        item-quantity  = iekko1-mng01.
        itemx-quantity = iekko1-mng01.
        if iekko1-wamng = iekko1-wemng.
        itemx-no_more_gr = item-no_more_gr = 'X'.
        else.
        itemx-no_more_gr = item-no_more_gr = ''.
        endif.
        append item.
        append itemx.
          clear return[].
          call function 'BAPI_PO_CHANGE'
               exporting
                    purchaseorder = iekko1-ebeln
               tables
                    return        = return
                    poitem        = item
                    poitemx       = itemx.
          if return[] is initial.
          commit work and wait.
          call function 'DEQUEUE_ALL'.
    search for deletion fields which u have to mark 'X'.
    before calling  this BAPi u have to lock the PO by using ENQUEUE.
    <b>
    FU BAPI_PO_CHANGE
    Text
    Change purchase order
    Functionality
    Function module BAPI_PO_CHANGE enables you to change purchase orders. The Change method uses the technology behind the online transaction ME22N.
    Alternatively, the IDoc type PORDCH1 is available. The data from this IDoc populates the interface parameters of the function module BAPI_PO_CHANGE.
    Functionality in Detail
    Authorization
    When you create (activity 02) an Enjoy purchase order, the following authorization objects are checked:
    M_BEST_BSA (document type in PO)
    M_BEST_EKG (purchasing group in PO)
    M_BEST_EKO (purchasing organization in PO)
    M_BEST_WRK (plant in PO)
    Controlling adoption of field values via X bar
    For most tables, you can use your own parameters in the associated X bar (e.g. PoItemX) to determine whether fields are to be set initial, values inserted via the interface, or default values adopted from Customizing or master records, etc. (for example, it is not mandatory to adopt the material group from an underlying requisition - you can change it with the BAPI).
    Transfer
    Purchase order number
    The PurchaseOrder field uniquely identifies a purchase order. This field must be populated in order to carry out the Change method.
    Header data
    The header data of the Enjoy purchase order is transferred in table PoHeader.
    Item data
    The item data of the Enjoy purchase order is stored in the tables PoItem (general item data). Changes regarding quantity and delivery date are to be made in the table PoSchedule.
    Use the table PoAccount to change the account assignment information.
    Services and limits
    Changes to existing items cannot be carried out with the Change method. It is only possible to create new items.
    Conditions
    Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. A new price determination process can be initiated via the parameter CALCTYPE in the table PoItem.
    Vendor and delivery address
    The vendor address in the table PoAddrVendor and the delivery address in the table PoAddrDelivery can only be replaced by another address number that already exists in the system (table ADRC). Changes to address details can only be made using the method BAPI_ADDRESSORG_CHANGE.
    Partner roles
    You can change all partners except the partner role "vendor" via the table PoPartner.
    Export/import data
    Export/import data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items. Changes to the export/import data of existing items are not possible.
    Texts
    Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText. Texts can only be replaced completely.
    Version Management
    You can make use of the Version Management facility via the table AllVersions.
    Return
    If the PO was changed successfully, the header and item tables are populated with the information from the PO.
    Return messages
    Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. If a PO has been successfully created, the PO number is also placed in the return table with the appropriate message.
    Restrictions
    With this function module, it is not possible to:
    Create subcontracting components (you can only use existing ones)
    Create configurations (you can only use existing ones)
    Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))
    Attach documents to the purchase order
    Change foreign trade data
    Change service data
    Change or reexplode BOMs
    A firewall prevents the manipulation of data that is not changeable in Purchasing according to the business logic of the purchase order (e.g. PO number, vendor, etc.).
    PO items with an invoicing plan cannot be created or changed using the BAPIs
    In this connection, please refer to current information in Note 197958.
    To change addresses with numbers from Business Address Services (cantral address management), please use the function module BAPI_ADDRESSORG_CHANGE.
    To change variant configurations, please use the function module BAPI_UI_CHANGE. More information is available in the BAPI Explorer under the Logistics General node.
    In the case of changes that are to be made via the BAPI_PO_CHANGE, a firewall first checks whether the relevant fields are changeable. This approach follows that of the online transaction. Here it is not possible to change the vendor or the document type, for example.
    Example
    Example of changes made to a purchase order with:
    1. Change in header data
    2. Change in item
    3. Change in delivery schedule
    4. Change in account assignment
    5. Change in conditions
    6. Change in partners
    Parameter: PURCHASEORDER 4500049596
    Parameter: POHEADER
    PMNTTRMS = 0002
    PUR_GROUP = 002
    Parameter: POHEADERX
    PMNTTRMS = X
    PUR_GROUP = X
    Parameter: POITEM
    PO_ITEM = 00001
    CONF_CTRL = 0001
    Parameter: POITEMX
    PO_ITEM = 00001
    PO_ITEMX = X
    CONF_CTRL =  X
    Parameter: POSCHEDULE
    PO_ITEM = 00001
    SCHED_LINE = 0001
    QUANTITY = 10.000
    PO_ITEM = 00001
    SCHED_LINE = 0003
    DELETE_IND =  X
    Parameter: POSCHEDULEX
    PO_ITEM =  00001
    SCHED_LINE =  0001
    PO_ITEMX =  X
    SCHED_LINEX =  X
    QUANTITY =  X
    PO_ITEM =  00001
    SCHED_LINE =  0003
    PO_ITEMX =  X
    SCHED_LINEX =  X
    DELETE_IND = X
    Parameter: POACCOUNT
    PO_ITEM = 00001
    SERIAL_NO = 01
    GL_ACCOUNT = 0000400020
    Parameter: POACCOUNTX
    PO_ITEM = 00001
    SERIAL_NO = 01
    PO_ITEMX = X
    SERIAL_NOX = X
    GL_ACCOUNT = X
    Parameter: POCOND
    ITM_NUMBER = 000001
    COND_TYPE = RA02
    COND_VALUE = 2.110000000
    CURRENCY = %
    CHANGE_ID = U
    Parameter: POCONDX
    ITM_NUMBER = 000001
    COND_ST_NO = 001
    ITM_NUMBERX = X
    COND_ST_NOX = X
    COND_TYPE = X
    COND_VALUE = X
    CURRENCY = X
    CHANGE_ID = X
    Parameter: POPARTNER
    PARTNERDESC =  GS
    LANGU =  EN
    BUSPARTNO = 0000001000
    Help in the Case of Problems
    1. Note 197958 lists answers to frequently asked questions (FAQs). (Note 499626 contains answers to FAQs relating to External Services Management.)
    2. If you have detected an error in the function of a BAPI, kindly create a reproducible example in the test data directory in the Function Builder (transaction code SE37). Note 375886 tells you how to do this.
    3. If the problem persists, please create a Customer Problem Message for the componente MM-PUR-PO-BAPI, and document the reproducible example where necessary.
    Customer Enhancements
    The following user exits (function modules) are available for the BAPI BAPI_PO_CREATE1:
    EXIT_SAPL2012_001 (at start of BAPI)
    EXIT_SAPL2012_003 (at end of BAPI)
    The following user exits (function modules) are available for the BAPI BAPI BAPI_PO_CHANGE:
    EXIT_SAPL2012_002 (at start of BAPI)
    EXIT_SAPL2012_004 (at end of BAPI)
    These exits belong to the enhancement SAPL2012 (see also transaction codes SMOD and CMOD).
    There is also the option of populating customer-specific fields for header, item, or account assignment data via the parameter EXTENSIONIN.
    Further Information
    1. Note 197958 contains up-to-date information on the purchase order BAPIs.
    2. If you test the BAPIs BAPI_PO_CREATE1 or BAPI_PO_CHANGE in the Function Builder (transaction code SE37), no database updates will be carried out. If you need this function, please take a look at Note 420646.
    3. The BAPI BAPI_PO_GETDETAIL serves to read the details of a purchase order. The BAPI cannot read all details (e.g. conditions). However, you can use the BAPI BAPI_PO_CHANGE for this purpose if only the document number is populated and the initiator has change authorizations for purchase orders.
    4. Frequently used BAPIs for purchase orders are BAPI_PO_CREATE, BAPI_PO_CREATE1, BAPI_PO_CHANGE, BAPI_PO_GETDETAIL, BAPI_PO_GETITEMS, BAPI_PO_GETITEMSREL, and BAPI_PO_GETRELINFO.
    5. For more information on purchase orders, refer to the SAP library (under MM Purchasing -> Purchase Orders) or the Help for the Enjoy Purchase Order, or choose the path Tools -> ABAP Workbench -> Overview -> BAPI Explorer from the SAP menu.
    Parameters
    PURCHASEORDER
    POHEADER
    POHEADERX
    POADDRVENDOR
    TESTRUN
    MEMORY_UNCOMPLETE
    MEMORY_COMPLETE
    POEXPIMPHEADER
    POEXPIMPHEADERX
    VERSIONS
    NO_MESSAGING
    NO_MESSAGE_REQ
    NO_AUTHORITY
    NO_PRICE_FROM_PO
    EXPHEADER
    EXPPOEXPIMPHEADER
    RETURN
    POITEM
    POITEMX
    POADDRDELIVERY
    POSCHEDULE
    POSCHEDULEX
    POACCOUNT
    POACCOUNTPROFITSEGMENT
    POACCOUNTX
    POCONDHEADER
    POCONDHEADERX
    POCOND
    POCONDX
    POLIMITS
    POCONTRACTLIMITS
    POSERVICES
    POSRVACCESSVALUES
    POSERVICESTEXT
    EXTENSIONIN
    EXTENSIONOUT
    POEXPIMPITEM
    POEXPIMPITEMX
    POTEXTHEADER
    POTEXTITEM
    ALLVERSIONS
    POPARTNER
    Exceptions
    Function Group
    2012
    </b>
    regards
    prabhu
    Message was edited by: Prabhu Peram

  • Func. Mod's, BAPI's, IDoc's Related to Customer Master

    Hi,
    I need Func. Mod's, BAPI's, IDoc's Related to Customer Master. For creation, modification, Deletion, Updation of master data records.
    Regards,
    Sudheer

    Hi,
    Bapi to create customer master
    BAPI_CUSTOMER_CREATEFROMDATA
    BAPI_CUSTOMER_CREATEFROMDATA1
    Or you can use FM SD_CUSTOMER_MAINTAIN_ALL
    customer master idoc is DEBMAS05
    Hope this helps
    Please reward points if useful.
    Regards
    Rose

  • How to add/delete single role to/from CUA

    Hi All,
    I want to add/delete single role from CUA system. I found one FM to change roles i.e BAPI_USER_LOCACTGROUPS_ASSIGN , In function module documentation said that it will overwrites all existing roles with the roles in the table parameter.I dont want to do that. I need a FM to add/delete role to CUA system. Please help me with your suggestions.
    Thanks,
    Suman

    I am not aware of another BAPI based way to do it. You will need to get the details of the Roles AND manual profiles assigned, and then re-assign the new set in the call.
    Cheers,
    Julius

  • BAPI for deletion of employee from work center T Code IR02

    Any one can give me a BAPI to delete position/person from work center ?
    T Code IR02
    IR02 -> HRMS - > Expand - > select person - > delete.
    Thank you
    Mrudang

    Thanks for your fast reply!
    I have looked to both functions before. Beside that they are both not remote enabled (which is not such a big problem as I could copy them or build a custom BAPI around them) I'm not quite sure how they could solve my problem.
    If I got it right, I would first use CR_CAPACITIES_OF_WORKCENTER to get the KAPID and using it as input for CLOI_WC_CAPACITY_READ. But I have problems to understand the output of CLOI_WC_CAPACITY_READ. The data type of the capacity is a float ( FLTP ) and the number seems to be to big, eg. 9.800000000000000E+01= 98h for one day.
    Could you try to explain your solution once again?
    Thanks,
    Simon

  • Customer Prospect in People Centric UI

    Hi together,
    can somebody explain to me, how to create an iView to create customer prospect in Portal?
    I found two OSS-notes where I found the information, that I have to copy the BSP and to add my own view on to the customer (ie. OSS-note 712481).
    In the iView "account", of the crm business package, there is called the BSP bsp_frame. In Customizing of the application CRMM_ACCOUNT (which is also defined in the iView) there is the package CRM_BSP_MODEL_IL_BP assigned. In this package I only found only the BSP-Application "crm_prn_acc_ov" - but I think this is not the account BSP.
    Have anybody an idea, which BSP-Application I have to copy? Where I'll give in the new iView the information for the new BSP-Application? Which steps I have to do in customizing?
    Thanks and regards
    Thomas

    From OSS-Note 712481:
    <i>In the SAP GUI, business partner roles (BP roles) represent different views for a business partner.
    This function is implemented in a different way in the People-Centric UI.
    SAP delivers the "Account" and "Competitor" People-Centric UI applications with CRM Release 3.1 and CRM Release 4.0 - two views for the business  partner. The "Contact person" application represents a special view for  the contact person relationship of a business partner.</i>
    I'm working with CRM 4.0 and Portal-Application. The proplem is, that I wan't to create(!) business partners in the role prospect (BUP002) and additional in role general (00000). SAP delivers only two iViews one to create business partners in role "sold-to" (CRM001) and one to create competitors (CRM005) (see OSS-Note).
    Regards, Thomas
    Message was edited by:
            Thomas Blasche

  • Deleting Expired Roles

    Hi,
    can delete expired profiles with PFCG_TIME_DEPENDENCY, but what can I do for roles with no valid date range in the user master dat
    Thanks,
    Sreekar.

    Hi,
    You may want to review notes 312943, 504412, and 313587 to see if there is any helpful information. Below is some documentation that may be helpful for others. We are going from 40B to 47 and had a few issues with role deletion.
    First, the report PFCG_TIME_DEPENDENCY is functioning as designed. It was not designed to remove activity groups.
    Second, in transaction SU10 you must have the "Valid From" and "Valid To" fields filled in with the actual dates (04/08/2002) in order to remove the invalid activity group. You need to be sure that the "Remove User" radio button is set in the role tab. In the profile tab, the "Add User" radio button is selected by default. What you have to do is go to the profile tab and select the "Remove User" radio button. You have to make sure both role and profile have the same radio button selected (i.e. remove from users). Only then when you click save, will it allow you to delete the role from user. In transaction SU10, you need to complete the following steps:
    1. Click on the Authorization data button.
    2. Entry the users name, latimerc.
    3. Click on the execute button.
    4. Put a check in front of the users name.
    5. Click on the transfer button.
    6. Now highlight the user.
    7. Click on the pencil button.
    8. Click on the Activity Groups tab.
    9. Enter the profile name (PM_NOTIFICATION_PROCESSOR).
    10. Enter the valid from and valid to dates (04/08/2002).
    11. Change the radio buttons to remove user from both the Activity Group and Profile Tabs.
    12. Click on the trash can.
    In another customer message the following was provided by developement:
    There is no regular functionality for mass deletion of roles. But, if you want to avoid the deletion by hand or with an own created report, I would suggest the following:
    The report ZDELETE_RY_T_AGRS can delete all roles with names like 'T_....' or 'RY....'. The report gives you a list of all these roles and then deletes the selected ones. You can modify the report to get all your roles in the selection list. Therefore, you have to change the following:
    SELECT * FROM AGR_FLAGS INTO TABLE L_AGR_FLAGS
    WHERE FLAG_TYPE = 'COLL_AGR'
    AND FLAG_VALUE = 'X'.
    SORT L_AGR_FLAGS BY AGR_NAME.
    LOOP AT SINGLE_ACTGROUPS WHERE AGR_NAME+11 <> SPACE AND <<< delete
    ( AGR_NAME(2) = 'T_' OR AGR_NAME(2) = 'RY' ). <<< delete
    LOOP AT SINGLE_ACTGROUPS WHERE AGR_NAME+11 <> SPACE. <<< insert
    READ TABLE L_AGR_FLAGS WITH KEY AGR_NAME = SINGLE_ACTGROUPS-AGR_NAME
    BINARY SEARCH.
    Text from an additional customer message offers further help:
    1. Go on role tab.
    2. Select remove from user.
    3. Enter ZR.PRD.GENERIC and date : 06/04/2002 12/31/9999.
    4. Go to profile tab.
    5. Select remove from user.
    6. Save.
    7. Do the same for ZR:HR:ESS from 01/01/2002 to 12/31/9999 and worked from date for testid was 01/01/2002 and testid2 02/01/2002. In this case, the two assignements were deleted, and the roles were also removed from the two UMR.
    Reward points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • Please tell me a BAPI to get Closing balance of customer account based on Sales Organization?

    Hi Experts,
    A requirement has come up where I want to get Customer closing balance based on its sales organization as this particular customer is extented to 2 different sales organizations. I want to get the closing balance of individual sales organization vise.
    Please tell me a BAPI to get Closing balance of customer account based on Sales Organization?

    AFAIK there is no such BAPI, cause there is no database table with balance for customer per sales organisation. (No KNCx table for VKORG)
    First ask functionals (*) how to recover sales organisation from a FI document (I suppose for SD invoice it is easy if no merging between organisation) will be a little tricker for pure FI document like payment transactions (hope thet are quickly cleared...)  Then start from non cleared records of BSID (also BSAD if you use a past date of reference, in case you have to add the records of BSAD with clearing date greater than reference date) and cross it with SD information to break FI into sales organisation.
    Regards,
    Raymond
    (*) Ask for where do they store VKORG in FI documents

  • Function modules or BAPI for deleting plan costs on a cost center

    Hi all,
    I search for a function module or bapi to delete plan costs / activity on a cost center.
    At the moment I update the planning with 0, but that cause a mass of needles entries on the cost centers.
    For check and posting I use the function group 6026 - BAPI_COSTACTPLN_* ,
    but there is no function for deleting.
    Has anyone an idea?
    Thx for help - points as reward !

    check
    BAPI_COSTACTPLN_POSTACTINPUT   Activity Input Planning: Posting                
    BAPI_COSTACTPLN_POSTACTOUTPUT  Activity/Price Planning: Posting                
    BAPI_COSTACTPLN_POSTKEYFIGURE  Stat. Key Figure Planning: Postings             
    BAPI_COSTACTPLN_POSTPRIMCOST   Primary Cost Planning: Postings                 
    BAPI_PDTRANSCO_POSTPRIMCOST    Transfer of Planning Data: Post Primary Costs   
    K40C                           CO Actual Postings, Manual                      
    BAPI_ACC_PRIMARY_COSTS_POST    Accounting: Post Primary Costs                  
    BAPI_COPAACTUALS_POSTCOSTDATA  BAPI Operating Concern: Post Costing-Based Actua
    BAPI_PRIM_COST_CHECK_AND_POST  Primary Costs: Formal Parameter Check           
    S@meer

  • Deleting a Contact on Customer Master with that Contact on Open Sale Orders

    Our current SAP system ECC 6.0 allows a user to delete a Contact from the Customer Master where that Contact is also on Open Sales Orders. 
    Then when our create delivery job runs, it abends saying Contact record not found.
    How is this normally handled ?  Are users not suppose to delete Contacts from the Customer Master if they are attached to an Sales Order ?  Is there some config to turn on in SAP that checks for Open Sales Orders before deleting a Contact in the Customer Master ?  Do I code this check in User Exit on the Save in the Customer Master and not let user delete the Contact if it's attached to Open Sales orders ?
    Would appreciate any help on this.
    Thanks,
    David

    Hi David,
    Try this user exit.
    RFDRRANZ  User exits: Accounts Receivable Information System
    Regards,
    Vijay

  • Procedure for deleting a role which is already in Production

    Hi,
    can any one explain me the procedure for deleting a role which is already in production
    i want to know procedure for deletion of
    1.single role
    2.composite role
    3.derived role
    4.parent role
    thanks,
    SSSS

    Hi,
    Role deletion must be done in development box and the deletion must be transported to quality and productuion
    For single and derrived roles create the transport request and delete the role and transport the deletion.
    For Deletion of parent role: you cannot delete the parent role unless all the derrived roles within it are deleted.
    To avoid the transport of user assignment make sure PRGN_CUST is set to 'NO' value for the parameter USER_REL_IMPORT.
    Rakesh

  • BAPI to delete Batch number

    Hi,
    Can anyone let me know the BAPI to delete the Batch Number when ever a particular Material document is reversed for a year.
    (Batch Number that was created as part of Material Document Creation and Each Batch Number is used only for one Material Document number)
    Points for sure..
    Thanks,
    Ponraj.s.

    Ponraj,
    BAPI_BATCH_CHANGE              Change Batch   
    BAPI_BATCH_CREATE              Create Batch   
    BAPI_BATCH_DELETE              delete batch
    Amit.

  • Delete request / role in ERM GRC 5.3

    Hi All
    I have a Role in ERM that I need to delete. Buuut, Role deletion is not possible; it has sent for approval.
    In CUP we have already deleted all request (following instructions by SAP note) and there is not any request in the system.
    The problem is that I can't delete this role from ERM because has been sent for approval, but I cant find the request in CUP or ERM, what can I do? Please, help me !!
    Thanks in Advance.
    David. ..

    Hi David,
    I was the same problem when i wanted to create a new role.
    Confirm in the Approval stage what user you assign as approver. The system doesn´t check if this user exists.
    If this user doesn´t exists, the only possibility to delete the role is create a new UME user with this user, giving the necessary roles and log in to CUP to delete the role.
    I hope this help you,
    Sergio

  • Create , delete "security roles" in weblogic console - sample Security providers

    Hi Everyone:
    Weblogic gave out sample Security Providers for version 7.0 and 8.1. In
    those sample Security Provider , the author of codes used property files as
    Security Providers Database, however he/she didn't show how to create a
    Manageable Sample Role Mapping Provider or Manageable Sample Authentication
    Provider, so Administrator of weblogic console can create and delete
    "security roles" in weblogic console.
    Have anyone known how to do that?
    Ming Qin

    "ming qin" <[email protected]> wrote in message news:[email protected]..
    Hi Everyone:
    Weblogic gave out sample Security Providers for version 7.0 and 8.1.In
    those sample Security Provider , the author of codes used property filesas
    Security Providers Database, however he/she didn't show how to create a
    Manageable Sample Role Mapping Provider or Manageable SampleAuthentication
    Provider, so Administrator of weblogic console can create and delete
    "security roles" in weblogic console.
    Have anyone known how to do that?
    I would ask in the weblogic.developer.interest.management.console newsgroup.
    >
    Ming Qin

  • The button 'New entry' and 'Delete' disappear on the customizing t_codes.

    Hello All
    I want to define new one QN.  but I don't find the button 'New entry'. After checking, I found that the button 'New entry' and 'Delete' disappear on all customizing transaction codes. who know why?
    By the way, currently our system finished doing the conversion from non-unicode to unicode, do it affect ? Pls advise! Thanks!

    our customizing system has 2 clients and basic colleague are delting the nonuse client, therefore the function of new entries and delete to those client-specific objects are inactive

Maybe you are looking for