Application Development and Automation 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: 
Read only

MIRO field modification

Former Member
0 Likes
1,546

Hi Experts,

I'm trying to change W/tax code on MIRO via EXIT_SAPLMRMP_010 user exit, with the follow code:

field-symbols: <fs> TYPE STANDARD TABLE.

assign ('(SAPLFWTD)XWITH[]') to <fs>.

loop at <fs> into x_with.

case x_with-witht.

when 'IV' or 'IW' or 'IX' or 'IY'.

case x_with-wt_withcd.

when '01'.

if abs( rmwwr ) ge 10000.

x_with-wt_withcd = '04'. <---- THIS VALUE MUST BE CHANGED!

modify <fs> from x_with.

message w027(zm).

else.

  • No action.

endif.

when others.

  • No action.

endcase.

when others.

  • No action.

endcase.

clear t_withcd.

move x_with-wt_withcd to t_withcd-withcd.

append t_withcd.

endloop.

However after save, the tax remains the same.

Any idea?

Michel Khouri

9 REPLIES 9
Read only

Former Member
0 Likes
1,276

Try using the BADI: MRM_WT_SPLIT_UPDATE

Update the Wtax code in the table TE_RBWS.

Read only

0 Likes
1,276

Hi sam!

Since you gave me the BAdi for my request I don't get to implement it. This is the firts time I'm working with BAdi, so I would be very glad if you could guide me on that.

I have created the implementation called Z_MIRO_TAX and the code written in IF_EX_MRM_WT_SPLIT_UPDATE~WHTAX_SPLIT_UPDATE method is:

data: teste like i_rbkpv,

teste1 like ti_drseg,

teste3 like TE_RBWS,

teste4 like TE_RBVS.

data exit type ref to if_ex_mrm_wt_split_update.

call method cl_exithandler=>get_instance

changing

instance = exit.

move '04' to TE_RBWS-WT_WITHCD.

call method exit->WHTAX_SPLIT_UPDATE

exporting i_rbkpv = teste

ti_drseg = teste1

importing

TE_RBWS = teste3

TE_RBVS = teste4.

Where I'm getting mistake?

Thanks

Michel

Read only

0 Likes
1,276

Try this code in the method:

LOOP AT TE_RBWS.

TE_RBWS-WT_WITHCD = ' 04'.

MODIFY TE_RBWS TRANSPORTING WT_WITHCD.

ENDLOOP.

This should update the table RBWS. No need to have any other code.

Reward points if helpful.

Read only

0 Likes
1,276

Sam,

It's returning the follow message when I try to compile the code you sent me:

Classe ZCL_IM__MIRO_TAX,Método IF_EX_MRM_WT_SPLIT_UPDATE~WHTAX_SPLIT_UPDATE

At "LOOP AT itab" one of the additions "INTO", "ASSIGNING" or

"TRANSPORTING NO FIELDS" is required in the OO context.

Another tip?

The points are already yours! 😃

Read only

0 Likes
1,276

DATA: W_RBWS TYPE RBWS.

LOOP AT TE_RBWS into W_RBWS.

W_RBWS-WT_WITHCD = ' 04'.

MODIFY TE_RBWS FROM W_RBWS INDEX SY-TABIX.

ENDLOOP.

If the internal table TE_RBWS is initial. You can add entries into this table.

IF TE_RBWS[] IS INITIAL.

SELECT LIFNR BUKRS WITHT WT_WITHCD WT_EXNR

FROM LFBW INTO TABLE T_LFBW

WHERE BUKRS = I_RBKPV-BUKRS

AND LIFNR = I_RBKPV-LIFNR.

LOOP AT T_LFBW INTO W_LFBW.

  • W_RBWS-WT_QSSHB = 0.

W_RBWS-WITHT = W_LFBW-WITHT.

W_RBWS-WT_WITHCD = '04'.

W_RBWS-ZZWT_EXNR = W_LFBW-WT_EXNR.

INSERT W_RBWS INTO TABLE TE_RBWS.

ENDLOOP.

ENDIF.

Read only

0 Likes
1,276

Hi Sam,

The code above looks fine, but after the BAdi routine, SAP comes and overlaps with the original the tax codes.

Is it settings "issue"?

Read only

0 Likes
1,276

Hi,

I need delete one record of Tax, I using METHOD if_ex_mrm_wt_split_update~whtax_split_update.

see the code.

DATA: w_drseg TYPE LINE OF mmcr_tdrseg.

DATA: w_rbws TYPE rbws.

DATA: t_lfbw TYPE TABLE OF lfbw.

DATA: w_lfbw TYPE lfbw.

DATA: ti_h_rbws LIKE i_rbkpv-h_rbws.

READ TABLE ti_drseg INTO w_drseg INDEX 1.

IF w_drseg-werks NE '6010'.

DESCRIBE TABLE i_rbkpv-h_rbws LINES sy-lilli.

IF sy-lilli > 0.

IF te_rbws[] IS INITIAL.

SELECT *

FROM lfbw INTO TABLE t_lfbw

WHERE bukrs = i_rbkpv-bukrs

AND lifnr = i_rbkpv-lifnr.

LOOP AT t_lfbw INTO w_lfbw.

IF W_LFBW-WITHT NE 'I1'.

w_rbws-wt_qsshb = 0.

w_rbws-witht = w_lfbw-witht.

w_rbws-wt_withcd = w_lfbw-witht.

INSERT w_rbws INTO TABLE te_rbws.

ENDIF.

ENDLOOP.

DELETE i_rbkpv-h_rbws WHERE witht EQ 'I1'.

ENDIF.

this code delete record, but then out method, the record is not deteted.

I need help.

PD: sorry my english is not good

tks.

Read only

0 Likes
1,276

Hi, I have the same problem. After BADI MRM_WT_SPLIT_BY_ISO call, SAP chenges my records.

How you solved your problem ?

Read only

Former Member
0 Likes
1,276

Transaction Code - MIRO Enter Incoming Invoice

Exit Name Description

LMR1M001 User exits in Logistics Invoice Verification

LMR1M002 Account grouping for GR/IR account maintenance

LMR1M003 Number assignment in Logistics Invoice Verification

LMR1M004 Logistics Invoice Verification: item text for follow-on docs

LMR1M005 Logistics Inv. Verification: Release Parked Doc. for Posting

LMR1M006 Logistics Invoice Verification: Process XML Invoice

MRMH0001 Logistics Invoice Verification: ERS procedure

MRMH0002 Logistics Invoice Verification: EDI inbound

MRMH0003 Logistics Invoice Verification: Revaluation/RAP

MRMN0001 Message output and creation: Logistics Invoice Verification

No of Exits: 10

USER EXIT

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

http://www.sapgenie.com/abap/code/abap26.htm

http://www.sap-img.com/abap/what-is-user-exits.htm

http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

http://www.easymarketplace.de/userexit.php

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

http://www.sappoint.com/abap/userexit.pdfUser-Exit

http://www.sap-img.com/ab038.htm

http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm

USER EXIT

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

http://www.sap-img.com/abap/what-is-user-exits.htm

http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html

Rewards if useful.........

Minal