SAP Function Modules

IMPORT_DYNPRO SAP Function module







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

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


Pattern for FM IMPORT_DYNPRO - IMPORT DYNPRO





CALL FUNCTION 'IMPORT_DYNPRO' "
* EXPORTING
*   dylang = SPACE              " d020s-spra    Screen generator language
*   dyname = SPACE              " d020s-prog    Name of the screen
*   dynumb = SPACE              " d020s-dnum    Number of the screen
*   request = SPACE             " d020s-type    Request to module
  IMPORTING
    header =                    " d020s         Screen header structure
  TABLES
    ftab =                      " d021s         Screen field table
  EXCEPTIONS
    DYLANGUAGE_INVALID = 1      "               Invalid screen generator language
    DYLANGUAGE_NOT_INST = 2     "               Screen generator language not installed
    DYNAME_INVALID = 3          "               Invalid screen name
    DYNPROLOAD_NOT_FOUND = 4    "               Screen load was not found
    DYNUMB_INVALID = 5          "               Invalid screen numbers
    FTAB_INVALID = 6            "               Table structure is invalid
    HEADER_INVALID = 7          "               Screen header structure invalid
    INTERNAL_ERROR = 8          "               Internal error
    NO_DYNPRO = 9               "               No screen available
    NO_FTAB_ROW = 10            "               No internal table line is available
    NO_MEMORY = 11              "               No more ROLL storage is available
    REQUEST_INVALID = 12        "               Request invalid
    .  "  IMPORT_DYNPRO

ABAP code example for Function Module IMPORT_DYNPRO





The ABAP code below is a full code listing to execute function module IMPORT_DYNPRO 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_header  TYPE D020S ,
it_ftab  TYPE STANDARD TABLE OF D021S,"TABLES PARAM
wa_ftab  LIKE LINE OF it_ftab .


SELECT single SPRA
FROM D020S
INTO @DATA(ld_dylang).


SELECT single PROG
FROM D020S
INTO @DATA(ld_dyname).


SELECT single DNUM
FROM D020S
INTO @DATA(ld_dynumb).


SELECT single TYPE
FROM D020S
INTO @DATA(ld_request).


"populate fields of struture and append to itab
append wa_ftab to it_ftab. . CALL FUNCTION 'IMPORT_DYNPRO' * EXPORTING * dylang = ld_dylang * dyname = ld_dyname * dynumb = ld_dynumb * request = ld_request IMPORTING header = ld_header TABLES ftab = it_ftab EXCEPTIONS DYLANGUAGE_INVALID = 1 DYLANGUAGE_NOT_INST = 2 DYNAME_INVALID = 3 DYNPROLOAD_NOT_FOUND = 4 DYNUMB_INVALID = 5 FTAB_INVALID = 6 HEADER_INVALID = 7 INTERNAL_ERROR = 8 NO_DYNPRO = 9 NO_FTAB_ROW = 10 NO_MEMORY = 11 REQUEST_INVALID = 12 . " IMPORT_DYNPRO
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 12. "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_header  TYPE D020S ,
ld_dylang  TYPE D020S-SPRA ,
it_ftab  TYPE STANDARD TABLE OF D021S ,
wa_ftab  LIKE LINE OF it_ftab,
ld_dyname  TYPE D020S-PROG ,
ld_dynumb  TYPE D020S-DNUM ,
ld_request  TYPE D020S-TYPE .


SELECT single SPRA
FROM D020S
INTO ld_dylang.


"populate fields of struture and append to itab
append wa_ftab to it_ftab.

SELECT single PROG
FROM D020S
INTO ld_dyname.


SELECT single DNUM
FROM D020S
INTO ld_dynumb.


SELECT single TYPE
FROM D020S
INTO ld_request.

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