Skip to Content
0
Former Member
Aug 20, 2007 at 07:06 AM

AGAIN SAME PROBLEM WITH RV_PRICE_PRINT_ITEM

138 Views

HI

PLZ CHECK THE FOLLOWING CODE .AGAIN IM UNABLE TO READ TKOMV TABLE.

TABLES: kna1, "Customer master record

*kna1, "Customer master record

komk, "Communicationarea for conditions

komp, "Communicationarea for conditions

komvd, "Communicationarea for conditions

vbdkil, "Communicationarea for SAPscript

vbpa, "Partner

vbak,

vbap,

sadr, "Addresses

tvko, "Sales organisation

nast,

t052.

DATA: pr_kappl(01) TYPE c VALUE 'V' . "Application for pricing

DATA: BEGIN OF tkomv OCCURS 50.

INCLUDE STRUCTURE komv.

DATA: END OF tkomv.

DATA: BEGIN OF tkomvd OCCURS 50.

INCLUDE STRUCTURE komvd.

DATA: END OF tkomvd.

DATA:BEGIN OF itab OCCURS 0,

vbeln LIKE vbak-vbeln,

kalsm LIKE vbak-kalsm,

waerk LIKE vbak-waerk,

knumv LIKE vbak-knumv,

vbtyp LIKE vbak-vbtyp,

posnr LIKE vbap-posnr,

END OF itab.

PARAMETERS:p_vbeln LIKE vbak-vbeln.

START-OF-SELECTION.

SELECT a~vbeln

a~kalsm

a~waerk

a~knumv

a~vbtyp

b~posnr

FROM vbak AS a

JOIN vbap AS b

ON avbeln = bvbeln

INTO TABLE itab WHERE a~vbeln = p_vbeln.

CLEAR: komp,

tkomv.

IF komk-knumv = itab-knumv.

CLEAR komk.

komk-mandt = sy-mandt.

komk-kalsm = itab-kalsm.

komk-kappl = pr_kappl.

komk-waerk = itab-waerk.

komk-knumv = itab-knumv.

komk-vbtyp = itab-vbtyp.

ENDIF.

komp-kposn = itab-posnr.

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.

IF sy-subrc = 0.

WRITE:/ 'OK'.

ENDIF.

LOOP AT tkomv.

WRITE:/ tkomv-kschl,'|',tkomv-kbetr.

ENDLOOP.