SAP Function Modules

STPA3_DOCUMENT_READ SAP Function module







STPA3_DOCUMENT_READ is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name STPA3_DOCUMENT_READ into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: STPA3
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM STPA3_DOCUMENT_READ - STPA3 DOCUMENT READ





CALL FUNCTION 'STPA3_DOCUMENT_READ' "
  EXPORTING
    serv_dest =                 " rfcdest
    step_oid =                  " castp_step_oid
*   read_related = BOOLEAN-FALSE  "
  IMPORTING
    doc_type =                  " c
    doc_number =                " c
    doc_version =               " c
    doc_part =                  " c
    upper_doc =                 " castp_step_oid
    status_oid =                " castp_step_oid
* TABLES
*   long_texts =                " castp_stexts
*   short_texts =               " castp_stexts
*   properties =                " step_instance
*   related_classes =           " step_instance
*   related_objects =           " step_instance
*   bom_headers =               " step_instance
*   admin_list =                " castp_admin_list
*   originals =                 " castp_oid_list
    .  "  STPA3_DOCUMENT_READ

ABAP code example for Function Module STPA3_DOCUMENT_READ





The ABAP code below is a full code listing to execute function module STPA3_DOCUMENT_READ including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_doc_type  TYPE C ,
ld_doc_number  TYPE C ,
ld_doc_version  TYPE C ,
ld_doc_part  TYPE C ,
ld_upper_doc  TYPE CASTP_STEP_OID ,
ld_status_oid  TYPE CASTP_STEP_OID ,
it_long_texts  TYPE STANDARD TABLE OF CASTP_STEXTS,"TABLES PARAM
wa_long_texts  LIKE LINE OF it_long_texts ,
it_short_texts  TYPE STANDARD TABLE OF CASTP_STEXTS,"TABLES PARAM
wa_short_texts  LIKE LINE OF it_short_texts ,
it_properties  TYPE STANDARD TABLE OF STEP_INSTANCE,"TABLES PARAM
wa_properties  LIKE LINE OF it_properties ,
it_related_classes  TYPE STANDARD TABLE OF STEP_INSTANCE,"TABLES PARAM
wa_related_classes  LIKE LINE OF it_related_classes ,
it_related_objects  TYPE STANDARD TABLE OF STEP_INSTANCE,"TABLES PARAM
wa_related_objects  LIKE LINE OF it_related_objects ,
it_bom_headers  TYPE STANDARD TABLE OF STEP_INSTANCE,"TABLES PARAM
wa_bom_headers  LIKE LINE OF it_bom_headers ,
it_admin_list  TYPE STANDARD TABLE OF CASTP_ADMIN_LIST,"TABLES PARAM
wa_admin_list  LIKE LINE OF it_admin_list ,
it_originals  TYPE STANDARD TABLE OF CASTP_OID_LIST,"TABLES PARAM
wa_originals  LIKE LINE OF it_originals .

DATA(ld_serv_dest) = 'Check type of data required'.
DATA(ld_step_oid) = 'Check type of data required'.
DATA(ld_read_related) = 'some text here'.

"populate fields of struture and append to itab
append wa_long_texts to it_long_texts.

"populate fields of struture and append to itab
append wa_short_texts to it_short_texts.

"populate fields of struture and append to itab
append wa_properties to it_properties.

"populate fields of struture and append to itab
append wa_related_classes to it_related_classes.

"populate fields of struture and append to itab
append wa_related_objects to it_related_objects.

"populate fields of struture and append to itab
append wa_bom_headers to it_bom_headers.

"populate fields of struture and append to itab
append wa_admin_list to it_admin_list.

"populate fields of struture and append to itab
append wa_originals to it_originals. . CALL FUNCTION 'STPA3_DOCUMENT_READ' EXPORTING serv_dest = ld_serv_dest step_oid = ld_step_oid * read_related = ld_read_related IMPORTING doc_type = ld_doc_type doc_number = ld_doc_number doc_version = ld_doc_version doc_part = ld_doc_part upper_doc = ld_upper_doc status_oid = ld_status_oid * TABLES * long_texts = it_long_texts * short_texts = it_short_texts * properties = it_properties * related_classes = it_related_classes * related_objects = it_related_objects * bom_headers = it_bom_headers * admin_list = it_admin_list * originals = it_originals . " STPA3_DOCUMENT_READ
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_doc_type  TYPE C ,
ld_serv_dest  TYPE RFCDEST ,
it_long_texts  TYPE STANDARD TABLE OF CASTP_STEXTS ,
wa_long_texts  LIKE LINE OF it_long_texts,
ld_doc_number  TYPE C ,
ld_step_oid  TYPE CASTP_STEP_OID ,
it_short_texts  TYPE STANDARD TABLE OF CASTP_STEXTS ,
wa_short_texts  LIKE LINE OF it_short_texts,
ld_doc_version  TYPE C ,
ld_read_related  TYPE STRING ,
it_properties  TYPE STANDARD TABLE OF STEP_INSTANCE ,
wa_properties  LIKE LINE OF it_properties,
ld_doc_part  TYPE C ,
it_related_classes  TYPE STANDARD TABLE OF STEP_INSTANCE ,
wa_related_classes  LIKE LINE OF it_related_classes,
ld_upper_doc  TYPE CASTP_STEP_OID ,
it_related_objects  TYPE STANDARD TABLE OF STEP_INSTANCE ,
wa_related_objects  LIKE LINE OF it_related_objects,
ld_status_oid  TYPE CASTP_STEP_OID ,
it_bom_headers  TYPE STANDARD TABLE OF STEP_INSTANCE ,
wa_bom_headers  LIKE LINE OF it_bom_headers,
it_admin_list  TYPE STANDARD TABLE OF CASTP_ADMIN_LIST ,
wa_admin_list  LIKE LINE OF it_admin_list,
it_originals  TYPE STANDARD TABLE OF CASTP_OID_LIST ,
wa_originals  LIKE LINE OF it_originals.

ld_serv_dest = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_long_texts to it_long_texts.
ld_step_oid = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_short_texts to it_short_texts.
ld_read_related = 'some text here'.

"populate fields of struture and append to itab
append wa_properties to it_properties.

"populate fields of struture and append to itab
append wa_related_classes to it_related_classes.

"populate fields of struture and append to itab
append wa_related_objects to it_related_objects.

"populate fields of struture and append to itab
append wa_bom_headers to it_bom_headers.

"populate fields of struture and append to itab
append wa_admin_list to it_admin_list.

"populate fields of struture and append to itab
append wa_originals to it_originals.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name STPA3_DOCUMENT_READ or its description.