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: 

Need to enhance BSEG data at the time of PGR.

Former Member
0 Kudos

Hi All,

for return order I have enhanced the MSEG-DMBTR value inside FM : MB_CREATE_GOODS_MOVEMENT. Now I have to enhance BSEG table for this order. Could you please guide me how can I solve this issue. Please update for more info.

Thanks,

Satya

22 REPLIES 22

Former Member
0 Kudos

Hi

Why do you need to enhance fields MSEG-DMBTR and BSEG-DMBTR?

0 Kudos

Yes.. MSEG-DMBTR is already enhanced and its working perfectly. Now I need to enhance BSEG-DMBTR. Please give me some idea.

Thanks,

Satya

0 Kudos

But why?

I don't think it's really good idea, but I woul like to know why you need to do it

0 Kudos

Hi Max,

Here we are getting VPRS value different from material moving cost. And the user want the PGR value as equal to VPRS value in return sales order as well as the material document when we are doing PGR. So I have to enhance the value for only one company code. This is the reason I have to enhance the value.

Thanks,

Satya

raymond_giuseppi
Active Contributor
0 Kudos

Did you check compliance of stock valuation when you do such strange operation (*), also how did you enhance MSEG as you should already get the same value in BSEG?

Regards,

Raymond

(*) Try executing transaction S_P6B_12000136 (report RM07MMFI) also check fiscal rules of managed countries.

0 Kudos

No I did not check for the compliance of sock valuation and I did the enhancement inside FM: MB_CREATE_GOODS_MOVEMENT for MSEG but I didn't get any value for BSEG inside this FM. Please help on this.

Thanks,

Satya

Former Member
0 Kudos

Need to enhance the value as per the below print screen.

Thanks,

Satya

0 Kudos

Ok

So do you want to update the value, I've understood you want to change the dictionary field

In generally the FI document is created by FM AC_DOCUMENT_POST, here the BADI AC_DOCUMENT should be called:

MM transactions should use that function too

Max

0 Kudos

Hi Max,

I changed the value in runtime using debug mode. But the value are not changing.

Debug mode changes:

Output:

Thanks,

Satya

0 Kudos

Hi

It's not easy to change the amount of FI item, the data are prepared before calling AC_DOCUMENT_POST,

The fm AC_DOCUMENT_CREATE should be called in order to prepare the accounting data, so if you want to change something, you should do it here

Max

0 Kudos

I am not able to find out the BSEG data inside the FM. Please help me.

Thanks,

Satya

0 Kudos

Hi

The BSEG data are in ACCIT structure

Max

0 Kudos

Hi Max,

I want to change BSEG-WRBTR value but inside ACCIT i am not able to find out the field.

Could you please tell me which field I have to update that should update the BSEG-WRBTR value.

Thanks,

Satya

0 Kudos

Look at the methods of a BAdI like AC_DOCUMENT, e.g. method CHANGE_AFTER_CHECK, it handles a parameter type ACC_DOCUMENT, where you will find included the following structures: ACCHD header, ACCIT items, ACCCR amounts, etc. (it also carry a structure for field to change ACC_DOCUMENT_SUBST but much less fields, and no amount field at all)

Also don't expect any unbalanced document to be inserted into database (at least I hope so)

Good luck for next tax audit/fiscal control...

Regards,

Raymond

0 Kudos

Uhm

sorry, amount are in ACCCR structure, but ACCCR are not available in BADI AC_DOCUMENT, I mean the amount can't be replaced by substitution ,

But there's a chance, it'a a little dangerous, but you can try:

I mean the fm AC_DOCUMENT_CREATE and AC_DOCUMENT_POST  are always used if a FI document has to be posted out of FI module, so be carefull!

Anyway AC_DOCUMENT_CREATE and AC_DOCUMENT_POST  call a set of function module stored in table TRWPR, the sequence is defined by field SUBNO:

you can create a your own fm (in order to change the values you want),

the problem is the custom fm should be placed from 900 to 999, and you should place your fm in the first positions.

So you should create a fm having an interfaces like FI_DOCUMENT_CHECK, and store it in TRWPR for

- PROCESS = DOCUMENT

- EVENT       = CHECK

- SUBNO      = ?

As I've written above, I believe SUBNO should be lower number as possible, because the system save the data in the global variables and then it can be very hard to change the value:

you can try to SUBNO = 900 (It's in custom range) and if it doesn't works, try with 1 (it's in SAP range)

Here you can find out documentation:

RWIN Control Table TRWPR: Actual Documents in Cont - Release notes 45A - SAP Library

so as Raymond said.....good luck

Former Member
0 Kudos

Hi Satya,

  PLease check whether you can apply FI substitution to get your solution. The T_Code is GGB1 and you have to create your form routine at Accounting ITEM data.

Thanks,

Prakash

0 Kudos

I dont know about this. Could you please elaborate.

Thanks,

Satya

Former Member
0 Kudos

Substitution is basically FI exit form , where you can substitute some value at run time for different structure given in that pocess area like BKPF, BSEG , ANLA etc. You will get lost of document on this. Please search for FI substitution in SAP.

Thanks,

Prakash

Lakshmipathi
Active Contributor
0 Kudos

Can you explain what is the functional requirement based on which, you were trying?

0 Kudos

Hi Lakshmipathi,

Here I am creating one return order there the VPRS value I changed as per the invoice VPRS value, Earlier the VPRS value is taking from material master moving price. After that when we are doing PGR at that time we have to change the material document currency(MSEG-DMBTR) as well as the accounting document BSEG data.

If you want any other info please update.

Thanks,

Satya

0 Kudos

First have a look at this OSS note

  • Note 185225 - Currency translation for conditions with category G (VPRS)

If the above note does not serve the purpose, then you can have a look at this to achieve the desired result.

  • Note 1933844 - Use of USEREXIT_VPRS_UPDATE

G. Lakshmipathi

0 Kudos

I checked both the note and both the node are in status 'Cannot be implemented'. Please let me know what to do next.

Thanks,

Satya