2007 May 10 5:51 PM
hi
i have a requirement where i need to print sum of values for all materials which have condition type zsc4 , for every customer.
the fields are in komv tabel
condition type is in komv-kschl
value is komv-kwert
i am not able to find the link between komv and other tables . how do i proceed.
hi
i have a requirement where i need to print sum of values for all materials which have condition type zsc4 , for every customer.
the fields are in komv tabel
condition type is in komv-kschl
value is komv-kwert
i am not able to find the link between komv and other tables . how do i proceed.
2007 May 10 5:53 PM
2007 May 10 5:57 PM
Hi,
If it is sales order conditions..Then check the table KONV..THe relationship is
KONV-KNUMV = VBAK-KNUMV.
IF if is condition records..Then check the table KONP..You have to get the customer / materials from the conditon table (Ex. A005) for the corresponding output type..The relationship is A005-KNUMH = KONP-KNUMH...
Thanks,
Naren
2007 May 14 8:00 AM
thanks naren
but i still could not figure it out. i wrote something like this
loop at itab.
select kschl into itab1-kschl
where knumv = itab1-knumv.
endselect.
however i find that for one knumv there are many values of condition type defined.
how do i proceed .
my requirement is to print the total values( field konv-kwert) for all materials which have order type zsc4 or zsc5 ( konv-kschl) for every customer.
2007 May 14 8:05 AM
Hi
Hope ITAB contains the fields of KNUMV.
and declare a Another int table with KSCHL and KWERT fields
loop at itab.
select kschl KWERT into ( itab1-kschl, itab1-kwert) from KONV
where knumv = itab-knumv and
kschl in ( 'ZSC4', 'ZSC5' ).
collect itab1.
endselect.
endloop.
Reward points if useful
Regards
Anji
Message was edited by:
Anji Reddy Vangala
2007 May 15 5:57 PM
thanks for ur reply,Anji.
I am working on it ,lets see if i get the right output.
2007 May 15 6:15 PM
Use below logic for better idea.
Get the data from A004 table to get KNUMH
Added new field Sales Unit - Seshu 01/09/2006
refresh : i_a004.
clear : i_a004.
data : lv_kbetr like konp-kbetr," Condition value
lv_KPEIN like konp-kpein , "per
lv_KMEIN like konp-KMEIN. " Sales Unit
select * from a004 into table i_a004
where matnr = i_join-matnr
and vkorg = '0001'
and vtweg = '01'.
if sy-subrc eq 0.
sort i_a004 by DATAB descending.
Get the Latetest Date
read table i_a004 with key matnr = i_join-matnr
vkorg = '0001'
vtweg = '01'
binary search.
Get the Sales Value
select single kbetr KPEIN KMEIN from konp
into (lv_kbetr,lv_KPEIN, lv_KMEIN)
where knumh = i_a004-knumh
and kappl = i_a004-kappl
and kschl = i_a004-kschl.
if sy-subrc eq 0.
i_output-kbetr = lv_kbetr / lv_KPEIN.
i_output-KMEIN = lv_KMEIN.
endif.
endif.
clear : lv_kbetr,
lv_kpein,
lv_KMEIN.
Reward Points if it is helpful
Thanks
Seshu
2007 Jun 27 9:17 PM
it was solved using some other additional conditions specific to my case. thanks guys for the replies.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |