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: 

Please help with 'Pricing' function module

Former Member
0 Kudos

Hi!

I am trying to use function module 'Pricing' but the table it_komv is still empty even after calling. I am basically trying to print some free of charge items on invoice sapscript and hence I am using 'Pricing' function in the print program. I am passing the below parameters. Please tell me whatelse I need to pass/not to pass.

wa_komk-mandt = sy-mandt.

wa_komk-kalsm = vbdkr-kalsm.

wa_komk-kappl = 'V'.

wa_komk-waerk = vbdkr-waerk.

  • wa_komk-knumv = vbdkr-knumv.

wa_komk-knuma = vbdkr-knuma.

wa_komk-vbtyp = vbdkr-vbtyp.

wa_komk-land1 = vbdkr-land1.

wa_komk-vkorg = vbdkr-vkorg.

wa_komk-vtweg = vbdkr-vtweg.

wa_komk-spart = vbdkr-spart.

wa_komk-prsdt = vbdkr-erdat.

wa_komk-kurst = vbdkr-kurst.

wa_komk-kurrf = vbdkr-kurrf.

wa_komk-kurrf_dat = vbdkr-kurrf_dat.

wa_komp-kposn = vbdpr-posnr.

wa_komp-kursk = vbdpr-kursk.

wa_komp-kursk_dat = vbdpr-kursk_dat.

wa_komp-werks = vbdpr-werks.

CALL FUNCTION 'PRICING'

EXPORTING

  • CALCULATION_TYPE = 'A'

comm_head_i = wa_komk

comm_item_i = wa_komp

  • PRELIMINARY = ' '

  • NO_CALCULATION = ' '

IMPORTING

comm_head_e = wa_komk

comm_item_e = wa_komp

TABLES

tkomv = it_komv

  • SVBAP =

  • CHANGING

  • REBATE_DETERMINED = ' '

Thanks a lot!

5 REPLIES 5

Former Member
0 Kudos

Hi,

Try using the Function module RV_PRICE_PRINT_ITEM to get the pricing information..

THanks,

Naren

0 Kudos

Hi Naren,

can you give me sample code reg. what to pass?

Thanks!

Former Member
0 Kudos

Hi Krishen,

Firstly populate this fields bcoz

KOMK, KOMP structures has many fields

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.

Then pass the fm 

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.

Revert back for any help

Regards

Naresh

Former Member
0 Kudos

Hi,

Check this example..

tables: vbdkr.

data: s_komk type KOMK.

data: s_komp type komp.

data: t_komv like KOMV occurs 0 with header line.

data: t_komvd like komvd occurs 0 with header line.

  • Input

s_komk-mandt = sy-mandt.

s_komk-knumv = vbdkr-knumv.

CALL FUNCTION 'RV_PRICE_PRINT_ITEM'

EXPORTING

comm_head_i = s_komk

comm_item_i = s_komp

tables

tkomv = t_komv

tkomvd = t_komvd

.

You can check the program RVADIN01 for a sample..

Hope this helps..

Thanks,

Naren

Former Member
0 Kudos

Krishen, did you ever get this to work? I have the exact same issue and was having the same results with the Pricing function module. Did you end up using the other function module?