Skip to Content
author's profile photo Former Member
Former Member

Change FI doc.type for Credit Memo in MIRO

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!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 29, 2016 at 01:56 PM

    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:


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 28, 2016 at 02:53 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.