Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Smart Forms + Graphics

Former Member
0 Kudos
736

Hello all!

I would like to know whether it's possible to show graphics in smart forms using the function HR_IMAGE_SHOW.

Thanks a lot!!

Hajar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Kudos
438

Hi Hajar,

See this code:

CALL FUNCTION 'HR_IMAGE_EXISTS'

EXPORTING

P_PERNR = P_PERNR

P_TCLAS = P_TCLAS

P_BEGDA = P_BEGDA

P_ENDDA = P_ENDDA

IMPORTING

P_EXISTS = L_EXISTS

P_CONNECT_INFO = L_CONNECT_INFO

EXCEPTIONS

  • error_connectinfo = 1

OTHERS = 2.

Regards,

Raj

13 REPLIES 13
Read only

Former Member
0 Kudos
438

Hi,

I think it is not possible. you need to upload the image through se78 and then you can show using smart forms.

thanks

vijay

Read only

0 Kudos
438

Thanks a lot Vijay!

Yes i know this method but the problem is that the images i have are jpeg. If i want to upload them through the se78 i need to convert them all to .bmp or .tif and i don't wanna do that.

If uploading images through the se78 is the only method is there a way to check whether the image is uploaded or not.

Thanks a lot!

hajar

Read only

0 Kudos
438

you can view the print preview(press F8) from se78 itself it is available if image is uploaded

Read only

0 Kudos
438

Thanks a lot for your help!

Maybe i was not that clear. I have created a smart form where i need to show the pictures of the employees. To do so i uploaded some of them into the se78 (these graphics are named by the employees pernr) and i used the graphic node in the smart form in order to display them. However, there are some employees that do not have their pictures uploaded. So, when i execute the smart form i get an error stating that the graphic was not found. How can i solve this problem? I thought about adding some ABAP code where i will check if the graphic exists before printing it. However, i don't know how to do that.

All your suggestions are welcomed!!

Yours,

Hajar

Read only

Former Member
0 Kudos
438

Hi,

You can have graphics in your smartforms using the 'Graphic' node.

This FM HR_IMAGE_SHOW, will give you the URL to the image.

Refer post

for the use of FM HR_IMAGE_SHOW

Regards,

RAj

Read only

Former Member
0 Kudos
438

Hi Hajar,

Add a 'program lines' node and check if the graphic exits in the system, if yes, then you set a flag,

Use 'Alternative' node, check the flag and then display the graphic.

Regards,

Raj

Read only

0 Kudos
438

Thanks a lot Rajasekhar!

This is what i was thinking about too. But the problem is that how to check if the graphic exists in the system. Is there any function that i need to call??

Thanks a lot.

Hajar

Read only

Former Member
0 Kudos
439

Hi Hajar,

See this code:

CALL FUNCTION 'HR_IMAGE_EXISTS'

EXPORTING

P_PERNR = P_PERNR

P_TCLAS = P_TCLAS

P_BEGDA = P_BEGDA

P_ENDDA = P_ENDDA

IMPORTING

P_EXISTS = L_EXISTS

P_CONNECT_INFO = L_CONNECT_INFO

EXCEPTIONS

  • error_connectinfo = 1

OTHERS = 2.

Regards,

Raj

Read only

0 Kudos
438

Can i use this function to check if the image exists in the se78 too???

Thanks a lot.

Hajar

Read only

0 Kudos
438

Can i use this function to check if the image exists in the se78 too???

Does anyone of you have an answer for that??

Thanks a lot.

Hajar

Read only

0 Kudos
438

Hi Hajar,

You could check if the image exists in table STXBITMAPS

Regards,

Ville

Read only

0 Kudos
438

Thank you very much!!

The image exists in the table cited above. However, I still have a question can we dispaly jpeg images in a smart form.

Thanks a lot for your help!

Hajar

Read only

0 Kudos
438

No,

you cannot. convert to BMP and can show it in smartforms.

thanks

vijay