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

Assign Reference Field at runtime Tx: MIRO

Hi,

I'm trying to set in the field BKPF-XBLNR the number of the document created by MIRO.

I made a debug and I notice that there is a structure called BKPF which contains all the information about the document. I manually set the field with some text before the end of the transaction and it works OK.

I found the BADI INVOICE_UPDATE which contains as a paremeter the number of the new invoice and I tried the following code:

  IF sy-tcode = 'MIRO'.
    break jchavez.

    FIELD-SYMBOLS: <fs> TYPE ANY.

    ASSIGN ('(SAPLFDCB)BKPF-XBLNR') TO <fs>.

    IF sy-subrc = 0.
      <fs> = s_rbkp_new-belnr.
    ENDIF.
  ENDIF.

And it works fine, when I continued the debugging I can see the value in the structure but in some part of the program the value is deleted.

Have you ever tried to do something similar?

I have tried with Substitution Exits (OBBH) but it doesn't work =(

Thanx in advanced.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Nov 22, 2007 at 05:30 PM

    Hi,

    Please try this.

    IF sy-tcode = 'MIRO'.
      break jchavez.
     
      FIELD-SYMBOLS: <fs> TYPE ANY.
     
      ASSIGN ('(SAPLFDCB)BKPF-XBLNR') TO <fs>.
     
      IF sy-subrc = 0.
        <fs> = s_rbkp_new-belnr.
      ENDIF.
       
      UNASSIGN <fs>.                       "Add here
    ENDIF.
    

    Regards,

    Ferry Lianto

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 22, 2007 at 05:31 PM

    Sometimes SAP store the original contents of the field before the user exit call, and then, except for the ones they allow you to change, they set them back. So no matter what you do in the exit, the values are always reset.

    matt

    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.