Application Development and Automation 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: 
Read only

Pricing condition routine

Former Member
0 Likes
1,973

Hi Experts

I have a issue where i need to over write invoice price with PO price during invoice creation itself. i created a routine which is triggered when invoice is created. this populates the table XKOMV. But as this the first time i will be created a invoice i dont have any entries in XKOMV table. i need this table so that i can put the PO price against invoice price going forward.

this is the piece of code i have written in my routine

SELECT SINGLE knumv FROM ekko

INTO zknumv WHERE ebeln = komp-aubel.

IF sy-subrc = 0.

SELECT SINGLE infnr

ebeln

FROM ekpo INTO (zinfnr, zebeln)

WHERE ebeln = komp-aubel.

IF sy-subrc = 0.

SELECT SINGLE kbetr FROM konv

INTO zkbetr "xkomv-kbetr

WHERE knumv = zknumv

AND kschl = 'PB00'.

IF sy-subrc = 0.

MOVE zkbetr TO xkomv-kbetr.

MOVE c_ztpr TO xkomv-kschl. "'ZTPR'

APPEND xkomv.

CLEAR xkomv.

CLEAR komt1-kschl.

ENDIF.

ENDIF.

ENDIF.

i cannot append data into XKOMV as i have done above. How else do i handle this issue? i want to do this when Invoice price is getting determined.

Please help me.

1 REPLY 1
Read only

eduardo_hinojosa
Active Contributor
0 Likes
665

Hi

Don't add or delete items in XKOMV from a formula or other VOFM subroutine. Control if it must works with pricing requirement (VOFM) in the pricing procedures, ie, in tcode M/08 you create the conditions, and with these pricing requirements you decide if it must work or not.

I hope this helps you

Regards

Eduardo

Edited by: E_Hinojosa on Nov 15, 2011 3:18 PM