Difference between revisions of "SAP ABAP VARIOS"

From SapWiki
Line 24: Line 24:
  
 
  ENDIF.
 
  ENDIF.
 +
 +
==Obtener Texto según Valor de dominio==
 +
FORM get_domvalue USING p_domname p_value CHANGING p_text.
 +
  DATA: l_domvalue TYPE dd07v-domvalue_l,
 +
        l_ddtext TYPE dd07v-ddtext.
 +
 +
  l_domvalue = p_value.
 +
 +
  CALL FUNCTION 'DOMAIN_VALUE_GET'
 +
    EXPORTING
 +
      i_domname  = p_domname
 +
      i_domvalue = l_domvalue
 +
    IMPORTING
 +
      e_ddtext  = l_ddtext
 +
    EXCEPTIONS
 +
      not_exist  = 1
 +
      OTHERS    = 2.
 +
  IF sy-subrc = 0.
 +
    MOVE l_ddtext TO p_text.
 +
  ELSE.
 +
    CLEAR p_text.
 +
  ENDIF.
 +
 +
ENDFORM.                    "get_domvalue

Revision as of 20:47, 26 March 2020

UUID ver nota 935047 - Creating and using GUIDs (UUIDs)

FORM generar_iddocumento_2 CHANGING p_resultado.
  DATA lcl_request_id TYPE guid_32.

  TRY.
      lcl_request_id = cl_system_uuid=>create_uuid_c32_static( ).
    CATCH cx_uuid_error.
      ASSERT 1 = 0.
  ENDTRY.

  MOVE lcl_request_id TO p_resultado.
ENDFORM.

Grabar XSTRING en equipo como Binario(XML,PDF,etc.)

CONCATENATE ls_dir_d '\' i_vbeln '.xml'
             INTO ls_fullpath.
CALL METHOD cl_faa_tenv_services=>gui_download_xstring
  EXPORTING
    id_fullpath = ls_fullpath
    id_xstring  = i_xml.
IF sy-subrc <> 0.
ENDIF.

Obtener Texto según Valor de dominio

FORM get_domvalue USING p_domname p_value CHANGING p_text.
  DATA: l_domvalue TYPE dd07v-domvalue_l,
        l_ddtext TYPE dd07v-ddtext.

  l_domvalue = p_value.

  CALL FUNCTION 'DOMAIN_VALUE_GET'
    EXPORTING
      i_domname  = p_domname
      i_domvalue = l_domvalue
    IMPORTING
      e_ddtext   = l_ddtext
    EXCEPTIONS
      not_exist  = 1
      OTHERS     = 2.
  IF sy-subrc = 0.
    MOVE l_ddtext TO p_text.
  ELSE.
    CLEAR p_text.
  ENDIF.

ENDFORM.                    "get_domvalue