‎2007 Apr 05 4:47 AM
Hi,
I have a function module to get PO details based on PO number given as the import parameter. I have taken a return parameter and need to display error message if the PO number given is not available.
The message should be like
"PO number XXXXX does not exis".
Could anyone let me know how to code this in the FM to give the error message. Need to display the PO number in the error message.
Regards,
Ramesh
‎2007 Apr 05 4:56 AM
Ram,
Take the return parameter check that PO number is exist or not.
If returnparamenter is initial.
MESSAGE E000(zmamap) WITH 'PO number' PO nunber 'does not exist'.
‎2007 Apr 05 4:56 AM
Hi Ram,
I think based on sy-subrc value we can made the code for error message. After checking the PO number related querrey then mention one IF condition like IF sy-subrc = <value>
message E..................
endif.
Hope this helps you, reply for queries, Shall post you the updates.
Regards.
Kumar. .
‎2007 Apr 05 5:00 AM
You can find a demo program in R/3. Go to SE38 and try out this program DEMO_MESSAGES.
Hope it helps. I don't know if your function group have a message class tag to it and I don't know if there is any customized message that you have.
in addition you can view this function module in transaction se37 'DEMO_FUNCTION_MESSAGE'.
‎2007 Apr 05 5:09 AM
Hi ,
If you want an error then raise an exception .
So first define a message in your message class as below
<b>PO Number & does not exist.</b> and also define an exception ERROR in your FM.
No in the code where you find that the PO does not exist , raise this exception.
message E009(Z_TEST) WITH PO_NUM RAISING ERROR .Here 009 is your error message
Z_TEST message class
and PO_NUM is the PO Number entered by the user.
Hope this helps in case you have any further queries please do revert back.
Regadrs
Arun
‎2007 Apr 05 5:43 AM
Hi,
Assign the returning parameter to a variable say po_num.
To display the error message:
if po_num is not initial.
message e000(zz) with 'Purchase order number po_num doesnot exist'.
endif.
regards,
keerthi.
‎2007 Apr 05 6:49 AM
Hi ram
CALL FUNCTION 'DEMO_FUNCTION_MESSAGE'
EXPORTING
message_type = S (which type do u want like S ,I etc)
message_place = 10
message_event = 10
if sy-subrc <> 0.
message s0001 with "PO number XXXXX does not exis".
endif.
I hope it will Use for U
Thanks.
Jay
‎2007 Apr 05 7:18 AM
suppose you have return value for error.
if returnval = <error or what val are you taking>.
message i000(zspd) with <var for po>.
endif.
now dbl click on message class <here it is zspd> it will go to se 91 there a table control you can find
000 PO number & does not exist
save it ..
reagrds
shiba dutta