Skip to Content
0
Former Member
Dec 11, 2006 at 04:41 PM

CUCB_CONFIGURATION_TO_DB - setting variant configuration

335 Views

Hi,

I'm trying to use function modules to set variant configuration for sales orders. In my code, I have:

CALL FUNCTION 'CUCB_GET_CONFIGURATION'

EXPORTING

instance = '000000000000000209'

IMPORTING

configuration = lt_configuration

EXCEPTIONS

INVALID_INPUT = 1

invalid_instance = 2

instance_is_a_classification = 3

OTHERS = 4.

  • Add / modify lt_configuration-values[]

.......

CALL FUNCTION 'CUCB_SET_CONFIGURATION'

EXPORTING

root_instance = '000000000000000209'

CHANGING

configuration = lt_configuration

EXCEPTIONS

INVALID_INPUT = 1

invalid_instance = 2

instance_is_a_classification = 3

OTHERS = 4.

l_owner-object_type = 'VBPS'.

l_owner-object_key = '7000000035'.

l_owner-object_key+10 = '000001'.

CALL FUNCTION 'CUCB_CONFIGURATION_TO_DB'

EXPORTING

root_instance = '000000000000000209'

root_object = l_owner.

After this, if I run this program again in debug mode, I can see that the values in lt_configuration have changed, but I don't see any change in VA02 / VA03 (menu Extras -> Configuration).

I have also tried using CUD0_GET_VAL_FROM_INSTANCE and CUD0_SET_VAL_TO_INSTANCE, but because I'm using this code for multiple line items of a sales order, it somehow only works for the first line item but gives an error to the rest of the line items. Specifically, after executing the program, when I try to display variant configuration for the second line item in VA02 / VA03, I get a popup error "Internal error in communication between configuration and sales doc.GET_CONFIG_MODE.".

So I'm getting really confused... if anyone has changed variant configuration and can give some directions, that'd be very much appreciated.

Thanks!

Madeline