report z. parameters: p_vbeln like vbap-vbeln obligatory memory id aun, p_posnr like vbap-posnr obligatory memory id apo. data: begin of characteristics occurs 0, atnam like cabn-atnam, atwrt like ausp-atwrt, atval like ausp-atwrt, end of characteristics. data characteristic_value like ausp-atwrt. types: ibco2_value_rec like ibvalue0. types: ibco2_value_tab type ibco2_value_rec occurs 100. data: lt_values type ibco2_value_tab, w_values like line of lt_values. data: w_cuobj like vbap-cuobj, w_atinn like ausp-atinn. ******************* start-of-selection. ******************* *I. get configuration number for the SO item: select single cuobj into w_cuobj from vbap where vbeln = p_vbeln and posnr = p_posnr. if sy-subrc <> 0. write: 'Sales Order not found'. stop. endif. if w_cuobj is initial. write: 'Sales Order has no configuration'. stop. endif. *II. first try to get Internal characteristic # and value from AUSP * (ver 3.1 or older) select atinn atwrt into (w_atinn, characteristics-atval) from ausp where objek = w_cuobj. select atnam into characteristics-atnam from cabn where atinn = w_atinn. select atwrt into characteristics-atwrt from ausp where objek = characteristics-atnam. append characteristics. endselect. endselect. endselect. *III. for 4.5 and 4.6 version use BAPI call * to replace AUSP to get char name and char value if characteristics[] is initial. call function 'CUCB_GET_VALUES_FROM_INSTANCE' exporting iv_instance = w_cuobj importing et_values = lt_values exceptions invalid_instance = 1 others = 2. if sy-subrc ne 0. write: 'Sales Order configuration not found'. stop. endif. loop at lt_values into w_values. characteristics-atval = w_values-atwrt. select atnam into characteristics-atnam from cabn where atinn = w_values-atinn. select atwrt into characteristics-atwrt from ausp where objek = characteristics-atnam. append characteristics. endselect. endselect. endloop. endif. ************ top-of-page. ************ write: /(30) 'Characteristic name', (30) 'Characteristic', (30) 'Characteristic value'. ***************** end-of-selection. ***************** loop at characteristics. write: / characteristics-atnam, characteristics-atwrt, characteristics-atval. endloop.