2005 Aug 25 7:16 AM
Hi,
To join the Billing document Item Level wise to "KONV" table the following query can be used;
WHERE VBRKKNUMV = KONVKNUMV and
VBRKVBELN = VBRPVBELN and
VBRPPOSNR = KONVKPOSN
If you carefully observe the "KONV" table you will find the field KNUMH which uniquely identify each record in "KONV" table.
1. Using KNUMH field could we build a link between KONV and VBRP table?
2. Is there alternate query for the above?
3. Is there a Function that could be used instead of the Query?
Thanks,
Kishan
2005 Aug 25 11:35 AM
Hi,
You could write your selects this way:
SELECT VBELN
KNUMV
FKDAT
KUNRG
KUNAG
VKORG
VTWEG
FKART
WAERK
INTO TABLE I_VBRK
FROM VBRK
WHERE ...............
SELECT VBELN
POSNR
MATNR
NETWR
FKIMG
AUBEL
AUPOS
VRKME
MEINS
INTO TABLE I_VBRP
FROM VBRP FOR ALL ENTRIES IN I_VBRK
WHERE VBELN = I_VBRK-VBELN.
get pricing conditions for all the billing items
SELECT KNUMV
KPOSN
KSCHL
KWERT INTO TABLE I_KONV
FROM KONV FOR ALL ENTRIES IN I_VBRP
WHERE KNUMV = I_VBRP-KNUMV AND
KPOSN = I_VBRP-POSNR AND
KSTAT <> C_X AND
KINAK = '' AND
KRUEK <> C_X.
regards
Aveek
2005 Aug 25 7:48 AM
Hi Kishan,
What you are following is correct. The tables VBRK and VBRP does not have the field KNUMH so you cannot link with KONV.
Thanks
Vinod
2005 Aug 25 8:09 AM
2005 Aug 25 9:44 AM
Hi,
Your current query is fine, that is the correct way also,
KNUMH won't work for this issue.
Cheers,
Sasi
2005 Aug 25 10:21 AM
Hi,
Your current query is fine, that is the correct way also,
KNUMH won't work for this issue.
Cheers,
Sasi
2005 Aug 25 11:24 AM
hi Guys ,
we cannt use Cluster tables in Join?
we have some FM to get Condtion values ?check with condtion
regards
Prabhu
2005 Aug 25 11:35 AM
Hi,
You could write your selects this way:
SELECT VBELN
KNUMV
FKDAT
KUNRG
KUNAG
VKORG
VTWEG
FKART
WAERK
INTO TABLE I_VBRK
FROM VBRK
WHERE ...............
SELECT VBELN
POSNR
MATNR
NETWR
FKIMG
AUBEL
AUPOS
VRKME
MEINS
INTO TABLE I_VBRP
FROM VBRP FOR ALL ENTRIES IN I_VBRK
WHERE VBELN = I_VBRK-VBELN.
get pricing conditions for all the billing items
SELECT KNUMV
KPOSN
KSCHL
KWERT INTO TABLE I_KONV
FROM KONV FOR ALL ENTRIES IN I_VBRP
WHERE KNUMV = I_VBRP-KNUMV AND
KPOSN = I_VBRP-POSNR AND
KSTAT <> C_X AND
KINAK = '' AND
KRUEK <> C_X.
regards
Aveek
2005 Aug 25 12:41 PM
Hi Aveek Ghose,
I awarded you points. I am now actually looking for a exact Function to get Item Level Price from KONV table.
Sorry to loop this Question.
Thanks
Kishan
2005 Aug 25 1:06 PM
2005 Aug 25 1:57 PM
Hi,
Max has provided the correct answer.
CALL FUNCTION 'RV_PRICE_PRINT_ITEM'
EXPORTING
COMM_HEAD_I = KOMK
COMM_ITEM_I = KOMP
IMPORTING
COMM_HEAD_E = KOMK
COMM_ITEM_E = KOMP
TABLES
TKOMV = TKOMV
TKOMVD = TKOMVD.
regards
Aveek
2005 Aug 25 2:24 PM
Hi,
There is another fucntion module you could try out:
CALL FUNCTION 'PRICING'
EXPORTING
calculation_type = c_c
comm_head_i = im_komk
comm_item_i = im_komp
IMPORTING
comm_head_e = ex_komk
comm_item_e = ex_komp
TABLES
tkomv = ex_komv.
regards
Aveek
2005 Aug 26 3:54 AM
Hi Aveek Ghose,
Your points awarded!
Thank U very much. One more doubt The KOMK & KOMP structures have lots of fields in them. Do I have to populate each field in them? Could U be kind enough to give me a example what fields need to be populated in this 2 structures. That will solve this problem.
Thanks,
Kishan
2005 Aug 26 7:55 AM
Hi,
Sorry to loop this.
CALL FUNCTION 'RV_PRICE_PRINT_ITEM'
EXPORTING
COMM_HEAD_I = KOMK
COMM_ITEM_I = KOMP
IMPORTING
COMM_HEAD_E = KOMK
COMM_ITEM_E = KOMP
TABLES
TKOMV = TKOMV
TKOMVD = TKOMVD.
What values have to filled in KOMK, KOMP structures because it has many fields.
Thanks,
Kishan
2005 Aug 26 10:07 AM
Hi,
Here are the fields that need to be populated:
CLEAR KOMK.
KOMK-MANDT = SY-MANDT.
KOMK-KALSM = VBDKR-KALSM.
KOMK-FKART = VBDKR-FKART.
KOMK-KAPPL = 'V'.
IF VBDKR-KAPPL NE SPACE.
KOMK-KAPPL = VBDKR-KAPPL.
ENDIF.
KOMK-WAERK = VBDKR-WAERK.
KOMK-KNUMV = VBDKR-KNUMV.
KOMK-VBTYP = VBDKR-VBTYP.
KOMK-BUKRS = VBDKR-BUKRS.
KOMK-BELNR = VBDKR-VBELN.
KOMP-KPOSN = VBDPR-POSNR.
regards
Aveek