Skip to Content
author's profile photo
Former Member

check the code for total price

in the following code tkomv table is not populated.plz tell me wht i have to pass into komk structure.

why is tkomv not filled?

clear komk,

komp,

tkomv,

gs_total,

gs_gross ,

gs_discount, gs_freight,

gs_vat.

READ TABLE gt_likp INTO gs_likp WITH KEY

vbeln = gs_yv_an_arno-/rbc2/yv_delno.

move:gs_likp-knumv TO komk-knumv,

gs_likp-kalsm TO komk-kalsm,

gs_likp-waerk TO komk-waerk,

gs_likp-vbtyp TO komk-vbtyp.

komk-mandt = sy-mandt.

komk-kappl = pr_kappl.

CALL FUNCTION 'RV_PRICE_PRINT_ITEM'

EXPORTING

comm_head_i = komk

comm_item_i = komp

language = nast-spras

IMPORTING

comm_head_e = komk

comm_item_e = komp

TABLES

tkomv = tkomv

tkomvd = tkomvd.

LOOP AT tkomv.

CASE tkomv-kschl.

WHEN 'ZOSP'.

READ TABLE tkomv WITH KEY kschl = 'ZOSP'.

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZPSP'.

READ TABLE tkomv WITH KEY kschl = 'ZPSP'.

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZPNP' .

READ TABLE tkomv WITH KEY kschl = 'ZPNP'.

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZPNN' .

READ TABLE tkomv WITH KEY kschl = 'ZPNN'.

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZD00'.

READ TABLE tkomv WITH KEY kschl = 'ZD00'.

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZF01'.

READ TABLE tkomv WITH KEY kschl = 'ZF01'.

MOVE tkomv-kbetr TO gs_freight.

WHEN 'ZF02'.

READ TABLE tkomv WITH KEY kschl = 'ZF02'.

MOVE tkomv-kbetr TO gs_freight.

WHEN 'R100'.

READ TABLE tkomv WITH KEY kschl = 'R100'.

MOVE tkomv-kbetr TO gs_discount.

WHEN 'ZWST'.

READ TABLE tkomv WITH KEY kschl = 'ZWST'.

MOVE tkomv-kbetr TO gs_vat.

ENDCASE.

ENDLOOP.

gs_total = gs_gross - gs_discount + gs_freight + gs_vat.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Posted on Aug 22, 2007 at 01:49 PM

    You need to put something in KOMP, not just KOMK.

    Add comment
    10|10000 characters needed characters exceeded