cancel
Showing results for 
Search instead for 
Did you mean: 

Show Picture From URL with dynamic URL

Former Member
0 Kudos

Dear all,

I have an issue when I try to insert a picture from an URL in my Adobe form.

The context is that I have to print an image from a file server (or sharepoint). The link is given in a text (like description).

So, I only know the link when the form is run (Like Master Data).

In other terms, I should be able to print the form with any picture from the file server...

I tried with the object Image (which is not the good way because there is no data biding for the Url).

I also tried with the ImageField with no success.

I could bind a global field in the "Default Binding" Tab but the Url Field property is empty (I think it's normal because the field is filled when the form is called).

My binding name is $.ZEP_GRAPH

Do I have to write some code in the script editor or do I have to put something in the field "URL" of the field tab?

I also see in the forum that Adobe or SAP disable the option which let you select a picture from the Web...

Is it still the case?

Thank you very much,

Luis.

Edited by: Luis Loredo Marino on Jan 16, 2012 3:51 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Did it myself 🐵

Former Member
0 Kudos

Dear all,

I found a work around to do what I want without using a 'external' picture...

I tried the method cl_http_client=>create_by_url without success (security reason due to internal policy) but I think this could work...

Here is the link for external picture:

The work around is to upload the picture on the SAP server and read it in binary mode. The transaction used to upload picture is CG3Z.

Here is the coding in my form:


DATA:
  lw_fname  TYPE string VALUE 'LOCATION_OF_YOUR_PICTURE',
  lw_string TYPE string,
  lw_logo   TYPE string,
  lw_read   TYPE xstring.
OPEN DATASET lw_fname IN BINARY MODE FOR INPUT.
DO.
  READ DATASET lw_fname INTO lw_read.
  IF sy-subrc = 0.
    CALL FUNCTION 'SSFC_BASE64_ENCODE'
      EXPORTING
        bindata = lw_read
      IMPORTING
        b64data = lw_string.
    CONCATENATE lw_logo lw_string INTO lw_logo.
  ELSE.
    EXIT.
  ENDIF.
ENDDO.
CLOSE DATASET lw_fname.
IF lw_logo IS NOT INITIAL.
  zep_graph = lw_logo.
ELSE.
  CLEAR zep_graph.
ENDIF.

Field ZEP_GRAPH is the binding field to the ImageField object in the form.

In my case, the path of the picture will be given by description filled in the characteristic.

Hope this could help someone one day...

Luis.

Former Member
0 Kudos

No idea?