Application Development 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: 

problem in module pool program

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

2 REPLIES 2

Former Member
0 Kudos

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

Former Member
0 Kudos

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.