SAP Function Modules

BARCHART_CREATE SAP Function module - Produce a bar chart control







BARCHART_CREATE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BARCHART_CREATE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: CNBC
Released Date: 11.05.2001
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM BARCHART_CREATE - BARCHART CREATE





CALL FUNCTION 'BARCHART_CREATE' "Produce a bar chart control
* EXPORTING
*   dynnr =                     " sy-dynnr      Screen number
*   owner_repid =               " sy-repid      Program to generated control
*   parentid =                  " i             Parent
*   link_repid =                " sy-repid      Program to merge control
*   container = SPACE           " c             Container
*   shellstyle =                " i             Style
*   alignment = 15              " i             Alignment of the control on screen
*   top =                       " i             Alignment with reference to upper edge
*   left =                      " i             Alignment with reference to left edge
*   height =                    " i             Control height
*   width =                     " i             Control width
*   metric = CNTL_METRIC_DYNPRO  " cntl_metric  Metric
*   no_flush = 'X'              " c             Flush
*   hide_status_bar =           " c             Hide status line
* CHANGING
*   handle =                    " cntl_handle   Control handle
  EXCEPTIONS
    CREATE_ERROR = 1            "               Error creating control
    .  "  BARCHART_CREATE

ABAP code example for Function Module BARCHART_CREATE





The ABAP code below is a full code listing to execute function module BARCHART_CREATE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).


DATA(ld_handle) = 'Check type of data required'.
DATA(ld_dynnr) = 'some text here'.
DATA(ld_owner_repid) = 'some text here'.
DATA(ld_parentid) = 'some text here'.
DATA(ld_link_repid) = 'some text here'.
DATA(ld_container) = 'some text here'.
DATA(ld_shellstyle) = 'some text here'.
DATA(ld_alignment) = 'some text here'.
DATA(ld_top) = 'some text here'.
DATA(ld_left) = 'some text here'.
DATA(ld_height) = 'some text here'.
DATA(ld_width) = 'some text here'.
DATA(ld_metric) = 'some text here'.
DATA(ld_no_flush) = 'some text here'.
DATA(ld_hide_status_bar) = 'some text here'. . CALL FUNCTION 'BARCHART_CREATE' * EXPORTING * dynnr = ld_dynnr * owner_repid = ld_owner_repid * parentid = ld_parentid * link_repid = ld_link_repid * container = ld_container * shellstyle = ld_shellstyle * alignment = ld_alignment * top = ld_top * left = ld_left * height = ld_height * width = ld_width * metric = ld_metric * no_flush = ld_no_flush * hide_status_bar = ld_hide_status_bar * CHANGING * handle = ld_handle EXCEPTIONS CREATE_ERROR = 1 . " BARCHART_CREATE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_handle  TYPE CNTL_HANDLE ,
ld_dynnr  TYPE SY-DYNNR ,
ld_owner_repid  TYPE SY-REPID ,
ld_parentid  TYPE I ,
ld_link_repid  TYPE SY-REPID ,
ld_container  TYPE C ,
ld_shellstyle  TYPE I ,
ld_alignment  TYPE I ,
ld_top  TYPE I ,
ld_left  TYPE I ,
ld_height  TYPE I ,
ld_width  TYPE I ,
ld_metric  TYPE CNTL_METRIC ,
ld_no_flush  TYPE C ,
ld_hide_status_bar  TYPE C .

ld_handle = 'some text here'.
ld_dynnr = 'some text here'.
ld_owner_repid = 'some text here'.
ld_parentid = 'some text here'.
ld_link_repid = 'some text here'.
ld_container = 'some text here'.
ld_shellstyle = 'some text here'.
ld_alignment = 'some text here'.
ld_top = 'some text here'.
ld_left = 'some text here'.
ld_height = 'some text here'.
ld_width = 'some text here'.
ld_metric = 'some text here'.
ld_no_flush = 'some text here'.
ld_hide_status_bar = 'some text here'.

SAP Documentation for FM BARCHART_CREATE


This function module generates a bar chart control and returns a handle. ...See here for full SAP fm documentation














Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BARCHART_CREATE or its description.