cancel
Showing results for 
Search instead for 
Did you mean: 

ORDER_SAVE

Former Member
0 Kudos
87

Hi All,

I am using the BADI ORDER_SAVE.. what i want to know is there is a parameter called CV_OWN_MESSAGE

in the method CHECK_BEFORE_SAVE.

Can anyone please tell me what exactly that variable does i.e. the functionality of the same?

Regards,

Riya.

Edited by: riya riya on May 18, 2008 9:01 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Riya,

MESSAGE...RAISING or MESSAGE...INTO variations.

Both of these will fill all the relevant SY-MSGxx fields but will not try to issue a message to the SAPGUI.

Normally you use the CRM_MESSAGE_COLLECT statement to collect messages to the transaction's message log. The particular UI looks after displaying the most severe one to the user.

Try using MESSAGE...INTO instead, and raising the ERROR_OCCURED exception or CV_OWN_MESSAGE flag (depending on which method you are using).

The calling program then looks after taking your message and storing it via CRM_MESSAGE_COLLECT.

This should then work in any UI.

Regards

Manohar

Former Member
0 Kudos

Hi Manohar,

Could you please elaborate a little with some code snippets?

Also please note that i am using IC Web client to display these messages.

Could you tell me how to go about it.

Regards,

Riya.

BGarcia
Active Contributor
0 Kudos

Hello Riya,

Honestly, I don't know the purpose of CV_OWN_MESSAGE flag. We don't used.

We raise messages in IC Webclient such as the code snippet available in my last reply on thread:

If you're trying to display error or warning messages in IC Webclient, this can be very useful to you. If not, just ignore this response

Regards.

Former Member
0 Kudos

Hi Bruno!!

Really appreciate ur help.

The error message is getting displayed but the problem is the Transaction gets saved i.e the order or say the document gets created.

Is there a way where we can stop the transaction on occurence of an Error.

Many thanks,

Riya.

BGarcia
Active Contributor
0 Kudos

Hello Riya,

For abort the saving, just launch the exception DO_NOT_SAVE in your CHECK_BEFORE_SAVE method.

This will give the oportunity to the user to correct the values you are validating.

Regards,

Bruno

Former Member
0 Kudos

Hi Bruno!!!

A lil more help please...

when exactly shoud i launch it.. i mean..after the code that u have given or is it through some parameter??

Do reply.

Many Thanks,

Riya.

BGarcia
Active Contributor
0 Kudos

Hello Ryia,

That depends on your logic.

I, for example, use a error flag variable that is filled if at least one error message is launched into the application (you can launch more than one error message).

Then at the end of CHECK_BEFORE_SAVE method, I see if this error flag variable is filled.

If filled then I raise the exception.

Regards,

Bruno

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Riya,

in the method "CHECK_BEFORE_SAVE"of "ORDER_SAVE " badi if you want to raise own massage then you will have to set this variable "CV_OWN_MESSAGE" to "X".

eg.

cv_own_message = 'X'.

MESSAGE 'Enter Event End Date' TYPE 'E' RAISING do_not_save.