SAP BARC_ADD_LAYER Function Module for Create a layer (graphical element)
BARC_ADD_LAYER is a standard barc add layer SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create a layer (graphical element) 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 barc add layer FM, simply by entering the name BARC_ADD_LAYER into the relevant SAP transaction such as SE37 or SE38.
Function Group: BARC
Program Name: SAPLBARC
Main Program: SAPLBARC
Appliation area: S
Release date: 07-Jun-1999
Mode(Normal, Remote etc): Normal Function Module
Update:

Function BARC_ADD_LAYER 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 'BARC_ADD_LAYER'"Create a layer (graphical element).
EXPORTING
* LAYER_TYPE = '00' "Layer type
* LAYPRIO = '0' "Drawing level, priority
* WINID = ' ' "Window ID
* LAYER_KIND = 'R' "Bar type
* SYMBOLTYPE = '01' "Symbol type
* COLOR_TYPE = '00' "Color
* FORM_TYPE = ' ' "Format type
* FIRSTDATE = 1 "Index of the start date
* SECONDDATE = 2 "Index of the end date
* HEIGHT = 400 "Length
* OFFSET = 0 "Offset
EXCEPTIONS
INVALID_TYPE = 1 INV_WINID = 2
IMPORTING Parameters details for BARC_ADD_LAYER
LAYER_TYPE - Layer type
Data type: TBCL-TYPEDefault: '00'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LAYPRIO - Drawing level, priority
Data type: TBCL-LAYPRIODefault: '0'
Optional: Yes
Call by Reference: No ( called with pass by value option)
WINID - Window ID
Data type: NET_GRAPH-WINIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LAYER_KIND - Bar type
Data type: TBCL-LAYER_TYPEDefault: 'R'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SYMBOLTYPE - Symbol type
Data type: TBCL-SYMBOLTYPEDefault: '01'
Optional: Yes
Call by Reference: No ( called with pass by value option)
COLOR_TYPE - Color
Data type: TBCC-TYPEDefault: '00'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FORM_TYPE - Format type
Data type: TBCF-TYPEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIRSTDATE - Index of the start date
Data type: TBCL-FIRSTDATEDefault: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
SECONDDATE - Index of the end date
Data type: TBCL-SECONDDATEDefault: 2
Optional: Yes
Call by Reference: No ( called with pass by value option)
HEIGHT - Length
Data type: TBCL-HEIGHTDefault: 400
Optional: Yes
Call by Reference: No ( called with pass by value option)
OFFSET - Offset
Data type: TBCL-OFFSETOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INVALID_TYPE - Invalid layer type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_WINID - Incorrect window ID
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BARC_ADD_LAYER 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: | ||||
| lv_layer_type | TYPE TBCL-TYPE, " '00' | |||
| lv_invalid_type | TYPE TBCL, " | |||
| lv_layprio | TYPE TBCL-LAYPRIO, " '0' | |||
| lv_winid | TYPE NET_GRAPH-WINID, " SPACE | |||
| lv_inv_winid | TYPE NET_GRAPH, " | |||
| lv_layer_kind | TYPE TBCL-LAYER_TYPE, " 'R' | |||
| lv_symboltype | TYPE TBCL-SYMBOLTYPE, " '01' | |||
| lv_color_type | TYPE TBCC-TYPE, " '00' | |||
| lv_form_type | TYPE TBCF-TYPE, " SPACE | |||
| lv_firstdate | TYPE TBCL-FIRSTDATE, " 1 | |||
| lv_seconddate | TYPE TBCL-SECONDDATE, " 2 | |||
| lv_height | TYPE TBCL-HEIGHT, " 400 | |||
| lv_offset | TYPE TBCL-OFFSET. " 0 |
|   CALL FUNCTION 'BARC_ADD_LAYER' "Create a layer (graphical element) |
| EXPORTING | ||
| LAYER_TYPE | = lv_layer_type | |
| LAYPRIO | = lv_layprio | |
| WINID | = lv_winid | |
| LAYER_KIND | = lv_layer_kind | |
| SYMBOLTYPE | = lv_symboltype | |
| COLOR_TYPE | = lv_color_type | |
| FORM_TYPE | = lv_form_type | |
| FIRSTDATE | = lv_firstdate | |
| SECONDDATE | = lv_seconddate | |
| HEIGHT | = lv_height | |
| OFFSET | = lv_offset | |
| EXCEPTIONS | ||
| INVALID_TYPE = 1 | ||
| INV_WINID = 2 | ||
| . " BARC_ADD_LAYER | ||
ABAP code using 7.40 inline data declarations to call FM BARC_ADD_LAYER
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 TYPE FROM TBCL INTO @DATA(ld_layer_type). | ||||
| DATA(ld_layer_type) | = '00'. | |||
| "SELECT single LAYPRIO FROM TBCL INTO @DATA(ld_layprio). | ||||
| DATA(ld_layprio) | = '0'. | |||
| "SELECT single WINID FROM NET_GRAPH INTO @DATA(ld_winid). | ||||
| DATA(ld_winid) | = ' '. | |||
| "SELECT single LAYER_TYPE FROM TBCL INTO @DATA(ld_layer_kind). | ||||
| DATA(ld_layer_kind) | = 'R'. | |||
| "SELECT single SYMBOLTYPE FROM TBCL INTO @DATA(ld_symboltype). | ||||
| DATA(ld_symboltype) | = '01'. | |||
| "SELECT single TYPE FROM TBCC INTO @DATA(ld_color_type). | ||||
| DATA(ld_color_type) | = '00'. | |||
| "SELECT single TYPE FROM TBCF INTO @DATA(ld_form_type). | ||||
| DATA(ld_form_type) | = ' '. | |||
| "SELECT single FIRSTDATE FROM TBCL INTO @DATA(ld_firstdate). | ||||
| DATA(ld_firstdate) | = 1. | |||
| "SELECT single SECONDDATE FROM TBCL INTO @DATA(ld_seconddate). | ||||
| DATA(ld_seconddate) | = 2. | |||
| "SELECT single HEIGHT FROM TBCL INTO @DATA(ld_height). | ||||
| DATA(ld_height) | = 400. | |||
| "SELECT single OFFSET FROM TBCL INTO @DATA(ld_offset). | ||||
Search for further information about these or an SAP related objects