Skip to Content
avatar image
Former Member

Substitution in MIRO

Hi experts,

I am working on this substitution that aims to substitute the bseg-sgtxt to rbkp-sgtxt.

I add a line-item substitution using TCode OBBH and then in program ZRGGBS00 I build up a exit. It all works well, but when I use MIRO and debug I find that there is no data in table BSEG and BKPF.

Down below is the code I use in the exit. The table BSEG and BKPF is almost totally blank. bkpf-awkey is pretty weird, it only contains the gjahr like this: ' 2017'. And bseg-belnr is like this: '$ 1'.

Could anyone please tell me what the hell is wrong with this? Any help will be appreciated. Thanks!

  CHECK sy-tcode = 'MIRO' AND bseg-hkont = '0022211001'.

  IF bkpf-awkey IS NOT INITIAL.

    i_belnr = bkpf-awkey+0(10).

    i_gjahr = bkpf-awkey+10(4).

    SELECT SINGLE sgtxt INTO i_text

           FROM rbkp

           WHERE belnr = i_belnr

             AND gjahr = i_gjahr.

    IF i_text NE space.

      bseg-sgtxt = i_text.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 26, 2017 at 10:08 AM

    At which level did you set the substitution? In either case, the database will not yet be committed so do not read invoice from database.

    You could export some data in a MIRO BAdI like INVOICE_UPDATE and then import it in the substitution exit (or some implementation of a BAdI like AC_DOCUMENT).

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 26, 2017 at 09:27 AM


    what about BTE SAMPLE_PROCESS_00001120?

    Best regards,


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Pablo, tried your advice but finally solved the problem with Raymond's advice.

      BTE seems don't work very well in this case's situation, but still, thank you very much!