Purpose
GuiXT already offers the possibility of displaying your own SAP tables. However, a few functions are not possible there and can be realized with a DataGridView. These include, for example, the interactive hiding of columns, display of images, coloring of rows and so on.

In this example, we want to evaluate the items of a customer's orders and display these together with the net value and a picture of the material in a table.

Solution
First we create a new project in Visual Studio and integrate the interface to GuiXT (guinet.dll). For testing purposes you can start a Windows Forms application, which will later be compiled as a class library.

The project mainly consists of a DataGridView object and some methods to request data from GuiXT and to customize the table design. We do not use event handling here, for example double-clicking a cell by a user.

You can download the project at the bottom of this page.

GuiXT Script:

  Pushbutton     (5,71)   "@D2\QRead sales@Read sales" _
     
process="read_orders.txt" size=(2,14)       

    // area for VB.NET control.   
   
Control         (7,140) (30,212) _
     
progID="Shell.Explorer" name="r1" initFlag="r1init" -closeOnHide   

        // embed control
   
if V[r1init]

      CallVB GuiXTdataGridView.Form1.embed "&V[r1]"    

      CallVB GuiXTdataGridView.Form1.SetSize "500" "500"        

      CallVB GuiXTdataGridView.Form1.SetRowHeight  "70"      

    endif  

InputScript:

Set
V[SALESORG] "1010"
Set
V[KUNNR] "K1172"

// read order
Call
"BAPI_SALESORDER_GETLIST"   _
 
export.CUSTOMER_NUMBER="KUNNR" _
 
export.SALES_ORGANIZATION="SALESORG" _
 
import.SALES_ORDERS="salesorders" _
 
import.RETURN="return"

 // Display .NET DataGridView
CallVB
r = GuiXTdataGridView.Form1.AddData "salesorders"

CallVB GuiXTdataGridView.Form1.SetHeaders  "Number|Net Value|Description"

CallVB GuiXTdataGridView.Form1.AddImageCol  "C:\guixtvb\productimages\" "0" 

message "&V[r]" -statusline

 

The .NET classlibrary:
You can start with a standard windows forms application and add a dataGridView object from the toolbar. Then you can change the design with the editor or later at runtime.

The dataGridView component offers lots of usefull features and different types of cells for example dropdown-lists, buttons, date-picker and so on.

 
After some texting you can embed the windows forms application into the SAP GUI screen. Please have a look at the tutorials to find out how to do this in detail.

Download:

Download the .NET project with source-code:
GuiXTdataGridView.zip

Components InputAssistant + Controls