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

error message

Former Member
0 Likes
523

Hi all

I have to display a message box asking the user he/she want to save data or not.If they select no then i have to reach selection screen but at present i am not getting this I am coming out of the program.For this I am writing below code in my program.

if vlgnum ne dlgnum.

call function 'POPUP_TO_CONFIRM_LOSS_OF_DATA'

exporting

textline1 = text-001

titel = text-002

importing

answer = answer.

case answer.

when 'N'.

leave to screen 0.

when 'J'.

endcase.

endif.

I also need to display error message in this messagebox but it displaying warning message.Please tell me how to solve these 2 problems.

Thank You.

Regards

Giri.

3 REPLIES 3
Read only

Former Member
0 Likes
482

Hi

The requirement is quite confusing. Please elaborate in detail.

Anyways, what i understood,

Try this out...

if vlgnum ne dlgnum.

call function 'POPUP_TO_CONFIRM_LOSS_OF_DATA'

exporting

textline1 = text-001 " Unsaved data will be lost.

titel = text-002 " Do you want to continue ?

importing

answer = answer.

case answer.

when 'N'.

message i143(zz) with 'Unsaved data lost.'.

when 'J'.

leave to screen 0.

endcase.

endif.

Hope this will help.

Regards

- Atul

Read only

Former Member
0 Likes
482

Hi,

use this FM POPUP_TO_CONFIRM_DATA_LOSS

that is absolete now

data : c type c.

CALL FUNCTION 'POPUP_TO_CONFIRM_DATA_LOSS'

EXPORTING

DEFAULTOPTION = 'J'

TITEL = 'shiva'

START_COLUMN = 25

START_ROW = 6

IMPORTING

ANSWER = c

.

case c.

when 'N'.

message e888(sabapdocu).

endcase.

Regards

Shiva

Read only

Former Member
0 Likes
482

Hi Giri,

Even I have come across this requirement.

Try the following code...

DATA: T_SELTAB LIKE STANDARD TABLE OF rsparams WITH HEADER LINE.

IF ANSWER = 'N'.

T_SELTAB-SELNAME = TEXT-001.

T_SELTAB-SIGN = 'I'.

T_SELTAB-OPTION = 'EQ'.

T_SELTAB-LOW = 'X'.

APPEND T_SELTAB.

SUBMIT ZMUMM009

WITH SELECTION-TABLE T_SELTAB.

REFRESH T_SELTAB.

MESSAGE S000(ZM) WITH 'Processing cancelled by user'.

ENDIF.

This should fulfill both ur answers...

Reward if found useful....