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: 

BADI MRM_WT_SPLIT_UPDATE fail

0 Kudos

Hi guys.

I tryed use this BADI but it not work... I saw the notes:

http://service.sap.com/sap/support/notes/1286713

and

http://service.sap.com/sap/support/notes/1156325

but they cant help me too.

My problem is: I need to change the first "tax code" like below:

for that, I insert the code in BADI MRM_WT_SPLIT_UPDATE.


  DATA: ls_rbws TYPE LINE OF mrm_tab_rbws.
te_rbvs[]
= i_rbkpv-h_rbvs[].
te_rbws[]
= i_rbkpv-h_rbws[].

LOOP AT te_rbws INTO ls_rbws.
ls_rbws
-wt_withcd = 'I2'.
MODIFY te_rbws FROM ls_rbws.
EXIT. "change only first item
ENDLOOP.

after pass this BADI, the tax not change.

Please.. anyone can Help me?

1 ACCEPTED SOLUTION

0 Kudos

I find one solution, it's not the best, but save me.

I put a ENHANCEMENT point in FM FI_WT_READ_LFBW and append the table  x_lfbw with my tax.

if anyone give a better soluction, please, put here

below how i put my code:

IF sy-tcode = 'MIRO' OR

      sy-tcode = 'MR8M' OR

      sy-tcode = 'MIR7'

*Get memory fields

ASSIGN: ('(SAPLMR1M)DRSEG-EBELN')    TO <fs_d>,

              ('(SAPLMR1M)DRSEG-EBELN'TO <fs_i>.

[...put your code...]

LOOP AT t_imposto INTO v_imposto.

           t_lfbw2-lifnr = i_lifnr.

           t_lfbw2-bukrs = i_bukrs.

           t_lfbw2-witht = v_imposto-witht.

           t_lfbw2-wt_subjct = 'X'.

           t_lfbw2-wt_withcd = v_imposto-wt_withcd.

           APPEND x_lfbw2. CLEAR x_lfbw2.

ENDLOOP.

ENDIF

9 REPLIES 9

former_member182371
Active Contributor
0 Kudos

Hi,

have you posted the MIRO/MIR7/RBKP (MM) document?

have you checked the BKPF (FI) document?

Best regards.

0 Kudos

Pablo,

My case is a MIRO document.

It is happening in creation document in Miro. because that, the FI document doesnt was created yet

tks.

0 Kudos

Hi,

first of all:

Are you using extended withholding tax?

Next:

depending on your release the reasons can be different e.g.:

for 46C

325228 - MIRO: Remove old withholding tax structure RBWT

for SAP ERP 6.0 - SAPKH60606

1903563 - Withholding tax data is being updated incorrectly in FI after posting via MIRO

try this too:

LOOP AT te_rbws INTO ls_rbws.
ls_rbws
-wt_withcd = 'I2'.
MODIFY te_rbws FROM ls_rbws index sy-tabix.
EXIT. "change only first item
ENDLOOP

.

Best regards.

0 Kudos

Pablo,

I'm  using extended withholding tax. it´s a problem?

I tryed change my code like you said, but not works.

My release is 6.0, but this note not help me.

I tryed execute the miro again, and I saw one important thing... When I saved the document (MIRO) and the SAP created the FI document, my changes went to FI Document, but not at Miro, just in FI document.

But I need the MIRO change too.

I'm thinking I'm close to the solution...

maybe exists another BADI or EXIT that cam help me...

0 Kudos

Hi,

when you say

But I need the MIRO change too.

are you referring to any table in particular?

if so, which one?

RBKP, RSEG, RBCO, VBKPF, VBSEGK?

Best regards.

0 Kudos

I mean..

is not a table, is the screen that I put in the first topic:

it is a screen from MIRO.

0 Kudos

Hi,

yes but that data in the screen must be saved somewhere.

Anyway try this:

LOOP AT te_rbws INTO ls_rbws.
ls_rbws
-witht = 'I2'.
MODIFY te_rbws FROM ls_rbws index sy-tabix.
EXIT. "change only first item
ENDLOOP

              

Best regards.

0 Kudos

I tryed to change my code like you said, but not works.

I think this BADI doesnt works to MIRO transaction. only for FI documents..

0 Kudos

I find one solution, it's not the best, but save me.

I put a ENHANCEMENT point in FM FI_WT_READ_LFBW and append the table  x_lfbw with my tax.

if anyone give a better soluction, please, put here

below how i put my code:

IF sy-tcode = 'MIRO' OR

      sy-tcode = 'MR8M' OR

      sy-tcode = 'MIR7'

*Get memory fields

ASSIGN: ('(SAPLMR1M)DRSEG-EBELN')    TO <fs_d>,

              ('(SAPLMR1M)DRSEG-EBELN'TO <fs_i>.

[...put your code...]

LOOP AT t_imposto INTO v_imposto.

           t_lfbw2-lifnr = i_lifnr.

           t_lfbw2-bukrs = i_bukrs.

           t_lfbw2-witht = v_imposto-witht.

           t_lfbw2-wt_subjct = 'X'.

           t_lfbw2-wt_withcd = v_imposto-wt_withcd.

           APPEND x_lfbw2. CLEAR x_lfbw2.

ENDLOOP.

ENDIF