SAP ISH ABAP
From SapWiki
Obtener extensión de documento (tabla NDOC)
data: ls_appl_data type RN2DT_APPLICATION, ls_pcdta type N2DTDTA. SELECT SINGLE dtid, dtvers into @data(ls_ndoc) FROM ndoc WHERE dokar = @c_data-dokar AND doknr = @c_data-doknr AND dokvr = @c_data-dokvr AND doktl = @c_data-doktl. "#EC CI_SEL_NESTED CALL FUNCTION 'ISH_N2_READ_DOCUMENT_TYPE' EXPORTING ss_dtid = ls_ndoc-dtid ss_dtvers = ls_ndoc-dtvers ss_einri = c_data-einri SS_VCODE = 'DIS' IMPORTING * SS_N2DT = * SS_N2DTT = SS_PCDTA = ls_pcdta * SS_ERROR_PCDTA = * SS_DOCCATEGORY = * SS_DOCCATEGORY_PC = * SS_APPLICATION = SS_APPL_NEW = ls_appl_data * SS_FORMAT = EXCEPTIONS NOT_FOUND_OBJECT = 1 WRONG_VCODE = 2 OTHERS = 3 . IF sy-subrc = 0. * Implement suitable error handling here c_data-extension = ls_pcdta-PCFEXT. else. c_data-extension = 'DOC'. ENDIF.