SAP CJPN_PROJECT_ATTACH Function Module for NOTRANSL: Zuordnung Auftrag zum Projekt
CJPN_PROJECT_ATTACH is a standard cjpn project attach SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Zuordnung Auftrag zum Projekt 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 cjpn project attach FM, simply by entering the name CJPN_PROJECT_ATTACH into the relevant SAP transaction such as SE37 or SE38.
Function Group: CJPN
Program Name: SAPLCJPN
Main Program: SAPLCJPN
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CJPN_PROJECT_ATTACH 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 'CJPN_PROJECT_ATTACH'"NOTRANSL: Zuordnung Auftrag zum Projekt.
EXPORTING
INT_NUM = "
* CHECK_ONLY = ' ' "Check only, no status changes
* AUF_OBJNR = ' ' "Object number of assigned order
TYP = "
* VKT = 'X' "Activity-assignment indicator
* I_VRGNG = CON_VNG_AUFTZUO "Business transaction
* TEST_KOKRS = ' ' "Controlling area (check for consistency)
* TEST_BUKRS = ' ' "Company code (check for consistency)
* TEST_GSBER = ' ' "Business area (check for consistency)
* RKBUK = ' ' "
IMPORTING
KOKRS = "Controlling area of WBS element
PSPHI = "
PSPRI = "
BUKRS = "
GSBER = "
ERROR_OCCURRED = "
EXCEPTIONS
NOT_FOUND = 1 WRONG_GSBER = 10 ACTIVITY_NOT_ALLOWED = 11 NO_ACCOUNT_ELEMENT = 2 NO_INVOICE_ELEMENT = 3 NO_ORDERS_INBETWEEN = 4 OBJECT_NOT_FOUND = 5 ALLOCATION_NOT_ALLOWED = 6 ELEMENT_NOT_RELEASED = 7 WRONG_KOKRS = 8 WRONG_BUKRS = 9
IMPORTING Parameters details for CJPN_PROJECT_ATTACH
INT_NUM -
Data type: PRPS-PSPNROptional: No
Call by Reference: No ( called with pass by value option)
CHECK_ONLY - Check only, no status changes
Data type: RCWBS-SEL01Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
AUF_OBJNR - Object number of assigned order
Data type: JEST-OBJNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TYP -
Data type: AUFK-AUTYPOptional: No
Call by Reference: No ( called with pass by value option)
VKT - Activity-assignment indicator
Data type: TJ02-NODISDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_VRGNG - Business transaction
Data type: TJ01-VRGNGDefault: CON_VNG_AUFTZUO
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_KOKRS - Controlling area (check for consistency)
Data type: PRPS-PKOKRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_BUKRS - Company code (check for consistency)
Data type: PRPS-PBUKRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_GSBER - Business area (check for consistency)
Data type: PRPS-PGSBRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
RKBUK -
Data type: TKA00-RKBUKDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CJPN_PROJECT_ATTACH
KOKRS - Controlling area of WBS element
Data type: PRPS-PKOKROptional: No
Call by Reference: No ( called with pass by value option)
PSPHI -
Data type: PROJ-PSPNROptional: No
Call by Reference: No ( called with pass by value option)
PSPRI -
Data type: PRPS-PSPRIOptional: No
Call by Reference: No ( called with pass by value option)
BUKRS -
Data type: PRPS-PBUKROptional: No
Call by Reference: No ( called with pass by value option)
GSBER -
Data type: PRPS-PGSBROptional: No
Call by Reference: No ( called with pass by value option)
ERROR_OCCURRED -
Data type: RCWBS-SEL01Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_FOUND - WBS element does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_GSBER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ACTIVITY_NOT_ALLOWED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ACCOUNT_ELEMENT - No account assignment element
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_INVOICE_ELEMENT - No billing element
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ORDERS_INBETWEEN - No orders between billing and accnt assignmnt elem.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT_NOT_FOUND - Object number for WBS element does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ALLOCATION_NOT_ALLOWED - Order assignment denied (locked/deletion flag..)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ELEMENT_NOT_RELEASED - WBS element neither released nor partially released
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_KOKRS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_BUKRS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CJPN_PROJECT_ATTACH 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_kokrs | TYPE PRPS-PKOKR, " | |||
| lv_int_num | TYPE PRPS-PSPNR, " | |||
| lv_not_found | TYPE PRPS, " | |||
| lv_check_only | TYPE RCWBS-SEL01, " SPACE | |||
| lv_wrong_gsber | TYPE RCWBS, " | |||
| lv_activity_not_allowed | TYPE RCWBS, " | |||
| lv_psphi | TYPE PROJ-PSPNR, " | |||
| lv_auf_objnr | TYPE JEST-OBJNR, " SPACE | |||
| lv_no_account_element | TYPE JEST, " | |||
| lv_typ | TYPE AUFK-AUTYP, " | |||
| lv_pspri | TYPE PRPS-PSPRI, " | |||
| lv_no_invoice_element | TYPE PRPS, " | |||
| lv_vkt | TYPE TJ02-NODIS, " 'X' | |||
| lv_bukrs | TYPE PRPS-PBUKR, " | |||
| lv_no_orders_inbetween | TYPE PRPS, " | |||
| lv_gsber | TYPE PRPS-PGSBR, " | |||
| lv_i_vrgng | TYPE TJ01-VRGNG, " CON_VNG_AUFTZUO | |||
| lv_object_not_found | TYPE TJ01, " | |||
| lv_test_kokrs | TYPE PRPS-PKOKR, " SPACE | |||
| lv_error_occurred | TYPE RCWBS-SEL01, " | |||
| lv_allocation_not_allowed | TYPE RCWBS, " | |||
| lv_test_bukrs | TYPE PRPS-PBUKR, " SPACE | |||
| lv_element_not_released | TYPE PRPS, " | |||
| lv_test_gsber | TYPE PRPS-PGSBR, " SPACE | |||
| lv_wrong_kokrs | TYPE PRPS, " | |||
| lv_rkbuk | TYPE TKA00-RKBUK, " SPACE | |||
| lv_wrong_bukrs | TYPE TKA00. " |
|   CALL FUNCTION 'CJPN_PROJECT_ATTACH' "NOTRANSL: Zuordnung Auftrag zum Projekt |
| EXPORTING | ||
| INT_NUM | = lv_int_num | |
| CHECK_ONLY | = lv_check_only | |
| AUF_OBJNR | = lv_auf_objnr | |
| TYP | = lv_typ | |
| VKT | = lv_vkt | |
| I_VRGNG | = lv_i_vrgng | |
| TEST_KOKRS | = lv_test_kokrs | |
| TEST_BUKRS | = lv_test_bukrs | |
| TEST_GSBER | = lv_test_gsber | |
| RKBUK | = lv_rkbuk | |
| IMPORTING | ||
| KOKRS | = lv_kokrs | |
| PSPHI | = lv_psphi | |
| PSPRI | = lv_pspri | |
| BUKRS | = lv_bukrs | |
| GSBER | = lv_gsber | |
| ERROR_OCCURRED | = lv_error_occurred | |
| EXCEPTIONS | ||
| NOT_FOUND = 1 | ||
| WRONG_GSBER = 10 | ||
| ACTIVITY_NOT_ALLOWED = 11 | ||
| NO_ACCOUNT_ELEMENT = 2 | ||
| NO_INVOICE_ELEMENT = 3 | ||
| NO_ORDERS_INBETWEEN = 4 | ||
| OBJECT_NOT_FOUND = 5 | ||
| ALLOCATION_NOT_ALLOWED = 6 | ||
| ELEMENT_NOT_RELEASED = 7 | ||
| WRONG_KOKRS = 8 | ||
| WRONG_BUKRS = 9 | ||
| . " CJPN_PROJECT_ATTACH | ||
ABAP code using 7.40 inline data declarations to call FM CJPN_PROJECT_ATTACH
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 PKOKR FROM PRPS INTO @DATA(ld_kokrs). | ||||
| "SELECT single PSPNR FROM PRPS INTO @DATA(ld_int_num). | ||||
| "SELECT single SEL01 FROM RCWBS INTO @DATA(ld_check_only). | ||||
| DATA(ld_check_only) | = ' '. | |||
| "SELECT single PSPNR FROM PROJ INTO @DATA(ld_psphi). | ||||
| "SELECT single OBJNR FROM JEST INTO @DATA(ld_auf_objnr). | ||||
| DATA(ld_auf_objnr) | = ' '. | |||
| "SELECT single AUTYP FROM AUFK INTO @DATA(ld_typ). | ||||
| "SELECT single PSPRI FROM PRPS INTO @DATA(ld_pspri). | ||||
| "SELECT single NODIS FROM TJ02 INTO @DATA(ld_vkt). | ||||
| DATA(ld_vkt) | = 'X'. | |||
| "SELECT single PBUKR FROM PRPS INTO @DATA(ld_bukrs). | ||||
| "SELECT single PGSBR FROM PRPS INTO @DATA(ld_gsber). | ||||
| "SELECT single VRGNG FROM TJ01 INTO @DATA(ld_i_vrgng). | ||||
| DATA(ld_i_vrgng) | = CON_VNG_AUFTZUO. | |||
| "SELECT single PKOKR FROM PRPS INTO @DATA(ld_test_kokrs). | ||||
| DATA(ld_test_kokrs) | = ' '. | |||
| "SELECT single SEL01 FROM RCWBS INTO @DATA(ld_error_occurred). | ||||
| "SELECT single PBUKR FROM PRPS INTO @DATA(ld_test_bukrs). | ||||
| DATA(ld_test_bukrs) | = ' '. | |||
| "SELECT single PGSBR FROM PRPS INTO @DATA(ld_test_gsber). | ||||
| DATA(ld_test_gsber) | = ' '. | |||
| "SELECT single RKBUK FROM TKA00 INTO @DATA(ld_rkbuk). | ||||
| DATA(ld_rkbuk) | = ' '. | |||
Search for further information about these or an SAP related objects