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: 

routine problem for VOFM

Former Member
0 Kudos

hi gurus ,

in VOFM , I am creating a routine for VA01 , conditions formula, for customer discount, Z007 is condition type , but problem is that after running the program nothing is coming.

FORM FRM_KONDI_WERT_860.

*{ INSERT DFDK914010 1

if XKOMV-kschl = 'Z007'.

data : basic like xkomv-KWERT,

vat like xkomv-KWERT,

X LIKE xkomv-KWERT,

Y LIKE xkomv-KWERT,

Z LIKE xkomv-KWERT,

ZTERM LIKE KOMP-ZTERM,

DAYS LIKE T052-ZTAG2.

  • +SK21112007

data: z_zterm like vbkd-zterm.

data: ref_zterm(21) value '(SAPMV45A)XVBKD-ZTERM'.

field-symbols: <FS_ZTERM> type any.

assign (ref_zterm) to <FS_ZTERM>.

z_zterm = <FS_ZTERM>.

*+SK21112007

READ TABLE XKOMV WITH KEY KSCHL = 'ZFBP'.

if sy-subrc = 0.

BASIC = XKOMV-KWERT.

endif.

READ TABLE XKOMV WITH KEY KSCHL = 'JIN7'.

if sy-subrc = 0.

VAT = XKOMV-KWERT.

endif.

*+SK21112007

SELECT SINGLE ZTAG1 INTO DAYS FROM T052

WHERE ZTERM = Z_ZTERM.

*+SK21112007

X = BASIC + VAT.

Y = ( X * 10 / 100 ) / 365.

Z = Y * DAYS.

*komv-KWERT = Z .

*xkomv-kwert = z.

xkwert = z.

endif.

*} INSERT

ENDFORM.

2 REPLIES 2

former_member195698
Active Contributor
0 Kudos

have you activated the routine (marked as active in VOFM) and also run the program RV80HGEN to activate the Routine.

<b>Reward points if useful</b>

Regards,

Abhishek

0 Kudos

its giving error -

Errors while transferring conditions: duplicates found

Message no. VH806

Diagnosis

During the data transfer after successful pricing, the system recognized

that document conditions with the same key exist for condition type

ZFBP.

System Response

Transferral of the document conditions is canceled, in order to prevent

incorrect system behavior or a cancellation of updates when you save. At

the same time, the system set pricing of the item affected 000010 as

containing errors.

Procedure

First find the cause of the problem:

1. For a variant condition, is the system including a particularly

large number of characteristics for valuation?

2. Is a condition type being used as an additional condition?

3. In the pricing procedure, are there several condition types at the

same level number?

The problem can only be solved removing the cause of the problem. If the

first cause applies, you should consider distributing the

characteristics using several condition types. In the second case, you

should check whether all conditions are required at the same time, or

whether you can avoid their use altogether. In the third case, you will

need to change the pricing procedure.