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

ALV report using OOPS concept.

Former Member
0 Likes
7,256

Hi,

Please help me in writing ALV report using OOPS concept as i have never used this concept before.Please post a clear picture for this.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,036

Hi,

Pls find the steps below.

1) Create a Z report program.

2) Now create a screen (say 100) in your report program. You can do this by writing call screen 100 and double clicking on it.

3) now in the screen painter of screen 100, click on Edit->create element->custom control

4) give some name. say (LIST_GRID). Save and come back to report

5) Now in the data declaretion add the follow statments

DATA:lo_container TYPE REF TO cl_gui_custom_container,

lo_grid TYPE REF TO cl_gui_alv_grid.

6) populate the output internal table, field catlog etc...

7) now do the following.

CREATE OBJECT lo_container

EXPORTING

container_name = 'LIST_GRID'.

CREATE OBJECT lo_grid

EXPORTING

i_parent = lo_container.

*(LIST_GRID is the name which you have given in the screen painter)

😎 Now, do the following

CALL METHOD lo_grid->set_table_for_first_display

EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

I_STRUCTURE_NAME = 'MARA' "UR STRUCTURE

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT = 'X'

  • IS_LAYOUT =

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

CHANGING

it_outtab = it_ans "UR INTERNAL TABLE

  • IT_FIELDCATALOG =

  • IT_SORT =

  • IT_FILTER =

  • EXCEPTIONS

  • INVALID_PARAMETER_COMBINATION = 1

  • PROGRAM_ERROR = 2

  • TOO_MANY_LINES = 3

  • others = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Reward point if useful.

Regards,

Niyaz

7 REPLIES 7
Read only

Former Member
0 Likes
4,036

HI

Here is the simple code as explained previously.

REPORT  zgs_simple_alv.
 
DATA : it_mara TYPE TABLE OF mara.
 
DATA : container TYPE REF TO cl_gui_custom_container,
       grid TYPE REF TO cl_gui_alv_grid.
 
SELECT * FROM mara INTO TABLE it_mara UP TO 10 ROWS.
 
 CREATE OBJECT container
   EXPORTING
*     PARENT                      =
     container_name              =  'CONTAINER'
*     STYLE                       =
*     LIFETIME                    = lifetime_default
*     REPID                       =
*     DYNNR                       =
*     NO_AUTODEF_PROGID_DYNNR     =
*   EXCEPTIONS
*     CNTL_ERROR                  = 1
*     CNTL_SYSTEM_ERROR           = 2
*     CREATE_ERROR                = 3
*     LIFETIME_ERROR              = 4
*     LIFETIME_DYNPRO_DYNPRO_LINK = 5
*     others                      = 6
     .
 IF sy-subrc <> 0.
*  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
 ENDIF.
 
 
CREATE OBJECT grid
  EXPORTING
*    I_SHELLSTYLE      = 0
*    I_LIFETIME        =
    i_parent          = container
*    I_APPL_EVENTS     = space
*    I_PARENTDBG       =
*    I_APPLOGPARENT    =
*    I_GRAPHICSPARENT  =
*    I_NAME            =
*    I_FCAT_COMPLETE   = SPACE
*  EXCEPTIONS
*    ERROR_CNTL_CREATE = 1
*    ERROR_CNTL_INIT   = 2
*    ERROR_CNTL_LINK   = 3
*    ERROR_DP_CREATE   = 4
*    others            = 5
    .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
 
CALL METHOD grid->set_table_for_first_display
  EXPORTING
*    I_BUFFER_ACTIVE               =
*    I_BYPASSING_BUFFER            =
*    I_CONSISTENCY_CHECK           =
    i_structure_name              = 'MARA'
*    IS_VARIANT                    =
*    I_SAVE                        =
*    I_DEFAULT                     = 'X'
*    IS_LAYOUT                     =
*    IS_PRINT                      =
*    IT_SPECIAL_GROUPS             =
*    IT_TOOLBAR_EXCLUDING          =
*    IT_HYPERLINK                  =
*    IT_ALV_GRAPHICS               =
*    IT_EXCEPT_QINFO               =
*    IR_SALV_ADAPTER               =
  CHANGING
    it_outtab                     = it_mara
*    IT_FIELDCATALOG               =
*    IT_SORT                       =
*    IT_FILTER                     =
*  EXCEPTIONS
*    INVALID_PARAMETER_COMBINATION = 1
*    PROGRAM_ERROR                 = 2
*    TOO_MANY_LINES                = 3
*    others                        = 4
        .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
 
CALL SCREEN 100.

http://www.erpgenie.com/abap/controls/alvgrid.htm

Go to the following link which gives you sample codes with brief description of the programs.

OOALV

Then coming to steps for creation of ALV in OOABAP.

1. Create a program in se38 and just activate it without any code for now.

2. Go to module pool and create a screen, put a custom container control on to the screen. (You will find this control on right side tool box).

3. Give a name to the control created in step 2.

4. Activate the screen.

5. Come to the program declare two variables to hold instances of 2 classes CL_GUI_CUSTOM_CONTAINER, CL_GUI_ALV_GRID.

6. create an instance of the class CL_GUI_CUSTOM_CONTAINER passing container name created in step 3.

7. create an instance of the class CL_GUI_ALV_GRID passing INSTANCE VARIBALE name created in step 6.

8. using the ref. variable of previous step call method SET_TABLE FORFIRST_DISPLAY method and pass structure name and internal table containing data.

9. then call screen created in step 2.

Hey... execute the program . You are there with your OOALV.

http://www.sapdev.co.uk/reporting/alv/alvscr.htm

<b>Reward if usefull</b>

Read only

former_member386202
Active Contributor
0 Likes
4,036

Hi,

Goto SE38 give BCALV* and pressF4 it will display list of all oops alv stadard programs just refer that.

Regards,

Prashant

Read only

Former Member
0 Likes
4,037

Hi,

Pls find the steps below.

1) Create a Z report program.

2) Now create a screen (say 100) in your report program. You can do this by writing call screen 100 and double clicking on it.

3) now in the screen painter of screen 100, click on Edit->create element->custom control

4) give some name. say (LIST_GRID). Save and come back to report

5) Now in the data declaretion add the follow statments

DATA:lo_container TYPE REF TO cl_gui_custom_container,

lo_grid TYPE REF TO cl_gui_alv_grid.

6) populate the output internal table, field catlog etc...

7) now do the following.

CREATE OBJECT lo_container

EXPORTING

container_name = 'LIST_GRID'.

CREATE OBJECT lo_grid

EXPORTING

i_parent = lo_container.

*(LIST_GRID is the name which you have given in the screen painter)

😎 Now, do the following

CALL METHOD lo_grid->set_table_for_first_display

EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

I_STRUCTURE_NAME = 'MARA' "UR STRUCTURE

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT = 'X'

  • IS_LAYOUT =

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

CHANGING

it_outtab = it_ans "UR INTERNAL TABLE

  • IT_FIELDCATALOG =

  • IT_SORT =

  • IT_FILTER =

  • EXCEPTIONS

  • INVALID_PARAMETER_COMBINATION = 1

  • PROGRAM_ERROR = 2

  • TOO_MANY_LINES = 3

  • others = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Reward point if useful.

Regards,

Niyaz

Read only

Former Member
0 Likes
4,036

Hi

Refer this code:

REPORT zcls_alv_oops MESSAGE-ID z1.

TABLES : mara.

\*----


\-

  • Types Declaration..
\

\*----


\-

TYPES :

BEGIN OF t_mara,

matnr TYPE matnr,

mtart TYPE mtart,

maktx TYPE maktx,

END OF t_mara,

\*

BEGIN OF t_marc,

matnr TYPE matnr,

werks TYPE werks_d,

mtart TYPE mtart,

maktx TYPE maktx,

END OF t_marc.

\*----


\-

  • Internal Tables Declaration..
\

\*----


\-

DATA :

i_mara TYPE TABLE OF t_mara,

i_marc TYPE TABLE OF t_marc,

i_fcat1 TYPE lvc_t_fcat,

i_fcat2 TYPE lvc_t_fcat.

\*----


\-

  • Constants Declaration..
\

\*----


\-

CONSTANTS :

c_cont1 TYPE scrfname VALUE 'CONT1',

c_cont2 TYPE scrfname VALUE 'CONT2'.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS:

s_matnr FOR mara-matnr NO INTERVALS.

SELECTION-SCREEN SKIP 1.

PARAMETERS :

p_hotspt RADIOBUTTON GROUP r1 DEFAULT 'X',

p_bttn RADIOBUTTON GROUP r1.

SELECTION-SCREEN END OF BLOCK b1.

\*

\* Class forward referncing.

CLASS lcl_rcvr_class DEFINITION DEFERRED.

\*----


\-

\* Pointers Declaration..

\*----


\-

DATA :

lp_rcvr TYPE REF TO lcl_rcvr_class,

lp_cont1 TYPE REF TO cl_gui_custom_container,

lp_cont2 TYPE REF TO cl_gui_custom_container,

lp_grid1 TYPE REF TO cl_gui_alv_grid,

lp_grid2 TYPE REF TO cl_gui_alv_grid.

\*----


\-

\* Local Class Definiton.

\*----


\-

CLASS lcl_rcvr_class DEFINITION.

PUBLIC SECTION.

METHODS :

hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid

IMPORTING e_row_id e_column_id es_row_no,

\*

handle_double_click FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING e_row e_column.

ENDCLASS.

\*----


\-

\* Local Class Implementation.

\*----


\-

CLASS lcl_rcvr_class IMPLEMENTATION.

METHOD hotspot_click.

DATA :

wa_mara TYPE t_mara,

wa_marc TYPE t_marc.

\*

DATA :

l_index TYPE sy-tabix.

\*

READ TABLE i_mara INTO wa_mara INDEX e_row_id-index.

IF sy-subrc EQ 0.

REFRESH i_marc.

SELECT matnr

werks

INTO TABLE i_marc

FROM marc

WHERE matnr EQ wa_mara-matnr.

\*

IF sy-subrc EQ 0.

LOOP AT i_marc INTO wa_marc.

l_index = sy-tabix.

wa_marc-mtart = wa_mara-mtart.

wa_marc-maktx = wa_mara-maktx.

MODIFY i_marc FROM wa_marc INDEX l_index

TRANSPORTING mtart maktx.

ENDLOOP.

CALL SCREEN 200.

ELSE.

MESSAGE e121 WITH text-005 wa_mara-matnr.

ENDIF.

ENDIF.

\*

ENDMETHOD.

\*

METHOD handle_double_click.

DATA :

wa_mara TYPE t_mara,

wa_marc TYPE t_marc.

\*

DATA :

l_index TYPE sy-tabix.

\*

READ TABLE i_mara INTO wa_mara INDEX e_row-index.

IF sy-subrc EQ 0.

REFRESH i_marc.

SELECT matnr

werks

INTO TABLE i_marc

FROM marc

WHERE matnr EQ wa_mara-matnr.

\*

IF sy-subrc EQ 0.

LOOP AT i_marc INTO wa_marc.

l_index = sy-tabix.

wa_marc-mtart = wa_mara-mtart.

wa_marc-maktx = wa_mara-maktx.

MODIFY i_marc FROM wa_marc INDEX l_index

TRANSPORTING mtart maktx.

ENDLOOP.

CALL SCREEN 200.

ELSE.

MESSAGE e121 WITH text-005 wa_mara-matnr.

ENDIF.

ENDIF.

\*

ENDMETHOD.

ENDCLASS.

\*----


\-

\* Start of Selection

\*----


\-

START-OF-SELECTION.

\* Extract the Material Master data for the Input Material.

SELECT a~matnr

a~mtart

b~maktx

INTO TABLE i_mara

FROM mara AS a

INNER JOIN makt AS b

ON a~matnr EQ b~matnr

WHERE a~matnr IN s_matnr

AND b~spras EQ sy-langu.

\*

END-OF-SELECTION.

IF NOT i_mara\[\] IS INITIAL.

\* Call Screen to display the Material Master data.

CALL SCREEN 100.

ELSE.

MESSAGE s121 WITH text-006.

ENDIF.

\*&----


\*

\*& Module DISP_GRID OUTPUT

\*&----


\*

\* text

\*----


\*

MODULE disp_grid OUTPUT.

\* Build the Field catelog for Material Master data.

PERFORM build_fcat.

\* Display the Material Master data using ALV.

PERFORM disp_alv.

\*

ENDMODULE. " DISP_GRID OUTPUT

\*&----


\*

\*& Module USER_COMMAND_0100 INPUT

\*&----


\*

\* text

\*----


\*

MODULE user_command_0100 INPUT.

\*

\*when exit or cancel is clicked program has to come out

CASE sy-ucomm.

WHEN 'EXIT' OR 'CANC'.

LEAVE PROGRAM.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

ENDCASE.

\*

ENDMODULE. " USER_COMMAND_0100 INPUT

\*&----


\*

\*& Form build_fcat

\*&----


\*

\* text

\*----


\*

\* \--> p1 text

\* <-\- p2 text

\*----


\*

FORM build_fcat.

\*

DATA : ws_fcat TYPE lvc_s_fcat.

\*

ws_fcat-fieldname = 'MATNR'.

ws_fcat-scrtext_m = text-001.

ws_fcat-tabname = 'I_MARA'.

IF p_hotspt EQ 'X'.

ws_fcat-hotspot = 'X'.

ENDIF.

APPEND ws_fcat TO i_fcat1.

CLEAR ws_fcat.

\*

ws_fcat-fieldname = 'MTART'.

ws_fcat-scrtext_m = text-002.

ws_fcat-tabname = 'I_MARA'.

APPEND ws_fcat TO i_fcat1.

CLEAR ws_fcat.

\*

ws_fcat-fieldname = 'MAKTX'.

ws_fcat-scrtext_m = text-003.

ws_fcat-tabname = 'I_MARA'.

APPEND ws_fcat TO i_fcat1.

CLEAR ws_fcat.

\*

ENDFORM. " build_fcat

\*&----


\*

\*& Form disp_alv

\*&----


\*

\* text

\*----


\*

\* \--> p1 text

\* <-\- p2 text

\*----


\*

FORM disp_alv.

\*

IF lp_cont1 IS INITIAL.

\* Create the Container Object of Material Master.

CREATE OBJECT lp_cont1

EXPORTING

container_name = c_cont1

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5

others = 6 .

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

\* Create the Object for Grid of Material Master.

CREATE OBJECT lp_grid1

EXPORTING

i_parent = lp_cont1

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

others = 5.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

\* Dipslay Material Master data by calling method.

CALL METHOD lp_grid1->set_table_for_first_display

CHANGING

it_outtab = i_mara

it_fieldcatalog = i_fcat1

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

\* Set Handler for the Hot Spot Event.

CREATE OBJECT lp_rcvr.

IF p_hotspt EQ 'X'.

SET HANDLER lp_rcvr->hotspot_click FOR lp_grid1.

ELSE.

SET HANDLER lp_rcvr->handle_double_click FOR lp_grid1.

ENDIF.

ENDIF.

\*

ENDIF.

\*

ENDIF.

\*

ENDIF.

\*

ENDFORM. " disp_alv

\*&----


\*

\*& Module STATUS_0100 OUTPUT

\*&----


\*

\* text

\*----


\*

MODULE status_0100 OUTPUT.

SET PF-STATUS 'MAIN_STAT'.

SET TITLEBAR 'T_100'.

ENDMODULE. " STATUS_0100 OUTPUT

\*&----


\*

\*& Module STATUS_0200 OUTPUT

\*&----


\*

\* text

\*----


\*

MODULE status_0200 OUTPUT.

SET PF-STATUS 'PLANT_STAT'.

SET TITLEBAR 'T_200'.

ENDMODULE. " STATUS_0200 OUTPUT

\*&----


\*

\*& Module DISP_GRID_plant OUTPUT

\*&----


\*

\* text

\*----


\*

MODULE disp_grid_plant OUTPUT.

\* Build the Field catelog for Material Plant data.

PERFORM build_fcat_plant.

\* Display the Material Master Plant data using ALV.

PERFORM disp_alv_plant.

ENDMODULE. " DISP_GRID_plant OUTPUT

\*&----


\*

\*& Module USER_COMMAND_0200 INPUT

\*&----


\*

\* text

\*----


\*

MODULE user_command_0200 INPUT.

\*

\*when exit or cancel is clicked program has to come out

CASE sy-ucomm.

WHEN 'EXIT' OR 'CANC'.

LEAVE PROGRAM.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

ENDCASE.

\*

ENDMODULE. " USER_COMMAND_0200 INPUT

\*&----


\*

\*& Form build_fcat_plant

\*&----


\*

\* text

\*----


\*

\* \--> p1 text

\* <-\- p2 text

\*----


\*

FORM build_fcat_plant.

DATA : ws_fcat TYPE lvc_s_fcat.

\*

ws_fcat-fieldname = 'MATNR'.

ws_fcat-scrtext_m = text-001.

ws_fcat-tabname = 'I_MARC'.

APPEND ws_fcat TO i_fcat2.

CLEAR ws_fcat.

\*

ws_fcat-fieldname = 'WERKS'.

ws_fcat-scrtext_m = text-004.

ws_fcat-tabname = 'I_MARC'.

APPEND ws_fcat TO i_fcat2.

CLEAR ws_fcat.

\*

ws_fcat-fieldname = 'MTART'.

ws_fcat-scrtext_m = text-002.

ws_fcat-tabname = 'I_MARC'.

APPEND ws_fcat TO i_fcat2.

CLEAR ws_fcat.

\*

ws_fcat-fieldname = 'MAKTX'.

ws_fcat-scrtext_m = text-003.

ws_fcat-tabname = 'I_MARC'.

APPEND ws_fcat TO i_fcat2.

CLEAR ws_fcat.

\*

ENDFORM. " build_fcat_plant

\*&----


\*

\*& Form disp_alv_plant

\*&----


\*

\* text

\*----


\*

\* \--> p1 text

\* <-\- p2 text

\*----


\*

FORM disp_alv_plant.

IF lp_cont2 IS INITIAL.

\* Create the Container Object of Material Plant data.

CREATE OBJECT lp_cont2

EXPORTING

container_name = c_cont2

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5

others = 6.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

\* Create the Object for Grid of Material Plant data.

CREATE OBJECT lp_grid2

EXPORTING

i_parent = lp_cont2

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

others = 5.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

\* Dipslay Material Plant data by calling method.

CALL METHOD lp_grid2->set_table_for_first_display

CHANGING

it_outtab = i_marc

it_fieldcatalog = i_fcat2

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

\*

ENDIF.

\*

ENDIF.

\*

ELSE.

\* Call method 'REFRESH_TABLE_DISPLAY' to refresh the grid data.

CALL METHOD lp_grid2->refresh_table_display.

ENDIF.

\*

ENDFORM. " disp_alv_plant

Thanks

Vasudha

Read only

Former Member
0 Likes
4,036

Hi,

http://www.abap4.it/download/ALV.pdf

check this .pdf file. Its very good and simple to learn ALV with OOPS.

Regards,

Vikram

Read only

Former Member
0 Likes
4,036

HI

<b>Object Oriented ALV-Sample program to insert Logo in ALV</b>

REPORT z_ooalv_logo.

****DECLARATION FOR LOGO INSERT
CONSTANTS: cntl_true TYPE i VALUE 1,
cntl_false TYPE i VALUE 0.
DATA:h_picture TYPE REF TO cl_gui_picture,
h_pic_container TYPE REF TO cl_gui_custom_container.

DATA: graphic_url(255),
graphic_refresh(1),
g_result LIKE cntl_true.

DATA: BEGIN OF graphic_table OCCURS 0,
line(255) TYPE x,
END OF graphic_table.

DATA: graphic_size TYPE i.

CALL SCREEN 100.

*&---------------------------------------------------------------------*
*& Module PICTURE OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE picture OUTPUT.

DATA: l_graphic_xstr TYPE xstring,
l_graphic_conv TYPE i,
l_graphic_offs TYPE i.

CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = 'GRAPHICS'
p_name = 'EDS'"IMAGE NAME - Image name from SE78
p_id = 'BMAP'
p_btype = 'BCOL'
RECEIVING
p_bmp = l_graphic_xstr
EXCEPTIONS
not_found = 1
OTHERS = 2.


graphic_size = XSTRLEN( l_graphic_xstr ).
CHECK graphic_size > 0.

l_graphic_conv = graphic_size.
l_graphic_offs = 0.

WHILE l_graphic_conv > 255.
graphic_table-line = l_graphic_xstr+l_graphic_offs(255).
APPEND graphic_table.
l_graphic_offs = l_graphic_offs + 255.
l_graphic_conv = l_graphic_conv - 255.
ENDWHILE.

graphic_table-line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).
APPEND graphic_table.

CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'image'
subtype = cndp_sap_tab_unknown " 'X-UNKNOWN'
size = graphic_size
lifetime = cndp_lifetime_transaction "'T'
TABLES
data = graphic_table
CHANGING
url = graphic_url
EXCEPTIONS
* dp_invalid_parameter = 1
* dp_error_put_table = 2
* dp_error_general = 3
OTHERS = 4 .
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.

CREATE OBJECT h_pic_container
EXPORTING container_name = 'LOGO'.
CREATE OBJECT h_picture EXPORTING parent = h_pic_container.

CALL METHOD h_picture->load_picture_from_url
EXPORTING
url = graphic_url
IMPORTING
RESULT = g_result.



ENDMODULE. " PICTURE OUTPUT