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: 

Change the Tax Code in Tcode - MIRO

0 Kudos

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

Former Member

Hi ABAP SCN,

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

Regards.

11 REPLIES 11

former_member198275
Active Contributor
0 Kudos

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

0 Kudos

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.

0 Kudos

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.

0 Kudos

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

0 Kudos

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.

Shubham1
Employee
Employee
0 Kudos

Hi

SAP Note 395973 reference would be useful.

Shubham

former_member194965
Active Participant
0 Kudos

Hi,

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

Regards,

E.Ananthachari

former_member182371
Active Contributor
0 Kudos

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

Former Member

Hi ABAP SCN,

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

Regards.

0 Kudos

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


0 Kudos

Thanks!

That works!