Advertisement
ezecasti18

Untitled

Jul 18th, 2022
1,454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 2.28 KB | None | 0 0
  1. METHOD m_buscar_contrato .
  2.  
  3.   DATA lo_api_controller TYPE REF TO if_wd_controller.
  4.   DATA ls_documento      TYPE wd_this->element_documento.
  5.  
  6.   lo_api_controller ?= wd_this->wd_get_api( ).
  7.   DATA(lo_message_manager) = lo_api_controller->get_message_manager( ).
  8.  
  9.   DATA ls_configuracion TYPE wd_this->element_configuracion.
  10.   wd_context->get_child_node( name = wd_this->wdctx_configuracion )->get_element(
  11.   )->set_static_attributes( static_attributes = ls_configuracion ).
  12.  
  13.   DATA(lo_element) = wd_context->get_child_node( name = wd_this->wdctx_documento )->get_element( ).
  14.   lo_element->get_static_attributes( IMPORTING static_attributes = ls_documento ).
  15.   wd_this->m_invalidar_partners( ).
  16.   IF ls_documento-object_id IS INITIAL.
  17.     lo_message_manager->report_attribute_message(
  18.        EXPORTING
  19.          message_text              = 'Complete Contrato/Pedido'
  20.          element                   = lo_element
  21.          attribute_name            = 'OBJECT_ID' ).
  22.     re_result = 'FAILED'.
  23.     RETURN.
  24.   ENDIF.
  25.  
  26.   IF ls_documento-process_type IS INITIAL.
  27.     lo_message_manager->report_attribute_message(
  28.        EXPORTING
  29.          message_text              = 'Complete tipo de documento'
  30.          element                   = lo_element
  31.          attribute_name            = 'PROCESS_TYPE' ).
  32.     re_result = 'FAILED'.
  33.     RETURN.
  34.   ENDIF.
  35.  
  36.   IF wd_this->m_buscar_local( im_object_id = ls_documento-object_id
  37.                               im_tipo      = ls_documento-process_type ) EQ abap_true.
  38.     wd_this->go_contrato = zcl_ppm_contrato=>get_instance( ls_documento-object_id ).
  39.     RETURN.
  40.   ELSEIF wd_this->m_buscar_proxy( im_object_id = ls_documento-object_id
  41.                                   im_tipo      = ls_documento-process_type ) EQ abap_true.
  42.     wd_this->go_contrato = zcl_ppm_contrato=>get_instance( ls_documento-object_id ).
  43. *    wd_this->m_solicitar_catalogo( ).
  44.     RETURN.
  45.  
  46.   ELSEIF wd_this->m_buscar_proxy( im_object_id = ls_documento-object_id
  47.                                   im_tipo      = ls_documento-process_type ) EQ abap_false.
  48. *Avanzar para que te permita mostrar los detalles del contrato sin bloquearte el proceso
  49.     wd_this->go_contrato = zcl_ppm_contrato=>get_instance( ls_documento-object_id ).
  50.     RETURN.
  51.   ENDIF.
  52.   re_result = 'FAILED'.
  53. ENDMETHOD.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement