Print a picture from an URL

HI All,
is it possible to print (using a sapscript or a report) a picture directly from an URL instead of upload this picture into SAP (with report RSTXLDMC)?
Many thanks.
Luca

Hi
Check this report
program zsap_picture_demo.
set screen 200.
TYPE-POOLS cndp.
* CLASS    c_event_receiver
* DEFINITION
class c_event_receiver definition.
* The class is used to test the events raised by the cl_gui_picture
* class
  public section.
    methods event_handler_picture_dblclick
            for event picture_dblclick of cl_gui_picture
            importing mouse_pos_x mouse_pos_y sender.
    methods event_handler_context_menu
            for event context_menu of cl_gui_picture
            importing sender.
    methods event_handler_context_menu_sel
            for event context_menu_selected of cl_gui_picture
            importing fcode sender.
  endclass.
* DATA
  data function like sy-ucomm.         " OK-Code field in screen 200
  data url  type cndp_url.                " URL-field in screen 200
  data url2 type cndp_url.               " URL-field in screen 200
  data picture_control_1 type ref to cl_gui_picture.
  data picture_control_2 type ref to cl_gui_picture.
  data container_1 type ref to cl_gui_custom_container.
  data container_2 type ref to cl_gui_custom_container.
  data event_receiver  type ref to c_event_receiver.
  data event_tab type cntl_simple_events.
  data event_tab_line type cntl_simple_event.
  data return type i.
* PBO
* before_output
module before_output output.
  set pf-status 'MAIN0001'.
  IF PICTURE_CONTROL_1 IS INITIAL.
* Create controls
    create object container_1
      exporting container_name = 'PICTURE_CONTROL_1'.
    create object container_2
      exporting container_name = 'PICTURE_CONTROL_2'.
    CREATE OBJECT PICTURE_CONTROL_1 exporting parent = container_1.
    CREATE OBJECT PICTURE_CONTROL_2 exporting parent = container_2.
* Register the events
    EVENT_TAB_LINE-EVENTID = CL_GUI_PICTURE=>EVENTID_PICTURE_DBLCLICK.
    append EVENT_TAB_LINE to EVENT_TAB.
    EVENT_TAB_LINE-EVENTID = CL_GUI_PICTURE=>EVENTID_CONTEXT_MENU.
    append EVENT_TAB_LINE to EVENT_TAB.
EVENT_TAB_LINE-EVENTID = CL_GUI_PICTURE=>EVENTID_CONTEXT_MENU_SELECTED.
    append EVENT_TAB_LINE to EVENT_TAB.
    CALL METHOD PICTURE_CONTROL_1->SET_REGISTERED_EVENTS
      exporting
        EVENTS = event_tab.
    CALL METHOD PICTURE_CONTROL_2->SET_REGISTERED_EVENTS
      exporting
        EVENTS = event_tab.
* Create the event_receiver object and set the handlers for the events
* of the picture controls
    create object event_receiver.
    set handler event_receiver->event_handler_picture_dblclick
                FOR PICTURE_CONTROL_1.
    set handler event_receiver->event_handler_context_menu
                FOR PICTURE_CONTROL_1.
    set handler event_receiver->event_handler_context_menu_sel
                FOR PICTURE_CONTROL_1.
    set handler event_receiver->event_handler_picture_dblclick
                FOR PICTURE_CONTROL_2.
    set handler event_receiver->event_handler_context_menu
                FOR PICTURE_CONTROL_2.
    set handler event_receiver->event_handler_context_menu_sel
                FOR PICTURE_CONTROL_2.
* Set the display mode to 'normal' (0)
    CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
         EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
    CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
         EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
* Set 3D Border
    CALL METHOD PICTURE_CONTROL_1->SET_3D_BORDER
       exporting border = 1.
    CALL METHOD PICTURE_CONTROL_2->SET_3D_BORDER
       exporting border = 1.
* new async implementation since 4.6C
CALL FUNCTION 'DP_PUBLISH_WWW_URL'
  EXPORTING
    OBJID                       = 'HTMLCNTL_TESTHTM2_SAP_AG'
    LIFETIME                    = cndp_lifetime_transaction
  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.
CALL FUNCTION 'DP_PUBLISH_WWW_URL'
  EXPORTING
    OBJID                       = 'DEMOWORD97SAPLOGO'
    LIFETIME                    = cndp_lifetime_transaction
  IMPORTING
    URL                         = url2
  EXCEPTIONS
    OTHERS                      = 1.
* load image
    if sy-subrc = 0.
      CALL METHOD PICTURE_CONTROL_2->LOAD_PICTURE_FROM_URL_async
         exporting url = url2.
    endif.
  endif.
endmodule.
* PAI
* after_input
module after_input input.
  case function.
* At the end of the program destroy the control
    when 'BACK'.
      CALL METHOD container_1->FREE.
      CALL METHOD container_2->FREE.
      leave to screen 0.
* Change the display mode
    when 'NORMAL'.
      CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
           EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
      CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
           EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
    when 'STRETCH'.
      CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
         EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
      CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
         EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
    when 'FIT'.
      CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
           EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
      CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
           EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
    when 'NORMAL_CTR'.
      CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
    EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL_CENTER.
      CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
    EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL_CENTER.
    when 'FIT_CTR'.
      CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
      EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT_CENTER.
      CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
      EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT_CENTER.
* Clear the picture
    when 'CLEAR'.
      CALL METHOD PICTURE_CONTROL_1->CLEAR_PICTURE.
* Load a new picture
    when space.
      CALL METHOD PICTURE_CONTROL_1->LOAD_PICTURE_FROM_URL
           exporting url = url
           importing result = return.
      call method cl_gui_cfw=>flush.
      if return = 0.
        url = text-000.
      endif.
  endcase.
  clear function.
endmodule.
* CLASS   c_event_receiver
* IMPLEMENTATION
CLASS C_event_receiver implementation.
* CLASS   c_event_receiver
* METHOD  event_handler_picture_dblclick
  METHOD EVENT_HANDLER_PICTURE_DBLCLICK.
*        for event picture_dblclick of c_picture_control
*        importing mouse_pos_x mouse_pos_y.
    DATA pos_x(5) type c.
    DATA pos_y(5) type c.
    pos_x = mouse_pos_x.
    pos_y = mouse_pos_y.
    IF SENDER = PICTURE_CONTROL_1.
      MESSAGE I000(0K) WITH
        'DoubleClick' 'Upper Picture' POS_X POS_Y. "#EC NOTEXT
    else.
      MESSAGE I000(0K) WITH
        'DoubleClick' 'Lower Picture' POS_X POS_Y. "#EC NOTEXT
    endif.
  endmethod.
* CLASS   c_event_receiver
* METHOD  event_handler_context_menu
  METHOD EVENT_HANDLER_CONTEXT_MENU.
    data menu type ref to cl_ctmenu.
    create object menu.
    call method menu->ADD_FUNCTION exporting
      fcode = text-001
      TEXT = TEXT-001.
    call method menu->ADD_FUNCTION exporting
      FCODE = TEXT-002
      TEXT = TEXT-002.
    call method menu->ADD_FUNCTION exporting
      FCODE = TEXT-003
      TEXT = TEXT-003.
    call method menu->ADD_FUNCTION exporting
      FCODE = TEXT-004
      TEXT = TEXT-004.
    call method menu->ADD_FUNCTION exporting
      FCODE = TEXT-005
      TEXT = TEXT-005.
    CALL METHOD SENDER->DISPLAY_CONTEXT_MENU
      EXPORTING CONTEXT_MENU = MENU.
  endmethod.
* CLASS   c_event_receiver
* METHOD  event_handler_context_menu_sel
  METHOD EVENT_HANDLER_CONTEXT_MENU_sel.
    DATA DISPLAY_MODE TYPE I.
    IF FCODE = TEXT-001.
      DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
    ENDIF.
    IF FCODE = TEXT-002.
      DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
    ENDIF.
    IF FCODE = TEXT-003.
      DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
    ENDIF.
    IF FCODE = TEXT-004.
      DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL_CENTER.
    ENDIF.
    IF FCODE = TEXT-005.
      DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT_CENTER.
    ENDIF.
    CALL METHOD SENDER->SET_DISPLAY_MODE
         EXPORTING DISPLAY_MODE = DISPLAY_MODE.
  endmethod.
endclass.
Reward all hepfull answers
Regards
Pavan

Similar Messages

  • Download picture from a URL

    Hi!
    I want to make a small java application which will download picture from a given URL, resize it and put it on the local disc?
    I have no idea how to download a picture from a URL to image buffer!
    Can somebody show me the way?
    Thanks

    [java image download|http://lmgtfy.com/?q=java+image+download]

  • How do i print a picture from a text message on my iphone 5

    how do i print a picture from a text message

    Open the picture by tapping on it in messages. Then in the upper right corner tap the icon that has a box with an arrow coming out pointing to the right. Select print.

  • When I print a picture from my mac it has black lines through it . has anyone had this same problem?

    When i print a picture from iphoto or photo shop on my mac it has black lines running through , has anyone else had this same problem?

    Thank you Terence , I re-loader the printer driver a third time and this seems to have fixed the problem.
    traveltime

  • Why do I always get a "looks like spam" msg when I try printing a picture from my phone?

    I own a hp Photosmart 5512, my OS is Vista Home.  I have a Motorola Photon phone, and every time I try to print a picture or a document over the internet from my phone I get a Spam Alert on my printer!  I would like to find a solution to eleviate this problem.

    The "spam/virus" message often occurs because the email did not contain any text in the subject line. Please try re-sending an email to your printer and adding text in the email's subject line.
    I want to be sure that the information provided has completely resolved the issue.  Please reply to this email and let me know whether or not the issue has been resolved.  If the issue persists, please include the following pieces of information so that I may assist you further:
    1. Are there any attachments being sent? If so, which attachment file type is being used (PDF or Word documents, JPG photos, etc)?
    2. Which email address/addresses are used to send ePrint emails?
    3. The results of a test email (success/fail) which will help isolate the source of the issue. Please follow the instructions below:
    a. Type the word "test" in the subject line
    b. Type the word "test" in the email body
    c. Do not include an email signature
    d. Do not include an email attachment (documents/photos/etc.)
    Please include the results of this test email in your reply.
    I hope the initial set of steps resolved the issue but look forward to providing you additional support if necessary.
    If I have SOLVED your issue, please feel free to provide KUDOS and make sure you mark this thread as SOLUTION PROVIDED!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • How do you print a picture from Facebook on the iPad Air2

    How do you print a picture on Facebook appearing on my iPad Air2 with my HP 8600 Office jet?

    After enlarging the photo you might have to take a screen shot then print that from photos. When you hold you finger on the photo then tap save photo it's doesn't seem to be  saving to photos.

  • Officejet 150 only prints/reads pictures from Flash Drive??!!

    Everytime I try to print something off my flash drive, the printer will only search for pictures.  It doesn't recognize that there are PDF or Word documents on there.  Is there something wrong or can it only read/print pictures from the flash drive.  Same thing happpens when I try it with a SD card.
    Help??!!

    Hi Emmee102,
    The Officejet 150 can only read photo files from the USB flash drive and SD card.
    A couple of workarounds can enable you to print from your ipad to the OJ 150:
    1) convert your pdf/word files into jpeg/jpg format and save to the flash drive/SD card
    2) use print screen from your PC , this is good if you only have a few pages in your document.
    Hope this helps.
    If my answer was helpful please click the blue “Kudos" button to say "Thank You" or Click "Accept as Solution" if it solved your problem, so others can find it.
    Although I am an HP employee, I am speaking for myself and not for HP.
    Have a nice day!

  • Is there a way to print a document from the URL?

    I have found information on opening a pdf file to a specific page, or with bookmarks open, but are there parameters to print the specified pdf document from the URL?

    Open your calendar in your browser and press your print screen key (Print Scrn) on your keyboard.  Then paste this into an application like Paint.  Once in Paint you can print it.  There's a video of this here: http://windows.microsoft.com/en-us/windows/take-screen-capture-print-screen#take -screen-capture-print-screen=windows-7.

  • When I print a picture from I photo on my HP 310 printer I select the fill picture which appears as a portrate then prints as landscape so I get the centre of the the original picture only. I have tried to fix but no luck what can I do?

    When I try to print from I photo ie a A6 lanscape picture a page apears showing me how I want the picture on the selected paper and size ie "fill" I then press print and then a window apears showing how it will apear on the paper and it continously shows the paper as portrait and the picture I am trying to print appears in a lanscape form so that only the center of the picture is printed with two white areas apearing top and pottom. Why does the picture not print in the correct direction as the print page shows I selected landscape format. I hope you understand.

    Hi,
    Tried all the cleaning programmes and it still will not print...I am lost.

  • How do I print my pictures from Photoshop Elements 8?

    Hi,
    I purchased and Adobe Photoshop Elements 8 from a garage sale and have downloaded the software onto my computer. I have posted pictures and edited them, but I am unable to pass the pictures to any site to be printed. I have registered the photoshop with adobe .com, but I can't find any information that is helpful concerning my being unable to send the pictures to any source. Am I missing something? My email is [email protected], if you have any information or could please email me back...
    Thanks,
    Brian.

    Good day!
    Please post Photoshop Elements related queries over at
    http://forums.adobe.com/community/photoshop_elements
    Regards,
    Pfaffenbichler

  • How do i print a picture from my samsung phone using eprint

    I have a samsung phone and it a android phone and I see my email address for printer and I see a picuture out and send it to that eamil address and it tell me it fail why

    Hello,
    Here are some general rules to follow when using ePrint:
    Send to only one email recipient, the one recipient is your printer
    Make sure the email address you're sending from is on your Approved Senders list (if you set one up in your ePrintCenter account)
    The email and attachments must be less than 5MB total
    If possible, try another email client
    Let me know if any of these work for you.
    Miles
    HP Employee

  • How do i print a picture from my windows folder from windows 7 64-bit on a deskjet 3050A

    see subject

    Display the picture with whatever application you have.  Press the print button and it should print.  If not, we need more info.
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • HT204364 Can I print my pictures from iPhoto?

    I want to print some photos, but I get the message that I need to install a theme first.  How do I do that?

    What is your iPhoto version?
    If it is iPhoto 9.4.2, installed from the AppStore, just reinstall it from the AppStore. In that case the themes are stored inside iPhoto's application bundle.
    If you have a different version, post back with the exact version number.
    Regards
    Léonie

  • When I try to print a picture from iPhoto, all of the detail is not shown...any ideas?

    So I design a nice card in iPhoto, and then I try to print it - all of the design disappears and only the text is visible.
    To view the full card design do I have to purchase the card and have it delivered?

    Tried. If I directly print, or save as a PDF, the design is either:
    a) lost
    b) replaced with the design of another card
    c) just goes blank
    I've had this problem ever since updating to the most amazing operating system in the world (Lion...) ahem...
    All of the Lion computers at my university also have this same issue...I have no idea how to remedy it.

  • Printing 8x10 pictures from cs2

    hi there. new to this forum. kind of simple, but for the life of me I can't seem to get a 1/4 in border on an 8x10 sheet of photo paper. I use a mac G5 running tiger, photoshop cs2 and an epson 1280 silver printer...my files are 4x6 # 300 dpi..i've tried all manner of settings, i.e. image size, document size, all to no avai..can someone be kind enough to lend a hand?
    many thanks in advance, Steven

    I retired my 1280 a little while ago. What is the name of the paper size you've chosen? On Epsons of that vintage, the trailing edge margin is bigger (.56 inches) than the other three by default, unless you select the paper size that says "Minimize Margins." This reduces the gripper edge margin to the same value as the other three sides. For example, if you were choosing "8x10," you need to choose "8x10 (Minimize Margins)" instead. Then all the margins will be the same, and you'll finally get the maximum possible print area and proper centering without the need for any time-consuming "fooling the printer" tricks.
    The reason nothing you try in Photoshop helps is because the solution is in the Epson printer driver, not in Photoshop. Photoshop can only work within the printable area handed to it by the printer driver. Once you get the printer driver to behave, Photoshop can do what you expect.

Maybe you are looking for

  • Problem in RFC  call in ABAP code...Urgernt

    Hi , I am working on scenario wherein , i have created remote enabled RFC in target system SAP R/3 one . I have maintained RFC in original system where i have my calling program.This done by using sm59 transaction .When i execute my abap calling prog

  • Alternative UoM issue

    Hi Gurus material A - Base UoM = LB component B - Base UoM = LB, Alt UoM = PC (conversion 1PC = 10 LB) I am trying to create a BOM (CS01) for material A: with components B. And I'm receiving this error: Unit of measure PC not supported for material B

  • Non-EDI messages via AS2 Communication Channel

    Hi, We have many EDI interfaces running via AS2 communication channel provided by Seeburger. I was wondering whether AS2 should only be used for EDI message or any other normal XML formats also. If AS2 can be used for other formats also, what is the

  • Widget not working in Internet Explorer

    My Spry widget drop down menu works in all browsers except Internet Explorer. In Explorer it shows a white box with the word "false" in it. Any ideas?

  • Como doy solución al mensaje de "5.07 Error fusor"

    ACVO de adquirir ONU multifuncional hice "Color LaserJet PRO200 MFO m276nw" su modelo es las Impresiones de prueba, but in Seguida se atasco el papel y me marca leyenda Una "50.7 Error de fusor, Apague y encienda." -Esta acción de apagar y Encender d