SAP CHECK_CUSTOMER_NAME_FIELD Function Module for Determine whether a key field lies in the customer name range









CHECK_CUSTOMER_NAME_FIELD is a standard check customer name field SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determine whether a key field lies in the customer name range 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 check customer name field FM, simply by entering the name CHECK_CUSTOMER_NAME_FIELD into the relevant SAP transaction such as SE37 or SE38.

Function Group: STCR
Program Name: SAPLSTCR
Main Program: SAPLSTCR
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CHECK_CUSTOMER_NAME_FIELD 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 'CHECK_CUSTOMER_NAME_FIELD'"Determine whether a key field lies in the customer name range
EXPORTING
* OBJECTTYPE = 'TABU' "Object type e.g. TABU for tables
TABLEKEY = "Key field value that needs to be checked
TABLENAME = "Table name of table that needs to be checked
FIELDNAME = "Field name of table field to be checked

IMPORTING
KEYFIELD_ALLOWED = "X, if key field is in permitted range
SYSTEM_SAP = "X, if the call is made at SAP
TABLE_NOT_FOUND = "X, if no name ranges are entered for the table
RESERVED_IN_TRESC = "X, if there is no appropriate entry in TRESC

EXCEPTIONS
OBJECTTYPE_NOT_FILLED = 1 TABLENAME_NOT_FILLED = 2 FIELDNAME_NOT_FILLED = 3
.



IMPORTING Parameters details for CHECK_CUSTOMER_NAME_FIELD

OBJECTTYPE - Object type e.g. TABU for tables

Data type: TRESC-OBJECT
Default: 'TABU'
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLEKEY - Key field value that needs to be checked

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

TABLENAME - Table name of table that needs to be checked

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

FIELDNAME - Field name of table field to be checked

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

EXPORTING Parameters details for CHECK_CUSTOMER_NAME_FIELD

KEYFIELD_ALLOWED - X, if key field is in permitted range

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

SYSTEM_SAP - X, if the call is made at SAP

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

TABLE_NOT_FOUND - X, if no name ranges are entered for the table

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

RESERVED_IN_TRESC - X, if there is no appropriate entry in TRESC

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

EXCEPTIONS details

OBJECTTYPE_NOT_FILLED - The OBJECTYPE parameter is not filled

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

TABLENAME_NOT_FILLED - The parameter TABLENAME name is not filled

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

FIELDNAME_NOT_FILLED - Parameter field name is not filled

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

Copy and paste ABAP code example for CHECK_CUSTOMER_NAME_FIELD 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_objecttype  TYPE TRESC-OBJECT, "   'TABU'
lv_keyfield_allowed  TYPE TRPARI-FIELDALLOW, "   
lv_objecttype_not_filled  TYPE TRPARI, "   
lv_tablekey  TYPE E071K-TABKEY, "   
lv_system_sap  TYPE TRPARI-SYSTEM_SAP, "   
lv_tablename_not_filled  TYPE TRPARI, "   
lv_tablename  TYPE TRESC-TABNAME, "   
lv_table_not_found  TYPE TRPARI-TABNOTFOUN, "   
lv_fieldname_not_filled  TYPE TRPARI, "   
lv_fieldname  TYPE TRESC-FIELDNAME, "   
lv_reserved_in_tresc  TYPE TRPARI-RESTRESC. "   

  CALL FUNCTION 'CHECK_CUSTOMER_NAME_FIELD'  "Determine whether a key field lies in the customer name range
    EXPORTING
         OBJECTTYPE = lv_objecttype
         TABLEKEY = lv_tablekey
         TABLENAME = lv_tablename
         FIELDNAME = lv_fieldname
    IMPORTING
         KEYFIELD_ALLOWED = lv_keyfield_allowed
         SYSTEM_SAP = lv_system_sap
         TABLE_NOT_FOUND = lv_table_not_found
         RESERVED_IN_TRESC = lv_reserved_in_tresc
    EXCEPTIONS
        OBJECTTYPE_NOT_FILLED = 1
        TABLENAME_NOT_FILLED = 2
        FIELDNAME_NOT_FILLED = 3
. " CHECK_CUSTOMER_NAME_FIELD




ABAP code using 7.40 inline data declarations to call FM CHECK_CUSTOMER_NAME_FIELD

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.

"SELECT single OBJECT FROM TRESC INTO @DATA(ld_objecttype).
DATA(ld_objecttype) = 'TABU'.
 
"SELECT single FIELDALLOW FROM TRPARI INTO @DATA(ld_keyfield_allowed).
 
 
"SELECT single TABKEY FROM E071K INTO @DATA(ld_tablekey).
 
"SELECT single SYSTEM_SAP FROM TRPARI INTO @DATA(ld_system_sap).
 
 
"SELECT single TABNAME FROM TRESC INTO @DATA(ld_tablename).
 
"SELECT single TABNOTFOUN FROM TRPARI INTO @DATA(ld_table_not_found).
 
 
"SELECT single FIELDNAME FROM TRESC INTO @DATA(ld_fieldname).
 
"SELECT single RESTRESC FROM TRPARI INTO @DATA(ld_reserved_in_tresc).
 


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!