Example: MM03 fast display

You probably know the "Display material" transaction (transaction code MM03), or perhaps another display transaction in R/3 that uses a series of screens in order to show all attributes of the selected business object. The views presented by R/3 on these screens are grouped together according to logical criteria.

A typical user would often prefer to get a certain selection of fields without having to navigate through different screens, and without the need to remember this information when he has to leave one of the screens. With GuiXT, this can be done without database programming and without any R/3 modification. We will show you here a typical example. You can use this example as a basis for your own view, selecting more fields or different fields, or using the same technique for other business objects.

We start from the first screen of the original MM03 transaction. This makes sense since the user already knows how to reach this transaction, and since we can use the material number input field with its standard functionality (e.g., matchcode).

1 A short example: Display material master (MM03) with Snapshot function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

As you can see here we added a new pushbutton with the text "Snapshot". The user enters a material number and then he can either use the normal R/3 functionality, or just press the Snapshot button.

 

2 MM03 with snapshot displayed

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The snapshot button displays a special view of the material, collecting information from various standard R/3 screens. We also added a picture of the product.

Finalyy, we can give the user the possibility to display a snapshot of 2 products (or more, if you like) simultaneously. For this example we decided to display the previous view as well.

 

3 MM03 with two snapshots

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

It is now much easier to compare the two products.

4 Variants and extensions

We would like to suggest some variations that you could implement on base of this example:

 

5 General explanation of the technique

We combine the InputScript technology known from the single-screen input transactions with the appropriate use of GuiXT variables.

(a) We add the snapshot pushbutton and attach an InputScript to it

(b) In the InputScipt we navigate through various MM03 screens. We use the Set command in order to pick values from the screens and to store them to GuiXT variables, e.g.

Set V[MM_attr1.net_weight] "&[Net weight]"

(c) At the beginning of the input script we copy all MM_attr1 variables to MM_attr2 variables so that we can display the previous product as well, and then we clear all MM_attr1 variables.

(d) When we come back to the MM03 screen, after the InputScript processing, we display all information using the MM_attr variables. We also use the if command to display the information in a better readable way, and we concatenate some fields (weight and weight unit).

 

6 GuiXT Script (R/3 4.5 and 4.6)

if Q[Transaction=MM03]

// display data of up to 2 materials and of various views

Pushbutton (1,40) "@1E\QDisplay selected material data@Snapshot" "Process=DisplayMaterial.txt"
using material = [Material]



// Display material snapshot
if V[MM_attr1.number]

Offset (4,0)
Box (0,0) (14,50) "Current material"

Text (1,30) "&[MM_attr1.number]"
Comment (2,1) "&[MM_attr1.text]"

Text (4,1) "Net weight: &[MM_attr1.net_weight] &[MM_attr1.weight_unit]"
Text (5,1) "Gross weight: &[MM_attr1.gross_weight] &[MM_attr1.weight_unit]"

if V[MM_attr1.configurable]
Comment (7,1) "Configurable"
else
Text (7,1) "Not configurable"
endif

Text (9,1) "Stock"
Text (9,20) "&[MM_attr1.stock]"
Text (10,1) "Consignment"
Text (10,20) "&[MM_attr1.consi]"
Text (11,1) "Restr. stock"
Text (11,20) "&[MM_attr1.stock.r]"
Text (12,1) "Restr. consignment"
Text (12,20) "&[MM_attr1.consi.r]"

Image (9,38) (12,48) "G:\Product images\&[MM_attr1.number].jpg" "-NoStretch"


endif

if V[MM_attr2.number]

Offset (4,54)
Box (0,0) (14,50) "Previous material"


Text (1,30) "&[MM_attr2.number]"
Comment (2,1) "&[MM_attr2.text]"

Text (4,1) "Net weight: &[MM_attr2.net_weight] &[MM_attr2.weight_unit]"
Text (5,1) "Gross weight: &[MM_attr2.gross_weight] &[MM_attr2.weight_unit]"

if V[MM_attr2.configurable]
Comment (7,1) "Configurable"
else
Text (7,1) "Not configurable"
endif

Text (9,1) "Stock"
Text (9,20) "&[MM_attr2.stock]"
Text (10,1) "Consignment"
Text (10,20) "&[MM_attr2.consi]"
Text (11,1) "Restr. stock"
Text (11,20) "&[MM_attr2.stock.r]"
Text (12,1) "Restr. consignment"
Text (12,20) "&[MM_attr2.consi.r]"

Image (9,38) (12,48) "G:\Product images\&[MM_attr2.number].jpg" "-NoStretch"

endif

endif

7 InputScript (R/3 4.5 and 4.6)

/// Display material, set MM_attr1-variables

Parameter Plant 0001 // Use Plant 0001, if not specified

Screen SAPLMGMM.0070

// Save previous output fields
Set V[MM_attr2.number] "&[MM_attr1.number]"

Set V[MM_attr2.text] "&[MM_attr1.text]"
Set V[MM_attr2.gross_weight] "&[MM_attr1.gross_weight]"
Set V[MM_attr2.net_weight] "&[MM_attr1.net_weight]"
Set V[MM_attr2.weight_unit] "&[MM_attr1.weight_unit]"

Set V[MM_attr2.configurable] "&[MM_attr1.configurable]"

Set V[MM_attr2.stock] "&[MM_attr1.stock]"
Set V[MM_attr2.consi] "&[MM_attr1.consi] "
Set V[MM_attr2.stock.r] "&[MM_attr1.stock.r]"
Set V[MM_attr2.consi.r] "&[MM_attr1.consi.r]"

// Reset all output fields
Set V[MM_attr1.*] ""

// Set material number
Set V[MM_attr1.number] &[material]

// R/3 Release 4.6?
if C[View selection only on request]
Set cell[table,0,1] "X"
Set cell[table,0,2] "X"
Enter
Goto 4.6-Part

else
// Select views
Set C[Basic Data 1] "X"
Set C[Basic Data 2] "X"
Set C[Plant Stock] "X"
Enter
endif



// Organizational levels
Screen SAPLMGMM.0080
Set [Plant] &[Plant]
Enter



// Basic data 1
Screen SAPLMGMM.4000
Set V[MM_attr1.text] "&#[2,33]" // Material text field (no name)
Set V[MM_attr1.gross_weight] "&[Gross weight]"
Set V[MM_attr1.net_weight] "&[Net weight]"
Set V[MM_attr1.weight_unit] "&[Weight unit]"
Enter

// Basic data 2
Screen SAPLMGMM.4000
Set V[MM_attr1.configurable] "&[Material is configurable]"
Enter

// No plant data? Then return now
Screen SAPLSPO1.0300
Return

// Plant stock
Screen SAPLMGMM.4000
Set V[MM_attr1.stock] "&[Unrestr.-use stock]"
Set V[MM_attr1.consi] "&[Unrestr. consignment]"
Set V[MM_attr1.stock.r] "&[Restricted-use stock]"
Set V[MM_attr1.consi.r] "&[Restr. consignment]"
Return




// 4.6 InputScript

Label 4.6-Part


// Organizational levels

Screen SAPLMGMM.0080
Set [Plant] &[Plant]
Enter

// Basic data 1
Screen SAPLMGMM.4004
Set V[MM_attr1.text] "&#[2,32]" // Material text field (no name)
Set V[MM_attr1.gross_weight] "&[Gross weight]"
Set V[MM_attr1.net_weight] "&[Net weight]"
Set V[MM_attr1.weight_unit] "&[Weight unit]"
Enter


// Basic data 2
Screen SAPLMGMM.4000
Set V[MM_attr1.configurable] "&[Material is configurable]"
Enter

// No plant data? Then return now
Screen SAPLSPO1.0300
Return

// Plant stock
Screen SAPLMGMM.4000
Set V[MM_attr1.stock] "&[Unrestr.-use stock]"
Set V[MM_attr1.consi] "&[Unrestr. consignment]"
Set V[MM_attr1.stock.r] "&[Restricted-use stock]"
Set V[MM_attr1.consi.r] "&[Restr. consignment]"
Return