SAP Reports / Programs | Basis Components | Frontend Services - Use subcomponents (see SAP Note 1322184) | Graphic(BC-FES-GRA) SAP BC

BARCOCX1 SAP ABAP Report - Demonstration Program: Bar Chart Control







BARCOCX1 is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for Sample program for the bar chart graphic...see full standard documentation available for this report. Also check out the submitted Comments related to this SAP report and the details below to see which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC.

If you would like to execute this report or see the full code listing simply enter BARCOCX1 into the relevant SAP transactions such as SE38 or SE80


ABAP code to call this SAP report using the submit statement

This report can be called from another progam/report simply by using the ABAP SUBMIT statement, see below for example ABAP code snipts of how to do this.






SUBMIT BARCOCX1. "Basic submit
SUBMIT BARCOCX1 AND RETURN. "Return to original report after report execution complete
SUBMIT BARCOCX1 VIA SELECTION-SCREEN. "Display selection screen of submitted report to user
    See more syntax options for the ABAP SUBMIT statement


Text pool values


Selection Text: OCX = Call as control
Selection Text: NAME = Name
Selection Text: INDEX = Index
Selection Text: GRUPPE = Group
Title: Demonstration Program: Bar Chart Control
Text Symbol: 013 = No free layer type available
Text Symbol: 012 = Layer inserted
Text Symbol: 008 = Fld content changed
Text Symbol: 014 = No free text index available
Text Symbol: 015 = Resources
Text Symbol: 016 = Box
Text Symbol: 007 = Cannot change plant
Text Symbol: 001 = Graphics Profile
Text Symbol: 002 = End of loading process
Text Symbol: 003 = Box/node duplicated
Text Symbol: 004 = Box already exists in the line
Text Symbol: 005 = Box inserted
Text Symbol: 006 = Node inserted
Text Symbol: 026 = Not possible to move boxes between charts
Text Symbol: 025 = No Object Selected
Text Symbol: 019 = Title
Text Symbol: 020 = Title table part
Text Symbol: 021 = No.
Text Symbol: 022 = Name
Text Symbol: 023 = Plnt
Text Symbol: 024 = Offer


INCLUDES used within this REPORT BARCOCX1

INCLUDE APPLG_AUTO_TEST_INIT.
INCLUDE APPLG_AUTO_TEST_FORM.


TABLES used within REPORT and the associated SELECT statement:





No SAP DATABASE tables are accessed within this REPORT code!


Function Modules used within report and the associated call statement:

WS_QUERY CALL FUNCTION 'WS_QUERY' EXPORTING query = 'WS' IMPORTING return = ws EXCEPTIONS inv_query = 1 no_batch = 2 frontend_error = 3 OTHERS = 4.

BARCHART_CREATE CALL FUNCTION 'BARCHART_CREATE' EXPORTING owner_repid = this_repid dynnr = this_dynnr CHANGING handle = barc_ocx.

GRAPH_RECEIVE CALL FUNCTION 'GRAPH_RECEIVE' IMPORTING errorcode = errno mcode = m_typ"Messagetyp rwnid = rwnid EXCEPTIONS inv_communication = 1 no_batch = 2.

BARC_GRAPHIC_PAI CALL FUNCTION 'BARC_GRAPHIC_PAI'.

BARC_SET_OPTIONS CALL FUNCTION 'BARC_SET_OPTIONS' EXPORTING customize = sgrc_const-yes editinline = sgrc_const-no.

BARC_LOGIC CALL FUNCTION 'BARC_LOGIC' TABLES all_boxes = all_boxes all_box_vals = all_box_vals all_links = all_links all_link_vals = all_link_vals all_nodes = all_nodes all_node_vals = all_node_vals all_positions = all_positions boxes = boxes box_vals = box_vals deletions = deletions links = links link_vals = link_vals nodes = nodes node_vals = node_vals positions = positions.

BARC_GRAPHIC_PAI CALL FUNCTION 'BARC_GRAPHIC_PAI' EXPORTING control_handle = barc_ocx "für Umstellung auf OCX IMPORTING graph_cmd = graph_cmd graph_cmd_info = graph_cmd_info gr_sel_field = gr_sel_field layer_type = layer_kind settings = settings symboltype = symboltype TABLES boxes = boxes box_vals = box_vals deletions = deletions links = links link_vals = link_vals nodes = nodes node_vals = node_vals positions = positions EXCEPTIONS inv_winid = 1.

BARC_ADD_LAYER CALL FUNCTION 'BARC_ADD_LAYER' EXPORTING color_type = 'L0' firstdate = 1 layer_kind = layer_kind symboltype = symboltype seconddate = 2 layer_type = layer_type EXCEPTIONS invalid_type = 01.

BARC_ADD_LAYER CALL FUNCTION 'BARC_ADD_LAYER' EXPORTING color_type = 'L0' firstdate = firstdate layer_kind = layer_kind layer_type = layer_type seconddate = seconddate symboltype = symboltype EXCEPTIONS invalid_type = 01.

BARC_GET_TEXTINDEX CALL FUNCTION 'BARC_GET_TEXTINDEX' EXPORTING box_type = all_boxes-type field = box_vals-fl form_type = all_boxes-form_type object_type = bc_const-box_object IMPORTING textindex = box_vals-fl EXCEPTIONS inv_box_type = 01 inv_object_type = 02 inv_winid = 03.

BARC_SET_SECTION_ATTRIB CALL FUNCTION 'BARC_SET_SECTION_ATTRIB' EXPORTING fl = vals-fl id = vals-id val = vals-val.

BARC_SET_RIBBON_ATTRIB CALL FUNCTION 'BARC_SET_RIBBON_ATTRIB' EXPORTING fl = vals-fl id = vals-id val = vals-val.

BARC_SET_GRID_ATTRIB CALL FUNCTION 'BARC_SET_GRID_ATTRIB' EXPORTING fl = vals-fl id = vals-id val = vals-val.

BARC_ADD_DATELINE CALL FUNCTION 'BARC_ADD_DATELINE' EXPORTING chart_id = dateline-chart_id color_type = dateline-color_type date = dateline-date.

BARC_LOGIC CALL FUNCTION 'BARC_LOGIC' EXPORTING graph_cmd = graph_cmd TABLES all_boxes = all_boxes all_box_vals = all_box_vals all_links = all_links all_link_vals = all_link_vals all_nodes = all_nodes all_node_vals = all_node_vals all_positions = all_positions boxes = boxes box_vals = box_vals deletions = deletions links = links link_vals = link_vals nodes = nodes node_vals = node_vals positions = positions.

BARC_GET_PROFILE_CONTENTS CALL FUNCTION 'BARC_GET_PROFILE_CONTENTS' EXPORTING get_tbca_defs = space get_tbcc_defs = space get_tbcf_defs = space get_tbcl_defs = 'x' get_tbco_defs = space get_tfat_defs = space get_tfmt_defs = space get_thlt_defs = space profile = profile TABLES tbca_defs = tmp_tbca tbcc_defs = tmp_tbcc tbcf_defs = tmp_tbcf tbcl_defs = tmp_tbcl tfat_defs = tmp_tfat tfmt_defs = tmp_tfmt thlt_defs = tmp_thlt EXCEPTIONS inv_tbca_defs = 01 inv_tbcc_defs = 02 inv_tbcf_defs = 03 inv_tbcg_defs = 04 inv_tbcl_defs = 05 inv_tbco_defs = 06.

GRAPH_SET_CUA_STATUS CALL FUNCTION 'GRAPH_SET_CUA_STATUS' EXPORTING program = prog status = 'GRAFIK' TABLES excluding = excluding_tab EXCEPTIONS inv_cua_info = 01.

BARC_ADD_CALENDAR CALL FUNCTION 'BARC_ADD_CALENDAR' IMPORTING id = calendar.

BARC_ADD_TIME_OBJECT





CALL FUNCTION 'BARC_ADD_TIME_OBJECT' EXPORTING fl = bc_const-day_in_week r_val = bc_const-saturday timeobject_type = bc_const-recurrent IMPORTING id = to1.

BARC_ADD_TIME_OBJECT CALL FUNCTION 'BARC_ADD_TIME_OBJECT' EXPORTING fl = bc_const-day_in_week r_val = bc_const-sunday timeobject_type = bc_const-recurrent IMPORTING id = to2.

BARC_ADD_TIME_PROFILE CALL FUNCTION 'BARC_ADD_TIME_PROFILE' EXPORTING timeprof_type = bc_const-week IMPORTING id = prof1.

BARC_SET_TIME_PROFILE_ATTRIB CALL FUNCTION 'BARC_SET_TIME_PROFILE_ATTRIB' EXPORTING fl = bc_const-add_nw_time id = prof1 val = val.

BARC_SET_TIME_PROFILE_ATTRIB CALL FUNCTION 'BARC_SET_TIME_PROFILE_ATTRIB' EXPORTING fl = bc_const-add_nw_time id = prof1 val = val.

BARC_SET_CALENDAR_ATTRIB CALL FUNCTION 'BARC_SET_CALENDAR_ATTRIB' EXPORTING fl = bc_const-add_profile id = calendar val = val.

BARC_ADD_TIME_OBJECT CALL FUNCTION 'BARC_ADD_TIME_OBJECT' EXPORTING u_val = '20.03.1999'

BARC_ADD_TIME_OBJECT CALL FUNCTION 'BARC_ADD_TIME_OBJECT' EXPORTING u_val = '10.04.1999'

BARC_ADD_INTERVAL CALL FUNCTION 'BARC_ADD_INTERVAL' IMPORTING id = int1.

BARC_SET_INTERVAL_ATTRIB CALL FUNCTION 'BARC_SET_INTERVAL_ATTRIB' EXPORTING fl = bc_const-interval_start id = int1 val = val.

BARC_SET_INTERVAL_ATTRIB CALL FUNCTION 'BARC_SET_INTERVAL_ATTRIB' EXPORTING fl = bc_const-interval_end id = int1 val = val.

BARC_SET_CALENDAR_ATTRIB CALL FUNCTION 'BARC_SET_CALENDAR_ATTRIB' EXPORTING fl = bc_const-unique_interval id = calendar val = val.

BARC_ADD_CHART CALL FUNCTION 'BARC_ADD_CHART' EXPORTING column_anz = 3 index = 1 size = 300 chart_type = '00' IMPORTING id = chart1 EXCEPTIONS inv_winid = 01.

BARC_SET_CHART_ATTRIB CALL FUNCTION 'BARC_SET_CHART_ATTRIB' EXPORTING fl = bc_const-chart_border_box id = chart1 val = val.

BARC_SET_CHART_ATTRIB CALL FUNCTION 'BARC_SET_CHART_ATTRIB' EXPORTING id = chart1 fl = bc_const-chart_title_box val = val.

BARC_SET_CHART_ATTRIB CALL FUNCTION 'BARC_SET_CHART_ATTRIB' EXPORTING id = chart1 fl = bc_const-multi_line_confirm val = bc_const-x.

BARC_SET_COLUMN_WIDTH CALL FUNCTION 'BARC_SET_COLUMN_WIDTH' EXPORTING chart_id = chart1 index = 1 width = 1500.

BARC_SET_COLUMN_WIDTH CALL FUNCTION 'BARC_SET_COLUMN_WIDTH' EXPORTING chart_id = chart1 index = 2 width = 3500.

BARC_SET_COLUMN_WIDTH CALL FUNCTION 'BARC_SET_COLUMN_WIDTH' EXPORTING chart_id = chart1 index = 3 width = 2000.

BARC_SET_ROW_HEIGHT CALL FUNCTION 'BARC_SET_ROW_HEIGHT' EXPORTING chart_id = chart1 height = 800 row_number = 2. "Zeile 2




BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart1 color_type = 'R1' section_id = section1 unit = '5'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart1 color_type = 'R2' section_id = section1 unit = '3'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart1 color_type = 'R3' section_id = section2 unit = '5'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart1 color_type = 'R4' section_id = section2 unit = '3'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart1 color_type = 'R5' section_id = section3 unit = '5'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart1 color_type = 'R6' section_id = section3 unit = '3'.

BARC_ADD_GRID CALL FUNCTION 'BARC_ADD_GRID' EXPORTING calendar_id = calendar1 chart_id = chart1 color_type = 'G1' section_id = section1 grid_type = bc_const-calendar_grid.

BARC_ADD_GRID CALL FUNCTION 'BARC_ADD_GRID' EXPORTING calendar_id = calendar1 chart_id = chart1 color_type = 'G2' section_id = section2 grid_type = bc_const-calendar_grid.

BARC_ADD_GRID CALL FUNCTION 'BARC_ADD_GRID' EXPORTING calendar_id = calendar1 chart_id = chart1 color_type = 'G3' section_id = section3 grid_type = bc_const-calendar_grid.

BARC_ADD_CHART CALL FUNCTION 'BARC_ADD_CHART' EXPORTING column_anz = 2 index = 2 size = 200 chart_type = '01' IMPORTING id = chart2 EXCEPTIONS inv_winid = 01.

BARC_SET_CHART_ATTRIB CALL FUNCTION 'BARC_SET_CHART_ATTRIB' EXPORTING fl = bc_const-chart_border_box id = chart2 val = val.

BARC_SET_CHART_ATTRIB CALL FUNCTION 'BARC_SET_CHART_ATTRIB' EXPORTING id = chart2 fl = bc_const-chart_title_box val = val.

BARC_SET_CHART_ATTRIB CALL FUNCTION 'BARC_SET_CHART_ATTRIB' EXPORTING id = chart2 fl = bc_const-multi_line_confirm val = bc_const-x.

BARC_SET_COLUMN_WIDTH CALL FUNCTION 'BARC_SET_COLUMN_WIDTH' EXPORTING chart_id = chart2 index = 1 width = 3000.

BARC_SET_COLUMN_WIDTH CALL FUNCTION 'BARC_SET_COLUMN_WIDTH' EXPORTING chart_id = chart2 index = 2 width = 4000.

BARC_SET_ROW_HEIGHT CALL FUNCTION 'BARC_SET_ROW_HEIGHT' EXPORTING chart_id = chart2 height = 1000 row_number = 1. "Zeile 1

BARC_SET_ROW_HEIGHT CALL FUNCTION 'BARC_SET_ROW_HEIGHT' EXPORTING chart_id = chart2 height = 1000 row_number = 2. "Zeile 2

BARC_SET_ROW_HEIGHT CALL FUNCTION 'BARC_SET_ROW_HEIGHT' EXPORTING chart_id = chart2 height = 1000 row_number = 3. "Zeile 3

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart2 color_type = 'R6' section_id = section1 unit = '5'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart2 color_type = 'R5' section_id = section1 unit = '3'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart2 color_type = 'R4' section_id = section2 unit = '5'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart2 color_type = 'R3' section_id = section2 unit = '3'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart2 color_type = 'R2' section_id = section3 unit = '5'.

BARC_ADD_RIBBON CALL FUNCTION 'BARC_ADD_RIBBON' EXPORTING chart_id = chart2 color_type = 'R1' section_id = section3 unit = '3'.

BARC_ADD_GRID CALL FUNCTION 'BARC_ADD_GRID' EXPORTING chart_id = chart2 color_type = 'G1' section_id = section1 unit = '3'.

BARC_ADD_GRID CALL FUNCTION 'BARC_ADD_GRID' EXPORTING chart_id = chart2 color_type = 'G1' section_id = section2 unit = '3'.

BARC_ADD_GRID CALL FUNCTION 'BARC_ADD_GRID' EXPORTING chart_id = chart2 color_type = 'G1' section_id = section3 unit = '3'.

BARC_SET_TIME_AXIS CALL FUNCTION 'BARC_SET_TIME_AXIS' EXPORTING start = '01.01.1999;'

BARC_ADD_SECTION CALL FUNCTION 'BARC_ADD_SECTION' EXPORTING size = 50 start = '01.01.1999;'

BARC_ADD_SECTION CALL FUNCTION 'BARC_ADD_SECTION' EXPORTING size = 100 start = '15.03.1999;'

BARC_ADD_SECTION CALL FUNCTION 'BARC_ADD_SECTION' EXPORTING size = 50 start = '01.03.2000;'

SCROLLING_IN_TABLE CALL FUNCTION 'SCROLLING_IN_TABLE' EXPORTING entry_act = entry_act entry_to = entry_to last_page_full = space loops = line_count ok_code = save_ok_code IMPORTING entry_new = entry_new EXCEPTIONS no_entry_or_page_act = 01 no_entry_to = 02 no_ok_code_or_page_go = 03.

SCROLLING_IN_TABLE CALL FUNCTION 'SCROLLING_IN_TABLE' EXPORTING entry_act = entry_act entry_to = entry_to last_page_full = space loops = line_count_sel ok_code = save_ok_code IMPORTING entry_new = entry_new EXCEPTIONS no_entry_or_page_act = 01 no_entry_to = 02 no_ok_code_or_page_go = 03.

BARCHART_SET_FUNCTION_CODE CALL FUNCTION 'BARCHART_SET_FUNCTION_CODE' EXPORTING handle = barc_ocx function_code = save_ok_code IMPORTING return = retval.

BARC_GRAPHIC_PBO CALL FUNCTION 'BARC_GRAPHIC_PBO' EXPORTING abap_cmd = abap_cmd stat = stat control_handle = barc_ocx.

BARC_GRAPHIC_PBO CALL FUNCTION 'BARC_GRAPHIC_PBO' EXPORTING abap_cmd = abap_cmd confirm = 'X' profile = graph_profile stat = stat status_text = status_text control_handle = barc_ocx "für OCX-Umstellung TABLES boxes = boxes box_vals = box_vals deletions = deletions links = links link_vals = link_vals nodes = nodes node_vals = node_vals positions = positions EXCEPTIONS err_in_profile = 1 inv_profile = 2 inv_winid = 3.

BARC_GRAPHIC_PAI CALL FUNCTION 'BARC_GRAPHIC_PAI' EXPORTING control_handle = barc_ocx at_control_destroy = sgrc_const-yes.

CONTROL_DESTROY CALL FUNCTION 'CONTROL_DESTROY' CHANGING h_control = barc_ocx EXCEPTIONS OTHERS = 1.



Contribute (Add Comments)

Although this basic information may have limited use it does provide an easy to find location to store any knowledge about this program/report.

The contribute/comments section below therefore offer's an opportunity for anyone to add additional information. This can be anything from useful hints, tips and screen shots to relevant SAP notes or anything else you feel is relevant to this report.

This will then be available for everyone to easily find by simply searching on the report name BARCOCX1 or its description.