10-20-2008 2:41 AM
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Save SOC '
DIAGNOSE_OBJECT = ' '
text_question = 'Sales Order Confirmation Will Be Archived in'
I have to use a message class in the text question, how is that possible?
10-20-2008 3:54 AM
Hi
try like this ,
*---w_count - u r Massge Text
EX:
w_count = 'Wot Even the Msg ...!'.
*---Pop Up Message to Confirm -
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question = w_count " Are you certain...?
IMPORTING
answer = w_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0. " Function call failed..
MESSAGE i001(zload) WITH text-006. " Func call failed contact IS
STOP.
ENDIF.
IF w_answer NE '1'.
STOP.
ENDIF.
10-20-2008 2:58 AM
Not possible directly in the Function call, but you can build the TEXT_Question just before calling the functiona module using a message class and number. you can use function module MESSAGE_PREPARE to build a message and pass that to TEXT_QUESTION in the call
10-20-2008 3:13 AM
text_question = perform message
form message.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
msg_id = 002
msg_no = 002.
endform.
if i remove the quote in th test_question, it displays an error,
if i put the quote it displays as is, it seems not to call the function.
is this syntax correct?
10-20-2008 3:29 AM
You need to call Message_Prepapre first to build the message, then call popup fm.check below
data : v_mess(255)
data : v_mess(255), v_ans.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
MSG_ID = '00'
MSG_NO = '002'
IMPORTING
MSG_TEXT = v_mess
.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
TEXT_QUESTION = v_mess
IMPORTING
ANSWER = v_ans
.
10-20-2008 3:46 AM
REPORT zisd_archivesoc_npsg MESSAGE-ID z10493498.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
MSG_ID = 00
MSG_NO = 002
IMPORTING
MSG_TEXT = v_mess
.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question = v_mess
It doesn't display anything.
v_mess(225), what is 255 for? when i enclosed id and no with quote
the program treat it as text element.
10-20-2008 3:56 AM
code works for me. you need to put msg_id and msg_no within single quotes unless you are passign a variable there.
255 is just the length, you can put that as type string if you want
REPORT YTEST1.
data : v_mess type string, v_ans.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
MSG_ID = '00'
MSG_NO = '002'
IMPORTING
MSG_TEXT = v_mess
.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
TEXT_QUESTION = v_mess.
10-20-2008 3:54 AM
Hi
try like this ,
*---w_count - u r Massge Text
EX:
w_count = 'Wot Even the Msg ...!'.
*---Pop Up Message to Confirm -
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question = w_count " Are you certain...?
IMPORTING
answer = w_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0. " Function call failed..
MESSAGE i001(zload) WITH text-006. " Func call failed contact IS
STOP.
ENDIF.
IF w_answer NE '1'.
STOP.
ENDIF.
10-20-2008 3:58 AM
I created a message class Z10493498.
002: Are you certain?
I have to use it instead of text element.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
MSG_ID = 00
MSG_NO = 002
IMPORTING
MSG_TEXT = v_mess.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Save SOC '
DIAGNOSE_OBJECT = ' '
text_question = v_mess
I tried this code but the pop up shows no text, why is that?
10-20-2008 4:02 AM
use your own message class and message # in the code
REPORT YTEST1.
data : v_mess type string, v_ans.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
MSG_ID = '00' *<---------your message class*
MSG_NO = '002' *<-------your message number*
IMPORTING
MSG_TEXT = v_mess
.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
TEXT_QUESTION = v_mess.
10-20-2008 4:21 AM
10-20-2008 4:23 AM
paste your code, are you getting any errors? do you have the same code as I put. which SAP version are you running
10-20-2008 4:25 AM
do i still have to declare my message id in data declaration section,
because it treats my message class as global field?
10-20-2008 4:26 AM
10-20-2008 4:27 AM
version 7.1
REPORT zisd_archivesoc_npsg MESSAGE-ID z10493498.
data : v_mess(225), v_ans.
call subroutine
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SAVE'.
PERFORM save_file.
WHEN 'BACK' OR 'CANC' OR 'EXIT'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
MSG_ID = z10493498
MSG_NO = 002
IMPORTING
MSG_TEXT = v_mess
.
FORM save_file.
CONCATENATE c_fname p_saleno INTO c_path.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Save SOC '
DIAGNOSE_OBJECT = ' '
text_question = v_mess
text_button_1 = 'Ok'
ICON_BUTTON_1 = ' '
text_button_2 = 'Cancel'
ICON_BUTTON_2 = ' '
DEFAULT_BUTTON = '1'
display_cancel_button = ''
USERDEFINED_F1_HELP = ' '
START_COLUMN = 25
START_ROW = 6
POPUP_TYPE =
IV_QUICKINFO_BUTTON_1 = ' '
IV_QUICKINFO_BUTTON_2 = ' '
IMPORTING
answer = v_answer
TABLES
PARAMETER =
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.
ELSE.
IF v_answer = 1.
OPEN DATASET c_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
TRANSFER wa_header TO c_path.
LOOP AT it_item INTO wa_items.
TRANSFER wa_items TO c_path.
ENDLOOP.
TRANSFER wa_total TO c_path.
CLOSE DATASET c_path.
MESSAGE s003 WITH c_path.
ENDIF.
ENDIF.
ENDFORM.
10-20-2008 4:30 AM
move your call to inside the form save_file, and use single quote for msg_id and msg_no
FORM save_file.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
MSG_ID = 'Z10493498'
MSG_NO = '002'
IMPORTING
MSG_TEXT = v_mess
.
10-20-2008 4:33 AM