Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

function module

Former Member
0 Kudos

hi all,

wht is the main pupose for DYNP_VALUEs_READ.Do u have a sample source code to show how the datas are passed into this f module.

5 REPLIES 5

Former Member
0 Kudos

Hi,

DYNP_VALUES_READ will Read the values from a dynpro. This function can be used to read the values from a report's selection screen also .

See the FM below . In that,

dyname is used to store the program name.

dynumb for Screen no.

dynpfields is the Table for reading current screen values .

data: v_prog like D020S-PROG,

v_scrno like D020S-DNUM.

data: itab like dynpread occurs 0.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = v_prog

DYNUMB = v_scrno

  • TRANSLATE_TO_UPPER = ' '

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

TABLES

DYNPFIELDS = itab

  • EXCEPTIONS

  • INVALID_ABAPWORKAREA = 1

  • INVALID_DYNPROFIELD = 2

  • INVALID_DYNPRONAME = 3

  • INVALID_DYNPRONUMMER = 4

  • INVALID_REQUEST = 5

  • NO_FIELDDESCRIPTION = 6

  • INVALID_PARAMETER = 7

  • UNDEFIND_ERROR = 8

  • DOUBLE_CONVERSION = 9

  • STEPL_NOT_FOUND = 10

  • OTHERS = 11

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Senthil

Former Member
0 Kudos

Hi AG,

FU DYNP_VALUES_READ
____________________________________________________
Text
Read screen field values before PAI field transport

Preliminary comment

This function module has been released.

The documentation is being revised so that it conforms to the requirements for released function modules.

Function module: DYNP_VALUES_READ

Purpose: Read field contents on screen and transport field to help
         processor

Function group: SHL2 - Help functions

Release: released for customers

Documentation

Functionality
This function module reads screen field contents that are to

be processed by the help modules.

Example:

  data: dyname like d020s-prog value 'TESTPROG',
        dynumb like d020s-dnum value '100'.
  data: begin of dynpfields occurs 3.
          include structure dynpread.
  data: end of dynpfields.
  move 'TABNAME' to dynpfields-fieldname.
  append dynpfields.
  move 'FIELDNAME' to dynpfields-fieldname.
  append dynpfields.
  call function 'DYNP_VALUES_READ'
       exporting
             dyname               = dymame
             dynumb               = dynumb
            translate_to_upper   = 'X'
       tables
             dynpfields           = dynpfields
       exceptions
            invalid_abapworkarea = 01
            invalid_dynprofield  = 02
            invalid_dynproname   = 03
            invalid_dynpronummer = 04
             invalid_request      = 05
            no_fielddescription  = 06
            undefind_error       = 07.
Notes:
The field contents read into DYNPFIELDS are being used by the following function modules for the external Help
HELP_VALUES_GET_WITH_TABLE_EXT and
HELP_VALUES_GET_WITH_DD_NAME (also ..NO_DD_NAME). The values are returned via
DYNP_VALUES_UPDATE.

The field names in DYNPFIELDS can be user-defined as in the above example, where fields TABNAME and FIELDNAME occur on the screen. A Data Dictonary reference of these fields (... like ...) is not affected.

All exceptions are caused by the C function HELP_GET_FIELDS.

To retain the current line in step loops, you must call function module DYNP_GET_STEPL before calling DYNP_VALUES_READ.

Description of parameters
   Parameter          Reference field/structure    Default value

Import parameter
  DYNAME                D020S-PROG
  DYNUMB               D020S-DNUM
  TRANSLATE_TO_UPPER                                SPACE

Table parameter
  DYNPFIELDS          DYNPREAD

Exceptions:
    INVALID_ABAPWORKAREA
   INVALID_DYNPROFIELD
   INVALID_DYNPRONAME
   INVALID_DYNPRONUMMER
  INVALID_REQUEST
  NO_FIELDDESCRIPTION
  UNDEFINED_ERROR

Parameter documentation

Import parameter:
DYNAME: Name of program (of calling screen)
        Meaning: Name of program from which the function module is
                   called. Do not set any SY-fields, because these
                   are filled dynamically during the call of function
                   modules.
        Value set: None
        Preallocation: None
DYNUMB: Number of calling screen
        Meaning:   Number of screen from which the function module is
                   called. Do not set SY-DYNNR.
                   sy-dynnr gesetzt werden.
        Value set: None
        Preallocation: None
TRANSLATE_TO_UPPER: For conversion to upper case
        Meaning:   If set, then the field contents read will be
                   converted to upper case letters, even if lower case
                   id defined for the domain in the Data Dictionary.
                   If not set, then the field contents will be treated
                   according to the definition of the domain in the
                   Data Dictionary.
Table parameter:
DYNPFIELDS: Table to read the current screen values.
        Meaning:   Before the call of the function module, the table
                   contains the name of the screen fields to be read.
                   After the call, it also contains the values read
                   and the step loop lines, if it is a step loop
                   screen.
Exceptions:
INVALID_ABAPWORKAREA: No work area
        Meaning:   No valid ABAP/4 work area exists.
INVALID_DYNPROFIELD: No valid screen field
        Meaning:   The specified field does not exist on the screen.
INVALID_DYNPRONAME: No valid screen name.
        Meaning:    The specified program does not exist.
INVALID_DYNPRONUMMER: No valid screen number
        Meaning:    The specified screen does not exist or has
                    not been generated.
INVALID_REQUEST: General request error
        Meaning: An error occurred during the system function call to
                 read the screen.
NO_FIELDDESCRIPTION: No field description exists
        Meaning: There is no description for the specified screen
                 field.
UNDEFINED_ERROR: Undefined error
        Meaning: An unknown error occurred during the system function
                 call.
Parameters
DYNAME
DYNUMB
TRANSLATE_TO_UPPER
REQUEST
PERFORM_CONVERSION_EXITS
PERFORM_INPUT_CONVERSION
DETERMINE_LOOP_INDEX
DYNPFIELDS

Exceptions
INVALID_ABAPWORKAREA
INVALID_DYNPROFIELD
INVALID_DYNPRONAME
INVALID_DYNPRONUMMER
INVALID_REQUEST
NO_FIELDDESCRIPTION
INVALID_PARAMETER
UNDEFIND_ERROR
DOUBLE_CONVERSION
STEPL_NOT_FOUND

Function Group
SHL2

Regards

Prabhu

sergey_korolev
Active Contributor
0 Kudos

It can be used for explicit reading of screen fields in PAI module (screen logic), e.g. in ON VALUE REQUEST processing block. I would recommend to look into usage samples, you can find them by where used list.

0 Kudos

Check this link , i have posted sample code on search help exit using FM : DYNP_VALUES_READ

Former Member
0 Kudos

HI,

This func. module helps in reading screen field values before passing on the control to the help processor.

You can find the sample code in the documentation of the function module DYNP_VALUEs_READ.

Reward if helpful.

Regards