cancel
Showing results for 
Search instead for 
Did you mean: 

Image Object

Former Member
0 Kudos

Hello everybody,

i have my PDF Form with an Image Object for a logo. What I want to do is write some code and set there the URL of the image I want to put on the form. This way I could set up the image and the end user should need to open the form and manually select an image.

Is this possible? And if yes, where should I write the code and where should I set the URL for my image in my code? Is there a variable, a structure or something like that where it can be setup?

Thank you and regards!

Accepted Solutions (1)

Accepted Solutions (1)

OttoGold
Active Contributor
0 Kudos

Hello,

I am a little confused about your requirement. Why would you code antyhing if you want to use url (where you can place anything). Is that because you may want to get the image in ABAP/ backend and not in the form? Next why would your user should choose a picture himself? That means you need to script things and your form won´t work offline.

Maybe you should consider placing the images (if they are small, i mean really tiny) into the form from backend and only show the picture to the user if he wishes to. Are you sure you want to download pictures from the location dynamically and ask the user to choose some images? Is this the right way to solve your problem?

My feeling about this is that you´ve been given a mismatch to do or it is my understanding but this does not sound good to develop for me. Or maybe you can clarify the future use of the form.

Regards, Otto

Answers (5)

Answers (5)

Former Member
0 Kudos

Excellent!

Thank you very much!

OttoGold
Active Contributor
0 Kudos

Example:

1. Currently we will Hard Code the fields Vorna and Nachn and will use the standard method to get the photographs form SE78 (Form Graphics).

2. Add this piece of code

CONSTANTS: c_graphics TYPE tdobjectgr VALUE 'GRAPHICS',

c_bmap TYPE tdidgr VALUE 'BMAP' ,

c_bcol TYPE tdbtype VALUE 'BCOL'.

DATA: lv_pernr1 TYPE tdobname.

      • Vorna and Nachn.

ls_z_if_test_cv-im_vorna = 'Bhawanidutt'.

ls_z_if_test_cv-im_nachn = 'Dabral'.

      • Get the Photographs.

lv_pernr1 = '00000028'. " Employee Number

CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp

EXPORTING

p_object = c_graphics

p_name = lv_pernr1

p_id = c_bmap

p_btype = c_bcol

RECEIVING

p_bmp = ls_z_if_test_cv-im_photo

EXCEPTIONS

not_found = 1

internal_error = 2

OTHERS = 3.

Using this method you can get the picture out of transaction SE78. You only provide the name of the picture (that is what you get out of your customizing) and use it as the graphics name for the function to get your data. For further reference check the tutorial named How Tou2026 Integrate ADOBE form on WebdynPro for ABAP and Deploy it on portal by Bhawanidutt Dabral.

Hope this solves the problem to the end, in case there are some more problems, feel free to ask, have a nice day, Otto

Former Member
0 Kudos

Hello Otto,

this sounds good, thank you.

Just one more question: the URL is clear how to use, but for SAP Internal what should the xstring contain? In tx se78 i can get only the name of the image, but this is not enough for the image field in the form.

Thanks again!

OttoGold
Active Contributor
0 Kudos

This is very easy to do. Just:

1) create a simple customizing for a image source (URL is one option, SAP ID is another, use tx SE78)

2) when you generate the form for the user, check who the user is, get the right picture (URL or SAP internal) as an XSTRING.

3) pass this XSTRING to the form as one of the context fields

4) create image field (not image !! there is your picture based on condition

Hope this solves your problem, Otto

Former Member
0 Kudos

Hello Otto,

thanks for your answer.

The idea is that the form should be used by different users, and each user should have a different image on the form.

In order to prevent the user from going actually in the form and set there the image, he could put somewhere a url of an image (for example in a customizing table) and the form reads the url form the table and sets the image on the form.

The goal is that the user doesn't have to work directly with the form and does not needs knowledge on how to edit the form, in order to set up the image. He just puts the url in the table and the form reads it and sets automatically the right image.

Thanks and regards!