<?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 Call Bapi -  'BAPI_MESSAGE_GETDETAIL' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-bapi-message-getdetail/m-p/1729967#M317885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem when I want to call de BAPI 'BAPI_MESSAGE_GETDETAIL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table it_idoc with the necesary fields for the bapi. but I want to put the result of the bapi in the field i_idoc - message for every case in the it_idoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have any idea how I can write the message on the field idoc-message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at it_idoc.&lt;/P&gt;&lt;P&gt;      read table it_bapi with key docnum = it_idoc-docnum.&lt;/P&gt;&lt;P&gt;        move-corresponding it_bapi to it_idoc.&lt;/P&gt;&lt;P&gt;        modify it_idoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL' destination 'NONE'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          ID                = it_idoc-stamid&lt;/P&gt;&lt;P&gt;          NUMBER           = it_idoc-stamno&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        LANGUAGE          = SY-LANGU&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          TEXTFORMAT        = 'ASC'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        LINKPATTERN       =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         MESSAGE_V1        = it_idoc-stapa1&lt;/P&gt;&lt;P&gt;         MESSAGE_V2        = it_idoc-stapa2&lt;/P&gt;&lt;P&gt;         MESSAGE_V3        = it_idoc-stapa3&lt;/P&gt;&lt;P&gt;         MESSAGE_V4        = it_idoc-stapa4&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          MESSAGE           = &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           RETURN            =  ?????????&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        TEXT              =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  modify it_idoc.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Dec 2006 12:15:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-18T12:15:48Z</dc:date>
    <item>
      <title>Call Bapi -  'BAPI_MESSAGE_GETDETAIL'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-bapi-message-getdetail/m-p/1729967#M317885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem when I want to call de BAPI 'BAPI_MESSAGE_GETDETAIL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table it_idoc with the necesary fields for the bapi. but I want to put the result of the bapi in the field i_idoc - message for every case in the it_idoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have any idea how I can write the message on the field idoc-message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at it_idoc.&lt;/P&gt;&lt;P&gt;      read table it_bapi with key docnum = it_idoc-docnum.&lt;/P&gt;&lt;P&gt;        move-corresponding it_bapi to it_idoc.&lt;/P&gt;&lt;P&gt;        modify it_idoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL' destination 'NONE'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          ID                = it_idoc-stamid&lt;/P&gt;&lt;P&gt;          NUMBER           = it_idoc-stamno&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        LANGUAGE          = SY-LANGU&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          TEXTFORMAT        = 'ASC'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        LINKPATTERN       =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         MESSAGE_V1        = it_idoc-stapa1&lt;/P&gt;&lt;P&gt;         MESSAGE_V2        = it_idoc-stapa2&lt;/P&gt;&lt;P&gt;         MESSAGE_V3        = it_idoc-stapa3&lt;/P&gt;&lt;P&gt;         MESSAGE_V4        = it_idoc-stapa4&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          MESSAGE           = &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           RETURN            =  ?????????&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        TEXT              =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  modify it_idoc.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 12:15:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-bapi-message-getdetail/m-p/1729967#M317885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T12:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Call Bapi -  'BAPI_MESSAGE_GETDETAIL'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-bapi-message-getdetail/m-p/1729968#M317886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI returns the message in its entirety in parameter &amp;lt;b&amp;gt;MESSAGE&amp;lt;/b&amp;gt; (220 Char). The long text, if available, is return line by line in the TABLES parameter &amp;lt;b&amp;gt;TEXT&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter &amp;lt;b&amp;gt;RETURN&amp;lt;/b&amp;gt; puts the individual parts of the message together in the standard structure BAPIRET2 (Note: RETURN-MESSAGE = MESSAGE parameter).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: 
  ld_idx     TYPE i,
  ld_msg   TYPE bapi_msg,
  ls_idoc   LIKE LINE OF it_idoc.

LOOP AT it_idoc INTO ls_idoc.
  ld_idx = syst-tabix.

* Call the BAPI 
ALL FUNCTION 'BAPI_MESSAGE_GETDETAIL' 
EXPORTING
ID = ls_doc-stamid
NUMBER = ls_idoc-stamno
* LANGUAGE = SY-LANGU
TEXTFORMAT = 'ASC'
* LINKPATTERN =
MESSAGE_V1 = ls_idoc-stapa1
MESSAGE_V2 = ls_idoc-stapa2
MESSAGE_V3 = ls_idoc-stapa3
MESSAGE_V4 = ls_idoc-stapa4
IMPORTING
  MESSAGE = ld_msg.

  ls_idoc-message = ld_msg.  " if types are not compatible
 
  MODIFY it_idoc FROM ls_idoc INDEX ld_idx
    TRANSPORTING message.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 12:34:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-bapi-bapi-message-getdetail/m-p/1729968#M317886</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-12-18T12:34:05Z</dc:date>
    </item>
  </channel>
</rss>

