Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

tables komv

Former Member
0 Likes
6,053

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.

7 REPLIES 7
Read only

Former Member
0 Likes
3,878

use where used list

Read only

Former Member
0 Likes
3,878

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

Read only

0 Likes
3,878

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.

Read only

0 Likes
3,878

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

Read only

0 Likes
3,878

thanks for ur reply,Anji.

I am working on it ,lets see if i get the right output.

Read only

0 Likes
3,878

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

Read only

Former Member
0 Likes
3,878

it was solved using some other additional conditions specific to my case. thanks guys for the replies.