SAP IDOCTYPE_READ_COMPLETE Function Module for Read IDoc type with segments (RFC-compatible)
IDOCTYPE_READ_COMPLETE is a standard idoctype read complete SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read IDoc type with segments (RFC-compatible) processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for idoctype read complete FM, simply by entering the name IDOCTYPE_READ_COMPLETE into the relevant SAP transaction such as SE37 or SE38.
Function Group: EDIMEXT
Program Name: SAPLEDIMEXT
Main Program: SAPLEDIMEXT
Appliation area: S
Release date: 14-Apr-1998
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function IDOCTYPE_READ_COMPLETE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'IDOCTYPE_READ_COMPLETE'"Read IDoc type with segments (RFC-compatible).
EXPORTING
PI_IDOCTYP = "Basic type
* PI_CIMTYP = "Enhancement
* PI_RELEASE = SY-SAPRL "Release
* PI_APPLREL = "IDoc Development: Application Release of Segment Definition
* PI_VERSION = '3' "Version of IDoc record types
IMPORTING
PE_HEADER = "Header data for IDoc type
TABLES
* PT_SEGMENTS = "Structure of IDoc type (segments)
* PT_FIELDS = "Structure of segments for IDoc type (fields)
* PT_FVALUES = "Permitted values for segment fields
* PT_MESSAGES = "Linked logical messages
EXCEPTIONS
OBJECT_UNKNOWN = 1 SEGMENT_UNKNOWN = 2 RELATION_NOT_FOUND = 3
IMPORTING Parameters details for IDOCTYPE_READ_COMPLETE
PI_IDOCTYP - Basic type
Data type: EDI_IAPI00-IDOCTYPOptional: No
Call by Reference: No ( called with pass by value option)
PI_CIMTYP - Enhancement
Data type: EDI_IAPI00-CIMTYPOptional: Yes
Call by Reference: No ( called with pass by value option)
PI_RELEASE - Release
Data type: SY-SAPRLDefault: SY-SAPRL
Optional: Yes
Call by Reference: No ( called with pass by value option)
PI_APPLREL - IDoc Development: Application Release of Segment Definition
Data type: SEGDEFARLOptional: Yes
Call by Reference: No ( called with pass by value option)
PI_VERSION - Version of IDoc record types
Data type: EDI_VERREC-VERSIONDefault: '3'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for IDOCTYPE_READ_COMPLETE
PE_HEADER - Header data for IDoc type
Data type: EDI_IAPI10Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for IDOCTYPE_READ_COMPLETE
PT_SEGMENTS - Structure of IDoc type (segments)
Data type: EDI_IAPI11Optional: Yes
Call by Reference: No ( called with pass by value option)
PT_FIELDS - Structure of segments for IDoc type (fields)
Data type: EDI_IAPI12Optional: Yes
Call by Reference: No ( called with pass by value option)
PT_FVALUES - Permitted values for segment fields
Data type: EDI_IAPI14Optional: Yes
Call by Reference: No ( called with pass by value option)
PT_MESSAGES - Linked logical messages
Data type: EDI_IAPI17Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
OBJECT_UNKNOWN - Basic type or extension does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SEGMENT_UNKNOWN - Segment could not be read
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
RELATION_NOT_FOUND - Extension and basic type not assigned
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for IDOCTYPE_READ_COMPLETE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_pe_header | TYPE EDI_IAPI10, " | |||
| lv_pi_idoctyp | TYPE EDI_IAPI00-IDOCTYP, " | |||
| lt_pt_segments | TYPE STANDARD TABLE OF EDI_IAPI11, " | |||
| lv_object_unknown | TYPE EDI_IAPI11, " | |||
| lv_pi_cimtyp | TYPE EDI_IAPI00-CIMTYP, " | |||
| lt_pt_fields | TYPE STANDARD TABLE OF EDI_IAPI12, " | |||
| lv_segment_unknown | TYPE EDI_IAPI12, " | |||
| lv_pi_release | TYPE SY-SAPRL, " SY-SAPRL | |||
| lt_pt_fvalues | TYPE STANDARD TABLE OF EDI_IAPI14, " | |||
| lv_relation_not_found | TYPE EDI_IAPI14, " | |||
| lv_pi_applrel | TYPE SEGDEFARL, " | |||
| lt_pt_messages | TYPE STANDARD TABLE OF EDI_IAPI17, " | |||
| lv_pi_version | TYPE EDI_VERREC-VERSION. " '3' |
|   CALL FUNCTION 'IDOCTYPE_READ_COMPLETE' "Read IDoc type with segments (RFC-compatible) |
| EXPORTING | ||
| PI_IDOCTYP | = lv_pi_idoctyp | |
| PI_CIMTYP | = lv_pi_cimtyp | |
| PI_RELEASE | = lv_pi_release | |
| PI_APPLREL | = lv_pi_applrel | |
| PI_VERSION | = lv_pi_version | |
| IMPORTING | ||
| PE_HEADER | = lv_pe_header | |
| TABLES | ||
| PT_SEGMENTS | = lt_pt_segments | |
| PT_FIELDS | = lt_pt_fields | |
| PT_FVALUES | = lt_pt_fvalues | |
| PT_MESSAGES | = lt_pt_messages | |
| EXCEPTIONS | ||
| OBJECT_UNKNOWN = 1 | ||
| SEGMENT_UNKNOWN = 2 | ||
| RELATION_NOT_FOUND = 3 | ||
| . " IDOCTYPE_READ_COMPLETE | ||
ABAP code using 7.40 inline data declarations to call FM IDOCTYPE_READ_COMPLETE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single IDOCTYP FROM EDI_IAPI00 INTO @DATA(ld_pi_idoctyp). | ||||
| "SELECT single CIMTYP FROM EDI_IAPI00 INTO @DATA(ld_pi_cimtyp). | ||||
| "SELECT single SAPRL FROM SY INTO @DATA(ld_pi_release). | ||||
| DATA(ld_pi_release) | = SY-SAPRL. | |||
| "SELECT single VERSION FROM EDI_VERREC INTO @DATA(ld_pi_version). | ||||
| DATA(ld_pi_version) | = '3'. | |||
Search for further information about these or an SAP related objects