04-26-2011 3:50 PM
Hi;
I added exstra fields in va01 transaction using program name = SAPMV45A
screen 8903.
I want to bring condition value to my extra field 'sales fields'.
I write code in ' MV45AOZZ' but I can't find vbak-knumv field so I can't calculate new value.
How can I find value of vbak-knumv ?
04-27-2011 7:53 AM
Hi I used MV45AFZA or MV45AFZZ,but it fall debug mode but I don't see knumn value before click 'additional data B' tab or after.
I see when document opened using va02 transaction.
ın other words ;value of knumv comes after save document.I want to see before save because I need calculate this value.
04-26-2011 10:14 PM
You don't need VBAK-KNUMV in the user exit. Pricing conditions should be available in the tables like TKOMK/TKOMP. Check in the debugger what condition tables are available in that user exit.
04-27-2011 7:02 AM
hi I see tkomp-knumv but it doesn't has value about pricing.
I see knumv field after document save But I need to see before save document in additional data B of va01.
04-27-2011 3:20 PM
KNUMV will be generated after the sales document is created. You can try SAVE_DOCUMENT user exit instead of save_Document_prepare.
Why do you need all these user exits?
However, the process will be different in VA01 and VA02.
In VA01 - The KNUMV will not be available but you will have access to all pricing conditions generated for items in internal table XKOMV. KPOSN is equal to the posnr of VBAP which is item number.
in VA02 - you have the same as above and you will also have the knumv in vbak as well as XKOMV.
It is the same for sales order number. If you want to save something with knumv in any custom table, as i said, use save_document where you will have access to pretty much everything and the data is available.
If you dont want to save in custom tables then you can pretty much calculate anything in pricing condition routines.
What exactly is your requirement? is anyone there to guide you on the right path. I mean, is it you who is designing this or someone told you to do this? if it is you who is designing this, take the right path. There may be good ways of doing the same.
good luck...
04-27-2011 7:36 AM
Hello,
you add your code in MV45AFZA or MV45AFZZ Include as per processing logic. there are so many internal routine available which you can use.
Regards,
Sujeet
04-27-2011 7:53 AM
Hi I used MV45AFZA or MV45AFZZ,but it fall debug mode but I don't see knumn value before click 'additional data B' tab or after.
I see when document opened using va02 transaction.
ın other words ;value of knumv comes after save document.I want to see before save because I need calculate this value.
04-27-2011 8:02 AM
Hello,
It should work.
check the routine USEREXIT_PRICING_PREPARE_TKOMP in MV45AFZZ it will calculate the price at the SAVE event.
and routine USEREXIT_MOVE_FIELD_TO_KOMPD in MV45AFZA will get triggered when you click on Additional data Tab.
Regards,
Sujeet
04-27-2011 3:13 PM
@Sujeet: Those are the wrong user exits to recommend. They are for pricing and substitution work area preparation. Check the documentation. Why would you use an exit that is called BEFORE pricing is carried out?
@Poster: I don't know why you need the exits at all. The subscreen for Additional Data B is custom and you can easily add your own logic to retrieve the data you need, including pricing data.
04-27-2011 8:32 AM
Hi;
I tried but no no no.
Routine USEREXIT_MOVE_FIELD_TO_KOMPD in MV45AFZA will get triggered when you click on Additional data Tab BUT
tkomp-knumv or vbak-knumv is empty.
or I checked USEREXIT_PRICING_PREPARE_TKOMP in MV45AFZZ but tkomp-knumv or vbak-knumv is empty.
my code;
in program = SAPMV45A
screen = 8309 for 'Additional data B'
PROCESS BEFORE OUTPUT.
module USEREXIT_MOVE_FIELD_TO_KOMPD.
module userexit_pricing_prepare_tkomp.
PROCESS AFTER INPUT.
module calculate_result.