LSMW

Legacy System Migration Workbench (LSMW) is handy tool for data uploads. In most of the big projects there is a separate development / data migration team is available. However, at times, it would be responsibility of the functional consultant to load the data such as vendor master, customer master and asset master etc. It would be real handy for a functional consultant to know LSMW (at least recording method) and it would help them to successfully complete the task. Hope this document would help many of our functional consultants, as I am seeing number of questions around LSMW. The simple rule is: Follow this document and practice is for number of times possible, then you will become master

http://scn.sap.com/docs/DOC-46251

http://www.saptechnical.com/Tutorials/LSMW/LSMWMainPage.htm

 

 

SmartForms vs StreamServe

SmartForms is SAP’s out-of-the box forms solution (successor of SAPScript).

However in some situations SmartForms is not enough. For example you might need extended printer driver support, extended barcode format support, advanced business graphics, white space management, post processing etc, etc.

In this case you can use StreamServe (a SAP Endorsed Business Solution) as a complementary product to handle document output (both printed and electronic) from SAP. Seehttp://streamserve.com for some background. In this case you normally reuse some standard SmartForm / SAPScript / PDF-based print form in your system for which you enable raw data output (XSF, RDIĀ  or XFP respectively), and use your existing forms to provide data to StreamServe. Technically you would typically set up StreamServe as an output device in the Spool Administration and just print your document to the “StreamServe printer”

http://help.adobe.com/en_US/productionprint/8.2/StreamServe_Connect_for_SAP_E-docs.pdf

Call UOMSelect

Script

Private Sub btnUOM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUOM.Click
frmUOMSelect.ShowDialog()
If frmUOMSelect.isOK Then
If cboUOMKey.Items.Count = 0 Then
fillUOM()
For i = 0 To uomView.Table.Rows.Count – 1
cboUOMKey.Items.Add(uomView.Item(i).Item(“uomkey”).ToString)
Next
End If
cboUOMKey.Text = frmUOMSelect.selected_uom
End If
End Sub

 

Example for select

It’s example for help search in datagridview.

Capture

Script :

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Windows.Forms
Public Class frmUOMSelect
Dim strCon As String
Dim uomView As DataView

Public isOK As Boolean = False
Public selected_uom As String = “”
Private Sub frmUOMSelect_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
fillUOM()
DataGridView1.DataSource = uomView
DataGridView1.RowHeadersVisible = False
DataGridView1.Columns(0).HeaderCell.Value = “UOM Key”
DataGridView1.Columns(1).HeaderCell.Value = “UOM Description”
End Sub
Private Function fillUOM() As Boolean
strCon = modDataSource.strCon_Online
Try
Dim cn As New SqlConnection(strCon)
cn.Open()

Dim strSelect As String = “select uomkey,uomdescription from uom”
Dim dscmd As New SqlDataAdapter(strSelect, cn)

Dim dtable As New DataTable()
dscmd.Fill(dtable)

uomView = New DataView(dtable)
cn.Close()
fillUOM = True
Catch ex As Exception
MsgBox(“Connection to database online failed.”)
fillUOM = False
End Try
End Function
Private Sub filterUOMView()
Dim fltstr As String = “”
If txtUOMDescription.Text <> “” Then
fltstr = “uomdescription like ‘%” & Trim(txtUOMDescription.Text) & “%'”
End If
If txtUOMKey.Text <> “” Then
If fltstr <> “” Then
fltstr = fltstr & ” and ”
End If
fltstr = fltstr & ” uomkey like ‘%” & Trim(txtUOMKey.Text) & “%'”
End If
uomView.RowFilter = fltstr
End Sub

Private Sub btnSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelect.Click
isOK = True
Dim idx As Integer = DataGridView1.CurrentRow.Index
selected_uom = uomView.Item(idx).Item(“uomkey”).ToString
Me.Close()
End Sub

Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
Me.Close()
End Sub

Private Sub txtUOMKey_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUOMKey.TextChanged
filterUOMView()
End Sub

Private Sub txtUOMDescription_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUOMDescription.TextChanged
filterUOMView()
End Sub
End Class

 

Populate combobox from database vb.net

Call to populate

fillUOM()
For i = 0 To uomView.Table.Rows.Count – 1
cboUOMKey.Items.Add(uomView.Item(i).Item(“uomkey”).ToString)
Next

Function to fill

Private Function fillUOM()
strCon = modDataSource.strCon_Online

Try
Dim cn As New SqlConnection(strCon)
cn.Open()

Dim strSelect As String = “select uomkey,uomdescription ” _
& “from uom”
Dim dscmd As New SqlDataAdapter(strSelect, cn)

Dim dtable As New DataTable()
dscmd.Fill(dtable)

uomView = New DataView(dtable)
cn.Close()
fillUOM = True
Catch ex As Exception
MsgBox(“Connection to database online failed.”)
fillUOM = False
End Try

End Function