<?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: Question regarding Checkbox in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349082#M175348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a couple of ways to do this.  Here is one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) move the data from the ITAB to a second one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ITAB2[] = ITAB1[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Delete all of the entries that do not have a CHECK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;delete itab2 where check =  space.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Describe the table and get the lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: checked_lines type i.
describe table itab2 lines checked_lines.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Now give message if the check_lines = 0.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if check_lines = 0.
message e001(00) with 'Please select at least one line.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this solution, I assume that you are modifing the internal when rows are being selected.&lt;/P&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, 23 May 2006 23:27:24 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-05-23T23:27:24Z</dc:date>
    <item>
      <title>Question regarding Checkbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349078#M175344</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 have declared a checkbox in an internal table and I have displayed the fields of the internal table along with checkbox as a list. Now based on the check of the checkbox value i need to do action specified by the button in the pf-status. So i want to give a message to user if no checkbox is checked asking him to check the checkboxes. How do i validate on this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;VIcky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 23:05:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349078#M175344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T23:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Checkbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349079#M175345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is this alv or a standard report?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 23:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349079#M175345</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-05-23T23:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Checkbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349080#M175346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vicky,&lt;/P&gt;&lt;P&gt;How about a pop up?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if ...&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        TITEL  = 'Error: no boxes checked'&lt;/P&gt;&lt;P&gt;        TXT1   = ' '&lt;/P&gt;&lt;P&gt;        TXT2   = 'You must check at least 1 box.'&lt;/P&gt;&lt;P&gt;        TXT3   = ' '&lt;/P&gt;&lt;P&gt;        TXT4   = ' '&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        OTHERS = 1.&lt;/P&gt;&lt;P&gt;    stop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;den&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 23:12:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349080#M175346</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T23:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Checkbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349081#M175347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vicky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if you're asking about how to check to see if any checkboxes are checked...  You could either loop/endloop or read the table looking for check = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.,&lt;/P&gt;&lt;P&gt;read table itab with key check = 'X'.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    &amp;lt;insert the pop-up code here&amp;gt;&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2006 23:22:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349081#M175347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-23T23:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Checkbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349082#M175348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a couple of ways to do this.  Here is one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) move the data from the ITAB to a second one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ITAB2[] = ITAB1[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Delete all of the entries that do not have a CHECK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;delete itab2 where check =  space.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Describe the table and get the lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: checked_lines type i.
describe table itab2 lines checked_lines.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Now give message if the check_lines = 0.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if check_lines = 0.
message e001(00) with 'Please select at least one line.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this solution, I assume that you are modifing the internal when rows are being selected.&lt;/P&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, 23 May 2006 23:27:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349082#M175348</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-05-23T23:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Checkbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349083#M175349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vicky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use similar code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data recs type C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at user-command. &lt;/P&gt;&lt;P&gt;case sy-ucomm. &lt;/P&gt;&lt;P&gt;when 'BUTTON'.&lt;/P&gt;&lt;P&gt;   perform check_recs.&lt;/P&gt;&lt;P&gt;   if recs is initial. &lt;/P&gt;&lt;P&gt;        message i000 with 'No records were selected'.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;   endif. &lt;/P&gt;&lt;P&gt;   perform function.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form check_recs.&lt;/P&gt;&lt;P&gt;lsind = sy-lsind - 1.&lt;/P&gt;&lt;P&gt;  clear recs.&lt;/P&gt;&lt;P&gt;  clear anzkr. &lt;/P&gt;&lt;P&gt;  refresh tbkpf.&lt;/P&gt;&lt;P&gt;  do.&lt;/P&gt;&lt;P&gt;    read line sy-index index lsind field value xpickc.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      check xpickc ne space.&lt;/P&gt;&lt;P&gt;      rec = 'X'.&lt;/P&gt;&lt;P&gt;      anzkr = anzkr + 1.&lt;/P&gt;&lt;P&gt;      move-corresponding vbkpf to tbkpf.&lt;/P&gt;&lt;P&gt;      append tbkpf.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;endform. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that was useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Susmitha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dont forget to reward points for useful answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2006 03:43:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349083#M175349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-24T03:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Checkbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349084#M175350</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;If you are using ALV, call one event.&lt;/P&gt;&lt;P&gt;i dont remember the name right now.&lt;/P&gt;&lt;P&gt;this event automatically updates your internal table with the checked values.&lt;/P&gt;&lt;P&gt;then check your internal table whether your check field is populated for any line item or not.&lt;/P&gt;&lt;P&gt;if no line item is check, throw the error to the user.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2006 04:02:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-regarding-checkbox/m-p/1349084#M175350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-24T04:02:28Z</dc:date>
    </item>
  </channel>
</rss>

