‎2007 Feb 07 12:01 PM
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.
‎2007 Feb 07 12:07 PM
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
‎2007 Feb 07 12:10 PM
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
‎2007 Feb 07 12:12 PM
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....