‎2009 Aug 18 6:50 AM
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.
‎2009 Aug 18 7:00 AM
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.
‎2009 Aug 18 7:00 AM
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.
‎2009 Aug 18 7:03 AM
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.
‎2009 Aug 18 7:04 AM
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
‎2009 Aug 18 7:04 AM
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.
‎2009 Aug 18 7:10 AM
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.