Mobil ITS servisi oluşturma

ITS, aşağıdaki avantajlara sahip mobil cihazlarda ABAP uygulamalarıdır:

Tüm uygulama ABAP çalışma tezgahı kullanılarak geliştirilebilir.
SAP GUI, Windows için ABAP hata ayıklaması yapmak için kullanılabilir ve sistem manzara karmaşık değildir.
Şablonlar ve oluşturulan HTML, işletme gereksinimlerine göre özelleştirilebilir.
Uygulamada cihaz türlerine göre HTML veya JavaScript kullanılabilir.
ITS mobil 1D ve 2D barkod tarama ile veri girişini destekler.

Farklı tarayıcı türleri:

Pocket Browser
Wavelink Industrial browser
Internet Explorer

Adımlar
1.Internet hizmetini oluşturma: SE80 ->Package ->Create->Other->Internet Service (Servis ismi kullanılacak t-code ile aynı ad olabilir).
2.Programdaki ekranların şablonlarının oluşturulması: SE80->Program-> Screen (Her ekrana ayrı ayrı)->Other Function->Create Template (Servis adı ve tema 99, stil No HTML table).
3. Internet Servisini yayına alma: SE80->Package->ITS Service->Service File + Complete Service (Parametre: ~TRANSACTION).
4. ICF bağlantısını yaratma: SICF:default_host/sap/bc/gui/sap/its ->New Sub-Element-> Service Data: GUI configuration (params:~ITSMOBILE: ~TRANSACTION: ~THEME:)+ Handler List(CL_HTTP_EXT_ITS ). + Error Pages: Sistem oturum açma->Servise özgü ayarlar
Save.Activate.Test Service.
se80->ITS Service->Start Service
https://blogs.sap.com/2015/02/09/sample-its-mobile-application/

VisualStudio 2008 Smart Device Project SQL bağlantısı TextBox

Public Class Form1
Dim SqlConnStr As String = “server=192.168.0.144;database=TEST;uid=fdonmez;pwd=2051970025;”
Dim SqlConn As New System.Data.SqlClient.SqlConnection(SqlConnStr)
Dim kullanici As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conf, pos, ckont As String

If TextBox8.Text <> “” Then
TextBox8.Text = UCase(TextBox8.Text)
ckont = Mid(TextBox8.Text, 1, 1)
If ckont = “C” Then
conf = Mid(TextBox8.Text, 2, 8)
pos = Mid(TextBox8.Text, 10, 8)
Else
conf = Mid(TextBox8.Text, 1, 8)
pos = Mid(TextBox8.Text, 9, 8)
End If
SqlConn.Open()
Dim mySelectQuery As String = “SELECT CONFIRMATION,CONFIRMPOS,MATERIAL,VOPTIONS,QUANTITY,QUNIT,BATCHNUM ,PROJECT,INVDOCTYPE,INVDOCNUM,INVDOCITEM,WAREHOUSE,STOCKPLACE,B.STEXT BEDEN,R.STEXT RENK FROM IASINVITEM WITH (NOLOCK),IASVAROPTIONX B WITH (NOLOCK), IASVAROPTIONX R WITH (NOLOCK) WHERE (INVDOCTYPE = ‘IG’ OR INVDOCTYPE = ‘BG’ OR INVDOCTYPE = ‘TR’ ) AND QPOSTWAY = 0 AND ISCANCELED = 0 AND (TRANTYPE = ‘ISG’ OR TRANTYPE = ‘BLG’ OR TRANTYPE = ‘TRF’ ) AND WAREHOUSE <> ’300′ AND CONFIRMATION = ‘” & conf & “‘ AND CONFIRMPOS = ‘” & pos & “‘ AND CREATEDAT IN ( SELECT MAX( CREATEDAT ) AS CREATEDAT FROM IASINVITEM WHERE( INVDOCTYPE = ‘IG’ OR INVDOCTYPE = ‘BG’ OR INVDOCTYPE = ‘TR’ ) AND QPOSTWAY = 0 AND ISCANCELED = 0 AND (TRANTYPE = ‘ISG’ OR TRANTYPE = ‘BLG’ OR TRANTYPE = ‘TRF’ ) AND WAREHOUSE <> ’300′ AND CONFIRMATION = ‘” & conf & “‘ AND CONFIRMPOS = ‘” & pos & “‘) AND B.VARIANTKEY=’RB’ AND B.ATTRIBUTEKEY=’01′ AND B.OPTIONKEY=SUBSTRING(VOPTIONS,4,2) AND R.VARIANTKEY=’RB’ AND R.ATTRIBUTEKEY=’02′ AND R.OPTIONKEY=SUBSTRING(VOPTIONS,10,3);”

Dim SqlComm As New System.Data.SqlClient.SqlCommand(mySelectQuery, SqlConn)

Dim reader As System.Data.SqlClient.SqlDataReader
reader = SqlComm.ExecuteReader()
While reader.Read()

TextBox8.Text = “”
TextBox1.Text = reader(“CONFIRMATION”).ToString() + reader(“CONFIRMPOS”).ToString()
TextBox2.Text = reader(“MATERIAL”).ToString()
TextBox3.Text = reader(“RENK”).ToString()
TextBox4.Text = reader(“BEDEN”).ToString()
TextBox5.Text = reader(“BATCHNUM”).ToString()
TextBox6.Text = reader(“QUANTITY”).ToString()
TextBox9.Text = reader(“INVDOCTYPE”).ToString()
TextBox10.Text = reader(“INVDOCNUM”).ToString()
TextBox11.Text = reader(“INVDOCITEM”).ToString()
TextBox7.Focus()

End While

SqlConn.Close()

Else
If TextBox6.Text <> “” Then
SqlConn.Open()
If TextBox7.Text <> “” Then
TextBox6.Text = TextBox6.Text + TextBox7.Text / 12
End If
If TextBox12.Text <> “” Then
TextBox6.Text = TextBox6.Text – TextBox12.Text / 12
End If
Dim mySelectQuery As String = “UPDATE IASINVITEM SET CHANGEDBY=’PARCA’ , QUANTITY=’” & TextBox6.Text & “‘,SKQUANTITY=’” & TextBox6.Text & “‘ WHERE INVDOCTYPE=’” & TextBox9.Text & “‘ AND INVDOCNUM=’” & TextBox10.Text & “‘ AND INVDOCITEM=’” & TextBox11.Text & “‘;”

Dim SqlComm As New System.Data.SqlClient.SqlCommand(mySelectQuery, SqlConn)
SqlComm.ExecuteNonQuery()
SqlConn.Close()
Else
MessageBox.Show(“barkod okutun”)
End If

End If
TextBox7.Text = “”
TextBox8.Text = “”
TextBox12.Text = “”

 

End Sub

Private Sub TextBox8_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox8.GotFocus
TextBox1.Text = “”
TextBox2.Text = “”
TextBox3.Text = “”
TextBox4.Text = “”
TextBox5.Text = “”
TextBox6.Text = “”
TextBox7.Text = “”
TextBox9.Text = “”
TextBox10.Text = “”
TextBox11.Text = “”
TextBox12.Text = “”
End Sub

Private Sub TextBox8_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox8.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then
Button1_Click(sender, New System.EventArgs())
End If
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

TextBox2.Text = “”
TextBox3.Text = “”
End Sub

Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
Me.Close()
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox8.Focus()
Try
SqlConn.Open()
Catch ex As Exception
MessageBox.Show(ex.Message, “baglantı yok”)

Me.Close()
End Try
If SqlConn.State = 1 Then

Me.Text = “sql bağlandı”
End If
TextBox1.Text = “”
TextBox2.Text = “”
TextBox3.Text = “”
SqlConn.Close()
End Sub

Private Sub TextBox8_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox8.TextChanged
TextBox1.Text = “”
TextBox2.Text = “”
TextBox3.Text = “”
TextBox4.Text = “”
TextBox5.Text = “”
TextBox6.Text = “”
TextBox7.Text = “”
TextBox9.Text = “”
TextBox10.Text = “”
TextBox11.Text = “”
TextBox12.Text = “”
End Sub

Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox7.TextChanged
kullanici = “PARCAGIR”
End Sub

Private Sub TextBox12_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox12.TextChanged
kullanici = “PARCACIK”
End Sub
End Class

Visual Studio 2008 mobile sql server insert

Public Class Uretim_Giris
Dim SqlConnStr As String = “server=192.168.0.144;database=ALIM;uid=HALI;pwd=01234;”
Dim SqlConn As New System.Data.SqlClient.SqlConnection(SqlConnStr)
Dim Readerim As System.Data.SqlClient.SqlDataReader
Dim SqlComm As New System.Data.SqlClient.SqlCommand(“”, SqlConn)

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
Me.Close()

End Sub

Private Sub editpersonel_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles editpersonel.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then
editbarcode.Focus()
End If
End Sub

Private Sub editbarcode_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles editbarcode.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then
editmiktar.Focus()
‘editmiktar.SelectedText(“3″)
End If
End Sub

Private Sub Uretim_Giris_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
editpersonel.Focus()
End Sub

Private Sub editmiktar_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
Dim hatasayisi As Integer
Dim girilensayi As Double
hatasayisi = 0

If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then
girilensayi = editmiktar.Text
ElseIf (editbarcode.Text = “”) Then
editbarcode.Focus()
editbarcode.Text = “bos”
hatasayisi = hatasayisi + 1
ElseIf (editpersonel.Text = “”) Then
editpersonel.Focus()
editpersonel.Text = “bos”
hatasayisi = hatasayisi + 1
ElseIf girilensayi < 0 Then
‘editmiktar.Focus()
hatasayisi = hatasayisi + 1
End If

If hatasayisi = 0 Then
MenuItem1.Enabled = False
MenuItem2_Click(sender, e)

End If
End Sub

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click

Dim hatasayisi As Integer
Dim girilensayi As Double

hatasayisi = 0
girilensayi = editmiktar.Text
MenuItem2.Enabled = False

If (editbarcode.Text = “”) Then
editbarcode.Focus()
editbarcode.Text = “bos”
hatasayisi = hatasayisi + 1
ElseIf (editpersonel.Text = “”) Then
editpersonel.Focus()
editpersonel.Text = “bos”
hatasayisi = hatasayisi + 1
ElseIf girilensayi < 0 Then
editmiktar.Focus()
hatasayisi = hatasayisi + 1
End If

If hatasayisi = 0 Then
MenuItem1.Enabled = False
End If
If hatasayisi = 0 Then
SqlConn.Open()
‘Me.Tag = Me.Tag + 1
‘ Me.Text = “kaydetke” & Me.Tag ‘bu kodu sonraq kaldır
Me.BackColor = Color.DarkRed

SqlComm.CommandText = “INSERT INTO T_PERSONEL_URETIM (PERSONEL,MATERIAL,MIKTAR) VALUES (‘” & editpersonel.Text & “‘,’” & editbarcode.Text & “‘,’” & girilensayi & “‘)”
SqlComm.ExecuteNonQuery()
editpersonel.Text = “”
editbarcode.Text = “”
editmiktar.Text = “0,0″
MenuItem1.Enabled = True
editpersonel.Focus()

SqlConn.Close()

Me.BackColor = Color.DarkBlue
End If

MenuItem2.Enabled = True
End Sub
End Class