SAP COS6_MATERIAL_EDIT Function Module for NOTRANSL: Einfügen oder Verändern einer Komponente
COS6_MATERIAL_EDIT is a standard cos6 material edit 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: Einfügen oder Verändern einer Komponente 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 cos6 material edit FM, simply by entering the name COS6_MATERIAL_EDIT into the relevant SAP transaction such as SE37 or SE38.
Function Group: COS6
Program Name: SAPLCOS6
Main Program: SAPLCOS6
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function COS6_MATERIAL_EDIT 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 'COS6_MATERIAL_EDIT'"NOTRANSL: Einfügen oder Verändern einer Komponente.
EXPORTING
IS_RESBD_NEW = "Reservation/Dependent Requirements
I_AKTYP = "Activity Category in Transaction
I_FLG_NO_DIALOG = "Selection Indicator
* I_FLG_PS_IF = ' ' "Selection Indicator
* I_FLG_INSR_WITH_REF = ' ' "Selection Indicator
* I_FLG_INSR_BATCH_SPL = ' ' "Selection Indicator
* I_FLG_BOM_EXPLODE = ' ' "Selection indicator
* IS_RESBD_OLD = "Reservation/Dependent Requirements
IS_CAUFVD = "Dialog Structure for Order Headers and Items
IS_AFPOD = "Order Item Dialog Structure
IS_AFVGD = "Order: Dialog Table for Table AFVG (Order Operation)
I_AFFL_INDBT = "Field defined as in SY-TABIX
IS_MSFCV = "Material Master View on Production Orders
IS_MTCOR = "Material Master View: Return Codes
* I_SETTLE_RULE = ' ' "Selection Indicator
IMPORTING
ES_CAUFVD = "Dialog Structure for Order Headers and Items
ES_RESBD = "Reservation/Dependent Requirements
EXCEPTIONS
CHANGES_NOT_EXECUTED = 1 MATERIAL_PLANT_NOT_EXISTING = 2 MISSING_MAT_TEXT = 3 MISSING_PUR_DATA = 4
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLCOS6_001 DE-EN-LANG-SWITCH-NO-TRANSLATION
EXIT_SAPLCOS6_002 Check a Newly Assigned Component
IMPORTING Parameters details for COS6_MATERIAL_EDIT
IS_RESBD_NEW - Reservation/Dependent Requirements
Data type: RESBDOptional: No
Call by Reference: Yes
I_AKTYP - Activity Category in Transaction
Data type: RC27S-AKTYPOptional: No
Call by Reference: Yes
I_FLG_NO_DIALOG - Selection Indicator
Data type: RC27X-FLG_SELOptional: No
Call by Reference: Yes
I_FLG_PS_IF - Selection Indicator
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_FLG_INSR_WITH_REF - Selection Indicator
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_FLG_INSR_BATCH_SPL - Selection Indicator
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_FLG_BOM_EXPLODE - Selection indicator
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: Yes
IS_RESBD_OLD - Reservation/Dependent Requirements
Data type: RESBDOptional: Yes
Call by Reference: Yes
IS_CAUFVD - Dialog Structure for Order Headers and Items
Data type: CAUFVDOptional: No
Call by Reference: Yes
IS_AFPOD - Order Item Dialog Structure
Data type: AFPODOptional: No
Call by Reference: Yes
IS_AFVGD - Order: Dialog Table for Table AFVG (Order Operation)
Data type: AFVGDOptional: No
Call by Reference: Yes
I_AFFL_INDBT - Field defined as in SY-TABIX
Data type: AFFLD-INDBTOptional: No
Call by Reference: Yes
IS_MSFCV - Material Master View on Production Orders
Data type: MSFCVOptional: No
Call by Reference: Yes
IS_MTCOR - Material Master View: Return Codes
Data type: MTCOROptional: No
Call by Reference: Yes
I_SETTLE_RULE - Selection Indicator
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for COS6_MATERIAL_EDIT
ES_CAUFVD - Dialog Structure for Order Headers and Items
Data type: CAUFVDOptional: No
Call by Reference: Yes
ES_RESBD - Reservation/Dependent Requirements
Data type: RESBDOptional: No
Call by Reference: Yes
EXCEPTIONS details
CHANGES_NOT_EXECUTED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MATERIAL_PLANT_NOT_EXISTING -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MISSING_MAT_TEXT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MISSING_PUR_DATA -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for COS6_MATERIAL_EDIT 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_es_caufvd | TYPE CAUFVD, " | |||
| lv_is_resbd_new | TYPE RESBD, " | |||
| lv_changes_not_executed | TYPE RESBD, " | |||
| lv_i_aktyp | TYPE RC27S-AKTYP, " | |||
| lv_i_flg_no_dialog | TYPE RC27X-FLG_SEL, " | |||
| lv_i_flg_ps_if | TYPE RC27X-FLG_SEL, " SPACE | |||
| lv_i_flg_insr_with_ref | TYPE RC27X-FLG_SEL, " SPACE | |||
| lv_i_flg_insr_batch_spl | TYPE RC27X-FLG_SEL, " SPACE | |||
| lv_i_flg_bom_explode | TYPE RC27X-FLG_SEL, " SPACE | |||
| lv_es_resbd | TYPE RESBD, " | |||
| lv_is_resbd_old | TYPE RESBD, " | |||
| lv_material_plant_not_existing | TYPE RESBD, " | |||
| lv_is_caufvd | TYPE CAUFVD, " | |||
| lv_missing_mat_text | TYPE CAUFVD, " | |||
| lv_is_afpod | TYPE AFPOD, " | |||
| lv_missing_pur_data | TYPE AFPOD, " | |||
| lv_is_afvgd | TYPE AFVGD, " | |||
| lv_i_affl_indbt | TYPE AFFLD-INDBT, " | |||
| lv_is_msfcv | TYPE MSFCV, " | |||
| lv_is_mtcor | TYPE MTCOR, " | |||
| lv_i_settle_rule | TYPE RC27X-FLG_SEL. " SPACE |
|   CALL FUNCTION 'COS6_MATERIAL_EDIT' "NOTRANSL: Einfügen oder Verändern einer Komponente |
| EXPORTING | ||
| IS_RESBD_NEW | = lv_is_resbd_new | |
| I_AKTYP | = lv_i_aktyp | |
| I_FLG_NO_DIALOG | = lv_i_flg_no_dialog | |
| I_FLG_PS_IF | = lv_i_flg_ps_if | |
| I_FLG_INSR_WITH_REF | = lv_i_flg_insr_with_ref | |
| I_FLG_INSR_BATCH_SPL | = lv_i_flg_insr_batch_spl | |
| I_FLG_BOM_EXPLODE | = lv_i_flg_bom_explode | |
| IS_RESBD_OLD | = lv_is_resbd_old | |
| IS_CAUFVD | = lv_is_caufvd | |
| IS_AFPOD | = lv_is_afpod | |
| IS_AFVGD | = lv_is_afvgd | |
| I_AFFL_INDBT | = lv_i_affl_indbt | |
| IS_MSFCV | = lv_is_msfcv | |
| IS_MTCOR | = lv_is_mtcor | |
| I_SETTLE_RULE | = lv_i_settle_rule | |
| IMPORTING | ||
| ES_CAUFVD | = lv_es_caufvd | |
| ES_RESBD | = lv_es_resbd | |
| EXCEPTIONS | ||
| CHANGES_NOT_EXECUTED = 1 | ||
| MATERIAL_PLANT_NOT_EXISTING = 2 | ||
| MISSING_MAT_TEXT = 3 | ||
| MISSING_PUR_DATA = 4 | ||
| . " COS6_MATERIAL_EDIT | ||
ABAP code using 7.40 inline data declarations to call FM COS6_MATERIAL_EDIT
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 AKTYP FROM RC27S INTO @DATA(ld_i_aktyp). | ||||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_i_flg_no_dialog). | ||||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_i_flg_ps_if). | ||||
| DATA(ld_i_flg_ps_if) | = ' '. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_i_flg_insr_with_ref). | ||||
| DATA(ld_i_flg_insr_with_ref) | = ' '. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_i_flg_insr_batch_spl). | ||||
| DATA(ld_i_flg_insr_batch_spl) | = ' '. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_i_flg_bom_explode). | ||||
| DATA(ld_i_flg_bom_explode) | = ' '. | |||
| "SELECT single INDBT FROM AFFLD INTO @DATA(ld_i_affl_indbt). | ||||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_i_settle_rule). | ||||
| DATA(ld_i_settle_rule) | = ' '. | |||
Search for further information about these or an SAP related objects