CL_GUI_PICTURE: Show a bitmap on a dynpro

Hi abap masters.
I want to show a bitmap on a dynpro stored on the application server. All seems to work fine: No FM exceptions, GUIDs generated, ... but I don't know why the picture is not shown.
Please, help!!
  TYPES pict_line(256) TYPE x.
  DATA: lt_pict_tab  TYPE TABLE OF pict_line,
        wa_pict_line TYPE pict_line,
        lv_url(255)  TYPE c,
        len          TYPE i.
  DATA: lv_direc   TYPE char50,
        lv_syrepid TYPE syrepid,
        lv_dynnr   TYPE sydynnr.
  lv_syrepid = sy-repid.
  lv_dynnr = '9001'.
DATA: container1 TYPE REF TO cl_gui_custom_container,
            picture      TYPE REF TO cl_gui_picture.
  IF container1 IS INITIAL.
    CREATE OBJECT container1
      EXPORTING
*    PARENT                      =
        container_name              = 'PICTURE'
*    STYLE                       =
*    LIFETIME                    = lifetime_default
      repid                       = lv_syrepid
      dynnr                       = lv_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.
      IF picture IS INITIAL.
        CREATE OBJECT picture
          EXPORTING
*    LIFETIME =
*    SHELLSTYLE =
            parent = container1
*    NAME   =
          EXCEPTIONS
            error  = 1
            OTHERS = 2.
        IF sy-subrc = 0.
          CALL METHOD picture->set_display_mode
            EXPORTING
              display_mode = cl_gui_picture=>display_mode_fit_center
            EXCEPTIONS
              error        = 1
              OTHERS       = 2.
          IF sy-subrc <> 0.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.
  IF picture IS NOT INITIAL.
* Obtener ruta del directorio
    SELECT SINGLE valor INTO lv_direc
    FROM t9lacredp_params
    WHERE clave1 = c_dir_fotos.
    CONCATENATE lv_direc wa_acred_aux-inss c_ext_bmp INTO lv_svrfile.
****Hay que cargar la imagen en LT_PICT_TAB
    DESCRIBE FIELD wa_pict_line LENGTH len IN BYTE MODE.
    OPEN DATASET lv_svrfile FOR INPUT IN BINARY MODE.
    IF sy-subrc = 0.
      DO.
        READ DATASET lv_svrfile INTO wa_pict_line MAXIMUM LENGTH len.
        IF sy-subrc = 0.
          APPEND wa_pict_line TO lt_pict_tab.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
    ENDIF.
    CLOSE DATASET lv_svrfile.
    CALL FUNCTION 'DP_CREATE_URL'
      EXPORTING
        type                       = 'IMAGE'
        subtype                    = CNDP_SAP_SUBTYPE_UNKNOWN
*   SIZE                       =
*   DATE                       =
*   TIME                       =
*   DESCRIPTION                =
*   LIFETIME                   =
*   CACHEABLE                  =
*   SEND_DATA_AS_STRING        =
      TABLES
        data                       = lt_pict_tab
*   FIELDS                     =
*   PROPERTIES                 =
      CHANGING
        url                        = lv_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.
    ENDIF.
    CALL METHOD picture->load_picture_from_url
      EXPORTING
        url    = lv_url
      EXCEPTIONS
        error  = 1
        OTHERS = 2.
    IF sy-subrc = 0.
      CALL METHOD cl_gui_cfw=>flush.
    ELSE.
    ENDIF.
  ENDIF.
  FREE lt_pict_tab.
Thanks in advance,
Jordi

class lcl_event_handler definition .
  public section .
    methods:
*Event Handler for Top of page
    top_of_page for event top_of_page
           of cl_gui_alv_grid
           importing e_dyndoc_id. "#EC NEEDED
endclass.             "lcl_event_handler DEFINITION
data: g_custom_container  type ref to cl_gui_custom_container,
      g_handler           type ref to lcl_event_handler.
      CLASS LCL_EVENT_HANDLER IMPLEMENTATION
class lcl_event_handler implementation.
  method top_of_page.
Top-of-page event
    perform event_top_of_page using o_dyndoc_id. "#EC NEEDED
  endmethod.                            "top_of_page
endclass.       "LCL_EVENT_HANDLER IMPLEMENTATION
  create object g_custom_container
    exporting
      container_name = g_container.
  create object o_dyndoc_id
    exporting
      style = 'ALV_GRID'.
Create Splitter for custom_container
  create object o_splitter
    exporting
      parent  = g_custom_container
      rows    = 2
      columns = 1.
  call method o_splitter->get_container
    exporting
      row       = 1
      column    = 1
    receiving
      container = o_parent_top.
  call method o_splitter->get_container
    exporting
      row       = 2
      column    = 1
    receiving
      container = o_parent_grid.
Set height for g_parent_html
*If Summary is choosed
  if p_summ eq 'X'.
    call method o_splitter->set_row_height
      exporting
        id     = 1
        height = 100.
  else.
    call method o_splitter->set_row_height
      exporting
        id     = 2
        height = 100.
  endif.
  create object g_grid
    exporting
      i_parent = o_parent_grid.
  if p_summ = 'X'.
    create object g_handler.
    set handler g_handler->top_of_page for g_grid.
  endif.
*Calling the Method for ALV output
  if p_deta eq 'X' .
    call method g_grid->set_table_for_first_display
      changing
        it_outtab       = il_final
        it_fieldcatalog = il_fieldcatalog.
  endif.
  if p_summ = 'X'.
    call method g_grid->list_processing_events
      exporting
        i_event_name = 'TOP_OF_PAGE'
        i_dyndoc_id  = o_dyndoc_id.
  endif.
  data: sdydo_text_element type sdydo_text_element.
  sdydo_text_element = text-015.
  call method document->add_picture
    exporting
      picture_id = logo.
  call method document->new_line.
  call method document->new_line.
  call method document->add_gap
    exporting
      width = 50.
  call method document->add_text
    exporting
      text      = sdydo_text_element
      sap_style = 'HEADING'.

Similar Messages

  • How to show a pcd object in dynpro view

    Hi All,
    I have to show a PCD object in dynpro view but I can't use iFrame because it will show all header footer of portal not just view.
    what will be other way to show a PCD object in Webdynpro view.
    Thanks

    Hi John,
    Yes I want to display a iView only but of other type, will you please guide me how you have achieved it?
    Thanks

  • Code  for showing a messagi in web dynpro for java

    Hi All,
    What is the Code  for showing a messagi in web dynpro for java.
    Thanks and Regards,
    Saurabh

    Hello Saurabh,
    SuccessMessage - WdComponentAPI.getMessageManager().reportSuccess("Success");
    ErrorMessage - WdComponentAPI.getMessageManager().reportException("Error",false);
    WarningMessage - WdComponentAPI.getMessageManager().reportWarning("Warning");
    Regards
    Nizamudeen SM

  • How to show program documentation in the dynpro?

    hi everyone
    i just wrote a short documentation for the abap programm and now i want to make a button in the menubar in my dynpro to show the documentation... how can i do this?

    The function DSYS_SHOW_FOR_F1HELP will do the job I think - here's some sample code that should point you in the right direction:
    report zlocal_jc_sdn_show_doco.
    start-of-selection.
      perform show_my_doco.
    *&      Form  show_my_doco
    form show_my_doco.
    * Popup doco for sy-repid
      data:
        l_dokclass          like dsysh-dokclass,
        l_docu_object       like sy-repid,
        l_title             like dsyat-child_titl.
      l_title       = 'Report documentation'.
      l_dokclass    = 'RE'.
      l_docu_object = sy-repid.
      call function 'DSYS_SHOW_FOR_F1HELP'
        exporting
          dokclass         = l_dokclass
          dokname          = l_docu_object
          doktitle         = l_title
          short_text       = 'X'
          appendix         = 'X'
        exceptions
          class_unknown    = 1
          object_not_found = 2
          others           = 3.
    endform.                    "show_my_doco
    Jonathan

  • How can i show a bitmap relative to mouse coordination

    hi
    I want to show a image (bitmap) and i want him to move with the mouse.
    I'm use "GetRelativeMouseState" to get coordinations of the mouse and i want that the image will move by the coordinations.
    Ther is a function that can do this? 

    Hi
    This should do what you want. (see attachment) Build and run the project.  The canvas will follow the mouse wherever it goes.
    Ryk
    Attachments:
    Moveable.zip ‏397 KB

  • This browser shows-not supported by web dynpro when open selfcare.ndc.bsnl.co.in

    ''dupe of https://support.mozilla.org/en-US/questions/916084''
    when i open 'selfcare.ndc.bsnl.co.in to check my account usages,on screen appears 'your browser/programme is not supported by Web Dynpro.

    I have downloaded firefox 10 version but my problem is not solved.After browsing selfcare.ndc.bsnl.co.in, a page welcome to customer care portal opens. After login this page with user ID and password another page of sap netweaver portal opens.On this page a message appears,"Your browser/programme is not supported by Web Dynpro".While Safari Browser opens account usage,My services etc. onthis page.

  • GP Web Dynpro Error message display

    Hi All
    How to show Input Error on Web Dynpro Callable Object?
    Not like Normal Web dynpro, IWDMessageManager doesn't work in GP Web dynpro.
    Thanks in Advance

    By input error do you mean you are validating the input and trying to display any errors using the IWDMessageManager?  This should be possible.  I have used the IWDMessageManager before in GP Web Dynpro and it works fine.  Here is a little code snippet that does it:
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
    ~Greg

  • Context not updated from adobe from fields to ABAP web dynpro every time

    Hi,
    I work through a turtorial for interactive adobe form in web dynpro. The turtorial link is as following:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/c766e918-0b01-0010-99b1-c2b78cd059b3?prtmode=navigate
    I use Active X adobe form display type and submit button. Basically, it works.
    My problem is the 1st time I change the out_amount in adobe form and click 'Submit'. Everything OK. The corresponding context field in Web Dynpro is updated and showed in my own web dynpro field.
    Then, I change the out_amount again in Adobe form and click 'Submit' again. The context is not updated.
    The interesting thing is when I click 'Submit' the 3rd time, it works again. Same situation happens for 4 and 5 times click 'Submit' and so on.
    It seems I need to click 'Submit' two times and the web dynpro context is then  updated.
    Is there anyone have any clue about my problem?
    Thank you in advance!
    Trey

    Please provide the solution.......

  • Adobe Document in Web Dynpro

    Hello All,
    I have a requirement where i want to show Adobe document on Web Dynpro iview in specific area.
    Is it possible to show Adobe document may be 4X6 Area in the iview.
    How can i do this? Any help would highly appreciated.
    Regards,
    Learner

    Thanks for your reply. Those links very useful. I tried to follow the same example, it is throwing
       java.lang.Exception: Incorrect content-type found 'text/html'
    at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.ClientMimeMessage.initDeserializationMode(ClientMimeMessage.java:120)
    at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.handleResponseMessage(MimeHttpBinding.java:956)
    at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.call(MimeHttpBinding.java:1437)
    at com.sap.tc.webdynpro.adsproxy.ConfigBindingStub.rpData(ConfigBindingStub.java:82)
    at com.sap.tc.webdynpro.adsproxy.ConfigBindingStub.rpData(ConfigBindingStub.java:99)
    Detailed Exception
    Caused by: com.sap.tc.webdynpro.pdfobject.core.PDFObjectRuntimeException: Service call exception; nested exception is:
         java.lang.Exception: Incorrect content-type found text/html
    What is the reason for this? I am using NWDS 7.0.12.
    Is there any way i can find all the required services are running?  I am testing in my local system.
    Regards,
    Learner

  • How to Remove Web Dynpro ABAP - Starting Application white banner

    Hi everyone,
    When I call the Web Dynpro ABAP applicaion, it shows the Login screen, after proper authentication, it shows a SAP NetWeaver Web Dynpro ABAP white screen/banner stating "Starting Application... ", and after sometime it launches the Web Dynpro application. I want to remove the white screen. How can we do that?
    Thanks in advance,
    Amber
    Message was edited by: Amber Gupta

    Hi Amber,
    Just as a quick note: There is no artificial delay when displaying the splash screen. During that time the application loads itself. The screen is removed as soon as everything will have been initialized including calling all application hooks such as wdDoInit on all the different controllers. This means, that by removing the splash screen you will only get a blank white screen with a "Application is being loaded.." message that will stay as long as the splash screen would have done. Hence, disabling or enabling it is more a matter of taste, not of performance.
    Best regards,
    Thomas

  • Bitmap DisplayObjects cause a memory peak that kills IOS devices

    Hey there
    We are creating a game using Starling in Adobe Air for IOS, Android, Kindle and Facebook and are coming across an issue with Bitmap DisplayObjects. The following profiling session was recorded in an android device with 1GB of memory:
    http://dev.jojugames.com/projects/wicked/AndroidLogTutorial/001_CPUPeak.png
    The problem is that IOS devices have only 512MB and crash frequently at the peak shown in the image above (154MB CPU + 148MB GPU, 302MB Total)
    This peak happens because for 400 frames or so the AIR runtime decides to create some objects called "Bitmap Displayobjects" as a cache for decoded compressed textures to avoid re-decoding them in the future, and keeps these objects in memory for some arbitrary time (we tested disposing every single bitmap and texture but these objects remained in memory). The next figure shows these bitmap DisplayObjects in time:
    http://dev.jojugames.com/projects/wicked/AndroidLogTutorial/002_BMDisplayObjects.png
    The creation of these objects seems to be arbitrary because there are many times in the game where textures and bitmaps disposed and recreated because the game state changes (from map to game and vice versa), these parts are shown in the scout screenshot above with gray arrowed boxes.
    We need to avoid creating these Bitmap DisplayObjects altogether, we don't care if texture decoding takes a little longer.
    Please notice the following:
    * From the first screenshot: the game uses half the memory of the peak during all gameplay
    * From the second screenshot: most of the memory in the peak are these Bitmap Displayobjects.
    * From the second screenshot: A lot of textures are created and uploaded to GPU memory without the use of Bitmap DisplayObjects.
    Can anybody help us to configure the AIR runtime to avoid using these Bitmap DisplayObjects?
    Thanks!

    Thanks for the answer.
    The problem we are facing is between frames 140 and 500 of the game's execution (the first 4 minutes of gameplay), after that the game runs flat because we dispose the assets periodically and call System.gc. We saw in scout that the memory is indeed flat after these 500 frames (not because lack of proper disposal but because the Bitmap DisplayObjects are not created so aggressively anymore).
    Our problem is these Bitmap DisplayObjects at the beginning, you can see them in green in this image:
    http://dev.jojugames.com/projects/wicked/AndroidLogTutorial/002_BMDisplayObjects.png
    We made an experiment in which we load, instantiate and upload to GPU memory one of the textures that's provoking instantiation of Bitmap DisplayObjects and disposed both the bitmap and the texture right away, also we called System.gc. We noticed in scout that the bitmap was removed from CPU memory and the texture was removed from the GPU memory but the Bitmap DisplayObjects remained in main memory for about 300 frames.
    It's worth mentioning that after the initial 500 frames the Bitmap DisplayObjects are not created as aggressively as they are created at the beginning of the execution, that can also be seen in the screenshot on this post.
    That said, does anybody knows how tho prevent these Bitmap DisplayObjects from ever being created at the beginning of the game's execution?

  • List-output after pressing button on Dynpro

    Hello,
    I have a dynpro with an alv grid and a button on the top. I need to print a text after pressing the button. I tried to do that by using WRITE, but nothing was shown. Can I show a textarea on another dynpro?
    How would You do that?
    Regards, Michael

    Hello Michael,
    I don't think you'd require another dynpro.
    Instead of giving you the complete solution, I'll just try to give you a teaser..:-). Please refer to the ABAP statements LEAVE TO LIST-PROCESSING and LEAVE LIST-PROCESSING.
    Regards,
    Anand Mandalika.

  • Adding property to property editor of Dynpro iView

    In case of regualr(non-dynpro) iView, I could just modify portalapp.xml to add a property which shows up in the iView property editor inside PCD.
    In case of web dynpro iView, How do I add property which shows up on my web dynpro iView property editor? How do I programmatically read this property?
    Right now I am using "Application Parameters" attribute of the iView to store the attributes as name/value pair seperated by "&" . But it's not very user friendly.
    Thanks
    Sam

    Hi,
    I can only ask the same as Sam.
    Is it possible to add any custom property to a web dynpro iView ?
    Regards,
    Ferenc

  • Photoshop installation affects MS Access bitmap handling

    I have a problem, after installation of Photoshop CS5 in Windows, MS Access (I tried on Windows 7 and XP) does not longer show embedded bitmaps in database forms. Access can show only BMP files, so Photoshop installation somehow interferes with MS Office handling of this format. After deinstallation, everything returns to normal behaviour. The only workaround I came up is to backup Windows registry before Photoshop installation, then install it, and restore registry from backup afterwards. However, it removes all Photoshop's associations and stuff which is in registry. I wonder if anyone had the same problem, and if there are any solutions?

    Welcome to the forum.
    I wonder if this in not just a simple file association issue. As PS can handle BMP's, it might change the File Type Association (Control Panel>Folder Options>File Type), and if one goes there, and re-assigns the File Type Association back to MS Access, whether it would work, as before?
    I'd reinstall PS, and then change the BMP File Type Association to MS Access, and test.
    Good luck,
    Hunt

  • How convert bitmap to Image.source ?

    I hold some bitmap object in the memory  ( simple
    System.Drawing.Bitmap ).
    I want to make some wpf image control to show this bitmap.
    I dont want to save the bitmap to the disk and then load it as URI to the wpf image control
    So, How can i do this simple action ?
    Thanks.

    Hi
    Please go through the following link
    http://www.i-programmer.info/programming/wpf-workings/678-the-bitmap-transform-classes.html
    http://www.redmondpie.com/how-to-save-and-retrieve-images-in-c-wpf-application-from-sql-server-database/
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This will help other members to find the solution easily.

Maybe you are looking for

  • PDFMaker Server cannot be loaded

    Acrobat 7.0.1 Word 2003 XP SP2 PDFMaker is unavailable from Word, PowerPoint, Excel, and Publisher. I get the error message "PDFMaker Server cannot be loaded." Running the Intaller in repair mode has no effect. PDFMaker is NOT listed as disabled (Abo

  • Which Message type to choose

    Hi All, My requirement is if , in an editable ALV, a negative value is entered , processing should stop and an error message should be displayed 'Negative Value cannot be used'. I have used message type e , but the problem is whenever I change the va

  • Asset Accountig.. summing up different Depreciation areas

    Does anyone know why it´s not possible to total different deprec areas using the cube 0FIAA_C02. As the matter of facts one can total areas but it does not lead to correct result in the queries Thanks Walter

  • Domain aliasing with iMS 5.2?

    We're testing iMS 5.2 with direct ldap to ds 5.1 and need to do a domain alias. We have our-name.com and ourname.com. We always use ourname.com but some still use the original our-name.com so we would like it to work as an alias. Vanity domain isn't

  • OC4J and ias 1.021 on AIX 433 ??

    hello I am planning to install the OC4J engine on AIX433 and I downloaded oc4j.zip However the last version of IAS on AIX we have is the release 1.021 instead of 1.022 as adviced ( or required ?? ) in the documentation. Could you tell me if this inst