SAP Controls im Eigenbau SAP-Controls im Eigenbau Enno Wulff Seite 5 von 40 Enno Wulff

  • View
    1

  • Download
    0

Embed Size (px)

Text of SAP Controls im Eigenbau SAP-Controls im Eigenbau Enno Wulff Seite 5 von 40 Enno Wulff

  • SAP Controls im Eigenbau Erstellung von ActiveX-Controls in

    Visual Basic und Einbindung in SAP

    Inhaltsverzeichnis 1. Einleitung ........................................................................................................................................ 4

    1.1. Für wen ist dieses Buch? ......................................................................................................... 4

    1.2. Was sind OCX/ ActiveX-Controls? ........................................................................................ 4

    1.3. Bedeutung der GUI Controls ................................................................................................... 4

    1.4. Nachteile von Controls ............................................................................................................ 4

    1.5. Grenzen der SAP-Controls ...................................................................................................... 4

    1.6. Möglichkeiten durch eigene Controls ..................................................................................... 4

    1.7. Nachteile von eigenen Controls............................................................................................... 5

    1.8. Unbehandelte Themen ............................................................................................................. 5

    1.8.1. SAP Dataprovider ............................................................................................................ 5

    1.8.2. Drag and Drop ................................................................................................................. 5

    2. Grundlagen Visual Basic ................................................................................................................. 5

    2.1. Entwicklungsumgebung .......................................................................................................... 5

    2.2. Elemente eines Controls .......................................................................................................... 6

    3. Erstellung......................................................................................................................................... 6

    3.1. Was haben wir vor? ................................................................................................................. 6

    3.2. ActiveX-Projekt anlegen ......................................................................................................... 7

    3.3. Schnittstellen anpassen ............................................................................................................ 9

    3.3.1. Manuell ............................................................................................................................ 9

    3.3.2. Mithilfe des AddIns „ActiveX-Control Interface Wizard“ ............................................. 9

    3.4. Projekt hinzufügen ................................................................................................................ 10

    3.5. Element zeichnen .................................................................................................................. 11

    3.6. Control testen ........................................................................................................................ 11

    3.7. Resize-Event .......................................................................................................................... 12

    3.8. Nötige Methoden und Eigenschaften .................................................................................... 13

    3.9. LISTBOX - Das Visual Basic Coding ................................................................................... 13

    3.9.1. Event deklarieren ........................................................................................................... 13

    3.9.2. Methode „Resize“ .......................................................................................................... 13

    3.9.3. Methode „Clear“ ............................................................................................................ 13

    3.9.4. Methoden „Mark“ und „Unmark“ ................................................................................. 14

    3.9.5. Methode „Add_Item“ .................................................................................................... 14

    3.9.6. Methode „Delete_Item“ ................................................................................................. 14

    3.9.7. Methode „Selected_Item“ ............................................................................................. 14

    3.9.8. Methode „Get_Selected_Elemtents“ ............................................................................. 14

    3.9.9. Methode „Get_All_Elements“ ....................................................................................... 15

    3.9.10. Eigenschaft „NumberOfItems“ ..................................................................................... 15

    3.10. BUTTONS – Das Visual Basic Coding ................................................................................ 15

    3.10.1. Events deklarieren ......................................................................................................... 15

  • SAP-Controls im Eigenbau Enno Wulff Tricktresor.de

    Seite 2 von 40 Enno Wulff

    3.10.2. Methode „Button_Click“ ............................................................................................... 15

    3.10.3. Methode „Resize“ .......................................................................................................... 15

    3.10.4. Eigenschaft „MyCaption“ ............................................................................................. 16

    3.10.5. Eigenschaft „MyFontsize“ ............................................................................................. 16

    3.10.6. Eigenschaft „MyFontname“ .......................................................................................... 16

    3.10.7. Eigenschaft „MyID“ ...................................................................................................... 16

    4. Kapselung in SAP ......................................................................................................................... 16

    4.1. Anlegen der Klasse ................................................................................................................ 16

    4.1.1. CONSTRUCTOR .......................................................................................................... 18

    4.1.2. DISPATCH ................................................................................................................... 18

    4.1.3. SET_REGISTERED_EVENTS .................................................................................... 19

    4.2. Das SAP-Coding der Methoden: LISTBOX ......................................................................... 19

    4.2.1. CONSTRUCTOR .......................................................................................................... 19

    4.2.2. DISPATCH ................................................................................................................... 20

    4.2.3. SET_REGISTERED_EVENTS .................................................................................... 20

    4.2.4. Add_Item ....................................................................................................................... 20

    4.2.5. Delete_Item ................................................................................................................... 21

    4.2.6. Get_Selected_Items ....................................................................................................... 21

    4.3. Das SAP-Coding der Methoden: BUTTON .......................................................................... 21

    4.3.1. CONSTRUCTOR .......................................................................................................... 21

    4.3.2. DISPATCH ................................................................................................................... 22

    4.3.3. SET_REGISTERED_EVENTS .................................................................................... 23

    4.3.4. Add_Item ....................................................................................................................... 24

    4.3.5. Delete_Item ................................................................................................................... 24

    4.3.6. Get_Selected_Items ....................................................................................................... 24

    5. Einbindung in SAP ........................................................................................................................ 24

    5.1. Testprogramm OCX-LISTBOX ............................................................................................ 24

    5.2. Testprogramm OCX-BUTTONS .......................................................................................... 28

    6. Fehleranalyse ................................................................................................................................. 30

    6.1. Automation Queue ................................................................................................................ 30