cancel
Showing results for 
Search instead for 
Did you mean: 

how to display employee photo in ADOBE forms?

former_member182426
Active Contributor
0 Kudos

hi friends,

i created one report to get employee photo URL by passing PERNR.

And i designed one ADOBE form with these details.

vorna, nachn, and photo.

now the vorna and nachn, i am able to see in ADOBE form when i test it.

And i passed the URL of employee to photo parameter. but it's not appearing in that.

I am using IMAGEFILED to display the employee photo. Even i checked the Embed picture option check box in the object. and The field value is $record.photo

Any helps regarding this.....

Regards,

Shankar.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shankar Reddy,

Please look at the Blog Post

[How Tou2026 Integrate ADOBE form on WebdynPro for ABAP and Deploy it on portal...(By Bhawanidutt Dabral)|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/7783] [original link is broken] [original link is broken] [original link is broken];

May be you are missing some steps out there. This blog can help you.

Regards

Pradeep Goli

Former Member
0 Kudos

Hey Thought I'll reply you with the answer, but you already got what I wanted to tell you in the earlier post. Do let me know if you still find some issue with the development.

~BD

former_member182426
Active Contributor
0 Kudos

hi,

thanks for ur reply. But, i already followed same thing which u specified the link. The problem is employee photo is not displaying in ADOBE form when i tested it.

Regards,

Shankar.

former_member182426
Active Contributor
0 Kudos

hi,

i am unable to display the photo. i am getting the URL of employee photo and i am passing it to interface also. But it's showing only first and last name. it's not showing the employee photo.

Any helps...........

Regards,

Shankar.

Former Member
0 Kudos

Hi, I dont see any reason that the photo should not display --- please check once again and the code, I am sure you must have missed some thing. Check for the values, bindiing --- add one more ImageField and check.

~BD

former_member182426
Active Contributor
0 Kudos

hi,

i checked each and every step. i didn't missed anything in that. plz if possible u try it. and let me know weather it's working r not.

Regards,

Shankar.

Former Member
0 Kudos

Hi Can you confirm what value do you get after this code

      • 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.

Once you get the value also bind this to a input or test field on the layout with the image field. ... confirm that you get the value in the new text field.

~BD

former_member182426
Active Contributor
0 Kudos

Hi,

I didn't get ur question. Here after this code i am getting the image path i.e in binary format into that ls_z_if_test_cv-IM_PHO

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.

Now the ls_z_if_test_cv-im_photo contains the path of employee photo, I checked in debug mode also it's getting the path. But in output it's not showing the photo of employee.

Regards,

Shankar.

Former Member
0 Kudos

Hi Please confirm --- is the ls_z_if_test_cv-im_photo is of type XSTRING?

Former Member
0 Kudos

Have you stored the photograph as bmp in SE78?

former_member182426
Active Contributor
0 Kudos

hi,

i changed the code to get the employee photo from archive link. So now the IM_PHOTO field contains the employee photo. i.e in binary format.

the code is like this....

DATA pernrid TYPE PERNR-PERNR.  "tdobname.

  DATA temp TYPE c.

  DATA: p_connect_info TYPE TOAV0,
        wa_p_connect_info TYPE TOAV0,
        p_document_type TYPE TOAV0-RESERVE,
        exists TYPE c.

  DATA: url TYPE char255,
        turl TYPE string,
        turl1 TYPE xstring.

  DATA lo_nd_z_if_test_cv TYPE REF TO if_wd_context_node.
  DATA lo_el_z_if_test_cv TYPE REF TO if_wd_context_element.
  DATA ls_z_if_test_cv TYPE wd_this->element_z_if_test_cv.

* navigate from <CONTEXT> to <Z_IF_TEST_CV> via lead selection
  lo_nd_z_if_test_cv = wd_context->get_child_node( name = wd_this->wdctx_z_if_test_cv ).

* get element via lead selection
  lo_el_z_if_test_cv = lo_nd_z_if_test_cv->get_element(  ).

* get all declared attributes
  lo_el_z_if_test_cv->get_static_attributes(
    IMPORTING
      static_attributes = ls_z_if_test_cv ).

* *** Vorna and Nachn.
 ls_z_if_test_cv-im_vorna = 'shankar'.
 ls_z_if_test_cv-im_nachn = 'chamala'.

***pernr
  pernrid = '00000003'.

CALL FUNCTION 'HR_IMAGE_EXISTS'
  EXPORTING
    P_PERNR                     = PERNRID
*   P_TCLAS                     = 'A'
*   P_BEGDA                     = '18000101'
*   P_ENDDA                     = '99991231'
 IMPORTING
   P_EXISTS                    = exists
   P_CONNECT_INFO              = P_CONNECT_INFO
 EXCEPTIONS
   ERROR_CONNECTIONTABLE       = 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.

P_DOCUMENT_TYPE = P_CONNECT_INFO-RESERVE.

CALL FUNCTION 'SCMS_DOC_URL_READ'
  EXPORTING
*   MANDT                      = SY-MANDT
    STOR_CAT                   = SPACE
    CREP_ID                    = P_CONNECT_INFO-ARCHIV_ID
    DOC_ID                     = P_CONNECT_INFO-ARC_DOC_ID
*   PHIO_ID                    =
   COMP_ID                    = 'DATA'
*   SIGNATURE                  = 'X'
*   SECURITY                   = ' '
*   USE_LOCATION               = 'A'
*   LOCATION                   = ' '
*   HTTP_URL_ONLY              = ' '
   DP_URL_ONLY                = 'X'
*   LIFETIME                   = ' '
*   NO_CACHE                   = ' '
*   EXPIRATION                 =
*   PDF_MODE                   = ' '
*   URL_EXTENTION              = ' '
*   FORCE_GET                  = ' '
 IMPORTING
   URL                        = URL
 EXCEPTIONS
   ERROR_CONFIG               = 1
   ERROR_PARAMETER            = 2
   ERROR_SIGNATURE            = 3
   HTTP_NOT_SUPPORTED         = 4
   DOCGET_NOT_SUPPORTED       = 5
   NOT_ACCESSABLE             = 6
   DATA_PROVIDER_ERROR        = 7
   TREE_NOT_SUPPORTED         = 8
   NOT_SUPPORTED              = 9
   OTHERS                     = 10
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

turl = url.

CALL FUNCTION 'HR_KR_STRING_TO_XSTRING'
  EXPORTING
*   CODEPAGE_TO            = '8500'
    UNICODE_STRING         = turl
*   OUT_LEN                =
 IMPORTING
   XSTRING_STREAM         = turl1
 EXCEPTIONS
   INVALID_CODEPAGE       = 1
   INVALID_STRING         = 2
   OTHERS                 = 3
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ls_z_if_test_cv-im_photo = turl1.


*** Get the Photographs  
*
*CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
*  EXPORTING
*    p_object       = 'GRAPHICS'
*    p_name         = pernrid
*    p_id           = 'BMAP'
*    p_btype        = 'BCOL'
*  receiving
*    p_bmp          = ls_z_if_test_cv-im_photo
*  EXCEPTIONS
*    not_found      = 1
*    internal_error = 2
*    others         = 3
*        .
*IF sy-subrc EQ 0.
**  MOVE 'y' TO temp.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
**            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.


*** Send the values back to the node
  lo_el_z_if_test_cv->set_static_attributes(
    EXPORTING
      static_attributes = ls_z_if_test_cv ).

But, Still now i am not getting the photo in output. only it's showing VORNA, NACHN filed values.

Regards,

Shankar.

Former Member
0 Kudos

I think the issue is when u convert string into xstring using this FM CALL

CALL FUNCTION 'HR_KR_STRING_TO_XSTRING'

EXPORTING

  • CODEPAGE_TO = '8500'

UNICODE_STRING = turl

  • OUT_LEN =

IMPORTING

XSTRING_STREAM = turl1

EXCEPTIONS

INVALID_CODEPAGE = 1

INVALID_STRING = 2

OTHERS = 3

--- Why dont you first just to check upload one BMP in SE78 and using the call method try to retrive the photo and use it in your form?

former_member182426
Active Contributor
0 Kudos

hi,

But my requirement, i have retrevie the employee photo from archive link only. but not from se78.

is there any solution....

Regards,

Shankar.

Former Member
0 Kudos

Buddy I do understand your requirement -


what I am asking you is to check if at all the photo appears on the form through SE78.. if photo appears from SE78 the issue is with your conversion from string to xstring when retrieving the photo through archive link.

I am just asking for the confirmation to reach to a conclusion

former_member182426
Active Contributor
0 Kudos

hi,

which ever the employee photos u uploaded through TCODE OAOH , how we can see in se78.

Here I uploaded employee photo through TCODE OAOH, but not from SE78.

Regards,

Shankar.

D037255
Advisor
Advisor
0 Kudos

If you would like to work with a picture, loaded dynamically from an URL, you should use scripting.

FormCalc scripting on the picture element:

$.value.image.href = $record.URL

guillaume-hrc
Active Contributor
0 Kudos

Hi,

This post helped me a lot, and I figured out what was going wrong for me.

Thanks guys!

Here is the code that works for me:

  CALL FUNCTION 'HR_IMAGE_EXISTS'
    EXPORTING
      p_pernr                     = p_pernr
*     P_TCLAS                     = 'A'
*     P_BEGDA                     = '18000101'
*     P_ENDDA                     = '99991231'
    IMPORTING
*     P_EXISTS                    =
      p_connect_info              = l_connect_info
    EXCEPTIONS
      error_connectiontable       = 1
      OTHERS                      = 2.

  CHECK sy-subrc = 0.

  CALL FUNCTION 'SCMS_DOC_READ'
    EXPORTING
*     MANDT                       = SY-MANDT
      stor_cat                    = space
      crep_id                     = l_connect_info-archiv_id
      doc_id                      = l_connect_info-arc_doc_id
*     PHIO_ID                     =
*     SIGNATURE                   = 'X'
*     SECURITY                    = ' '
*     NO_CACHE                    = ' '
*     RAW_MODE                    = ' '
*   IMPORTING
*     FROM_CACHE                  =
*     CREA_TIME                   =
*     CREA_DATE                   =
*     CHNG_TIME                   =
*     CHNG_DATE                   =
*     STATUS                      =
*     DOC_PROT                    =
    TABLES
      access_info                 = lt_infos
*     CONTENT_TXT                 =
      content_bin                 = lt_image_bin
    EXCEPTIONS
      bad_storage_type            = 1
      bad_request                 = 2
      unauthorized                = 3
      comp_not_found              = 4
      not_found                   = 5
      forbidden                   = 6
      conflict                    = 7
      internal_server_error       = 8
      error_http                  = 9
      error_signature             = 10
      error_config                = 11
      error_format                = 12
      error_parameter             = 13
      error                       = 14
      OTHERS                      = 15.

  CHECK sy-subrc = 0.

  READ TABLE lt_infos INDEX 1 ASSIGNING <fs_info>.
  CHECK sy-subrc = 0.

  CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
    EXPORTING
      input_length = <fs_info>-comp_size
      first_line   = <fs_info>-first_line
      last_line    = <fs_info>-last_line
    IMPORTING
      buffer       = l_employee_photo_content
    TABLES
      binary_tab   = lt_image_bin
    EXCEPTIONS
      failed       = 1
      OTHERS       = 2.

  CHECK sy-subrc = 0.
  l_employee_photo_mime = <fs_info>-mimetype.

You have to create a node Graphics (Content) in the Form Context and assign both the field containing the XSTRING and the filed containing the MIME type.

Best regards,

Guillaume

indraneel_dasbarua
Participant
0 Kudos

Dear All,

Please follow the reply form Guillaume GARCIA, His solution worked for me .

Regards

Indraneel