Application Development 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: 

How to catch Kbetr fileld from konp based on mwskz in EKPO

Former Member
0 Kudos

Dear All,

Please can anyone tell me how to catch Kbetr field from konp based on mwskz in EKPO.

Regards

Mave

5 REPLIES 5

Former Member
0 Kudos

hi,

try with this

ekpo-ebeln = ekko-ebeln

konp-KNUMH = ekko-knumv

ekpo-mwskz = konp-MWSK1

cheers,

sasi

0 Kudos

Hi,

use fm RECP_FI_TAX_CALCULATE

Andreas

Former Member
0 Kudos

HI Mave,

Actualy you can join like this

from ekpo and A016 get knumh

on ekpo-ebeln = A016-ebeln where mwskz = '<your value>'.

now using this value of knumh get kbetr from Konp.

The Ideal join condition (but it will not work since A016 is pooled table, you can't join)

select single Kbetr into lv_kbetr from

EKPO as a inner join A016 as b on aEBELN = bEVRTN

inner join KONP as c on bKNUMH = cKNUMH

where a~mwskz = 'aa'.

So you do like this-->

data: begin of lt_ebeln occurs 0,

lv_ebeln like ekpo-ebeln,

end of lt_ebeln.

data: begin of lt_knumh occurs 0,

lv_knumh like A016-knumh,

end of lt_knumh.

data: begin of lt_kbetr occurs 0,

lv_kbetr like konp-kbetr,

end of lt_kbetr.

select ebeln into table lt_ebeln from ekpo

where mwskz = '<your value>'.

loop at lt_ebeln.

select single knumh from A016 into lt_knumh

where EVRTN eq lt_ebeln.

append lt_knumh.

endloop.

loop at lt_knumh.

select single Kbetr from konp into lt_kbetr

where knumh = lt_knumh.

append lt_kbetr .

endloop.

Reward point if it helps you.

Former Member
0 Kudos

Hi Mave ,

Which value are you trying to retrieve . Is the tax amount (Invoice tab on PO Screen ) or an amount on condition tab.

Did you check this -

Cheers

Former Member
0 Kudos

Here is a more compact and effecient one.

data: begin of lt_ebeln occurs 0,

lv_ebeln like ekpo-ebeln,

end of lt_ebeln.

data: begin of lt_knumh occurs 0,

lv_knumh like A016-knumh,

end of lt_knumh.

data: begin of lt_kbetr occurs 0,

lv_kbetr like konp-kbetr,

end of lt_kbetr.

select ebeln into table lt_ebeln from ekpo

where mwskz = 'ur value'.

select knumh from A016 into table lt_knumh

for all entries in lt_ebeln

where EVRTN eq lt_ebeln-lv_ebeln.

select Kbetr from konp into table lt_kbetr

for all entries in lt_knumh

where knumh = lt_knumh-lv_knumh.

loop at lt_kbetr.

write:/ lt_kbetr-lv_kbetr.

endloop.