‎2008 Jan 22 12:43 AM
Hi,
I have a question about how to write message.
In the selection screen, when user enter a customer code, if the records belong to the customer code has been deleted from internal table T. No data will come out. I need to wite the message when the user enter an uneffected customer code.
Questions:
1,Where can I write the warnning message in my program.
2, How to write it?
Please help, Thank you.
‎2008 Jan 22 12:48 AM
Check this lnik.
http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaae335c111d1829f0000e829fbfe/content.htm
Regards,
Maha
‎2008 Jan 22 12:54 AM
Write like this
In this example, company is not selected.
AT-SELECTION-SCREEN .
IF P_CO = ' '.
message W016(pn) with 'COMPANY NOT SELECTED'.
ENDIF.
Hope this helps
vinodh Balakrishnan
‎2008 Jan 22 1:55 AM
Hi,
Write the error message in AT SELECTION-SCREEN ON FIELD event.
Ex; PARAMETERS: P_BUKRS type BUKRS.
AT SELECTION-SCREEN ON p_bukrs.
IF p_bukrs <> '7570'.
MESSAGE w208(00) WITH 'In correct Company code'.
ENDIF.
‎2008 Jan 22 2:03 AM
Hi,
Thanky you for your advice.
I have another question is that the program is using
GET kna1.
GET knb1.
GET bsid."INS MG050706
CHECK bsid-budat <= dd_stida.
CHECK bsid-augdt = '00000000' OR bsid-augdt > dd_stida.
in the start-of-selection.
How can I write the error message when the records of bsid-kunnr the user enter in the selection screen has been deleted in the internal table T?
Please help. Thank you.
‎2008 Jan 22 2:44 AM
Hi,
You mean, how to display message after deleting the data from internal table based on kunnr.
If my understanding is correct, check the below logic:
Loop at itab where kunnr = p_kunnr.(selection screen kunnr)
Delete itab.
flag = 'X'. (to know whether atleast 1 record has been deleted or not)
Endloop.
If flag = 'X'.
MESSAGE I208(00) WITH 'Customer code records are deleted'.
(In start-of-selection, if you want to display the error message and stop the process, i.e., going back to selection screen, then dont use 'E' for error message, use 'I' or 'W' and use 'STOP' statement after message display.)
endif.
‎2008 Jan 22 4:22 AM
Hi,
use the below logic ok.
parameters : var type i.
if var ne <condition>
message e001(pn) with 'It is not in a range'.
endif.
e000 : e stands for error message.
s001 : s stands for success message
w002 : w stands for warning message
a003 : a stands for abend message
Reward points if helpful.
Kiran Kumar.G.A
Have a Nice Day..
‎2008 Jan 22 4:24 AM
Hi ,
Example :
if sy-batch = space.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
exporting
textline1 = p_mess.
else.
MESSAGE E899(bd) WITH p_mess.
endif.
Reward points if it is useful...
Girish