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

Change the Tax Code in Tcode - MIRO

Former Member
0 Likes
5,131

Hi All,

I need to change the tax code in the MIRO screen(Please see the attached image). I have created an implementation for the BADI 'MRM_HEADER_CHECK'. I programmed as below to change the tax code.

Note: I will change the tax code depending upon the custom values which we get, I just used VN for the test purpose.


method IF_EX_MRM_HEADER_CHECK~HEADERDATA_CHECK.

   FIELD-SYMBOLS <ls_drseg> LIKE LINE OF ti_drseg[].

   LOOP AT ti_drseg ASSIGNING <ls_drseg>.

    <ls_drseg>-mwskz = 'VN'.

   ENDLOOP.

endmethod.

But the tax code value is not changing. Is there any way to change the tax code? Please let me know.

Thanks in advance,

Kind Regards,

Venkat

1 ACCEPTED SOLUTION
Read only

Former Member
4,199

Hi ABAP SCN,

Have you solved your problem?. I need to do the same.

Regards.

Hi All,

I need to change the tax code in the MIRO screen(Please see the attached image). I have created an implementation for the BADI 'MRM_HEADER_CHECK'. I programmed as below to change the tax code.

Note: I will change the tax code depending upon the custom values which we get, I just used VN for the test purpose.


method IF_EX_MRM_HEADER_CHECK~HEADERDATA_CHECK.

   FIELD-SYMBOLS <ls_drseg> LIKE LINE OF ti_drseg[].

   LOOP AT ti_drseg ASSIGNING <ls_drseg>.

    <ls_drseg>-mwskz = 'VN'.

   ENDLOOP.

endmethod.

But the tax code value is not changing. Is there any way to change the tax code? Please let me know.

Thanks in advance,

Kind Regards,

Venkat

11 REPLIES 11
Read only

Former Member
0 Likes
4,199

Hi,

In the method, TI_DRSEG is importing parameter hence change will not be effective until you have changing or exporting parameters in method parameters.

You can search for other options..

Read only

0 Likes
4,199

Hi Kaushik,

Thanks for the reply, i have changed the code as below now. I am using constants and field symbol.


method IF_EX_MRM_HEADER_CHECK~HEADERDATA_CHECK.

   DATA: lv_name(30) TYPE c VALUE '(SAPLMR1M)DRSEG'.

   FIELD-SYMBOLS <fs_drseg> TYPE drseg.

   ASSIGN (lv_name) to <fs_drseg>.

   IF <fs_drseg> IS ASSIGNED.

     <fs_drseg>-mwskz = 'VN'.

   ENDIF.

endmethod.

But still the value is not changing. Please let me know how to solve this problem.

Thanks in advance,

KR,

Venkat.

Read only

0 Likes
4,199

Hi Kaushik,

Thanks for the reply, i have changed the code as below now. I am using constants and field symbol.

  1. method IF_EX_MRM_HEADER_CHECK~HEADERDATA_CHECK. 
  2.    DATA: lv_name(30) TYPE c VALUE '(SAPLMR1M)DRSEG'
  3.    FIELD-SYMBOLS <fs_drseg> TYPE drseg. 
  4.    ASSIGN (lv_name) to <fs_drseg>. 
  5.    IF <fs_drseg> IS ASSIGNED. 
  6.      <fs_drseg>-mwskz = 'VN'
  7.    ENDIF. 
  8. endmethod. 

But still the value is not changing. Please let me know how to solve this problem.

Thanks in advance,

KR,

Venkat.

Read only

0 Likes
4,199

Hi ,

The BADI you are using is only for Additional Checks of the Document Header Data not for changing the values.

Please check alternate.

Regards

Raj

Read only

0 Likes
4,199

Like I said, this method is not to change any value ( all parameters are importing) , you can change the value in the method , but when control goes back to main code , you cant see any change value. To change any value method should have changing or exporting parameters.

Hence search for another BADi which allows to change parameters.

Read only

Shubham_Srivastava1
Product and Topic Expert
Product and Topic Expert
0 Likes
4,199

Hi

SAP Note 395973 reference would be useful.

Shubham

Read only

Former Member
0 Likes
4,199

Hi,

Try this badi MRM_WT_SPLIT_UPDATE(BAdI for Changing Withholding Tax and Amount Split).

Regards,

E.Ananthachari

Read only

former_member182371
Active Contributor
0 Likes
4,199

Hi,

shouldn´t that be a customizing issue rather than development one?

Why can´t that be done via SPRO?

i don´t get it...

Please read this oss note:

904652 - MIRO: Different from FB60

Best regards,

Pablo

Read only

Former Member
4,200

Hi ABAP SCN,

Have you solved your problem?. I need to do the same.

Regards.

Read only

0 Likes
4,199

Hi David,

Try the BAdI  'MRM_HEADER_CHECK'.


METHOD if_ex_mrm_header_check~headerdata_check.

DATA: lv_drseg(30) TYPE c VALUE '(SAPLMR1M)YDRSEG[]'.

DATA: ls_drseg TYPE LINE OF mmcr_tdrseg.

FIELD-SYMBOLS: <fs_drseg> TYPE mmcr_tdrseg.

ASSIGN (lv_drseg) TO <fs_drseg>.

IF <fs_drseg> IS ASSIGNED.

   LOOP AT <fs_drseg> INTO ls_drseg.

     ls_drseg-mwskz = 'VN'.

     MODIFY <fs_drseg> FROM ls_drseg INDEX sy-tabix.

   ENDLOOP.

ENDIF.

.ENDMETHOD.

KR


Read only

0 Likes
4,199

Thanks!

That works!