#1
|
|||
|
|||
![]() Hola a todos:
Estoy tratando de modificar una lista de material especificamente los componentes y encabezado usando la BAPI BAPI_MATERIAL_BOM_GROUP_CREATE, ya logre crear una lista de material usando la bapi use el siguiente codigo : Data : Variante LIKE it_bomgroup-object_id Value 'ZNUEVA'. * Fill the data * Material BoM Group Header Data CLEAR it_bomgroup. it_bomgroup-bom_group_identification = ''. it_bomgroup-object_type = 'BGR'. it_bomgroup-object_id = VARIANTE. it_bomgroup-technical_type = ''. it_bomgroup-bom_usage = MATERIALES_ENC-STLAN. it_bomgroup-created_in_plant = MATERIALES_ENC-WERKS. it_bomgroup-ltxt_lang = SY-LANGU. it_bomgroup-bom_text = ''. APPEND it_bomgroup. ** Header Details of the different variants CLEAR it_variants. it_variants-bom_group_identification = ''. it_variants-object_type = 'BOM'. it_variants-object_id = VARIANTE. it_variants-alternative_bom = MATERIALES_ENC-STLAL. it_variants-bom_status = MATERIALES_ENC-STLAN. it_variants-base_qty = MATERIALES_ENC-BASE_QTY. it_variants-base_unit = MATERIALES_ENC-base_unit. it_variants-valid_from_date = SY-DATUM. it_variants-function = 'NEW'. APPEND it_variants. Loop at MATERIALES_DET. ** Details of the items of the variants CLEAR it_items. it_items-bom_group_identification = ''. it_items-object_type = 'ITM'. it_items-object_id = VARIANTE. it_items-item_no = MATERIALES_DET-POSNR. it_items-item_cat = MATERIALES_DET-POSTP. it_items-component = MATERIALES_DET-IDNRK. it_items-comp_qty = MATERIALES_DET-COMP_QTY. it_items-comp_unit = MATERIALES_DET-COMP_UNIT. it_items-valid_from_date = SY-DATUM. APPEND it_items. EndLOOP. ** Details of the materials of the different variants CLEAR it_matrel. it_matrel-bom_group_identification = ''. it_matrel-material = MATERIALES_ENC-MATNR. it_matrel-plant = MATERIALES_ENC-WERKS. it_matrel-bom_usage = MATERIALES_ENC-STLAN. it_matrel-alternative_bom = MATERIALES_ENC-STLAL. APPEND it_matrel. ** Linking items to the corresponding variants CLEAR it_itemas. it_itemas-bom_group_identification = ''. it_itemas-sub_object_type = 'ITM'. it_itemas-sub_object_id = VARIANTE. it_itemas-super_object_type = 'BOM'. it_itemas-super_object_id = VARIANTE. it_itemas-valid_from_date = SY-DATUM. it_itemas-function = 'NEW'. APPEND it_itemas. * Create variants CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE' EXPORTING all_error = 'X' TABLES bomgroup = it_bomgroup variants = it_variants items = it_items materialrelations = it_matrel itemassignments = it_itemas return = RETORNO_MEN. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'. Ahora quiero modificar la lista pero usando la misma bapi cambiando la function a 'CHG', alguien lo ha hecho?. Ojo la lista de materiales que cree no tiene bom_group_identification porque por lo que vi mi empresa no lo usa. Pero tengo la duda si igual le asigna un grupo por defecto. ![]() De ante mano muchas gracias al que pueda responder, ![]() YCastro |
![]() |
Herramientas | Buscar en Tema |
Desplegado | |
|
|