Skip to Content
author's profile photo Former Member
Former Member

ABAP OLE2 code issue with chart development

Hi Experts,

The below ABAP OLE2 code isn't working for me: 😔

* Making the Series lines with no Markers

GET PROPERTY OF h_excel 'ActiveChart' = h_chart3.

CALL METHOD OF h_chart3

'SeriesCollection' = h_series

EXPORTING #1 = c_maxinv. "Name of the Series

* CALL METHOD OF

* h_chart3

* 'SeriesCollection(1)' = h_series.

CALL METHOD OF h_series 'Select'.

GET PROPERTY OF h_series 'Border' = h_series.

SET PROPERTY OF h_series 'MarkerStyle' = '-4142'. " None

for the below VBA:

ActiveChart.SeriesCollection(2).Select

With Selection.Border

.ColorIndex = 3

.Weight = xlThin

.LineStyle = xlContinuous

End With

With Selection

.MarkerBackgroundColorIndex = xlAutomatic

.MarkerForegroundColorIndex = xlAutomatic

.MarkerStyle = xlNone

.Smooth = False

.MarkerSize = 5

.Shadow = False

End With

End Sub

-------------------------------

This one is also not working 😔

* Making the Horizontal Axis Label to display in the bottom

CALL METHOD OF h_chart3 'Axes' = h_axis

EXPORTING #1 = 3. "xlTimeScale

SET PROPERTY OF h_axis 'HasAxis' = 1.

CALL METHOD OF h_axis 'Select'.

SET PROPERTY OF h_axis 'TickLabelPosition' = '-4134'. "xlLow

-------------

* Making the Max Inv / Min Inv lines - Red Color

* CALL METHOD OF

* h_chart3

* 'SeriesCollection(1)' = h_series.

CALL METHOD OF h_chart3 'SeriesCollection' = h_series EXPORTING #1 = c_maxinv.

CALL METHOD OF h_series 'Select'.

GET PROPERTY OF h_series 'Border' = h_series.

SET PROPERTY OF h_series 'ColorIndex' = '3'. " Red colored Line

SET PROPERTY OF h_series 'LineStyle' = '-4115'. " Dashed Line

SET PROPERTY OF h_series 'MarkerStyle' = '-4142'. " None

Can someone help me in this issue? Where did I go wrong in the above code?

Thanks & Regards,

Sowmya

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jun 15, 2012 at 05:23 AM

    Hi,

    I think the problem is in passing the value of XlDash from abap to excel. Have a look at the follwoing code :

    CALL METHOD OF h_chart4 'SeriesCollection' = series
    EXPORTING
    #1 = 'Required'. " Here required is my series name, in you case c_maxinv

    GET PROPERTY OF series 'Border' = gv_border.

    SET PROPERTY OF gv_border 'ColorIndex' = '3'.


    * SET PROPERTY OF gv_border 'LineStyle' = '4'."'&HFFFFEFED'."'-4115'.

    It works fine to change the color of the selected line and also to change the line style to XlDashDot. Even i am having problems in changing the linestyle to XlDash.

    Thanks and regards,

    kartik

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.