‎2007 Nov 22 5:06 PM
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.
‎2007 Nov 22 5: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
‎2007 Nov 22 5: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