2009 Oct 22 4:15 PM
Hi ALL
i am selecting fixed cost(EL_HF) from table TCKH3 and cost fields from table KEPH (fields are KST001,KST002..........KST040)
i want if EL_HF = 0 then KST000 field should consider
if EL_HF = 1 then KST001.................EL_HF = 40 then KST040.
Can any one tell me how can i achive the same?
Regards,
Oorvi
Hi ALL
i am selecting fixed cost(EL_HF) from table TCKH3 and cost fields from table KEPH (fields are KST001,KST002..........KST040)
i want if EL_HF = 0 then KST000 field should consider
if EL_HF = 1 then KST001.................EL_HF = 40 then KST040.
Can any one tell me how can i achive the same?
Regards,
Oorvi
2009 Oct 22 4:28 PM
DATA: v_field TYPE name_feld,
v_numb(3) TYPE n.
DATA: v_cost TYPE kstel.
v_numb = tckh3-el_hf.
CONCATENATE 'KST'
v_numb
INTO v_field.
CONDENSE v_field NO-GAPS.
SELECT (v_field) INTO v_cost
FROM keph
WHERE........
2009 Oct 22 4:46 PM
Hi,
Below code using field symbols should give you an idea.
data: v_el_hf_c(3) type c,
v_elhf(6) type c.
FIELD-SYMBOLS : <fs_kstval>.
v_el_hf_c = TCKH3-el_hf.
overlay v_el_hf_c with '000'.
concatenate 'KST' v_el_hf_c into v_elhf.
loop at i_keph.
ASSIGN COMPONENT v_elhf of structure I_KEPH to <fs_kstval>.
if sy-subrc = 0.
"<fs_kstval> has the value
endif.
endloop.
Cheers,
Vikram
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |