Skip to Content
author's profile photo Former Member
Former Member

problem in module pool program

hi all

i have design a system in which on one screen i put a delete button for deletion of record. i want to implement this button as

1. by pressing delete button, program should show a message asking ' you want to delete record'.

2. if i press ok(green) button on displayed message, the program will delete records from database table

3. else i press cross button (cancel) on displayed message, records should not be deleted

please give me the code to implement this.

thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2007 at 12:45 PM

    Yogesh,

    Refer to the following sample code, test it by exicuting the exact code which I am enclosing below.

    DATA parameters LIKE spar OCCURS 0 WITH HEADER LINE.

    DATA name(75) TYPE c.

    name = ' '.

    DATA : v_ecc6_text TYPE string,

    v_ecc6_title TYPE string.

    DATA: l_svar(1).

    CONCATENATE

    '1'

    '2'

    '3'

    INTO name SEPARATED BY space.

    MOVE name TO parameters-value.

    MOVE 'NAME' TO parameters-param.

    APPEND parameters.

    CALL FUNCTION 'POPUP_TO_CONFIRM'

    EXPORTING

    titlebar = 'Hai'

    diagnose_object = 'ZDIALOG_TEXT'

    text_question = 'Hello'

    default_button = '1'

    IMPORTING

    answer = l_svar

    TABLES

    parameter = parameters

    EXCEPTIONS

    text_not_found = 1

    OTHERS = 2.

    IF sy-subrc <> 0.

    l_svar = 'A'.

    ELSE.

    CASE l_svar.

    WHEN '1'.

    l_svar = 'J'.

    WHEN '2'.

    l_svar = 'N'.

    WHEN OTHERS.

    l_svar = 'A'.

    ENDCASE.

    ENDIF.

    WRITE : l_svar.

    **************************

    Hope this will serve your requirement.

    Do reward with out fail if found use full.

    Cheers,

    Rama.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2007 at 10:38 AM

    hi,

    You can use the function module POPUP_TO_CONFIRM

    TITLEBAR

    DIAGNOSE_OBJECT

    TEXT_QUESTION ARE U SURE U WANT TO DELETE

    TEXT_BUTTON_1 Yes

    ICON_BUTTON_1 no

    TEXT_BUTTON_2 cancel

    ICON_BUTTON_2

    DEFAULT_BUTTON 1

    DISPLAY_CANCEL_BUTTON X

    USERDEFINED_F1_HELP

    START_COLUMN

    START_ROW

    POPUP_TYPE

    I THINK THIS WILL HELP U

    Regrds,

    karthik

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.