<?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: Module Pool - Delete Button in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515928#M1261074</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;Check this Code.. you need to declare the flag field in the internal table and pass this field in the Table Control attributes &lt;STRONG&gt;Selection col. name&lt;/STRONG&gt; and select the check box &lt;STRONG&gt;With Sel&lt;/STRONG&gt; column*.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHEN 'DELETE'.
 *     Routine to delete the Selected records
      PERFORM delete_records.

 FORM delete_records .
   DATA :
     lv_answer,
     lv_lines TYPE i.

   REFRESH it_delrec.
   CLEAR g_val_BENE_maint_wa.

   CALL FUNCTION 'ENQUEUE_E_TABLE'
     EXPORTING
       tabname        = 'ZVAL_BENEFIT'
     EXCEPTIONS
       foreign_lock   = 1
       system_failure = 2
       OTHERS         = 3.
   IF sy-subrc &amp;lt;&amp;gt; 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
   ENDIF.

   LOOP AT g_val_BENE_maint_itab INTO g_val_BENE_maint_wa.
     CHECK g_val_BENE_maint_wa-flag EQ 'X'.
     APPEND g_val_BENE_maint_wa TO it_delrec .
     CLEAR g_val_BENE_maint_wa.
   ENDLOOP.

   DESCRIBE TABLE it_delrec LINES lv_lines .
   IF lv_lines NE 0.
     CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
       EXPORTING
         defaultoption  = 'N'
       textline1      = 'Do you want to delete selected record(s)'(009)
         titel          = 'Delete Lines'(010)
         cancel_display = ' '
       IMPORTING
         answer         = lv_answer.
     IF sy-subrc EQ 0.
       IF lv_answer = 'J'.
         DELETE zval_BENEFIT FROM TABLE it_delrec.
         IF sy-subrc EQ 0.
           MESSAGE s398(00) WITH
                          'Records deleted sucessfully,'(008)
                          space
                          space
                          space.

         ENDIF.
         DELETE g_val_BENE_maint_itab WHERE flag EQ 'X'.
       ENDIF.
     ENDIF.
   ENDIF.
   CALL FUNCTION 'DEQUEUE_E_TABLE'
     EXPORTING
       tabname = 'ZVAL_BENEFIT'.

 ENDFORM.                    " delete_records&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Apr 2009 11:15:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-30T11:15:24Z</dc:date>
    <item>
      <title>Module Pool - Delete Button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515925#M1261071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I have this requirement, I need to display some set of data in form of a table control as soon as the transaction is entered and those data will be in disabled mode.Its clear that, this will happen in PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Only thing that the user can do is, just delete the entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Now, if the user selects any entry from the given display list and presses the Delete button, then that entry has to be deleted from the table control list, with a pop-up information message like "Are sure to delete this entry" . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone share some lines of code regarding this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chandan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 11:04:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515925#M1261071</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T11:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Module Pool - Delete Button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515926#M1261072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You have to give a column SEL in your table control add this button in your table control attributes in screen painter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then read selected record in PAI where SEL =  'X' from the internal table .&lt;/P&gt;&lt;P&gt;This will give you the selected record then you can delete that particular  record  from table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps in resolving your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 11:11:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515926#M1261072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T11:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Module Pool - Delete Button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515927#M1261073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was nice, just can you be bit more elaborate in describing that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chandan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 11:14:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515927#M1261073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T11:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Module Pool - Delete Button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515928#M1261074</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;Check this Code.. you need to declare the flag field in the internal table and pass this field in the Table Control attributes &lt;STRONG&gt;Selection col. name&lt;/STRONG&gt; and select the check box &lt;STRONG&gt;With Sel&lt;/STRONG&gt; column*.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHEN 'DELETE'.
 *     Routine to delete the Selected records
      PERFORM delete_records.

 FORM delete_records .
   DATA :
     lv_answer,
     lv_lines TYPE i.

   REFRESH it_delrec.
   CLEAR g_val_BENE_maint_wa.

   CALL FUNCTION 'ENQUEUE_E_TABLE'
     EXPORTING
       tabname        = 'ZVAL_BENEFIT'
     EXCEPTIONS
       foreign_lock   = 1
       system_failure = 2
       OTHERS         = 3.
   IF sy-subrc &amp;lt;&amp;gt; 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
   ENDIF.

   LOOP AT g_val_BENE_maint_itab INTO g_val_BENE_maint_wa.
     CHECK g_val_BENE_maint_wa-flag EQ 'X'.
     APPEND g_val_BENE_maint_wa TO it_delrec .
     CLEAR g_val_BENE_maint_wa.
   ENDLOOP.

   DESCRIBE TABLE it_delrec LINES lv_lines .
   IF lv_lines NE 0.
     CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
       EXPORTING
         defaultoption  = 'N'
       textline1      = 'Do you want to delete selected record(s)'(009)
         titel          = 'Delete Lines'(010)
         cancel_display = ' '
       IMPORTING
         answer         = lv_answer.
     IF sy-subrc EQ 0.
       IF lv_answer = 'J'.
         DELETE zval_BENEFIT FROM TABLE it_delrec.
         IF sy-subrc EQ 0.
           MESSAGE s398(00) WITH
                          'Records deleted sucessfully,'(008)
                          space
                          space
                          space.

         ENDIF.
         DELETE g_val_BENE_maint_itab WHERE flag EQ 'X'.
       ENDIF.
     ENDIF.
   ENDIF.
   CALL FUNCTION 'DEQUEUE_E_TABLE'
     EXPORTING
       tabname = 'ZVAL_BENEFIT'.

 ENDFORM.                    " delete_records&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 11:15:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515928#M1261074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T11:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Module Pool - Delete Button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515929#M1261075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add that SEL column (which you have declared in table control attribute w/e selcolumn )to your internal table.&lt;/P&gt;&lt;P&gt;Add a delete button on screen &lt;/P&gt;&lt;P&gt;In PAI, handle that button when sy-ucomm =  &amp;lt;function code of your buton&amp;gt;&lt;/P&gt;&lt;P&gt;Read &amp;lt;tabname &amp;gt; in to &amp;lt;work area &amp;gt; where sel = 'X'&lt;/P&gt;&lt;P&gt;Delete &amp;lt;inter tabnme &amp;gt; from &amp;lt;work area selected&amp;gt;&lt;/P&gt;&lt;P&gt;You can use "POP_UP_TO_CONFRIM " function module to give popup message for user confirmation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it resolves your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 11:20:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515929#M1261075</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T11:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Module Pool - Delete Button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515930#M1261076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac5e35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac5e35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 11:25:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515930#M1261076</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T11:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Module Pool - Delete Button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515931#M1261077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was a great answer, just 1 last question, can you tell me how to add the SEL of Table Control to the internal table ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chandan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 11:45:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515931#M1261077</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T11:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Module Pool - Delete Button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515932#M1261078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare a internal table in your main program having same fields as in your table control, In the type declaration of of your internal table also add field SEL type c.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 11:57:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515932#M1261078</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T11:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Module Pool - Delete Button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515933#M1261079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to define sel in the program?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 06:35:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/module-pool-delete-button/m-p/5515933#M1261079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-17T06:35:52Z</dc:date>
    </item>
  </channel>
</rss>

