Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

delete options

Former Member
0 Likes
1,255

Hi Experts,

I have report program. In selection screen I have a text box. whenever user enters value in that and click on Delete from CustoTable pushbutton the table entries should delete from that table.

But before deleting the table entries I should include a query that asks before the deletion values. whenever user says OK the table entries should be deleted. Whenever user says CANCEL it shouldn't deleted from the table.

Regards,

Ramesh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
923

hai,

You should use POPUP_TO_CONFIRM Function For This Purpose.

call function 'POPUP_TO_CONFIRM'
   EXPORTING
     titlebar       = 'Delete a Record'
     text_question  = 'Confirm Deletion'
     text_button_1  = 'Yes'(001)
     text_button_2  = 'No'(002)
     default_button = '1'
   IMPORTING
     answer         = answer.

5 REPLIES 5
Read only

Former Member
0 Likes
924

hai,

You should use POPUP_TO_CONFIRM Function For This Purpose.

call function 'POPUP_TO_CONFIRM'
   EXPORTING
     titlebar       = 'Delete a Record'
     text_question  = 'Confirm Deletion'
     text_button_1  = 'Yes'(001)
     text_button_2  = 'No'(002)
     default_button = '1'
   IMPORTING
     answer         = answer.

Read only

Former Member
0 Likes
923

Hi,

You can use following code

CALL FUNCTION 'POPUP_TO_CONFIRM'
         EXPORTING
           titlebar              = 'Delete'
           text_question         = 'Are you Sure?'
           text_button_1         = 'Yes'
           icon_button_1         = 'ICON_CHECKED'
           text_button_2         = 'No'
           icon_button_2         = 'ICON_INCOMPLETE'
           default_button        = '2'
           display_cancel_button = 'X'
           popup_type            = 'ICON_MESSAGE_QUESTION'
         IMPORTING
           answer                = ans
         EXCEPTIONS
           text_not_found        = 1
           OTHERS                = 2.
       IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.

 if ans = 1 "means user has pressed ok
"delete statement
endif.

Read only

Former Member
0 Likes
923

Hi,

You can not delete from database table .

Use a loop on internal table and delete inside comparing values in where clause.

Get all the records in the internal table and then use this command.

delete <database table> from table itab.

if sy-subrc eq 0.

commit work.

endif.

or

tables : ztarget.

data : begin of itab occurs 0.

include structure ztarget.

data : end of itab.

select * into table itab from ztarget.

loop at itab.

delete from ztarget where kunnr = itab-kunnr.

endloop

regards,

Shweta

Read only

Former Member
0 Likes
923

They are all yours..

WS_MSG

Desc. Create a dialog box in which you display an one-line message.

POPUP_TO_CONFIRM_STEP

Desc. Create a dialog box in which you make a question whether the user wishes to perform the step.

POPUP_TO_CONFIRM_WITH_MESSAGE

Desc. Create a dialog box in which you inform the user about a specific decision point during an action.

POPUP_TO_CONFIRM_WITH_VALUE

Desc. Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.

POPUP_TO_DECIDE

Desc. Provide user with several choices as radio buttons

POPUP_TO_DECIDE_WITH_MESSAGE

Desc. Create a dialog box in which you inform the user about a specific decision point via a diagnosis text.

POPUP_TO_DISPLAY_TEXT

Desc. Create a dialog box in which you display a two-line message.

POPUP_TO_SELECT_MONTH

Desc. Popup to choose a month

POPUP_WITH_TABLE_DISPLAY

Desc. Provide a display of a table for user to select one, with the value of the table line returned when selected.

POPUP_TO_CONFIRM

Desc. Pop-up dialog confirm an action before it is carried out.

POPUP_TO_DISPLAY_TEXT

Desc. Displays a text in a modal screen

POPUP_TO_INFORM

Desc. Displays several lines of text. No OK or Cancel buttons.

POPUP_TO_CONFIRM/POPUP_TO_DISPLAY_TEXT

TH_POPUP Good One!

Desc. Display a popup system message on a specific users screen.

POPUP_TO_CONFIRM_LOSS_OF_DATA

Desc. Create a dialog box in which you make a question whether the user wishes to perform a processing step with loss of data.

POPUP_TO_CONFIRM_STEP

Desc. Create a dialog box in which you make a question whether the user wishes to perform the step.

POPUP_TO_CONFIRM_WITH_MESSAGE

Desc. Create a dialog box in which you inform the user about a specific decision point during an action.

POPUP_TO_CONFIRM_WITH_VALUE

Desc. Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.

POPUP_TO_DECIDE

Desc. Provide user with several choices as radio buttons

POPUP_TO_DECIDE_WITH_MESSAGE

Desc. Create a dialog box in which you inform the user about a specific decision point via a diagnosis text.

POPUP_TO_DISPLAY_TEXT

Desc. Create a dialog box in which you display a two-line message.

POPUP_WITH_TABLE_DISPLAY

Desc. Provide a display of a table for user to select one, with the value of the table line returned when selected.

Regards.

Sumit Nene.

Read only

Former Member
0 Likes
923

HI,

USE THE FOLLOWING CODES.

CASE OK_CODE.

WHEN ' CUST'.

CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'

EXPORTING

DEFAULTOPTION = 'N'

TEXTLINE1 = 'Do U Want To Delete The Text'

  • TEXTLINE2 = ' '

TITEL = 'Confirmation'

START_COLUMN = 25

START_ROW = 6

CANCEL_DISPLAY = 'X'

IMPORTING

ANSWER = ANS.

IF ANS EQ 'J'.

DELETE TEXT.

ELSEIF.

ENDIF.

ENDCASE.