cancel
Showing results for 
Search instead for 
Did you mean: 

CUCB_SET_CONFIGURATION is wrongly updating material master

0 Kudos
874

Hi Experts,

I have to copy Variant configuration from original order to return order.

I am using CUCB_GET_CONFIGURATION to fetch variant configuration from original order and

CUCB_SET_CONFIGURATION to set this configuration in return order.

Although this is updating the configuration in return sales order , however on saving the order the configuration also updates my configuration in material master MRP3 view.


* CALL FUNCTION 'ZSD_RETURN_ORDER_VC_CHANGE'
* EXPORTING
* i_org_cuobj = ls_vbap_org-cuobj
* i_ret_cuobj = ls_vbap-cuobj.
*
** Collect the original configuration
* CALL FUNCTION 'CUCB_GET_CONFIGURATION'
* EXPORTING
* instance = ls_vbap_org-cuobj
* IMPORTING
** IBASE =
* CONFIGURATION = lt_org_config
** EO_CBASE_REF =
* EXCEPTIONS
* INVALID_INPUT = 1
* INVALID_INSTANCE = 2
* INSTANCE_IS_A_CLASSIFICATION = 3
* OTHERS = 4 .
* IF sy-subrc EQ 0.
* IF NOT ls_vbap-cuobj IS INITIAL.
** Collect the return order configuration
* CALL FUNCTION 'CUCB_GET_CONFIGURATION'
* EXPORTING
* instance = ls_vbap-cuobj
* IMPORTING
** IBASE =
* CONFIGURATION = lt_ret_config
** EO_CBASE_REF =
* EXCEPTIONS
* INVALID_INPUT = 1
* INVALID_INSTANCE = 2
* INSTANCE_IS_A_CLASSIFICATION = 3
* OTHERS = 4 .
*
** Collect the Original Configuration values
* READ TABLE lt_org_config INTO ls_org_config INDEX 1.
* IF sy-subrc EQ 0.
* lt_values[] = ls_org_config-values[].
* IF NOT lt_values[] IS INITIAL.
* READ TABLE lt_ret_config INTO ls_org_config INDEX 1.
* IF sy-subrc EQ 0.
* ls_org_config-values[] = lt_values[].
* ls_owner = ls_org_config-owner.
* MODIFY lt_ret_config FROM ls_org_config INDEX 1.
* ENDIF.
* ENDIF.
* ENDIF.
* CALL FUNCTION 'CUCB_SET_CONFIGURATION'
* EXPORTING
* root_instance = ls_vbap-cuobj
** IS_CBASE_HEADER =
* changing
* configuration = lt_ret_config
* EXCEPTIONS
* INVALID_INPUT = 1
* INVALID_INSTANCE = 2
* INSTANCE_IS_A_CLASSIFICATION = 3
* OTHERS = 4 .
* IF sy-subrc EQ 0.
* CALL FUNCTION 'CUCB_CONFIGURATION_TO_DB'
* EXPORTING
* root_instance = ls_vbap-cuobj
* root_object = ls_owner
** FORCE_NEW_INSTANCE =
** IV_WITHOUT_COMMIT_UPDATE = ' '
** IV_MATERIAL =
** IV_LOCATION =
** IV_TECHS =
** IMPORTING
** NEW_INSTANCE =
** TABLES
** EXP_NEW_NESTED_CUOBJS =
* EXCEPTIONS
* INVALID_INSTANCE = 1
* INVALID_ROOT_INSTANCE = 2
* NO_CHANGES = 3
* ALREADY_REGISTERED_FOR_UPDATE = 4
* INSTANCE_IS_A_CLASSIFICATION = 5
* OTHERS = 6 .
* ENDIF.
* ENDIF.
* ENDIF.

shekar2525
Newcomer
0 Kudos
Was this get resolved? Can you please share the solution.

Accepted Solutions (0)

Answers (0)