Reading data in lists

InputScripts sometimes require reading data that is displayed in R/3 list format. A typical example is the following list that is shown  when you start transaction ME56, "Assign Source of Supply to Requisitions":

The "screen elements" window of GuiXT is completely empty in this case, and the screen number is always 0120.

Please note: It is not possible to change lists with GuiXT, but you can read data from lists in InputScripts, and you can add more user functions with GuiXT scripts.

 

The following system variables are available for lists:

  • _listline(1), _listline(2),... 
    Lines displayed on current page. 
    _listline(1) is the first line after the page header 
  • _listline
    Current line (determined by cursor position) 
  • _liststring
    Current string (determined by cursor position, delimiter (left and right) is Space) 
  • _listcursorrow, _listcursorcol
    Row and column number of cursor position
  • _listlastrow
    Number of last row in list (all pages, without page header lines) 
  • _listfirstvisiblerow, _listlastvisiblerow
    First and last row that is visible on current page 

Automatic scrolling  

Enter    "/ScrollToLine=..."
Scrolls the list to line ...

Example 1 (based on R/3 Rel. 4.6C)

You display an additional pushbutton "DIsplay selected material" on the ME56 list.  When the user selects a material number (cursor) and then presses the button, you call the material master display transaction MM03 in a new mode, pass the selected material number, and press enter.

 

GuiXT Script RM06BL00.E0120.txt 

Pushbutton (toolbar) "Display selected material" "/OMM03" "Process=ShowMaterial.txt"
using MATNR = [_liststring]

 

InputScript ShowMaterial.txt

Parameter MATNR

Screen SAPLMGMM.0060 
  Set F[Material] &[MATNR]
  Enter

Example 2 (based on R/3 Rel. 4.6C)

You want to display an html file that contains all requisitions with additional data like price, value, creator,...

Please note that this example is fine for small lists, but might result in performance problems for larger amount of data 

GuiXT Script RM06BL00.E0120.txt 

Pushbutton (toolbar) "Overview in html format"   "Process=ME56.Overview.txt"

InputScript ME56.Overview.txt

Screen RM06BL00.0120 
Set V[ME56.Overview*] "" // Reset variables 
Set V[ME56.Overview.index] 1
Set V[ME56.Overview.row] 1

Enter "/ScrollToLine=1" 

label next_req
Screen RM06BL00.0120 
if V[ME56.Overview.row>&[_listlastrow]]
goto end 
endif

SetCursor (5,1) // Point to line
Enter "/2" // View details 

Screen SAPMM06B.0102

Set V[ME56.Overview.&[ME56.Overview.index].requisition] "&[Req.item]"
Set V[ME56.Overview.&[ME56.Overview.index].material] "&[Material]"
Set V[ME56.Overview.&[ME56.Overview.index].text] "&[Short text]"
Set V[ME56.Overview.&[ME56.Overview.index].price] "&[Val.price]"
Set V[ME56.Overview.&[ME56.Overview.index].quantity] "&[Quantity]"

Enter "=AS" 


Screen SAPMM06B.0110

Set V[ME56.Overview.&[ME56.Overview.index].value] "&[Total value]"
Set V[ME56.Overview.&[ME56.Overview.index].creator] "&[Created by]"

Enter "/3"
// Return


Screen SAPMM06B.0102
Enter "/3"
// Return

Screen RM06BL00.0120
Set V[ME56.Overview.row] &V[ME56.Overview.row] + 4 
Set V[ME56.Overview.index] &V[ME56.Overview.index] + 1 
Enter "/ScrollToLine=&[ME56.Overview.row]" 
goto next_req

label end
View "ME56.Overview.html" "template=ME56.Overview.template.html"
Enter "/ScrollToLine=1"

 

html page ME56.Overview.template.html (ceated with MS Frontpage)

 

Resulting html view: