<?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 Get header texts when creating SD invoice in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-header-texts-when-creating-sd-invoice/m-p/8201343#M1626307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to know if is it possible to get the header text when creating an invoice to do some validations and checks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is a structure or some way to get them on a requirement routine for message determination or from the invoice user exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://img40.imageshack.us/img40/615/dibujoaiw.png]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already know you can get those texts from function READ_TEXT or from table STXH once the document is created, but i want to get them when creating and I don't have the document number yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Aug 2011 08:19:55 GMT</pubDate>
    <dc:creator>marcelogb</dc:creator>
    <dc:date>2011-08-19T08:19:55Z</dc:date>
    <item>
      <title>Get header texts when creating SD invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-header-texts-when-creating-sd-invoice/m-p/8201343#M1626307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to know if is it possible to get the header text when creating an invoice to do some validations and checks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is a structure or some way to get them on a requirement routine for message determination or from the invoice user exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://img40.imageshack.us/img40/615/dibujoaiw.png]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already know you can get those texts from function READ_TEXT or from table STXH once the document is created, but i want to get them when creating and I don't have the document number yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 08:19:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-header-texts-when-creating-sd-invoice/m-p/8201343#M1626307</guid>
      <dc:creator>marcelogb</dc:creator>
      <dc:date>2011-08-19T08:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Get header texts when creating SD invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-header-texts-when-creating-sd-invoice/m-p/8201344#M1626308</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;READ_TEXT should work fine, but try to transfer XXXXXXXXXX as name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 08:46:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-header-texts-when-creating-sd-invoice/m-p/8201344#M1626308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-19T08:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get header texts when creating SD invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-header-texts-when-creating-sd-invoice/m-p/8201345#M1626309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for answering.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been making some tests and it works if using the temporal ID in the field &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;NAME&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;. For example: '&amp;amp;000000001'. (this is just needed when creating, if not you can get the NAME from &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;komkbv3-vbeln&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Seems like the text values are selected from the buffer on creating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As this ID is asigned depending on the number of documents you are processing at once, you gotta know it for each document. To do this, you can use the global variable &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MSG_OBJKY&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; which has the temp ID for each document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So as a resume you will have something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   IF sy-tcode = 'VF03' OR sy-tcode = 'VF02'.
      va_tdname = komkbv3-vbeln.
   ELSE.
     va_tdname = MSG_OBJKY'.
   ENDIF.

  CALL FUNCTION 'READ_TEXT'
  EXPORTING
    ID                            = ID
    LANGUAGE                      = LANGUAGE
    name                          = va_tdname
    object                        = 'VBBK'
  TABLES
    LINES                         = it_tdline
  EXCEPTIONS
    ID                            = 1
    LANGUAGE                      = 2
    name                          = 3
    not_found                     = 4
    object                        = 5
    reference_check               = 6
    wrong_access_to_archive       = 7
    OTHERS                        = 8. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 11:40:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-header-texts-when-creating-sd-invoice/m-p/8201345#M1626309</guid>
      <dc:creator>marcelogb</dc:creator>
      <dc:date>2011-08-19T11:40:52Z</dc:date>
    </item>
  </channel>
</rss>

