Application Development 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: 

Graphic in Selection-screen - An Issue

jogeswararao_kavala
Active Contributor
0 Kudos

Dear Experts,

I have used an image to decorate the selection-screen of a report program, using:

cl_gui_docking_container and cl_gui_picture

The issue is, this graphic is continuing to output ALV screen.

How to avoid this.

Pl. help.

kind regards

Jogeswara Rao

1 ACCEPTED SOLUTION

jrg_wulf
Active Contributor
0 Kudos

Hi,

without some detail on your actual coding it's hard to tell.

When you create the instance of   cl_gui_docking_container, Which parameters do you provide?

I made a little test myself and it worked fine with just REPID and DYNNR provided in variables.

Please give some details.

Regards

Jörg

9 REPLIES 9

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi

Please check the below sample code

REPORT  zgb_prog06.

* START OF DO NOT CHANGE***********************************
DATA: docking TYPE REF TO cl_gui_docking_container,
      picture_control_1 TYPE REF TO cl_gui_picture,
      url(256) TYPE c .
DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
      html_table LIKE w3html OCCURS 1,
      return_code LIKE  w3param-ret_code,
      content_type LIKE  w3param-cont_type,
      content_length LIKE  w3param-cont_len,
      pic_data LIKE w3mime OCCURS 0,
      pic_size TYPE i.
* END OF DO NOT CHANGE*************************************
DATA : sum(4) , num1(4) , num2(4).
PARAMETERS: p_dummy(4) DEFAULT '4' .
PARAMETERS: p_dummy1(4) DEFAULT '5' .
AT SELECTION-SCREEN OUTPUT.
  PERFORM show_pic.
START-OF-SELECTION.
*&-------------------------------------------------------------------
*& Form show_pic
*&-------------------------------------------------------------------
FORM show_pic.
  DATA: repid LIKE sy-repid.
  repid = sy-repid.
  CREATE OBJECT picture_control_1 EXPORTING parent = docking.
  CHECK sy-subrc = 0.
  CALL METHOD picture_control_1->set_3d_border
    EXPORTING
      border = 5.
  CALL METHOD picture_control_1->set_display_mode
    EXPORTING
      display_mode = cl_gui_picture=>display_mode_stretch.
  CALL METHOD picture_control_1->set_position
    EXPORTING
      height = 200
      left   = 100
      top    = 20
      width  = 400.
*CHANGE POSITION AND SIZE ABOVE***************************
  IF url IS INITIAL.
    REFRESH query_table.
    query_table-name  = '_OBJECT_ID'.
*CHANGE IMAGE NAME BELOW UPLOADED IN SWO0******************
    query_table-value = 'BIKER'.
    APPEND query_table.
    CALL FUNCTION 'WWW_GET_MIME_OBJECT'
      TABLES
        query_string        = query_table
        html                = html_table
        mime                = pic_data
      CHANGING
        return_code         = return_code
        content_type        = content_type
        content_length      = content_length
      EXCEPTIONS
        object_not_found    = 1
        parameter_not_found = 2
        OTHERS              = 3.
    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 FUNCTION 'DP_CREATE_URL'
      EXPORTING
        type     = 'image'
        subtype  = cndp_sap_tab_unknown
        size     = pic_size
        lifetime = cndp_lifetime_transaction
      TABLES
        data     = pic_data
      CHANGING
        url      = url
      EXCEPTIONS
        OTHERS   = 1.
  ENDIF.
  CALL METHOD picture_control_1->load_picture_from_url
    EXPORTING
      url = url.
*Syntax for URL
*url = 'file://D:\corp-gbanerji\pickut\cartoon_184.gif'.
*url = 'http://l.yimg.com/a/i/ww/beta/y3.gif'.
ENDFORM.                    "show_pic

jrg_wulf
Active Contributor
0 Kudos

Hi,

without some detail on your actual coding it's hard to tell.

When you create the instance of   cl_gui_docking_container, Which parameters do you provide?

I made a little test myself and it worked fine with just REPID and DYNNR provided in variables.

Please give some details.

Regards

Jörg

0 Kudos

Part of the code used for picture is as under:

DATA: docking TYPE REF TO cl_gui_docking_container,

       picture_control_1 TYPE REF TO cl_gui_picture,

       url(256) TYPE c .

DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,

       html_table LIKE w3html OCCURS 1,

       return_code LIKE  w3param-ret_code,

       content_type LIKE  w3param-cont_type,

       content_length LIKE  w3param-cont_len,

       pic_data LIKE w3mime OCCURS 0,

       pic_size TYPE i.

DATA: repid LIKE sy-repid.

AT SELECTION-SCREEN OUTPUT.

    repid = sy-repid.

   CREATE OBJECT picture_control_1 EXPORTING parent = docking.

   CHECK sy-subrc = 0.

   CALL METHOD picture_control_1->set_3d_border

     EXPORTING

       border = 0.

   CALL METHOD picture_control_1->set_display_mode

     EXPORTING

       display_mode = cl_gui_picture=>display_mode_stretch.

   CALL METHOD picture_control_1->set_position

     EXPORTING

       height = 278

       left   = 900

       top    = 0

       width  = 462.

   IF url IS INITIAL.

     REFRESH query_table.

     query_table-name  = '_OBJECT_ID'.

     query_table-value = 'ZKMG'.

     APPEND query_table.

     CALL FUNCTION 'WWW_GET_MIME_OBJECT'

       TABLES

         query_string        = query_table

         html                = html_table

         mime                = pic_data

       CHANGING

         return_code         = return_code

         content_type        = content_type

         content_length      = content_length

       EXCEPTIONS

         object_not_found    = 1

         parameter_not_found = 2

         OTHERS              = 3.

     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 FUNCTION 'DP_CREATE_URL'

       EXPORTING

         type     = 'image'

         subtype  = cndp_sap_tab_unknown

         size     = pic_size

         lifetime = cndp_lifetime_transaction

       TABLES

         data     = pic_data

       CHANGING

         url      = url

       EXCEPTIONS

         OTHERS   = 1.

   ENDIF.

   CALL METHOD picture_control_1->load_picture_from_url

     EXPORTING

       url = url.

kind regards

Jogeswara Rao

jrg_wulf
Active Contributor
0 Kudos

Hi,

In your code, i don't see where you actually create object docking.

I've tested back and forth but haven't met your problem. I tried INITIALIZATION as well as AT SELECTION-SCREEN OUTPUT like in your example. Both worked fine with no picture in ALV.

I can only guess, that you're passing the handle to your docking container to your alv container in some way.

Regards Jörg

0 Kudos

Thank you Jörg,

As per your reply, whether this problem has anything to do with the FM for ALV.

My ALV FM Code is as under:

     CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

       EXPORTING

         i_callback_program = sy-repid

         it_fieldcat        = git_fieldcat[]

         is_layout          = gs_layout

         it_sort            = git_sort

         i_default          = 'X'

         i_save             = 'A'

         is_variant         = v_variant

         it_events          = events

       TABLES

         t_outtab           = ITAB4

       EXCEPTIONS

         program_error      = 1

         OTHERS             = 2.

Any clues?

Thanks again.

jrg_wulf
Active Contributor
0 Kudos

Hi,

as far as i remember, it is not recommended to pass sy-repid to FM but instead use a variable.

Nevertheless, a test with sy-repid didn't bring up the problem either.

Sorry, i have no clue, since i cannot reproduce the issue.

You could still give it a try, to pass your report-id by variable instead of sy-repid.

Regards

Jörg

jrg_wulf
Active Contributor
0 Kudos

Hi,

i've just done a bit more of testing and now was able to reproduce your issue.

The solution is quite easy.

Just add

CALL METHOD picture_control_1->set_visible

   EXPORTING

      visible = cl_gui_picture=>visible_false.

to your code at START-OF-SELECTION, and all will be well.

Regards

Jörg

0 Kudos

Thank you so much Jörg, for the pains you've taken.

I'm off the desk and at residence. I'll apply this good news from you, early duty hours of tomorrow(about 12hrs from now) and get back to you.

kind regards

Jogeswara Rao

Just now tested, You're Great.

Lucky to have been hooked to you.

Thanks again.

kind regards

Jogeswara Rao