Show attached material picture in ABAP screen object

Hello,
I'm attaching material pictures with the GOS create attachment option. Here I could attach all kind of documents including the files "*.gif, *.tif, etc." These pictures are stored on our document server. Another possibility I use is to create a url to the direct link of the picture on the vendors site.
The materials are our own stock materials. These stock materials could be ordered by the reservation system. For that we have created our own reservation screen. In one of the fields they could enter a part of a material description to search for a particular material. If more material is valid these materials are shown in a selection list. To make is easier to pick the right material I want to show the material picture in a ABAP object on the selection screen.
I'm already able to show, in the list, if there is a material picture available with the function "BAPI_REL_GETRELATIONS"
If this function returns a table I know there is a (picture) document attached.
If the clicks on the hotspot in the list I want to show the picture in the ABAP object on the screen.
Here is a part to see if there is a material picture?
CLEAR OBJECTID.
OBJECTID-OBJKEY = makt-matnr. " Long number incl. zero's
OBJECTID-OBJTYPE = 'BUS1001006'.
N_lines = 0.
clear LISTOFRELATIONS.
CALL FUNCTION 'BAPI_REL_GETRELATIONS'
EXPORTING
OBJECTID = OBJECTID
ROLE =
RELATION =
RECURSIONLEVEL = 1
IMPORTING
RETURN = B_RETURN2
TABLES
LISTOFRELATIONS = LISTOFRELATIONS
describe table LISTOFRELATIONS lines N_lines.
IF N_lines > 0.
WRITE ICON_TIF AS ICON to artikelen-pic.
ELSE.
artikelen-pic = ' '.
ENDIF.
I'm able to show a picture in the ABAP object with the following code:
IF P_CONTAINER IS INITIAL.
CREATE OBJECT: P_CONTAINER EXPORTING container_name = 'MAT_PIC',
MM_PIC1 EXPORTING parent = P_CONTAINER.
l_alignment = cl_gui_control=>align_at_left +
cl_gui_control=>align_at_right +
cl_gui_control=>align_at_top +
cl_gui_control=>align_at_bottom.
CALL METHOD mm_pic1->set_alignment
EXPORTING
alignment = l_alignment.
CALL METHOD mm_pic1->set_3d_border
EXPORTING
border = 1.
CALL METHOD mm_pic1->set_display_mode
EXPORTING
display_mode = mm_pic1->display_mode_stretch
EXCEPTIONS
error = 1.
ENDIF.
IMPORT pict_tab = pict_tab FROM DATABASE abtree(pi) ID 'ENJOY'.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
TYPE = 'IMAGE'
SUBTYPE = 'GIF'
SIZE =
DATE =
TIME =
DESCRIPTION =
LIFETIME =
CACHEABLE =
SEND_DATA_AS_STRING =
TABLES
DATA = pict_tab
FIELDS =
PROPERTIES =
CHANGING
URL = 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 mm_pic1->load_picture_from_url
EXPORTING
url = url
EXCEPTIONS
others = 4.
Could any one help me further to show the picture in the ABAP object 'MAT_PIC'?
I'm using SAP release 4.7 on a Oracle database.
The document server is the SAP DMS server on a SAP-DB database.
Kind regards,
Richard Meijn

Refer the following:
REPORT  ZTEST12.
* Type declarations.....................
TYPES pict_line(256) TYPE c.
* data declarations......................
DATA :init,
      container TYPE REF TO cl_gui_custom_container,
      editor    TYPE REF TO cl_gui_textedit,
      picture   TYPE REF TO cl_gui_picture,
      pict_tab TYPE TABLE OF pict_line,
      url(255) TYPE c.
CALL SCREEN 100.
* Dialog modules......................................
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'SCREEN100'.
  IF init is initial.
    init = 'X'.
    CREATE OBJECT:
           container  EXPORTING container_name = 'PICTURE_CONTAINER',
           picture    EXPORTING parent = container.
  ENDIF.
  IMPORT pict_tab = pict_tab FROM DATABASE abtree(pi) ID 'ENJOY'.
  CALL FUNCTION 'DP_CREATE_URL'
       EXPORTING
            type    = 'IMAGE'
            subtype = 'GIF'
       TABLES
            data    = pict_tab
       CHANGING
            url     = url.
  CALL METHOD picture->load_picture_from_url EXPORTING url = url.
  CALL METHOD picture->set_display_mode
       EXPORTING display_mode = picture->display_mode_fit_center.
ENDMODULE.
MODULE cancel INPUT.
  LEAVE TO SCREEN 0.
ENDMODULE.

Similar Messages

  • I was found I pad Air is not that user friendly than I pad 4 even I pad 2, as I was a TaoBao fans and every time when I get in their link, I pad Air cannot show all the pictures on the screen and very slow. It make me very disappointed about this issue.

    I was found I pad Air is not that user friendly than I pad 4 even I pad 2, as I was a TaoBao (www.taobao.com) fans and every time when I get in their link, I pad Air cannot show all the pictures on the screen and very slow. It make me very disappointed about this.  Could you please help to improve this. Thank you vey much!

    iPad running slow? How to speed up a slow iPad
    http://appletoolbox.com/2012/07/ipad-running-slow-how-to-speed-up-a-slow-ipad/
    If You Think iOS 7 Feels Slow Here’s How to Speed It Up
    http://osxdaily.com/2013/09/23/ios-7-slow-speed-it-up/
    You may have many apps open which can possibly cause the slowdown and possibly the loss of wifi. In iOS 4-6 double tap your Home button & at the bottom of the screen you will see the icons of all open apps. Close those you are not using by pressing on an icon until all icons wiggle - then tap the minus sign. For iOS 7 users, there’s an easy way to see which apps are open in order to close them. By double-tapping the home button on your iPhone or iPad, the new multitasking feature in iOS 7 shows full page previews of all your open apps. Simply scroll horizontally to see all your apps, and close the apps with a simple flick towards the top of the screen.
     Cheers, Tom

  • Show picture in dialog screen

    Hi,
    Any body can show me how to show a picture in dislog screen?
    Very appreciate for any help.
    Rgds
    Shaohua

    Hello,
    You can attach the picture using <b>picture co</b>ntrol.For a <b>dialog screen</b>,make sure that when you create the screen,you choose <b>MODAL DIALOG BOX</b> in <b>SCREEN TYPE</b>.
    Now make a cusom container in the screen layout and name it as <b>CONTAINER</b>.Use the sample code below:
    REPORT SAMPLE.
    DATA: picture type ref to cl_gui_picture,
    cont type ref to cl_gui_custom_container.
    DATA:
    OK_CODE TYPE SY-UCOMM,
    p_url type cndp_url.
    START-OF-SELECTION.
    call screen 100.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'GUI'.
    SET TITLEBAR 'xxx'.
    if cont is initial.
    CREATE OBJECT CONT
    EXPORTING
    CONTAINER_NAME = '<b>CONTAINER</b>'.
    CREATE OBJECT PICTURE
    EXPORTING
    LIFETIME =
    SHELLSTYLE =
    PARENT = cont
    NAME =
    EXCEPTIONS
    ERROR = 1
    others = 2
    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->SET_3D_BORDER
    EXPORTING
    BORDER = 1.
    CALL FUNCTION 'DP_PUBLISH_WWW_URL'
    EXPORTING
    OBJID = 'HTMLCNTL_TESTHTM2_SAP_AG'
    LIFETIME = cndp_lifetime_transaction
    IMPORTING
    URL = p_url
    IF SY-SUBRC = 0.
    CALL METHOD PICTURE->LOAD_PICTURE_FROM_URL_ASYNC
    EXPORTING
    URL = p_url.
    ENDIF.
    endif.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
    WHEN 'BACK'.
    LEAVE PROGRAM.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    endcase.
    endmodule.
    Also check demo program:<b>RSDEMO_PICTURE_CONTROL</b>
    <b>TO GET PICTURES:</b>
    Refer this link
    1... create a logo using paint shop and save it as tifffile then using RSTXLDMC (is a program name) used to upload logo
    2.....create a logo using paint shop and save it as bmpfile then using SE78 you can do this.
    <b>http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIIMAGE/BCCIIMAGE.pdf
    http://www.sap-img.com/human/linking-employee-photos-using-sap-archive-link.htm</b>
    Transaction OAOR,
    - OAOR (Business Document Navigator)
    Give Class Name - PICTURES Class Type - OT..... then Execute
    It will show you the list, then select ENJOYSAP_LOGO.
    On that list, you will find one control with a "create" tab.
    Click std. doc types.
    Select SCREEN and double-click.
    It will push FILE selection screen.
    Select your company logo (.gif) and press OK.
    It will ask for a description- for instance: "company logo".
    It will let you know your doc has been stored successfully.
    You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
    Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
    Regards,
    Beejal
    **Reward if this helps

  • HT4061 My phone will not turn on. I did a hard reset but all that my screen will show is a picture indicating I should connect the power cord to iTunes (iTunes icon).I don't know my serial # and I do not have acces to my laptop

    My phone will not turn on. I did a hard reset but all that my screen will show is a picture indicating I should connect the power cord to iTunes (power cord symbol with an arrow iTunes icon).I don't know my serial # and I do not have acces to my laptop.

    The serial number has nothing to do with this.
    YOur phone is in recovery mode.
    You will need access to a computer with itunes on it to restore your phone.
    http://support.apple.com/kb/HT1808

  • Adding attachment through ABAP screen

    Hi experts,
    I have a requirement where i need to add attachment from a ABAP screen or through SM30 screen. That is, we provide a transaction code for the users to maintain table entries. In additon to maintain values, the user wants to add attachment. The attachment is a image of a map of the house plan.
    So can someone tell me how to add attachment and the path or URL of the attachment need to be stored in a separate field in the Z table?
    Is that can be done through OAAR transaction?

    Look for GOS Attachments in the forum - probably it should help your need

  • In iMovie when I move my curser through pictures in the project, I have an empty screen or it shows the first picture only..what might be the problem?

    In iMovie when I move my cursor through pictures in the project, I have an empty screen or it shows the first picture only..what might be the problem?

    Try putting the iPad into recovery mode and see if that fixes it : http://support.apple.com/kb/ht4097

  • I dropped my ipod touch and now it will only charge to 20%. It does turn on and the screen I get shows me a picture of a usb cord and a cd with a music note on it that says itunes under it. What does this mean?

    I dropped my ipod touch and now it will only charge to 20%. It does turn on and the screen I get shows me a picture of a USB cord and a cd with a music note on it that says itunes under it. What does this mean?

    connect it to your computer and open iTunes

  • Work order Screen objects settings

    Hi Experts,
    I've a requirement to display the Add. DeviceID  onto the work order screen, along with Equipment and Functional location.
    I've tried to do this via using ref. Screen object O130 (Serial No.+ Material No.+ Device Id) wherein I can get the DeviceID field successfully displayed onto IW31 screen.
    But in this case problem is , the Equipment and Functional location is not being displayed , instead Serial no. and Material fields are there. It can be displayed via Screen Object 0100.
    Now as per my need , the requirement would be fulfilled via  mix of O100 & O130. So the question is , is there any way , we can create our own custom Screen objects , wherein can select the required fields.
    Also Even if I'm using screen object O100 , I can view the Add. Device data field into IW38 (Order List) against the Order No. Is there any settings, we can display this Device data field on IW31 screen as well??  
    Waiting for your valuable reply..
    Thx in advance.

    Hi Dennis,
    You can add additional fields like your DeviceId with the help of screen-exit available in Enhancement
    IWO10018
    This gives an additional tab in IW31 screen named Enhancement where your custom fields appear.
    Screen looks like this
    After the above  exercise, you need to take this field into the structure RIHAUFK_LIST,  through Append Structure.
    See this IW38 screen,
    The above inputs would make an ABAPer perform the task needed by you easily.
    Jogeswara Rao K

  • How do I get a picture of my screen and then put it in a 'reply' email message? Please!

    I need to take a picture of the screen showing my test results that I took on a website and then email it. When I click on my 'prnt scrn' button and then paste it into my email message it shows up correctly but then when I actually send the message, it shows up as just a bunch of letters and numbers. Please help. Thank you so much

    See also:
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Current Firefox versions have a built-in feature to take a screenshot as part of the Web Developer Toolbar.
    *Web Developer > Developer Toolbar
    A quick way to save a screenshot is to press the "s", then the F1 key will bring up a help pop-up where you can click the "screenshot" entry' or use cursor Up/Down and press the Enter key.<br />
    The default file name is "Screen Shot yyyy-mm-dd at HH.MM.SS.png" in the download directory.
    help screenshot
    You will have to type options yourself because clicking an entry in the pop-up that appears after the first "-" doesn't work (to see available options, use: screenshot --).

  • Creating attachment in Webdynpro for ABAP

    Hi Expertrs,
                      I am new to webdynpro for ABAP. I have a requirement like I need to create an attachment in webdynpro screen. I have searched the forums and I got the class CL_GOS_SRV_ATTACHMENT_CREATE and method EXECUTE_ITS. but when I call this method I am getting dump in the method.
    Can anybody please suggest me how to create attachment in webdynpro for ABAP?
    When ever attachment is created and clicks on save button workflow will be triggered and a workitem appears portal when ever the user click on the display attachment I need to display the created attachemnt.
    Please suggest me.
    Thank You.
    Ranganadh

    Hi,
    Please follow the steps below;
    Follow these steps;
    1.create a node 'FILEUPLOAD' with 2 attributes
    a) FILECONTENT type XSTRING
    b) FILENAME type STRING
    2. Create a fileuplaod uielement
    a) bind the data property with attribute 'FILECONTENT'
    b) bind the filename property with attribute 'FILENAME'
    3. Create a button 'UPLOAD'
    a) create the action method for this button
    Paste the following code in this method
    Data l_node type ref to if_wd_context_node.
    Data l_stru type wd_this->elements_cn_fileupload.
    l_node = wd_context->get_child_node( 'FILEUPLOAD' ).
    l_node->get_static_attributes( importing static_attributes = l_stru ).
    "save l_stru-fielcontent in database. Your file will be saved in the database in XSTRING format.
    Now when you want to display  this file;
    1. Create a Node 'FILEDOWNLOAD' with 1 attribute
    a) FILE type XSTRING
    2. Create a filedownload uielement
    a) bind the data property with the attribute 'FILE'
    Fetch the file from databased and set the File attribute of teh filedownload uielemnt to display the file.
    Hope this helps!
    Radhika.

  • Report showing overdelivery material and its value.

    A report is required showing the material received by giving overdelivery/unlimited tolerance.  It should give the details of the material,quantity excess received, excess quantity value.
    How to get it.
    Pl reply.
    T.SRINIVAS

    Hello Friend
    Try Report with Tcode ME2M and in input screen dont forget to choose "ALLES" in Scope of list.
    Else If your corporate policy is the same regardless of vendor /
    material combination, then you can use the ME2N transaction. It
    has a dynamic selections button that allows you to search on
    practically any PO field. The Delivery tolerances fields are
    contained on the PO item folder of the dynamic selections.
    Additionally, you can enter a document date restriction to limit
    the results. I also recommend entering "WE101" - "OPen Goods
    Receipt" as a Selection parameter to keep the list to include
    open, GR relevant PO Items.
    If the Delivery tolerances vary by Material vendor and you can
    not create variants in the ME2N transaction to capture the
    relevant scenarios, then you may have to write a SAP query to
    compare the PO Item to the Purchasing Information REcord. If
    this is the case, I recommend using Infoset MEPOLDB for the
    Purchase ORder information, and table EINE for the Delivery
    tolerance information of the PIR.
    Reward if useful
    Regards
    SE
    Edited by: SAP Enjoy on Jan 24, 2008 4:56 PM

  • Invoking Openoffice calc through ABAP OLE Object

    I want to show the output of my ABAP process  through openoffice calc worksheet.
    I tried to invoke calc using ABAP OLE object.
    But even a blank calc sheet is not getting opened with the following statements.
    Type-pools: OLE2.
    TYPES:
    service_manager type OLE2_OBJECT,
    DESKTOP type OLE2_OBJECT,
    DOCUMENT type OLE2_OBJECT.
    CREATE OBJECT service_manager 'com.sun.star.ServiceManager'.
    CALL METHOD OF SERVICE_MANAGER 'createInstance' = DESKTOP
    EXPORTING #1 = 'com.sun.star.frame.Desktop'.
    CALL METHOD OF DESKTOP 'loadComponentFromURL' = DOCUMENT
    EXPORTING #1 = 'private:factory/scalc'
              #2 = '_blank'
              #3 = 0
              #4 = '' .
    What is wrong with this code?. Is there any other setting required at the system/OS/ABAP/BASIS
    level to invoke openoffice applications?.
    I have registered the classid for openservice manager in the transaction SOLE. Still it is not working.
    Iam able to invoke openoffice applications with Visual Basic/Power builder lanaguages.
    Please respond.
    Thanks in advance
    Liju

    I don't think it's possible.
    4th parameter of loadComponentFromURL method is an array ( http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html )
    Arrays are not supported as parameters in ABAP OLE Automation. (see note [633105|https://service.sap.com/sap/support/notes/633105] - OLE automation: ABAP type for OLE array parameters )

  • Material for oo abap

    Hi All
         can any one send me the materials on complete oo abap ....
    regards,
    varma

    Hi Dilip
    BC404 is SAPs reference material on OO programming in ABAP.
    Also See these links.
    <b>Object Service</b>
    http://help.sap.com/saphelp_nw04s/helpdata/en/ab/9d0a3ad259cd58e10000000a11402f/frameset.htm
    <b>ABAP - Shared Objects</b>
    http://help.sap.com/saphelp_nw04s/helpdata/en/14/dafc3e9d3b6927e10000000a114084/frameset.htm
    <b>OO interfaces,</b>
    http://help.sap.com/saphelp_nw04s/helpdata/en/c3/225b5354f411d194a60000e8353423/frameset.htm
    <b>ABAP Objects</b>
    http://help.sap.com/saphelp_nw04s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    <b>ABAP OO Books</b>
    ABAP Objects
    by Horst Keller, Sascha Kruger
    ABAP Objects - Reference book
    by Horst Keller, Joachim Jacobitz
    Dont forget to reward pts, if it helps ;>)
    Regards,
    Rakesh.
    Message was edited by: Rakesh

  • Picture in Selection Screen

    Dear Experts
    My problem is when i am Putting Picture in Selection Screen I was able to change its width but not its Height,can anyone tell me How to Change its Height..
    Thanks in Advance
    Somesh

    Hi
    check this one
    REPORT y_pic_show .
    DATA:
    docking TYPE REF TO cl_gui_docking_container,
    picture_control_1 TYPE REF TO cl_gui_picture,
    url(256) TYPE c .
    PARAMETERS: p_dummy TYPE c  .
    AT SELECTION-SCREEN OUTPUT.
      PERFORM show_pic.
    START-OF-SELECTION.
    *& Form show_pic
    FORM show_pic.
      DATA: repid LIKE sy-repid.
      DATA: file_name LIKE sapb-sapfiles,
      file_type LIKE bdn_con-mimetype.
      repid = sy-repid.
      IF docking IS INITIAL .
        CREATE OBJECT docking
        EXPORTING
        repid = repid
        dynnr = sy-dynnr
        side = cl_gui_docking_container=>dock_at_right
        extension = '200'
        EXCEPTIONS
        cntl_error = 1
        cntl_system_error = 2
        create_error = 3
        lifetime_error = 4
        lifetime_dynpro_dynpro_link = 5.
        CREATE OBJECT picture_control_1 EXPORTING parent = docking.
        CHECK sy-subrc = 0.
        CALL METHOD picture_control_1->set_3d_border
          EXPORTING
            border = 0.
        CALL FUNCTION 'DP_PUBLISH_WWW_URL'
          EXPORTING
            objid    = 'HTMLCNTL_TESTHTM2_SAP_AG'
            lifetime = 'T'
          IMPORTING
            url      = url
          EXCEPTIONS
            OTHERS   = 1.
    Load the picture by using the url generated by the data provider.
        IF sy-subrc = 0.
          CALL METHOD picture_control_1->load_picture_from_url_async
            EXPORTING
              url = url.
        ENDIF.
      ENDIF .
    ENDFORM.                    "show_pic
    More on controls demo at transaction DWDM
    reward points to all helpful answers
    kiran.M

  • My iphone email not showing attachment and signature when send out to anyone ?

    email not showing attachment and signature when send out to anyone ?

    This is what I did:
    How to put iPod touch / iPhone into DFU mode
    A small guide on how to put your iPod touch / iPhone  into DFU mode. Works with all G’s of iPod touch / iPhone
    What is DFU: Device Firmware Upgrade
    Step 1: Turn off your iPod touch / iPhone completely and connect to PC / mac
    Step 2: Hold down the Power button for 3 seconds
    Step 3: Without releasing the power button, also hold the Home button for 10 seconds
    Step 4: Without releasing the home button, release the power button and keep holding the Home button  for 20 seconds.
    Itunes will identify that you are in DFU mode.
    That's when I got the black screen with USB and iTunes icons.  iTunes itself, did not show my phone.

Maybe you are looking for

  • Why can't I get this website to load properly?

    www.wzzm13.com A local news website. I can access it with Internet explorer, or my android tablet with no problem. I cannot access it with Firefox, (32) or Nightly (64) and I have removed both, wiped out everything to do with them, reinstalled them w

  • Date format in Excel Export

    We do see different behaviour of date fields in exported Excel files and are not able to clearly identify why this happens. And even after reading through dozens of documents, web pages and forum posts it is still not clear how this should work. The

  • Open hub in 2004s - Detination type Third Party Tool

    Hello there, May be SAP people can answer this or anyone who has actually done the Extraction to Non SAP system pl answer. We're on 2004s SP 10. We have bunch of Hubs, right now creating flat files which gets loaded to a different Oracel DB system. I

  • VC vrs WebDynpro Java

    Hi Specialists, I have a question, we have to develop 7 dashboards (Views) with Oracle is back end, we are going to use Web Services for that. Details requirements are given below. 1.     Each of these views interacts with each other through hyperlin

  • Why not autoconnecting "when needed"?

    Hi there, I'm not sure where the best place is to post this question, but, I'll start here and hope for some guidance! I have my network preferences set to have my "built in ethernet pppoe session options" "connect automatically when needed". However