<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Assign Reference Field at runtime Tx: MIRO in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-reference-field-at-runtime-tx-miro/m-p/3086179#M731927</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF sy-tcode = 'MIRO'.
  break jchavez.
 
  FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY.
 
  ASSIGN ('(SAPLFDCB)BKPF-XBLNR') TO &amp;lt;fs&amp;gt;.
 
  IF sy-subrc = 0.
    &amp;lt;fs&amp;gt; = s_rbkp_new-belnr.
  ENDIF.
   
  UNASSIGN &amp;lt;fs&amp;gt;.                       "Add here
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Nov 2007 17:30:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-22T17:30:58Z</dc:date>
    <item>
      <title>Assign Reference Field at runtime Tx: MIRO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-reference-field-at-runtime-tx-miro/m-p/3086178#M731926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to set in the field BKPF-XBLNR the number of the document created by MIRO.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the BADI INVOICE_UPDATE which contains as a paremeter the number of the new invoice and I tried the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  IF sy-tcode = 'MIRO'.
    break jchavez.

    FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY.

    ASSIGN ('(SAPLFDCB)BKPF-XBLNR') TO &amp;lt;fs&amp;gt;.

    IF sy-subrc = 0.
      &amp;lt;fs&amp;gt; = s_rbkp_new-belnr.
    ENDIF.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you ever tried to do something similar?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried with Substitution Exits (OBBH) but it doesn't work =(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advanced.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Nov 2007 17:06:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-reference-field-at-runtime-tx-miro/m-p/3086178#M731926</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-22T17:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Assign Reference Field at runtime Tx: MIRO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-reference-field-at-runtime-tx-miro/m-p/3086179#M731927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF sy-tcode = 'MIRO'.
  break jchavez.
 
  FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY.
 
  ASSIGN ('(SAPLFDCB)BKPF-XBLNR') TO &amp;lt;fs&amp;gt;.
 
  IF sy-subrc = 0.
    &amp;lt;fs&amp;gt; = s_rbkp_new-belnr.
  ENDIF.
   
  UNASSIGN &amp;lt;fs&amp;gt;.                       "Add here
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Nov 2007 17:30:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-reference-field-at-runtime-tx-miro/m-p/3086179#M731927</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-22T17:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Assign Reference Field at runtime Tx: MIRO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-reference-field-at-runtime-tx-miro/m-p/3086180#M731928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Nov 2007 17:31:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-reference-field-at-runtime-tx-miro/m-p/3086180#M731928</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2007-11-22T17:31:35Z</dc:date>
    </item>
  </channel>
</rss>

