SAP DDUT_FORKEY_CHECK Function Module for DD: Foreign Key Check for Values in Single Fields









DDUT_FORKEY_CHECK is a standard ddut forkey check SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for DD: Foreign Key Check for Values in Single Fields processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for ddut forkey check FM, simply by entering the name DDUT_FORKEY_CHECK into the relevant SAP transaction such as SE37 or SE38.

Function Group: SDFC
Program Name: SAPLSDFC
Main Program: SAPLSDFC
Appliation area: S
Release date: 30-Apr-1999
Mode(Normal, Remote etc): Normal Function Module
Update:



Function DDUT_FORKEY_CHECK pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'DDUT_FORKEY_CHECK'"DD: Foreign Key Check for Values in Single Fields
EXPORTING
TABNAME = "Foreign key table name
* FIELDNAME = "Check field name
VALUE_LIST = "Value list (in structure of foreign key table)
* CLIENT_SPECIFIED = ' ' "Flag if client specified
* ACCEPT_INITIAL = ' ' "Accept intitial values (if 'X')
* ACCEPT_ALL_INITIAL = ' ' "If 'X', accept initial values in foreign key fields
* ADAPTED_FIELDVALUES = "List of Values for Cross-Structure Foreign Key Fields

TABLES
* COND_TAB = "Lines of WHERE conditions
* ADAPTED_FIELDS = "Supplement for cross-structure foreign keys
* FAILURE_TAB = "Messages for failed checks

EXCEPTIONS
FORKEY_NOT_DEFINED = 1 TABLE_NOT_ACTIVE = 2 FIELD_UNKNOWN = 3
.



IMPORTING Parameters details for DDUT_FORKEY_CHECK

TABNAME - Foreign key table name

Data type: TABNAME
Optional: No
Call by Reference: No ( called with pass by value option)

FIELDNAME - Check field name

Data type: FIELDNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

VALUE_LIST - Value list (in structure of foreign key table)

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

CLIENT_SPECIFIED - Flag if client specified

Data type: DDBOOL_D
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

ACCEPT_INITIAL - Accept intitial values (if 'X')

Data type: DDBOOL_D
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

ACCEPT_ALL_INITIAL - If 'X', accept initial values in foreign key fields

Data type: DDBOOL_D
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADAPTED_FIELDVALUES - List of Values for Cross-Structure Foreign Key Fields

Data type: DCFIELDDATS
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for DDUT_FORKEY_CHECK

COND_TAB - Lines of WHERE conditions

Data type: DDWHERECND
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADAPTED_FIELDS - Supplement for cross-structure foreign keys

Data type: DDTABFDS
Optional: Yes
Call by Reference: No ( called with pass by value option)

FAILURE_TAB - Messages for failed checks

Data type: DDFKEYRC
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

FORKEY_NOT_DEFINED - Foreign key not defined in DD

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

TABLE_NOT_ACTIVE - Foreign key table not active

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

FIELD_UNKNOWN - Check field not active

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for DDUT_FORKEY_CHECK Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_tabname  TYPE TABNAME, "   
lt_cond_tab  TYPE STANDARD TABLE OF DDWHERECND, "   
lv_forkey_not_defined  TYPE DDWHERECND, "   
lv_fieldname  TYPE FIELDNAME, "   
lt_adapted_fields  TYPE STANDARD TABLE OF DDTABFDS, "   
lv_table_not_active  TYPE DDTABFDS, "   
lv_value_list  TYPE DDTABFDS, "   
lt_failure_tab  TYPE STANDARD TABLE OF DDFKEYRC, "   
lv_field_unknown  TYPE DDFKEYRC, "   
lv_client_specified  TYPE DDBOOL_D, "   SPACE
lv_accept_initial  TYPE DDBOOL_D, "   SPACE
lv_accept_all_initial  TYPE DDBOOL_D, "   SPACE
lv_adapted_fieldvalues  TYPE DCFIELDDATS. "   

  CALL FUNCTION 'DDUT_FORKEY_CHECK'  "DD: Foreign Key Check for Values in Single Fields
    EXPORTING
         TABNAME = lv_tabname
         FIELDNAME = lv_fieldname
         VALUE_LIST = lv_value_list
         CLIENT_SPECIFIED = lv_client_specified
         ACCEPT_INITIAL = lv_accept_initial
         ACCEPT_ALL_INITIAL = lv_accept_all_initial
         ADAPTED_FIELDVALUES = lv_adapted_fieldvalues
    TABLES
         COND_TAB = lt_cond_tab
         ADAPTED_FIELDS = lt_adapted_fields
         FAILURE_TAB = lt_failure_tab
    EXCEPTIONS
        FORKEY_NOT_DEFINED = 1
        TABLE_NOT_ACTIVE = 2
        FIELD_UNKNOWN = 3
. " DDUT_FORKEY_CHECK




ABAP code using 7.40 inline data declarations to call FM DDUT_FORKEY_CHECK

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
 
 
 
 
 
 
 
DATA(ld_client_specified) = ' '.
 
DATA(ld_accept_initial) = ' '.
 
DATA(ld_accept_all_initial) = ' '.
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!