SAP GRAPH_GANTT Function Module for Call of SAP GANTT_Diagram
GRAPH_GANTT is a standard graph gantt SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Call of SAP GANTT_Diagram processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for graph gantt FM, simply by entering the name GRAPH_GANTT into the relevant SAP transaction such as SE37 or SE38.
Function Group: GANT
Program Name: SAPLGANT
Main Program:
Appliation area:
Release date: 19-Jan-1995
Mode(Normal, Remote etc): Normal Function Module
Update:

Function GRAPH_GANTT pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'GRAPH_GANTT'"Call of SAP GANTT_Diagram.
EXPORTING
* COMMAND_OK = ' ' "Allow inquiry in the CONFIRM mode = 'x' (2.0)
* NO_EL_POPUP = ' ' "Insert element : No attribute query
* NO_EX_POPUP = ' ' "Exit graphic : No confirmation prompt
* NO_IT_POPUP = ' ' "Insert line : No attribute query
* NO_MS_POPUP = ' ' "Insert milestone : No attribute query
* NO_SORT = ' ' "Suppress internal sorting
* PWDID = ' ' "Dialog parameters
* SET_FOCUS = 'x' "Set focus during reload
* SO_CONTENTS = ' ' "Subtitle of generated SAPoffice document
* SO_RECEIVER = ' ' "Recipient of generated SAPoffice object
* SO_SEND = ' ' "Graphic storage in SAPoffice instead of display
* CONFIRM = ' ' "Switch on extended dialog mode = 'x' (2.0)
* SO_TITLE = ' ' "Title of the generated SAPoffice document
* STAT = ' ' "Dialog parameters
* SUPER = ' ' "Dialog parameters
* TIMER = 0 "'Wind up' timer -> G_TYP = 'U'
* TLENGTH = ' ' "Width of the ITEM area (characters)
* TLINE = "vertical selection line, definite time
* TMBEG = "Scrolling area : Start
* TMEND = "Scrolling area : End
* TMVIEW = "Displayed area : Start
* TTEXT = ' ' "Heading for the item list
* DFEL = ' ' "Default element attributes
* TTITLE = ' ' "Heading of the planning table
* TUNIT = ' ' "Time unit of the time axis
* VGRID = ' ' "Activate vertical grid lines
* WHEADER = ' ' "Window title
* WINID = ' ' "Dialog parameters
* DFMS = ' ' "Default milestone attributes
* GLENGTH = ' ' "Width of the ELEM/MIST area (character)
* HGRID = ' ' "Activate horizontal grid lines
* LEGEND = ' ' "Legend title/switch on
* MODIF = ' ' "Display - editing mode
* NOTXT = ' ' "Suppress element texts = 'x'
IMPORTING
AKT_SVIEW = "Current diagram section
AKT_TMBEG = "Current start of diagram
AKT_TMEND = "Current end of diagram
AKT_TUNIT = "active time unit of the time axis
CUA_ID = "Key for CUA confirmation
G_TYP = "Confirmation type
M_TYP = "Dialog parameters
RBUFF = "DO NOT USE
RWNID = "Dialog parameters
TABLES
ELEM = "Table for planning elements
ITEM = "Table for planning lines
LGEL = "Table for element legend
LGMS = "Table for milestone legend
MIST = "Table for planning milestone
MSGT = "Table for confirmations
EXCEPTIONS
INV_ELEM_BAKGR = 1 INV_ELEM_BORDR = 2 INV_ELEM_FORGR = 3 INV_ELEM_PLACE = 4 INV_ITEM_UCOLOR = 5 INV_MIST_COLOR = 6 INV_MIST_FORM = 7 INV_MIST_POS = 8 INV_MIST_SIZE = 9
IMPORTING Parameters details for GRAPH_GANTT
COMMAND_OK - Allow inquiry in the CONFIRM mode = 'x' (2.0)
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_EL_POPUP - Insert element : No attribute query
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_EX_POPUP - Exit graphic : No confirmation prompt
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_IT_POPUP - Insert line : No attribute query
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_MS_POPUP - Insert milestone : No attribute query
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_SORT - Suppress internal sorting
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PWDID - Dialog parameters
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SET_FOCUS - Set focus during reload
Data type:Default: 'x'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SO_CONTENTS - Subtitle of generated SAPoffice document
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SO_RECEIVER - Recipient of generated SAPoffice object
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SO_SEND - Graphic storage in SAPoffice instead of display
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CONFIRM - Switch on extended dialog mode = 'x' (2.0)
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SO_TITLE - Title of the generated SAPoffice document
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
STAT - Dialog parameters
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUPER - Dialog parameters
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TIMER - 'Wind up' timer -> G_TYP = 'U'
Data type: GGAEL-BEGOptional: Yes
Call by Reference: No ( called with pass by value option)
TLENGTH - Width of the ITEM area (characters)
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TLINE - vertical selection line, definite time
Data type: GGAEL-BEGOptional: Yes
Call by Reference: No ( called with pass by value option)
TMBEG - Scrolling area : Start
Data type: GGAEL-BEGOptional: Yes
Call by Reference: No ( called with pass by value option)
TMEND - Scrolling area : End
Data type: GGAEL-BEGOptional: Yes
Call by Reference: No ( called with pass by value option)
TMVIEW - Displayed area : Start
Data type: GGAEL-BEGOptional: Yes
Call by Reference: No ( called with pass by value option)
TTEXT - Heading for the item list
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DFEL - Default element attributes
Data type: GGAELDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TTITLE - Heading of the planning table
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TUNIT - Time unit of the time axis
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VGRID - Activate vertical grid lines
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
WHEADER - Window title
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
WINID - Dialog parameters
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DFMS - Default milestone attributes
Data type: GGAMIDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
GLENGTH - Width of the ELEM/MIST area (character)
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
HGRID - Activate horizontal grid lines
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LEGEND - Legend title/switch on
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MODIF - Display - editing mode
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NOTXT - Suppress element texts = 'x'
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for GRAPH_GANTT
AKT_SVIEW - Current diagram section
Data type: GGAEL-BEGOptional: No
Call by Reference: No ( called with pass by value option)
AKT_TMBEG - Current start of diagram
Data type: GGAEL-BEGOptional: No
Call by Reference: No ( called with pass by value option)
AKT_TMEND - Current end of diagram
Data type: GGAEL-BEGOptional: No
Call by Reference: No ( called with pass by value option)
AKT_TUNIT - active time unit of the time axis
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CUA_ID - Key for CUA confirmation
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
G_TYP - Confirmation type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
M_TYP - Dialog parameters
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
RBUFF - DO NOT USE
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
RWNID - Dialog parameters
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for GRAPH_GANTT
ELEM - Table for planning elements
Data type: GGAELOptional: No
Call by Reference: No ( called with pass by value option)
ITEM - Table for planning lines
Data type: GGAITOptional: No
Call by Reference: No ( called with pass by value option)
LGEL - Table for element legend
Data type: GGAELOptional: No
Call by Reference: No ( called with pass by value option)
LGMS - Table for milestone legend
Data type: GGAMIOptional: No
Call by Reference: No ( called with pass by value option)
MIST - Table for planning milestone
Data type: GGAMIOptional: No
Call by Reference: No ( called with pass by value option)
MSGT - Table for confirmations
Data type: GGABAOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INV_ELEM_BAKGR - ELEM / DFEL / LGEL attribute BAKGR is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_ELEM_BORDR - ELEM / DFEL / LGEL attribute BORDR is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_ELEM_FORGR - ELEM / DFEL / LGEL attribute FORGR is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_ELEM_PLACE - ELEM / DFEL / LGEL attribute PLACE is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_ITEM_UCOLOR - ITEM attribute UCOLOR invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_MIST_COLOR - MIST / DFMS / LGMS attribute COLOR is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_MIST_FORM - MIST / DFMS / LGMS attribute FORM is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_MIST_POS - MIST / DFMS / LGMS attribute POS is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_MIST_SIZE - MIST / DFMS / LGMS attribute SIZE is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for GRAPH_GANTT Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lt_elem | TYPE STANDARD TABLE OF GGAEL, " | |||
| lv_akt_sview | TYPE GGAEL-BEG, " | |||
| lv_command_ok | TYPE GGAEL, " SPACE | |||
| lv_inv_elem_bakgr | TYPE GGAEL, " | |||
| lv_no_el_popup | TYPE GGAEL, " SPACE | |||
| lv_no_ex_popup | TYPE GGAEL, " SPACE | |||
| lv_no_it_popup | TYPE GGAEL, " SPACE | |||
| lv_no_ms_popup | TYPE GGAEL, " SPACE | |||
| lv_no_sort | TYPE GGAEL, " SPACE | |||
| lv_pwdid | TYPE GGAEL, " SPACE | |||
| lv_set_focus | TYPE GGAEL, " 'x' | |||
| lv_so_contents | TYPE GGAEL, " SPACE | |||
| lv_so_receiver | TYPE GGAEL, " SPACE | |||
| lv_so_send | TYPE GGAEL, " SPACE | |||
| lt_item | TYPE STANDARD TABLE OF GGAIT, " | |||
| lv_confirm | TYPE GGAIT, " SPACE | |||
| lv_akt_tmbeg | TYPE GGAEL-BEG, " | |||
| lv_inv_elem_bordr | TYPE GGAEL, " | |||
| lv_so_title | TYPE GGAEL, " SPACE | |||
| lv_stat | TYPE GGAEL, " SPACE | |||
| lv_super | TYPE GGAEL, " SPACE | |||
| lv_timer | TYPE GGAEL-BEG, " 0 | |||
| lv_tlength | TYPE GGAEL, " SPACE | |||
| lv_tline | TYPE GGAEL-BEG, " | |||
| lv_tmbeg | TYPE GGAEL-BEG, " | |||
| lv_tmend | TYPE GGAEL-BEG, " | |||
| lv_tmview | TYPE GGAEL-BEG, " | |||
| lv_ttext | TYPE GGAEL, " SPACE | |||
| lv_dfel | TYPE GGAEL, " SPACE | |||
| lt_lgel | TYPE STANDARD TABLE OF GGAEL, " | |||
| lv_akt_tmend | TYPE GGAEL-BEG, " | |||
| lv_inv_elem_forgr | TYPE GGAEL, " | |||
| lv_ttitle | TYPE GGAEL, " SPACE | |||
| lv_tunit | TYPE GGAEL, " SPACE | |||
| lv_vgrid | TYPE GGAEL, " SPACE | |||
| lv_wheader | TYPE GGAEL, " SPACE | |||
| lv_winid | TYPE GGAEL, " SPACE | |||
| lv_dfms | TYPE GGAMI, " SPACE | |||
| lt_lgms | TYPE STANDARD TABLE OF GGAMI, " | |||
| lv_akt_tunit | TYPE GGAMI, " | |||
| lv_inv_elem_place | TYPE GGAMI, " | |||
| lt_mist | TYPE STANDARD TABLE OF GGAMI, " | |||
| lv_cua_id | TYPE GGAMI, " | |||
| lv_glength | TYPE GGAMI, " SPACE | |||
| lv_inv_item_ucolor | TYPE GGAMI, " | |||
| lt_msgt | TYPE STANDARD TABLE OF GGABA, " | |||
| lv_g_typ | TYPE GGABA, " | |||
| lv_hgrid | TYPE GGABA, " SPACE | |||
| lv_inv_mist_color | TYPE GGABA, " | |||
| lv_m_typ | TYPE GGABA, " | |||
| lv_legend | TYPE GGABA, " SPACE | |||
| lv_inv_mist_form | TYPE GGABA, " | |||
| lv_modif | TYPE GGABA, " SPACE | |||
| lv_rbuff | TYPE GGABA, " | |||
| lv_inv_mist_pos | TYPE GGABA, " | |||
| lv_notxt | TYPE GGABA, " SPACE | |||
| lv_rwnid | TYPE GGABA, " | |||
| lv_inv_mist_size | TYPE GGABA. " |
|   CALL FUNCTION 'GRAPH_GANTT' "Call of SAP GANTT_Diagram |
| EXPORTING | ||
| COMMAND_OK | = lv_command_ok | |
| NO_EL_POPUP | = lv_no_el_popup | |
| NO_EX_POPUP | = lv_no_ex_popup | |
| NO_IT_POPUP | = lv_no_it_popup | |
| NO_MS_POPUP | = lv_no_ms_popup | |
| NO_SORT | = lv_no_sort | |
| PWDID | = lv_pwdid | |
| SET_FOCUS | = lv_set_focus | |
| SO_CONTENTS | = lv_so_contents | |
| SO_RECEIVER | = lv_so_receiver | |
| SO_SEND | = lv_so_send | |
| CONFIRM | = lv_confirm | |
| SO_TITLE | = lv_so_title | |
| STAT | = lv_stat | |
| SUPER | = lv_super | |
| TIMER | = lv_timer | |
| TLENGTH | = lv_tlength | |
| TLINE | = lv_tline | |
| TMBEG | = lv_tmbeg | |
| TMEND | = lv_tmend | |
| TMVIEW | = lv_tmview | |
| TTEXT | = lv_ttext | |
| DFEL | = lv_dfel | |
| TTITLE | = lv_ttitle | |
| TUNIT | = lv_tunit | |
| VGRID | = lv_vgrid | |
| WHEADER | = lv_wheader | |
| WINID | = lv_winid | |
| DFMS | = lv_dfms | |
| GLENGTH | = lv_glength | |
| HGRID | = lv_hgrid | |
| LEGEND | = lv_legend | |
| MODIF | = lv_modif | |
| NOTXT | = lv_notxt | |
| IMPORTING | ||
| AKT_SVIEW | = lv_akt_sview | |
| AKT_TMBEG | = lv_akt_tmbeg | |
| AKT_TMEND | = lv_akt_tmend | |
| AKT_TUNIT | = lv_akt_tunit | |
| CUA_ID | = lv_cua_id | |
| G_TYP | = lv_g_typ | |
| M_TYP | = lv_m_typ | |
| RBUFF | = lv_rbuff | |
| RWNID | = lv_rwnid | |
| TABLES | ||
| ELEM | = lt_elem | |
| ITEM | = lt_item | |
| LGEL | = lt_lgel | |
| LGMS | = lt_lgms | |
| MIST | = lt_mist | |
| MSGT | = lt_msgt | |
| EXCEPTIONS | ||
| INV_ELEM_BAKGR = 1 | ||
| INV_ELEM_BORDR = 2 | ||
| INV_ELEM_FORGR = 3 | ||
| INV_ELEM_PLACE = 4 | ||
| INV_ITEM_UCOLOR = 5 | ||
| INV_MIST_COLOR = 6 | ||
| INV_MIST_FORM = 7 | ||
| INV_MIST_POS = 8 | ||
| INV_MIST_SIZE = 9 | ||
| . " GRAPH_GANTT | ||
ABAP code using 7.40 inline data declarations to call FM GRAPH_GANTT
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single BEG FROM GGAEL INTO @DATA(ld_akt_sview). | ||||
| DATA(ld_command_ok) | = ' '. | |||
| DATA(ld_no_el_popup) | = ' '. | |||
| DATA(ld_no_ex_popup) | = ' '. | |||
| DATA(ld_no_it_popup) | = ' '. | |||
| DATA(ld_no_ms_popup) | = ' '. | |||
| DATA(ld_no_sort) | = ' '. | |||
| DATA(ld_pwdid) | = ' '. | |||
| DATA(ld_set_focus) | = 'x'. | |||
| DATA(ld_so_contents) | = ' '. | |||
| DATA(ld_so_receiver) | = ' '. | |||
| DATA(ld_so_send) | = ' '. | |||
| DATA(ld_confirm) | = ' '. | |||
| "SELECT single BEG FROM GGAEL INTO @DATA(ld_akt_tmbeg). | ||||
| DATA(ld_so_title) | = ' '. | |||
| DATA(ld_stat) | = ' '. | |||
| DATA(ld_super) | = ' '. | |||
| "SELECT single BEG FROM GGAEL INTO @DATA(ld_timer). | ||||
| DATA(ld_tlength) | = ' '. | |||
| "SELECT single BEG FROM GGAEL INTO @DATA(ld_tline). | ||||
| "SELECT single BEG FROM GGAEL INTO @DATA(ld_tmbeg). | ||||
| "SELECT single BEG FROM GGAEL INTO @DATA(ld_tmend). | ||||
| "SELECT single BEG FROM GGAEL INTO @DATA(ld_tmview). | ||||
| DATA(ld_ttext) | = ' '. | |||
| DATA(ld_dfel) | = ' '. | |||
| "SELECT single BEG FROM GGAEL INTO @DATA(ld_akt_tmend). | ||||
| DATA(ld_ttitle) | = ' '. | |||
| DATA(ld_tunit) | = ' '. | |||
| DATA(ld_vgrid) | = ' '. | |||
| DATA(ld_wheader) | = ' '. | |||
| DATA(ld_winid) | = ' '. | |||
| DATA(ld_dfms) | = ' '. | |||
| DATA(ld_glength) | = ' '. | |||
| DATA(ld_hgrid) | = ' '. | |||
| DATA(ld_legend) | = ' '. | |||
| DATA(ld_modif) | = ' '. | |||
| DATA(ld_notxt) | = ' '. | |||
Search for further information about these or an SAP related objects