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 FI doc.type for Credit Memo in MIRO

Former Member
0 Kudos

Hi everyone,

I'm trying to change document type (BLART) in FI document created through MIRO when a Credit Memo is made.

I'm using method HEADER_DEFAULT_SET of BADI ZMRM_HEADER_DEFAULT but nothing changes. This is my code:

   FIELD-SYMBOLS: <fs_rbkpv> TYPE mrm_rbkpv.

   DATA: c_rbkpv(15) TYPE c VALUE '(SAPLMR1M)RBKPV'.

   CASE sy-tcode.

     WHEN 'MIR7' OR 'MIRO'.

       ASSIGN (c_rbkpv) TO <fs_rbkpv>.

       <fs_rbkpv>-blart = 'KG'.

   ENDCASE.


Any advice?


Thanks a lot!

1 ACCEPTED SOLUTION

Former Member

Done!

I used method CHANGE_INITIAL of BADI - AC_DOCUMENT. Add this code:

   FIELD-SYMBOLS: <fs_rbkpv>  TYPE mrm_rbkpv,

                               <fs_xaccit> TYPE accit_t,

                               <fs_accit>  TYPE accit.

   DATA: lv_rbkpv TYPE char18 VALUE '(SAPLMRMP)RBKPV',

             lv_xaccit TYPE char18 VALUE '(SAPLMRMP)XACCIT[]'.

   ASSIGN (lv_rbkpv) TO <fs_rbkpv>.

   ASSIGN (lv_xaccit) TO <fs_xaccit>.

   CHECK sy-tcode EQ 'MIRO'.

   IF <fs_rbkpv>-xrech = space AND <fs_rbkpv>-tbtkz = space.

     LOOP AT <fs_xaccit> ASSIGNING <fs_accit>.

       <fs_accit>-blart = 'KG'.

     ENDLOOP.

   ENDIF.


This post was really helpful to indentify if the MIRO transaction is a Credit Memo:


3 REPLIES 3

Former Member
0 Kudos

Hello,

Did you try substitutions?. In the system parameters SYST-TCODE can be used but I am not sure how you will catch credit memo indicator.

Best regards

0 Kudos

I tried that too, but it is not possible to get credit memo indicator as you say. At least, I couldn't do it.

Former Member

Done!

I used method CHANGE_INITIAL of BADI - AC_DOCUMENT. Add this code:

   FIELD-SYMBOLS: <fs_rbkpv>  TYPE mrm_rbkpv,

                               <fs_xaccit> TYPE accit_t,

                               <fs_accit>  TYPE accit.

   DATA: lv_rbkpv TYPE char18 VALUE '(SAPLMRMP)RBKPV',

             lv_xaccit TYPE char18 VALUE '(SAPLMRMP)XACCIT[]'.

   ASSIGN (lv_rbkpv) TO <fs_rbkpv>.

   ASSIGN (lv_xaccit) TO <fs_xaccit>.

   CHECK sy-tcode EQ 'MIRO'.

   IF <fs_rbkpv>-xrech = space AND <fs_rbkpv>-tbtkz = space.

     LOOP AT <fs_xaccit> ASSIGNING <fs_accit>.

       <fs_accit>-blart = 'KG'.

     ENDLOOP.

   ENDIF.


This post was really helpful to indentify if the MIRO transaction is a Credit Memo: