Closing Windows from the ABAP Program Using GRAPH_DIALOG 

The GRAPH_DIALOG function module is a feature of the old waiting mechanism, which is not recommended for new programs.

The GRAPH_DIALOG function module does not call a specific graphics program. Instead, GRAPH_DIALOG offers specific utility functions:

Parameters used

The following table contains a list of all possible parameters you can use with this function module.

For a detailed description of parameters and exceptions, see the R/3 system documentation (Tools ® ABAP Workbench, Function library button, or transaction code SE37).

Parameters used in GRAPH_DIALOG

Name

Status

Initial Value

CLOSE

Import

SPACE

INBUF **

Import

SPACE

KWDID

Import

SPACE

STAT **

Import SPACE

 

M_TYP **

Export

 

RBUFF **

Export

 

RWNID **

Export

 

Note: ** denotes a dialog parameter

 

If you merely want to close windows, you only need the KWNID or CLOSE parameters.

If you merely want the function module to perform waiting, you only need the M_TYP and RWNID parameters. A STAT value of SPACE, a Wait value, is assumed by default. (The INBUF and RBUFF parameters are old and no longer needed. Do not use them when updating an existing programs.)

Closing Windows with GRAPH_DIALOG

The primary reason to call GRAPH_DIALOG is to kill a window from the ABAP program. The program can close one or all windows at a time.

Normally, windows are closed by the online user. This action is merely reported back to the ABAP program by the function module waiting for user input.

Occasionally, however, there may be reasons why the ABAP program needs to close the window itself. In this case, the ABAP program should call GRAPH_DIALOG with the KWDID parameter set to a valid window ID.

Using GRAPH_DIALOG as the Function Module That Waits

You can also use GRAPH_DIALOG as the function module that waits for input from the user. This can simplify how you handle return parameters.

GRAPH_DIALOG doesn't call any graphics program of its own. This means that all messages received from graphics programs can be handled consistently. There is no need to distinguish between messages sent by the waiter's graphics program, and those sent by other graphics programs. An M_TYP (message type) parameter of 'I' is not possible when GRAPH_DIALOG is the waiter.

For a detailed discussion of how return parameters are handled, see Controlling the Interaction Using Dialog Parameters.

Programming Interactive Applications

If your ABAP program allows the online user to open multiple windows or enter data with the mouse or keyboard, the application is interactive.

To control the interplay between online user and the ABAP program, you must use a special set of dialog parameters: STAT, INBUF, M_TYP, RBUFF, RWNID, PWDID, WINID, and SUPER. (The INBUF and RBUFF parameters are old and no longer needed. Do not use them for new programs.) For more information, see Dialog Programming in Releases Prior to 2.1.

Note that you should use the dialog programming mechanism with GRAPH_RECEIVE and GET_xxxx_PARAM in new programs.