Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FINDING TOTAL PRICE

HI

I HAVE TO FIND TOTAL PRICE.

TOTAL PRICE = GROSS VALUE - DISCOUNT + VAT + FREIGHT

I HAVE CONDITION TYPES

IF CONDITION TYPE IS ZOSP OR ZPSP OR ZPNP OR ZD00

I HAVE TO GET GROSS VALUE.

IF KSCHL IS ZF01 OR ZF02

I HAVE TO GET FREIGHT

IF KSCHL IS R100

I HAVE TO GET DISCOUNT

IF KSCHL IS ZWST

I HAVE TO GET VAT.

IM FETCHING CONDITION TYPES AND CONDITION RATE USING THE fm RV_PRICE_PRINT_ITEM.

NOW PLZ CHECK THE CODE BELOW IF IT IS CORRECT

TO GET THE FREIGHT VAT DISCOUNT GROSS VALUE.

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.

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.

Tags:
Former Member
replied

Hi...

Your code has to be changed since the Data is returned to an internal table.

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'.

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZPSP'.

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZPNP' .

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZPNN' .

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZD00'.

MOVE tkomv-kbetr TO gs_gross.

WHEN 'ZF01'.

MOVE tkomv-kbetr TO gs_freight.

WHEN 'ZF02'.

MOVE tkomv-kbetr TO gs_freight.

WHEN 'R100'.

MOVE tkomv-kbetr TO gs_discount.

WHEN 'ZWST'.

MOVE tkomv-kbetr TO gs_vat.

ENDCASE.

<<<write your calculation to get Total price>>

Modify Tkomv transporting <<gross prices>>.

ENDLOOP.

<b>Reward if Helpful</b>

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question