SAP J_3G_GET_KATNR Function Module for Determine Number in Catalog for Material/BOMs
J_3G_GET_KATNR is a standard j 3g get katnr 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 Number in Catalog for Material/BOMs 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 j 3g get katnr FM, simply by entering the name J_3G_GET_KATNR into the relevant SAP transaction such as SE37 or SE38.
Function Group: J3GW
Program Name: SAPLJ3GW
Main Program: SAPLJ3GW
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function J_3G_GET_KATNR 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 'J_3G_GET_KATNR'"Determine Number in Catalog for Material/BOMs.
EXPORTING
* I_MATNR = "Material Number
* I_EQUNR = "Equipment Number
* I_DATUM = SY-DATUM "Document Date
* I_KATKZ = "Catalog Code
* I_BELK = "Document File - Header Data
IMPORTING
E_KATNR = "Number in Catalog
E_LFDNR = "Sequence Number for BOMs
E_KATKZ = "Catalog Code
EXCEPTIONS
NO_NUMBER = 1 TWO_NUMBERS = 2 NO_VALUES = 3 NO_KATKZ = 4
IMPORTING Parameters details for J_3G_GET_KATNR
I_MATNR - Material Number
Data type: MARA-MATNROptional: Yes
Call by Reference: No ( called with pass by value option)
I_EQUNR - Equipment Number
Data type: EQUI-EQUNROptional: Yes
Call by Reference: No ( called with pass by value option)
I_DATUM - Document Date
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_KATKZ - Catalog Code
Data type: J_3GT370S-J_3GTPLKZOptional: Yes
Call by Reference: No ( called with pass by value option)
I_BELK - Document File - Header Data
Data type: J_3GBELKOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for J_3G_GET_KATNR
E_KATNR - Number in Catalog
Data type: J_3GKATAL-J_3GKATNRCOptional: No
Call by Reference: No ( called with pass by value option)
E_LFDNR - Sequence Number for BOMs
Data type: J_3GSTLKOPF-LFDNROptional: No
Call by Reference: No ( called with pass by value option)
E_KATKZ - Catalog Code
Data type: J_3GT370S-J_3GTPLKZOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_NUMBER - Neither Material Nor Equipment Number Entered
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TWO_NUMBERS - Material and Equipment Number Entered
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_VALUES - No Values Found for Selection
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_KATKZ - No Assignment Catalog Code
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for J_3G_GET_KATNR 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_e_katnr | TYPE J_3GKATAL-J_3GKATNRC, " | |||
| lv_i_matnr | TYPE MARA-MATNR, " | |||
| lv_no_number | TYPE MARA, " | |||
| lv_e_lfdnr | TYPE J_3GSTLKOPF-LFDNR, " | |||
| lv_i_equnr | TYPE EQUI-EQUNR, " | |||
| lv_two_numbers | TYPE EQUI, " | |||
| lv_e_katkz | TYPE J_3GT370S-J_3GTPLKZ, " | |||
| lv_i_datum | TYPE SY-DATUM, " SY-DATUM | |||
| lv_no_values | TYPE SY, " | |||
| lv_i_katkz | TYPE J_3GT370S-J_3GTPLKZ, " | |||
| lv_no_katkz | TYPE J_3GT370S, " | |||
| lv_i_belk | TYPE J_3GBELK. " |
|   CALL FUNCTION 'J_3G_GET_KATNR' "Determine Number in Catalog for Material/BOMs |
| EXPORTING | ||
| I_MATNR | = lv_i_matnr | |
| I_EQUNR | = lv_i_equnr | |
| I_DATUM | = lv_i_datum | |
| I_KATKZ | = lv_i_katkz | |
| I_BELK | = lv_i_belk | |
| IMPORTING | ||
| E_KATNR | = lv_e_katnr | |
| E_LFDNR | = lv_e_lfdnr | |
| E_KATKZ | = lv_e_katkz | |
| EXCEPTIONS | ||
| NO_NUMBER = 1 | ||
| TWO_NUMBERS = 2 | ||
| NO_VALUES = 3 | ||
| NO_KATKZ = 4 | ||
| . " J_3G_GET_KATNR | ||
ABAP code using 7.40 inline data declarations to call FM J_3G_GET_KATNR
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 J_3GKATNRC FROM J_3GKATAL INTO @DATA(ld_e_katnr). | ||||
| "SELECT single MATNR FROM MARA INTO @DATA(ld_i_matnr). | ||||
| "SELECT single LFDNR FROM J_3GSTLKOPF INTO @DATA(ld_e_lfdnr). | ||||
| "SELECT single EQUNR FROM EQUI INTO @DATA(ld_i_equnr). | ||||
| "SELECT single J_3GTPLKZ FROM J_3GT370S INTO @DATA(ld_e_katkz). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_i_datum). | ||||
| DATA(ld_i_datum) | = SY-DATUM. | |||
| "SELECT single J_3GTPLKZ FROM J_3GT370S INTO @DATA(ld_i_katkz). | ||||
Search for further information about these or an SAP related objects