<?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: Document Number after Post !! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/document-number-after-post/m-p/1673423#M297385</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;You can also code something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;...
clear i_msgtab.
refresh i_msgtab.
call transaction 'VA02' using    bdcdata
                        mode     p_mode
                        update   'S'
                        messages into i_msgtab.

if sy-subrc &amp;lt;&amp;gt; 0.
*Process and display error messages
  loop at i_msgtab.
    clear t100.
    select single * from t100 
    where sprsl = i_msgtab-msgspra and
          arbgb = i_msgtab-msgid   and
          msgnr = i_msgtab-msgnr.
    perform process_message using t100-text.
  endloop.
  skip.
endif.

form process_message using p_message.
  data: l_message(480).

  if sy-subrc = 0.
    l_message = p_message.
    if l_message cs '&amp;amp;1'.
      replace '&amp;amp;1' with i_msgtab-msgv1 into l_message.
      replace '&amp;amp;2' with i_msgtab-msgv2 into l_message.
      replace '&amp;amp;3' with i_msgtab-msgv3 into l_message.
      replace '&amp;amp;4' with i_msgtab-msgv4 into l_message.
    else.
      replace '&amp;amp;' with i_msgtab-msgv1 into l_message.
      replace '&amp;amp;' with i_msgtab-msgv2 into l_message.
      replace '&amp;amp;' with i_msgtab-msgv3 into l_message.
      replace '&amp;amp;' with i_msgtab-msgv4 into l_message.
    endif.
    condense l_message.
    write: /2 i_msgtab-msgtyp, l_message(250).
  else.
    write: /2 i_msgtab.
  endif.

endform.                    " process_message&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&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>Tue, 31 Oct 2006 20:11:50 GMT</pubDate>
    <dc:creator>ferry_lianto</dc:creator>
    <dc:date>2006-10-31T20:11:50Z</dc:date>
    <item>
      <title>Document Number after Post !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/document-number-after-post/m-p/1673421#M297383</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 am using Call Transaction in BDC . &lt;/P&gt;&lt;P&gt;After Posting the document , the system generates an Accounting Document Number ..how can i get that document number after the call transaction call ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2006 19:59:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/document-number-after-post/m-p/1673421#M297383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-31T19:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Document Number after Post !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/document-number-after-post/m-p/1673422#M297384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, this is pretty simple, use the MESSAGES INTO MESSTAB extension of the CALL TRANSACTION statement,  your document number will be there in one  of the messages.  All you need to do is read the MESSTAB table and get it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; For example, here is a small example from one of my programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;




data: messtab like bdcmsgcoll occurs 0 with header line.

  call transaction 'CO40' using bdcdata mode mode
                                        update 'S'
                              &amp;lt;b&amp;gt;messages into messtab.&amp;lt;/b&amp;gt;

* This is the success message, the production order 
* number is in the &amp;lt;b&amp;gt; MSGV1 field of MESSTAB&amp;lt;/b&amp;gt;
  read table messtab with key msgid = 'CO'
                              msgnr = '100'.
   if sy-subrc = 0.
        &amp;lt;b&amp;gt;write:/ messtab-MSGV1.&amp;lt;/b&amp;gt;
   endif.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2006 20:01:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/document-number-after-post/m-p/1673422#M297384</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-31T20:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Document Number after Post !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/document-number-after-post/m-p/1673423#M297385</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;You can also code something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;...
clear i_msgtab.
refresh i_msgtab.
call transaction 'VA02' using    bdcdata
                        mode     p_mode
                        update   'S'
                        messages into i_msgtab.

if sy-subrc &amp;lt;&amp;gt; 0.
*Process and display error messages
  loop at i_msgtab.
    clear t100.
    select single * from t100 
    where sprsl = i_msgtab-msgspra and
          arbgb = i_msgtab-msgid   and
          msgnr = i_msgtab-msgnr.
    perform process_message using t100-text.
  endloop.
  skip.
endif.

form process_message using p_message.
  data: l_message(480).

  if sy-subrc = 0.
    l_message = p_message.
    if l_message cs '&amp;amp;1'.
      replace '&amp;amp;1' with i_msgtab-msgv1 into l_message.
      replace '&amp;amp;2' with i_msgtab-msgv2 into l_message.
      replace '&amp;amp;3' with i_msgtab-msgv3 into l_message.
      replace '&amp;amp;4' with i_msgtab-msgv4 into l_message.
    else.
      replace '&amp;amp;' with i_msgtab-msgv1 into l_message.
      replace '&amp;amp;' with i_msgtab-msgv2 into l_message.
      replace '&amp;amp;' with i_msgtab-msgv3 into l_message.
      replace '&amp;amp;' with i_msgtab-msgv4 into l_message.
    endif.
    condense l_message.
    write: /2 i_msgtab-msgtyp, l_message(250).
  else.
    write: /2 i_msgtab.
  endif.

endform.                    " process_message&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&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>Tue, 31 Oct 2006 20:11:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/document-number-after-post/m-p/1673423#M297385</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-10-31T20:11:50Z</dc:date>
    </item>
  </channel>
</rss>

