Skip to Content
avatar image
Former Member

Mass Delete of BDocs in SAP CRM system

Dear SDC team,

We like to hard delete some BDocs which are hanging in the txn SMW01 in CRM 5.2 system.

As of now we do not see a option to delete these unnecessary BDocs, as they are in Intermediate state (I04) .

Please tell us if there any standard report which can be used to do Mass Delete of BDocs in SAP CRM system.

Or Is there any Tables which need to be emptied .

Please help ..Points would be rewarded .

Regards

Ritvij

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    May 08, 2008 at 01:08 PM

    Go to transaction smq2 and select the queue and delete it.

    or run programs RSTRFCIDS and enter your criteria in selection screen.

    Hope this will help.

    Thank you.

    Cheers,

    Ashish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2008 at 02:36 AM

    hi

    Concerning the BDOCs without error, there is a job that you can schedule to run daily that cleans the BDocs processed without errors from the database.

    The details of this job are:

    Job name: SMO6_REORG

    Job program: SMO6_REORG

    Variants: SAP_MW_REORG

    Trace data (days to hold): 7 (recomended by SAP)

    Trace log (days to hold): 7 (recomended by SAP)

    Period: daily.

    Besides i should tell you I looked through Help and there are no best practices that I could find.We went through this process at one of my clients. They had 40,000 pluserror'd BDOCs and thousands of processed ones. The Middleware guycreated a program to delete the BDOCs that were over 2 months old andhad completed successfully to prevent the further build up of theseBDOCs. SAP Help says they are marked for deletion after they areprocessed, but it doesn't look like they get removed as wanted..

    From SAP Help:

    Deleting Processed BDoc Messages

    1. Processed BDoc messages cannot be archived.

    2. BDoc messages that have been processed successfully are marked fordeletion.

    Procedure

    To delete processed BDoc messages choose Architecture and Technology >Middleware > Message Flow > Delete Processed BDoc Messages

    The messages you selected will be deleted.

    and regarding deletion of non errant Bdocs

    Usually there are two schools of thought on this issue:

    1) Make the hard decision to go back to the beginning and startcorrectly all the things that caused these to error out (bank codes, taxcodes, config on R/3 side but not on CRM side, etc.). Then these can bereprocessed and everything will be brought up to date in the system.This takes time and may neccesistate hiring a Middleware resource for ashort term to help go through the process. The big part of this isidentifying those config items that are out of synch between R/3 andCRM.

    2) The other way to handle these is to go through the errors quickly,gain an insight into the cause of the errors, and correct the bigthings. Delete all the old error'd BDOCs and then bring down all the bigitems again - BPs, Sales orders, products, and so forth. This is muchfaster process, but has it's own risks and problems vs Option 1 above.As these items come in, if you haven't fixed the config problems, theywill error out again. It's a fix and move - fix and move process. In theend you may have some missing data still, but the time commitment ismuch lower. You just need to get leadership's buy-in to this process.

    Those error'd BDOCs are a problem and point out all the datainconsistencies that exist in the system. They are also a drag onperformance and need to be processed one way or another. After that,keeping them under a "1000" number is imperative. If you don't, theproblem will get away from you again.

    finally Some Transaction Codes that people might find useful for working withBDOCs:

    SMW01 Display BDocs

    SMW02 Display BDoc Summary

    SMW02A BDoc Messages: Show Top N Errors

    SMW03 Show stats of unproc. BDoc messages

    SMW10 Bdoc structure chekker

    SMW19 Copy BDoc and process

    SMW20 Process BDocs

    SMW3EX1 Flow Carrier Example

    SMW3FDBDOC Maintain Bdoctype dep. Flows

    SMW3FDCUST Maintain Customer Flows

    SMW3FDIF Maintain Bdoctype dep. Attributes

    SMW3FDSTD Maintain Standard Flows

    SMW3RBM Convert BDoc Messages to XML

    SMW3RC BDoc Message Error Recovery

    SMW3RCW BDoc Message Error Processor

    SMW3STOP1 General Stop Configuration

    SMW3STOP2 BDoc Type Stop Configuration

    SMW3WD Watchdog for failed BDoc Messages

    SMW3_00 BDoc Type Settings

    SMW3_GSB Generic Bridge Activation

    SMW3_GSB2 Generic Synch. Bridge Configuration

    SMW3_GSB_SHOW Display Generic Synch Bridge Config

    SMWMBSTATDISP BDoc statistics

    hope info will help your cause,i told all this coz before deleting the Bdocs complete understanding of the errant and non errant Bdocs is necessary,

    best regards

    ashish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2008 at 05:41 AM

    Hi Ritvij,

    In transaction /nSMW01 you can select those BDOCs state and press F8. You will get the list of all those BDOCs. Then on the left hand side ( just before the state header) you have a select all button. Select all the BDOCs and delete them by pressing the delete button from the application toolbar.

    otherwise

    The program running behind is "RSMW_SHOW_BDOC".

    Are you facing any problem selecting the BDOCs with No limitation instead of selecting one daya at a time. If not then select with the selection criterial "No Limitaiton" and then delete all of them in one short.

    If not then use the program "RSMW_SHOW_BDOC" logic and write your own program.

    Award points if helpful

    Regards

    Manohar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2008 at 07:54 AM

    Hi,

    Use the report settings mentioned by Ashish, but instead use program SMO6_REORG2. This is the new and improved version of the report he mentioned.

    Kind regards,

    KZ

    Add comment
    10|10000 characters needed characters exceeded