on 02-05-2021 2:34 PM
Necesito mostrar la imagen de un empleado sap, para ello a partir del numero de empleado y usando la función HR_ESS_WHO_PROG_GET_PICT_URI obtengo una URL.
Aquí mi código en el método WDDOINIT
DATA: lo_http_response TYPE REF TO if_http_response,
lo_nd_empleado TYPE REF TO if_wd_context_node,
lo_el_empleado TYPE REF TO if_wd_context_element,
ls_empleado TYPE wd_this->elements_empleado.
* navigate from <CONTEXT> to <EMPLEADO> via lead selection
lo_nd_empleado = wd_context->get_child_node( name = wd_this->wdctx_empleado ).
* get element via lead selection
lo_el_empleado = lo_nd_empleado->get_element( ).
lv_pernr = '00006466'.
CALL FUNCTION 'HR_ESS_WHO_PROG_GET_PICT_URI'
EXPORTING
pernr = lv_pernr
date = sy-datum
tclas = 'A'
IMPORTING
uri = lv_uri
EXCEPTIONS
not_supported = 1
nothing_found = 2
no_authorization = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc is initial.
lv_url = lv_uri.
ENDIF.
* get element via lead selection
lo_el_empleado = wd_context->get_element( ).
* get single attribute
lo_el_empleado->set_attribute(
EXPORTING
name = 'IMAGEN'
value = lv_url ).
Resultado:
Hello m4lk4v14n
There is no IMAGEN attribute. That's why there is a short dump. Check the name, if there are no typos, otherwise check what attributes are available.
Kind regards,You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How did you upload the image?
Also, check out this answer, maybe it will be the solution: https://answers.sap.com/questions/10312611/how-to-get-url-path-of-image-which-i-uploaded-in-o.html
User | Count |
---|---|
75 | |
10 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.