<?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: Validating if ZDocument has attachments in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-if-zdocument-has-attachments/m-p/5699075#M1294622</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;try this way to get the attachment avaialble for the object..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 SELECT * FROM sww_contob
             WHERE  objtype     = 'ZBUS2032'       "your business object
             AND    objkey      = wa_vbak-vbeln.     "and the object key..
SELECT * FROM swwwihead WHERE wi_id      EQ sww_contob-wi_id.
  if        swwwihead- NOTE_COUNT    ge 0.
    "it contains attachments for theObject ..
 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;Prabhduas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2009 12:41:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-28T12:41:21Z</dc:date>
    <item>
      <title>Validating if ZDocument has attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-if-zdocument-has-attachments/m-p/5699074#M1294621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using functions SWU_OBJECT_PUBLISH and SWU_OBJECT_REFRESH, using an object key concatenation of ZDOCUMENT-ID + ZDOCUMENT-YEAR + ZDOCUMENT+BUKRS.&lt;/P&gt;&lt;P&gt;This means that i allready created in my Z table that document, and those functions are uses to toggle between showing in the upper left corner the standard button for options in attaching documents to my rows of the ZDOCUMENT table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything works fine, but i also wanted to verify in runtime, internally, if some object allready has attachments. Is there another function to do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                  Thank you all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                    Santi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 12:34:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-if-zdocument-has-attachments/m-p/5699074#M1294621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-28T12:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Validating if ZDocument has attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-if-zdocument-has-attachments/m-p/5699075#M1294622</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;try this way to get the attachment avaialble for the object..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 SELECT * FROM sww_contob
             WHERE  objtype     = 'ZBUS2032'       "your business object
             AND    objkey      = wa_vbak-vbeln.     "and the object key..
SELECT * FROM swwwihead WHERE wi_id      EQ sww_contob-wi_id.
  if        swwwihead- NOTE_COUNT    ge 0.
    "it contains attachments for theObject ..
 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;Prabhduas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 12:41:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-if-zdocument-has-attachments/m-p/5699075#M1294622</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-28T12:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Validating if ZDocument has attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-if-zdocument-has-attachments/m-p/5699076#M1294623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply, Prabhu. I tryed selecting values from table sww_contob only with objtype = 'ZPAGS', my type of object, but the result is 0. I think it's not here where my attachments and/or notes are kept.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 15:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-if-zdocument-has-attachments/m-p/5699076#M1294623</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-28T15:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Validating if ZDocument has attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-if-zdocument-has-attachments/m-p/5699077#M1294624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 clear v_attno1.
  i_object1-typeid = 'YTEST'.  " Your Object ID name
  i_object1-catid  = 'BO'.
  i_object1-instid = i_yitem-docnumber.   " Your document number 
  call method cl_gos_attachment_query=&amp;gt;count_for_object
    exporting
     is_object = i_object1
     ip_arl    = space
    receiving
     rt_stat   = i_stat1.
  read table i_stat1 into wa_stat1 index 1.
  if sy-subrc eq c_0.
     move wa_stat1-counter to v_attno1.
  endif.
 endif.
 if v_attno1 ge 1.
    " You have attachments in against the document number 
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 16:20:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-if-zdocument-has-attachments/m-p/5699077#M1294624</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-05-28T16:20:44Z</dc:date>
    </item>
  </channel>
</rss>

