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: 

how can I find belnr and knumv in additional data b?

Former Member
0 Kudos

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 ?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

8 REPLIES 8

Jelena
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

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...

sujeet2918
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

@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.

Former Member
0 Kudos

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.