Delete master record without deleting corresponding details

Hi all,
If we have a master-detail relation and we delete the master record, the “Implement cascade delete” flag can be selected to delete the detail records also.
Now, what if I don’t want to delete the detail records, but instead set the corresponding attribute (that points to the master) in this record to null.
For ex when deleting a department record, I need to set the “dpartmentId” field of all the corresponding employee records to null instead of deleting these records.
Is there a configuration that can be made to tell ADF automatically do this?
Thank you.

No, adf doesn't have such a mechanism. You can program it yourself by unsetting the cascade delete flag and before removing the master iterate over the child records and set the fk value to null.
Our you do this in the db using a trigger.  In this case you have to refresh the child vo too.
Timo

Similar Messages

  • LSMW- How to modify existing Master Records without using Recording/SBatch?

    Hi,
    Can anyone tell me of an alternative way to modify massive Vendor Master records except a transaction recording or Standard Batch Program?
    Actually my problem is that, i need to update Search Terms, whose lengths exceed the standard length for Search Terms.

    hi,
    use fm  ADDR_MAINTAIN_COMPLETE table ADDR1_DATA
    A.

  • Infotype to link Personnel Number with Vendor Master Record

    Hi All,
    pls help me what infotype to link Personnel Number with Vendor Master Record in AP module.
    Customer require when Create Employee then system automatic gernerate Vendor Master.
    pls help us.
    Thanks

    Hi,
    PRAA works absolutely fine. I have external number range for vendors.
    There is an option so that you can create HR accounts in vendor accounts
    Path:Accounting> Financial accounting>Travel
    management>Personal-Related Master Data> Create Vendors (tr.code PRAA)
    Look at this description:
    From the HR master data, this program creates a batch input session for
    maintaining person-specific vendor master records.
    The report can process vendor master records as follows:
    o Initial set up (create/add missing company code segment)
    o Uupdate (change completely according to vendor and HR reference)
    o Change (only according to HR master data, for example, name
    Block
    The following infotypes from HR master data are taken into account for
    the key date specified:
    o Actions (Infotype 0000)
    o Organizational Assignment (Infotype 0001)
    o Personal Data (Infotype 0002)
    o Permanent Residence (Infotype 0006 Subtype 1)
    o Bank Details (Infotype 0009 Subtype 0 or 2)
    All other required data is taken from a reference vendor that you can
    specify as a parameter when you start the program. Note that for the
    reference vendor, reference data must exist for all company codes that
    are applicable according to HR master data. Since program RPRAPA00 cannot
    assign vendor master record numbers externally when creating
    vendor master records, you must be sure that the reference vendor is
    assigned to an account group that requires internal number assignment.
    If no house bank is specified in the reference vendor, this is
    determined via feature TRVHB (Implementation guide for 'Travel Expenses'
    -> Transfer to Data Medium Exchange -> Set up Feature for Determining
    House Bank according to the employee's organizational situation.
    The link between the HR employee's master record and the corresponding
    vendor master record is set up by entering the personnel number in the
    company code segment of the vendor master record.
    General program flow
    Program RPRAPA00 creates a sequential work file in the specified
    directory. Ensure that you use a global directory that can be accessed
    by all application servers; a directory is automatically proposed. The
    work file is later transformed into a batch input session by the
    subsequent program RFBIKR00, which is started automatically.
    In test run mode this program delivers information messages which
    document the creation of a batch input session. Since each information
    message must be confirmed manually, the test run should only be
    performed for a small number of personnel numbers.
    In productive run mode, however, the program RFBIKR00 is automatically
    started as a job; the information mentioned above is stored in the job
    log in this case.
    Initial setup of vendor master records
    Corresponding vendor master records are created from the infotypes
    listed above and the non-HR-specific information from the reference
    vendor. During the process, the personnel number is stored in the
    company code segment of the vendor master record. Persons who already
    have a vendor master record with corresponding personnel number are
    rejected in this run.
    If a vendor master record already exists for a personnel number, but
    without a company code segment for the company code in which the
    employee exists at the key date entered, the program adds the required
    company code segment to the vendor master record. You must however
    activate the checkbox "Create new company code segment for existing
    vendor master records".
    The HR master data used is the info type record valid on the key date
    entered.
    Update of vendor master records
    The corresponding vendor master records are updated from the infotypes
    listed above and the non-HR-specific information from the reference
    vendor. Persons who already have a vendor master record with
    corresponding personnel number are rejected in this run. The system uses
    HR master data from the infotype records valid for the key date.
    Change vendor master records according to HR master data
    All HR-specific data is changed in the vendor master records for
    personnel numbers that have changes since the date recorded under '...
    with last change since'. The system uses HR master data again from the
    infotype records valid for the key date specified.
    Block vendor master records
    All vendor master records which correspond with the selected personnel
    numbers are blocked for posting.
    User exits
    For the following situations, two empty routines are supplied in the
    includes RPRAPAEX and RPRAPAEX&H5F001 which you can adapt to your
    requirements.
    o The employee's last name is entered in the sort field in the vendor
    master record. If you do not want this to happen, you can program
    the situation you want in the user exit routine
    'set&H5Fmc&H5Ffield&H5Fby&H5Fuser'.
    o If the address editing in the vendor master record does not suit
    your requirements, it can also be changed. For this purpose you have
    the user exit routine 'set&H5Faddress&H5Fby&H5Fuser'.
    o If you want to assign numbers to the vendor master records to be
    created via external number assignment (for example, vendor master
    record number &H3D personnel number), you can adjust the user exit
    routing 'SET&H5FVENDOR&H5FNO&H5FBY&H5FUSER' (in include RPRAPAEX&H5F00). Note
    that
    the account group of the reference vendor must also have external
    number assignment.
    Note that in each case a thorough knowledge of the programming
    language
    ABAP/4 is necessary.
    Set up vendor master records in a separate system
    The distribution of personnel master data from a HR system to an FI
    system is a prerequisite for creating, changing, and blocking vendor
    master records.
    In the section Master Data Distribution (link to separate HR unit) of
    the ALE IMG, an explanation is given regarding the way in which the
    FI
    System is supplied with the relevant employee data from the HR System
    In the FI System, report RPRAPA00 described here can be used to
    create,
    change, and block vendor master records.
    Other wise try with VPE1 t.code.
    Regards
    Devi

  • See my problem no master record move to next record

    hi master
    sir
    i have master detail block master table have all data but detail no data i need feed data in detail then i goto in detail block write value and press F10 for save
    for new record in detail
    in detail blick post-block or post_record or post_insert event i write this code
    go_block('masterblock');
    next_record;
    go_item('detailblock.item');
    but not responses no master block move to next record still and my curser sitll in last postion
    sir how i move master record after save the detail record and jump to detail block for new record
    please give me idea or code
    thanking you
    aamir

    thank for reply
    sir your help very usefull for my but when i press F10 then system show massage do you want to save change the record
    sir how i avoid that window and directly move to next record
    please give me idea
    thanking you
    aamir

  • Partner roles in Vendor master record

    Hi all
    can some one explain me how to enter the partner roles in vendor master record
    In sap help i didnt understood this point
    "When working with partner roles, you must maintain the following settings:
    Separate vendor master records must exist for all the partners of a vendor that are to be entered in that vendor’s master record."
    what does it mean
    suppose i am creating vendor master record 1234
    Vendor master record:1234
    LF 1234       /*vendor
    BA1234       /*ordering address
    i have to click 1234 in BA  and select 'parner' at the top to enter the ordering adress right ...
    what is the 'Separate vendor master records must exist for all the partners' mean
    it has to be like this?
    Vendor master record:1234
    LF 1234       /*vendor
    BA1235       /*ordering address
    1235 vendor master record is created earlier and ordering address maintained ??
    please help me in this record, any user manual or some screen shots to explain how to maintain partner roles in vendor master record
    regards
    Bhushan.N

    Hi Sasi ,
    What Ramkrishna explained is correct. I will try to illustrate it with the example.
    Suppose you  are creating a vendor 1234 which is Head office of the supplier where you need to place the order. But goods will be supplied from Pune plant so you should enter 1235 againts partner function GS , here 1235 is seperate  vendor master record with Pune plant details & it must exist in the system so that you can use it as a partner function Hope this has cleared your doubts.
    Similarly you vcan create other partner functions like payee,ordering party etc.
    Regards,
    Anand

  • Gl  master record with authorization group field, how to download this data

    Dear Experts
    I would like to  down load general ledger master record with the following details.
    gl account   
    text
    authorization group
    i did not find a way to down load this information with the values in the authorization
    group filed.
    submitted for experts advise and help.
    joyal
    Moderator: Please, use standard SAP reports/tables and search before posting

    Dear:
                       Please check
                       S_ALR_87012328 - G/L Account List
                       OB_GLACC13 - Descriptions
                       You can select Auth group from the selection in OB_GLACC13 - Descriptions  and download the same.
                        Regards

  • Derivation of juristriction code using state in customer master record

    Hi All
    Is there any way to derive juristriction code using state field in the customer master record without writing abap code.
    For exmple:
    If state of cutomer is NY then juristriction code should be defaulted as NY000000
    Thanks in advance

    Hi,
    It appears by your question, like there is one to one relationship between the state and the jurisdiction code. I am curious to know if you can create a CATT or LSMW program for customer master general data (KNA1) and just fill in state and jurisdiction code (fill in the values in excel) and then upload. You can easily apply an IF condition in excel for if state = NY then jurisdiction is xxxx. You may need one create program and one edit program. This is an easy solution rather than trying to automatically derive in SAP.
    Regards
    Sharabh

  • How to delete the master records when corresponding details records exist.

    What is the SQL statement to delete the records of master when the corresponding detail records are present.
    Note: No Cascade clause was used at the time of creation of referential integrity constraint.
    "M"- Master Table
    "D"- Detail Table
    I used, "Delete from M cascade". This statement is not working.
    Your favour in this will be deeply appreciated.
    Cheers
    PremChin

    Hi folk,
    i appreciate your suggestion,
    my crux of the situation is to know whether there is a way to make it without disabling,removing or modifying the referential integrity constraint.
    If so, modifying, please help me out how to modify the constraint in order to remove the master records keeping detail records in-tact.
    Cheers
    Premz

  • Can't delete master record when matching when matching detail record exist

    Hi
    on the rel. property:
    Delete Record Behaviour = cascading
    Prevent masterless Operation =yes
    Automatic Query = yesCan't delete Record Master & Detail...
    On delete getting error msg.
    Can't delete master record when matching when matching detail record exist
    am i missing something...!
    Regards,
    Abdetu...

    First of all, remember the ripple affect of cascading deletes and updates.
    Oracle database allows creating master/detail relationship between tables using foreign keys and allows cascading deletes by defining the FOREIGN KEY constraint with ON DELETE CASCADE clause.
    Oracle Forms on the other hand, handle cascade delete thing internally when you set the relation properties.
    Now if you have 3 tables with MASTER->DETAIL1->DETAIL2 relationship and you have a form defined with MASTER->DETAIL1 relationship only, it won't let you delete (and save) master or detail record since the third table (DETAIL2) is referencing the rows from DETAIL1 which you are trying to delete.
    If DETAIL2 were present on the form, it would have deleted with relation property CASCADING. If you really want that when you delete a master record, all its details should be deleted too, then consider defining FOREIGN KEY constraints with ON DELETE CASCADE and on the form set relation property CASCADING.
    And if all master/detail tables are on your form and still it is not allowing you to delete master with cascading, there must be some code preventing it. Check triggers like ON-DELETE, KEY-COMMIT etc what they are doing.

  • Delete master record if detail records are empty

    I have a simple question and response system
    the user enters their details (record stored in table called source - pkey as id_src)
    the user then goes on to answer questions (in a form)
    those responses are kept in a separate table (responses)
    with a foreign key in each response row telling me the ID of the source ie fk_id_src
    the form has a SUBMIT and CANCEL button
    PROBLEM
    If a user registers their details (created a source record with an ID)
    but fails to answer and questions (the response table does not have any foreign keys to that ID source)
    what is the best way to AUTOMATICALLY delete the user record (if there are no detail records in the response table)
    (note: the main response form IS NOT an ADDT form)
    the checking process needs to be triggered by the CANCEL button
    ie if the user presses submit - responses will be made to the questions - ie they will be empy answers - but in this case it is valid to do so
    I was wondering about a custom transaction - with delete SQL -
    or using check detail records - but cant see how to get that to fire the delete record transaction?
    any guidance appreciated
    tia
    Paul

    OK
    I can create a separate page that checks if a detail record exists
    and display an error if it does
    on the same page I can add a delete transaction
    pass the master record id
    Both work, all OK so far
    BUT, the check detail throws its error message if detail records DOES EXIST
    I need to allow the delete transaction to run, if detail records DO NOT EXIST
    AND then
    redirect then page - wether the delete occurs or not
    any ideas?
    Paul

  • Master deletion whil detail exists

    In BC4J how can I implement that user will not be able to delete master record if its detail records exist. I know this behaviour can be implemented by using Composition Association. But, as far as I learned, one child table cannot have more than one parent associated via composition association.
    My question is that how can we implement this behaviour in normal association ????

    But, as far as I learned, one child table cannot have more than one parent associated via composition association. Who told you that? I'm using one detail with multiple masters in a composition association and it works well.
    Maybe you should also have a look at Re: customized download function no longer working after last db recovery to get the trick. Look at the last reply.
    hope this helps
    Frank

  • Delete classification from specific customer master records

    We utilize customer master classificaitons to house cost centers specific to certain customers.  Most of them default and do not require this set-up.  I need to remove it for a few select customers, but cannot find instructions on removing the classification from the customer master record altogether, once it has been set up.  I can blank out the value, but i would really like to go the next step.

    Hello,
    Can you please confirm if it is XD02 ? As you can delete classification from the customer using that. But please provide more details on what customer data it is ?
    Thanks
    Amber

  • How to delete a master record with transaction data?

    Hi,
        Iam able to delete master record(GL/Vendor/Customer)through OBR2 when there is no transaction data in those respective master records. Despite of clearing all open items in a particular vendor Account, Iam unable to delete that master record. Please suggest me how we can delete vendor master data having transactional data.
                               Thanks in Advance
    Regards,
    Satish

    Hi...
    Not sure whether this helps....you can mark the vendorrecord for deletion and later try to delete it.
    Logistics >> Materials management >> Purchasing >>
    (new menu) Master data >> Vendor >> Central >> Flag for deletion
    try using XK06/FK06
    Assign points if useful
    Regards
    Aravind

  • Can VMD_EI_API handle Create, Edit, and Delete Vendor Master records?

    Hi Everyone,
    I have a development that requires to create, edit, and delete vendor master records through a webportal ui. Technically, it will be a background process in SAP because it must not have a dialog screen. In my search so far, there is no standard BAPI or Function module that can handle this one.
    Can the class VMD_EI_API handle the requirements?
    Regards,
    John

    Hi,
    Yes, You can use this class to create/modify/delete vendor master data. You can find in SCN documents with example how use it.
    Jarek

  • Delete Vendor Master Records

    Hi,
    I am deleting the vendor master records by using xk06 (mark for deletation) but this is individual marking. i would like to delete 500 vendors at a time not one by one
    i am also using OBR2 for the same but i am not so clear about that how it is working, this solve my problem but i am not aware of working of this Tcode please suggest me the concept of the same.
    Regards,
    Pankaj

    Hi Buddy,
    try t-code XK99- Mass maintenance of Vendor Master
    1. select the fields tab
    2. select the Deletion Flag-LFA1-LOEVM, then execute
    3. select the multiple selection, then from here you can either insert a textfile (see green call-outs icon) or paste the Vendor codes directly. execute again
    4. select central deletion flag (X)
    5. press fill down icon (the column), then save
    after this you can validate your changes in XK06
    hope this help you.
    regards,
    Maia
    Edited by: Maia on Apr 17, 2008 5:03 PM

Maybe you are looking for

  • S_ALR_87012083: incorrect (sub)totals in exported excel

    Hi, We run S_ALR_87012083 to do vendor line item analysis. Standard the report subtotals on Vendor, G/L account, Company Code and Currency (in this sequence). Sort order Ascending: Company Code, G/L account, Vendor, Special G/L indicator, Assignment,

  • Cross Frame Remote Scripting  = Access Denied with servlets

    In a Nutshell what I'm trying to accomplish is to update some data in a web page by posting to a servlet and not reload the whole page. So I created an <IFRAME> to do the dirty work. I am using javascript/dom to copy data from the <IFRAME> to the par

  • Parameter in view

    Hi, I am totally confused. I am trying to create a report which uses 3 parameters. The user uses 2 parameters to get the 3rd parameter. the 3rd parameter is also being used in creating view. The report uses the view to get the data for the report. I

  • How to use clamav anti-virus for Red Hat linux

    I wanted to know how to use clamAV anti-virus solution for RHEL 5.X. I tried to find it online but the information does not seem consolidated. I wanted to understand how to install and use it to scan the system. Requesting a reply to my query. Regard

  • How to Get IMEI number

    is there any code available for gettin the imei number internally