Skip to main content

How to use MS Word Mail merge to do mass updates in SAP

This article explains the step by step, a simple and effective trick to do mass updates/creations on SAP configurations. In many cases this can potentially save couple of days. Conceptually it is very simple. Many IT professionals know how to use mail merge. For an SAP consultant, BDC is not a news. This will explain the steps to create a BDC session using recording and mail merge.

1. Prepare the data First step is to prepare your data. It is easy to explain using an example. We will use IMG configuration for MRP Controller. We will use Name and telephone field of the MRP controller. The data to be created will be created as an excel sheet. Let us save this file as mrpc.xls







  • Next step is to create the recording. Before proceeding, decide your naming conventions. This will help you in troubleshooting and analysis. We will be creating 3 files, The basic recording as a text file The mail merge document as a word document Finally the merged bdc session as a text file. I use r_xxxx .txt (xxxx tcode or some other meaningful name) for basic recording, mm_xxxx.doc for the mail merge document and bdc_xxxx.txt for the merged session. To create the recording, you need to know the tcode. Most of the consultants are used to navigating using menu. Some experienced consultants know the tcodes by heart. It is easy to find the tcode. In the IMG screen>Additional Information>Additional Information>Display Key>IMG Activity. This will display the tcode of the specific IMG activity.
  • Another point before actually proceeding to create the recording, it is better to create one MRP controller normally to create the transport request. If the transport request is already created or if you can create the transport request manually then this is not required. 
  • Create the recording using the tcode SHDB. IN SHDB>New Recording, enter recording name and the tcode OMD0. Click Start Recording. You will get the actual MRP Controller maintenance screen. Create a new MRP Controller. When the transaction is completed, you will see the recording in the SHDB screen. Export the transaction to the desktop as a text file r_OMD0.txt. 
  •  Next step is to prepare the mail merger document. Open r_omd0.txt in ms word. You will see the text wrapped in 2 lines looking clumsy. Not to worry. Select File>page Setup. Choose paper size A3, orientation landscape and all margins as 2.5cm. EDIT>Select all and change font size to 6. If the display is very small, change zoom setting to 150%.



2. Mail Merge With the file in the MS Word, select menu option tools>mail merge. Click on create and select form letters. Select active window to use the current document. The Get data button will become active now. Click get data>open data source and select your excel file you created in step 1 (mrpc.xls). A window will appear with the button . Click on this button will take you to the main document. In this step you have to link the excel sheet fields to the place in document, so when the mail merge is executed, the main document contents are repeated for each record in the excel sheet replacing the linked field with values from excel sheet. The mailmerge tool bar should appear. If not select view>toolbars>mail merge. All the fields that needs to be linked will be in the right hand side end in the recording. Highlight the plant number, click on from the tool bar and select plant. The plant number will be replaced with <>, indicating that it is a merge field. Like this insert the merge fields where ever required. Sometimes the same fields might appear in multiple lines. The merge field needs to inserted in all the lines. Now click on button, enter the parameters in the window and click in the window. A new document window will open and create the merged document. Save this file as text document. You can use md_omd0.txt as the naming convention.

3. Run the Update Login to configuration client and run tcode SHDB>new recording. Enter a name in recording field and leave the transaction code field blank and click on green tick. Click on icon to import the recording. In the file open dialog select the text file created in step 2 (md_omd0.txt). Click to run the bdc session. An update: This can be used for any transaction that can be done using BDC. In case you are building a mail merge document with large volume of data, then it is better to save the imported mail merge file in SHDB  and create a session for that. This session in SM35 can be executed in background, which will run undsiturbed even if you close the SAp session.

4. Finishing touches
Also it is a good practice to save the mail merge document of step 2 as a word document. In case you want to come back later and redo it.

Comments

Popular posts from this blog

Vendor Consignment Business Process

Wikipedia offers a very simple definition for consignment . It is a process of placing a thing in the hand of another, but retaining the ownership until the goods are sold or used. In SAP consignment business process can be implemented very easily using the following steps. Activate Consignment inforecords using tcode OMEV. This activates the consignment prices to be picked up using the consignment info records. configure a special procurement type using IMG->Production->MRP->Master Data->Define special procurement type. In OBYC configure the consignment payables account (transaction KON). Assign the special procurement type created in step 2 to all the materials that are to use the consignment process. This is done in the MRP2 view of the material master maintenance transaction Create Consignment info record using tcode ME11. Select info category as consignment. Create general data, Purchase Org data and conditions. Conditions allow you to create time dependent prices. Cre

Stock Differences in HU (Handling Unit)

This blog post might help you to solve the problem with these messages. HUGENERAL 017 Handling unit &1 has the status "goods issue posted", cannot be changed HUFUNCTIONS 251 No posting-relevant material items could be found Many times it happens that the standard functionality provided by SAP is not sufficient. IN HU if customisations have been done, it is possible that, you end up with some data inconsistancy. The worst part about this is that not much is available in SAP or even internet. I learnt these hard way. The solution might look very simple, but it has consumed quite a lot of tense days. This could be due to some MDE customisations also. The above messages might appear if you are trying to transfer HU from blocked to unrestricted or vice versa using VLMOVE. Or if you are trying to pick a HU from stock. What happened in my case is that the inventory stock was transferred to Blocked stock, but the HU was not updated. So, the following standard transactions gives

LSMW Tip

This tip is very useful for Master Data LSMWs that updates many fields. Usually it happens that during a specific project we realise a need to update specific fields. We design these LSMWs in such a way that these values supplied in the input file is updated in the master file. Later on we try to reuse the LSMW for updating a subset if these fields. If we leave the values of other fields blank in the input file, depending on how the LSMW conversion rules were designed, the the master data will be updated with initial values. Common practice in many organisations is to create a new LSMW for the new set of fields. This is not required if the LSMW uses Direct Input. Direct input uses a special character to denote no value. The default is "/". This allows us to reuse the LSMW. Reformat the input text file and fill fields that are not to be disturbed with this character. For example if the LSMW is for updating the following fields 1. storage bin 2. picking area 3. reord