SAP Function POPUP_GET_VALUES_DB_CHECKED - Dialog box for requesting values, check against the DB table/view

Parameter Reference Type Length Default Optional Text
CHECK_EXISTENCE 0 'X' X Ind. whether table lines must exist
POPUP_TITLE 0 Text of title line
START_COLUMN 0 '5' X Start column of the dialog box
START_ROW 0 '5' X Start line of the dialog box

Parameter Reference Type Length Text
RETURNCODE 0 User response

Parameter Reference Length Optional Text
FIELDS SVAL 278 Table fields, values and attributes

Exception Text
ERROR_IN_FIELDS FIELDS were transferred incorrectly


INCLUDE 'DOCU_HAS_TO_BE_ELABORATED' OBJECT DOKU ID TX
Functions
The function module sends a dialog box and displays the fields listed inthe interface table FIELDS for entering or displaying. The fieldsspecified in the table FIELDS must be defined in the Dictionary andbelong to a database table or view. The entries of the user are checkedaccording to the relational operator specified in each case againstthese database tables or views (EQ, NE, GT, GE, LT, LE or NC= do notcheck). In the interface, you can be specify by means of the parameterCHECK_EXISTENCE whether the existence (for example, during "Fetch otherobject") or the absence (for example, during "Insert object") ofcorresponding tuples is required.
If no text is transferred to a field, the Dictionary key word isdisplayed. The key words and fields can be displayed normally orhighlighted. In addition, it must be defined for the fields whether theyshould be ready for input or not ready for input or not displayed (butchecked) and whether they are mandatory or nonmandatory. For the fields,a preselected option can be specified.
The function module can be used to
  • request values which must only be checked against the database,

  • request values to copy objects,

  • support prototyping,

  • etc.

  • Examples
    For examples, please refer to the program RSSPO420.
    Notes
    • Foreign key checks are supported by specifying reference fields in the
    • table FIELDS (see documentation on the parameter)
      • For client-specific tables, the client field is automatically checked
      • for uniformity with SY-MANDT, if it is not transferred in FIELDS.
        INCLUDE 'POPUP_GET_VALUES_NOTES_02' OBJECT DOKU ID TX
        Performance
        The database accesses does not put much load on the system, if the firstor all key fields are checked for uniformity.
        The user action is returned in this parameter. Itcan take the following values:
        • " " (Space)

        • The user wants to perform the action, the database check was successful,FIELDS contains the input values
          • "A"

          • The user has cancelled the action, FIELDS contains theoriginal values
            This indicator specifies whether appropriate table lines must exist(for example, to open another object) or must be missing (for example,to insert an object). Accordingly, an error message is sent when thecheck against the database is performed and the dialog box is processedonce more, or processing is terminated. The indicator must have one ofthe following values:
            • " " (Space) must be missing

            • When table lines exist, an error message is sent, for example, when anobject is to be inserted: No data may exist for the specified object.
              • "X" must exist

              • When table lines are missing, an error message is sent, for example,when another object is to be opened. Data must exist for this object.
                Dialog box title line text. It must be translatable (e.g. use numberedtexts).
                Column in which the dialog box starts. Default value 5.
                Row in which the dialog box starts. Default value 5.
                The table contains the fields, values and attributes for the dialog boxlayout, and the attributes for checking against the database tables orviews. The fields appear in the order in which they are in the tableFIELDS. One record must be entered per field in the dialog box:
                • TABNAME

                • Table name. It must be active in the Dictionary and be a database tableor view
                  • FIELDNAME

                  • Name of the field to be displayed. It must be in the table TABNAME
                    • VALUE (Field value)

                    • VALUE can be given a value when the function module is called. Thisvalue is displayed. If the user does not cancel the action, VALUEcontains the value input by the user.
                      INCLUDE 'FU_POPUP_GET_VALUES_1' OBJECT DOKU ID TX
                      • FIELD_ATTR (Field attribute)

                      • The field attribute determines the layout properties of the field, andmust have one of the following values:
                        " " (Space) = normal intensity, ready for input
                        "01" = highlighted, ready for input
                        "02" = normal intensity, not ready for input
                        "03" = highlighted, not ready for input
                        "04" = field is not displayed
                        • FIELD_OBL (obligatory)

                        • This flag indicates whether the field is obligatory, and must have oneof the following values:
                          " " (Space) the field is optional
                          "X" the field is required
                          • FIELDTEXT (key word)

                          • The field key word can be entered in FIELDTEXT, if the Dictionary keyword is not to be used. Ensure that the text can be translated (e.g. byusing numbered texts).
                            • COMP_CODE (comparison operator)

                            • The comparison operator determines how the database field comparisonshould be performed. The comparison is made in the form:
                              FIELDS-VALUE
                              If several fields in a table are passed, the compare conditions areconnected with AND (see example 1 below). The compare operator musthave one of the following values:
                              " " (Space) equals
                              "EQ" equals
                              "NE" not equal
                              "GT" greater than
                              "GE" greater than or equal to
                              "LT" is less than
                              "LE" is less than or equal to
                              "NC" not to be checked
                              • COMP_TAB (comparison table)

                              • Table for foreign key check. The table name can be specified if thevalue to be checked is to be input in COMP_TAB FIELD_TAB rather thanbeing entered by the user in the field TABNAME FIELDNAME. If acomparison table is specified, the TABNAME FIELDNAME should not bedisplayed (FIELD_ATTR = '04'). The comparison table must be active inthe Dictionary and be a database table or view (see example 2 below)
                                If a comparison table is specified and is to be checked for equality,missing records in TABNAME cause errors, regardless of whetherCHECK_EXISTENCE was passed with SPACE. This ensures that foreign keychecks are performed e.g. when creating an object: The object must notexist, the foreign key must exist.
                                • COMP_FIELD (Comparison field)

                                • The comparison field must be specified if a comparison table isspecified, and must be a field in the comparison table.
                                  • NOVALUEHLP

                                  • This indicator specifies whether the value help button should bedisplayed, and must have one of the following values.
                                    " " = The value help button is permanently displayed
                                    "X" = The value help button is not displayed
                                    Example 1
                                    Specification of several fields in a table. Contents of the tableFIELDS (fields which are not specified are passed with SPACE):
                                    TABNAME ,,FIELDNAME ,,COMP_CODE
                                    T100 ,, ,,SPRSL ,,EQ
                                    T100 ,, ,,ARBGB ,,EQ
                                    T100 ,, ,,MSGNR ,,GT
                                    The user input values are copied by the function module into aninternal table IFIELDS (with the same structure and contents as thetable FIELDS). Read access is made analogously to the followingcommand:
                                    SELECT * FROM T100 WHERE
                                    ,, ,, ,, ,, SPRSL EQ
                                    ,, ,, ,, AND ARBGB EQ
                                    ,, ,, ,, AND MSGNR GT .
                                    ENDSELECT.
                                    Example 2
                                    Specification of several fields in a table, as in example 1, with theadditional check that the language is valid, i.e. is in T002. Thecontents of the table FIELDS is the same as in example 1 plus thefollowing record (fields which are not specified are passed with SPACE):
                                    TABNAME ,, ,,T002
                                    FIELDNAME ,,SPRAS
                                    COMP_CODE ,,EQ
                                    FIELD_ATTR ,,04
                                    COMP_TAB ,,T100
                                    COMP_FIELD ,,SPRSL
                                    The field T002-SPRAS is not displayed. The user input values are copiedby the function module into an internal table IFIELDS (with the samestructure and contents as the table FIELDS). The read access isanalogous to the following commands:
                                    SELECT * FROM T002 WHERE
                                    SPRAS EQ .
                                    ENDSELECT.
                                    SELECT * FROM T100 WHERE
                                    ,, ,, ,, ,, SPRSL EQ
                                    ,, ,, ,, AND ARBGB EQ
                                    ,, ,, ,, AND MSGNR GT .
                                    ENDSELECT.

518407Various problems with value pop-up in returns