Hello All,
i have a requirement like below. After developing logik am getting empty values to that key figure in DSO. Wrote logik between DSO to DSO.
Requirement : Need to add a keyfigure : 0NETVAL_INV based on some conditions between DSo to DSo transformation. for this i used look up.Below is the code.
TYPES: BEGIN OF ty_zbt8,
bill_num TYPE /bi0/oibill_num,
bill_item TYPE /bi0/oibill_item,
netval_inv TYPE /bi0/oinetval_inv,
bill_type TYPE /bi0/oibill_type,
doc_number TYPE /bi0/oidoc_number,
s_ord_item TYPE /bi0/ois_ord_item,
END OF ty_zbt8.
////Here zbt8 is lookup DSO. Our keyfigure hav to populate from this DSO only.
DATA: lit_zbt8 TYPE STANDARD TABLE OF ty_zbt8,
lwa_zbt8 TYPE ty_zbt8.
DATA : r_billtype TYPE RANGE OF /bic/azbt800-bill_type,
r_btyp_wa LIKE LINE OF r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZBV'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZF2'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZF2C'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZG2'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZGS'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZIG'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZIV'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZL2'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZLFS'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZLFT'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZRE'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZS1'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZS2'.
APPEND r_btyp_wa TO r_billtype.
r_btyp_wa-sign = 'I'.
r_btyp_wa-option = 'EQ'.
r_btyp_wa-low = 'ZVS'.
APPEND r_btyp_wa TO r_billtype.
SELECT bill_num
bill_item
SUM( netval_inv ) AS netval_inv
bill_type
doc_number
s_ord_item
* SUM( NETVAL_INV ) AS NETVAL_INV
INTO TABLE lit_zbt8
FROM /bic/azbt800
WHERE bill_type IN r_billtype
GROUP BY bill_num bill_item netval_inv bill_type doc_number
s_ord_item.
IF sy-subrc = 0.
DELETE ADJACENT DUPLICATES FROM lit_zbt8 COMPARING
netval_inv.
SORT lit_zbt8 BY netval_inv.
ENDIF.
ENDIF.
Pls tell me what went wrong in this code? Do the keys for both DSos ( lookup one also) should be same?
Regards,
Raki