SAP Function Modules

PLM_SEARCH_DOCUMENTS SAP Function module







PLM_SEARCH_DOCUMENTS 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 PLM_SEARCH_DOCUMENTS into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: PLM_STRUCTURE_BROWSER_46C
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM PLM_SEARCH_DOCUMENTS - PLM SEARCH DOCUMENTS





CALL FUNCTION 'PLM_SEARCH_DOCUMENTS' "
  EXPORTING
    documentnumber =            " draw-doknr
*   documenttype = SPACE        " draw-dokar
*   documentpart = SPACE        " draw-doktl
*   documentversion = SPACE     " draw-dokvr
*   validfrom = SYST-DATUM      " syst-datum
*   flag_new_search =           " csdata-xfeld
*   index_from =                " syst-tabix
*   index_to =                  " syst-tabix
  IMPORTING
    max_hits =                  " syst-tabix
  TABLES
    document_data =             " plm_f4_document_info
  EXCEPTIONS
    NO_DOCUMENTS = 1            "
    .  "  PLM_SEARCH_DOCUMENTS

ABAP code example for Function Module PLM_SEARCH_DOCUMENTS





The ABAP code below is a full code listing to execute function module PLM_SEARCH_DOCUMENTS 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_max_hits  TYPE SYST-TABIX ,
it_document_data  TYPE STANDARD TABLE OF PLM_F4_DOCUMENT_INFO,"TABLES PARAM
wa_document_data  LIKE LINE OF it_document_data .


SELECT single DOKNR
FROM DRAW
INTO @DATA(ld_documentnumber).


SELECT single DOKAR
FROM DRAW
INTO @DATA(ld_documenttype).


SELECT single DOKTL
FROM DRAW
INTO @DATA(ld_documentpart).


SELECT single DOKVR
FROM DRAW
INTO @DATA(ld_documentversion).


DATA(ld_validfrom) = 20210129

DATA(ld_flag_new_search) = some text here

DATA(ld_index_from) = 123

DATA(ld_index_to) = 123

"populate fields of struture and append to itab
append wa_document_data to it_document_data. . CALL FUNCTION 'PLM_SEARCH_DOCUMENTS' EXPORTING documentnumber = ld_documentnumber * documenttype = ld_documenttype * documentpart = ld_documentpart * documentversion = ld_documentversion * validfrom = ld_validfrom * flag_new_search = ld_flag_new_search * index_from = ld_index_from * index_to = ld_index_to IMPORTING max_hits = ld_max_hits TABLES document_data = it_document_data EXCEPTIONS NO_DOCUMENTS = 1 . " PLM_SEARCH_DOCUMENTS
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here 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_max_hits  TYPE SYST-TABIX ,
ld_documentnumber  TYPE DRAW-DOKNR ,
it_document_data  TYPE STANDARD TABLE OF PLM_F4_DOCUMENT_INFO ,
wa_document_data  LIKE LINE OF it_document_data,
ld_documenttype  TYPE DRAW-DOKAR ,
ld_documentpart  TYPE DRAW-DOKTL ,
ld_documentversion  TYPE DRAW-DOKVR ,
ld_validfrom  TYPE SYST-DATUM ,
ld_flag_new_search  TYPE CSDATA-XFELD ,
ld_index_from  TYPE SYST-TABIX ,
ld_index_to  TYPE SYST-TABIX .


SELECT single DOKNR
FROM DRAW
INTO ld_documentnumber.


"populate fields of struture and append to itab
append wa_document_data to it_document_data.

SELECT single DOKAR
FROM DRAW
INTO ld_documenttype.


SELECT single DOKTL
FROM DRAW
INTO ld_documentpart.


SELECT single DOKVR
FROM DRAW
INTO ld_documentversion.


ld_validfrom = 20210129

ld_flag_new_search = some text here

ld_index_from = 123

ld_index_to = 123

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 PLM_SEARCH_DOCUMENTS or its description.