‎2011 Nov 15 10:58 AM
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.
‎2011 Nov 15 2:18 PM
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