Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP 2D Report

Former Member
0 Likes
1,442

Hi Experts,

I have created a ABAP PI Chart Report With the Function Module 'GRAPH_2D'.

Coding :

  DATA: BEGIN OF i_tab OCCURS 0,
name(20) TYPE c,
value TYPE p,
END OF i_tab.

i_tab-name = 'Trucks Ordered'.
i_tab-value = '90'.
APPEND i_tab.

CLEAR i_tab.

i_tab-name = 'Trucks Placed'.
i_tab-value = '30'.
APPEND i_tab.
CLEAR i_tab.

i_tab-name = 'Closing for Balance'.
i_tab-value = '27'.
APPEND i_tab.
CLEAR i_tab.


CALL FUNCTION 'GRAPH_2D'
  EXPORTING
    type              = 'PI'
    titl              = 'My Graph'
  TABLES
    data              = i_tab
  EXCEPTIONS
    gui_refuse_graphic = 1
    OTHERS            = 2.
IF sy-subrc EQ 0.
ENDIF.

The Output I get is, the below Report using Business Graphics,

But, the Output I require i like the report below,

Thanks,

Shankar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,315

Hi Shankar,

Instead of GRAPH_2D function module pls try with

CALL FUNCTION 'GRAPH_MATRIX_2D'
        EXPORTING
             TITL       = TITLE
             VALT       = 'DM'
             NROW       = 2D_ROW
             MAIL_ALLOW = 'X'
        TABLES
             DATA       = DATA
             OPTS       = OPTS
             TCOL       = TYEAR.

Please Refer the DEMO Program GRBUSG_3 (LINE GRAPHICS) For Better understanding.

Regards,

Ramya R

Hi Experts,

I have created a ABAP PI Chart Report With the Function Module 'GRAPH_2D'.

Coding :

  DATA: BEGIN OF i_tab OCCURS 0,
name(20) TYPE c,
value TYPE p,
END OF i_tab.

i_tab-name = 'Trucks Ordered'.
i_tab-value = '90'.
APPEND i_tab.

CLEAR i_tab.

i_tab-name = 'Trucks Placed'.
i_tab-value = '30'.
APPEND i_tab.
CLEAR i_tab.

i_tab-name = 'Closing for Balance'.
i_tab-value = '27'.
APPEND i_tab.
CLEAR i_tab.


CALL FUNCTION 'GRAPH_2D'
  EXPORTING
    type              = 'PI'
    titl              = 'My Graph'
  TABLES
    data              = i_tab
  EXCEPTIONS
    gui_refuse_graphic = 1
    OTHERS            = 2.
IF sy-subrc EQ 0.
ENDIF.

The Output I get is, the below Report using Business Graphics,

But, the Output I require i like the report below,

Thanks,

Shankar

5 REPLIES 5
Read only

Former Member
0 Likes
1,316

Hi Shankar,

Instead of GRAPH_2D function module pls try with

CALL FUNCTION 'GRAPH_MATRIX_2D'
        EXPORTING
             TITL       = TITLE
             VALT       = 'DM'
             NROW       = 2D_ROW
             MAIL_ALLOW = 'X'
        TABLES
             DATA       = DATA
             OPTS       = OPTS
             TCOL       = TYEAR.

Please Refer the DEMO Program GRBUSG_3 (LINE GRAPHICS) For Better understanding.

Regards,

Ramya R

Read only

0 Likes
1,315

Hi Ramya,

Yep, I got it Ramya. But, I get the Ouput as the Bar Char, But, I need it as PI Chart.

Thanks,

Shankar

Read only

0 Likes
1,315

Hi Shankar,

Please Refer the DEMO Program GRBUSG_3 (LINE GRAPHICS). In that the sample code is there for your requirement.

Regards,

Ramya R

Read only

gouravkumar64
Active Contributor
Read only

Former Member
0 Likes
1,315

Hi Shankar,

Try FM GRAPH_MATRIX_2D

opts-c = 'P2TYPE = PI'.
APPEND opts.
opts-c = 'P2PCNT = X'.
APPEND opts.

   CALL FUNCTION 'GRAPH_MATRIX_2D'
  EXPORTING
    titl        = 'My Graph'
  TABLES
    data        = i_tab
    opts        = opts
    tcol        = i_tcol
  EXCEPTIONS
    col_invalid = 1
    opt_invalid = 2
    OTHERS      = 3.

Regards,

Ravi.