Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
This method can be used as an alternative to BDC for small data updates in SAP. Standard SAP method
like BDC, BAPI etc.. are always recommended for data upload over this method and should be used.(But
always good to have some extra knowledge). This method do not required any TR creation as it do not
generate any SAP code.
Step 1:
Login into SAP and click on Script Recording and Playback under Customization Local Layout from menu
bar.
If the option of Script Recording and Playback is deactivated, then you need to system parameter to
enable it.
Save and re-login. Script Recording and Playback should be activated now.
In this step we will be recording the transaction, something similar to what we do in Tcode SHDB.
For recording the Tcode, click on the record button on the popup.
Once you will click on it you will be able to see Script Icon in SAP windows,
Demo Scenario: We want to change the description of multiple materials using MM02(basic view). Value
of new description is maintained in EXCEL.
Recording Steps:
Once this step is done, script will be saved on your given location.
Step 3:
Once script is created, you can test it by clicking on Play button on Popup. You need to locate the
recorded script. Change description of material using MM02 for which recording is done and execute the
script. As a result material description will be changed to the description you have given while recording.
To see the content of the generated script, right click on script and click on edit, or open the Script in
Notepad.
In this script I have highlighted the values that we have entered for doing this transaction.
MM02(Tcode), 1001007(Material) and Test Descrp(Description).
Material and description we need to pick from excel and pass it to transaction MM02. Below is the code
you need to add in script to achieve this.
Dim objExcel
Dim objSheet, intRow, i
Set objExcel = GetObject(,"Excel.Application")
Set objSheet = objExcel.ActiveWorkbook.ActiveSheet
For i = 2 to objSheet.UsedRange.Rows.Count
session.findById("wnd[0]/tbar[0]/okcd").text = "mm02"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtRMMG1-MATNR").text = COL1
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[1]/usr/tblSAPLMGMMTC_VIEW").getAbsoluteRow(0).selected = true
session.findById("wnd[1]").sendVKey 0
session.findById("wnd[0]/usr/subSUB2:SAPLMGD1:8001/tblSAPLMGD1TC_KTXT/txtSKTEXT-MAKTX[1,0]").text = COL2
session.findById("wnd[0]/usr/subSUB2:SAPLMGD1:8001/tblSAPLMGD1TC_KTXT/txtSKTEXT-MAKTX[1,0]").setFocus
session.findById("wnd[0]/usr/subSUB2:SAPLMGD1:8001/tblSAPLMGD1TC_KTXT/txtSKTEXT-MAKTX[1,0]").caretPosition = 12
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[1]/usr/btnSPOP-OPTION1").press
session.findById("wnd[0]/tbar[0]/btn[3]").press
Step 4:
Final step is to test the script.
● Keep the excel sheet with data open. It should be the only excel sheet open on your system.
● Login into you SAP system and open the popup for Record and Playback.
● Click on play Icon and locate your script.
● You can get some warning message, click ok on it.
● If everything is fine, you will be able to see recoding being played for all the materials you have
provided in excel sheet.
● At the end you will get message, “Process Completed”.