cancel
Showing results for 
Search instead for 
Did you mean: 

Check before save issue

Former Member
0 Kudos

Hi experts,

I need to add some controls before saving a marketing object and i used IF_EX_CRM_MKTPL_OL_OBJ~CHECK_BEFORE_SAVE badi for it.

An error message occured but the object saved even the exporting parameter ev_reject_save = abap true. When i checked the codes i realesed et_failed_objects is initial and i couldn't found why. How can i stop saving when there is an error message appears in badi or ev_reject_save = abap true?

Regards.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Seda,

In this above mentioned method both the export parameter needs to be updated with value to prevent save.

Set EV_REJECT_SAVE = ABAP_TRUE and fill the appropriate ERROR message in ET_MESSAGE_LOG and try.

I think your data should not be saved if both above parameters are correctly passed.

Regards,

Naresh

Former Member
0 Kudos

Hi Nareshkumar,

I set ev_reject_save = abap_true and fill the error message.

I set msgtype msgid msgno and msgv1. It's still saving the object. Is there any other fields i have to set in et_message_log?

former_member196553
Active Contributor
0 Kudos

Hello,

you need to set the reject_save flag and set the return error message as

LS_MESSAGE_LOG-MSGTY = 'E'. Only an error message type will prevent the system from saving the mkt object.

best regards,

Johannes

Former Member
0 Kudos

Hello Johannes,

Thanks all for replies.

I set reject_save = abap_true and msgtype = 'E'.

I fill msgtype, msgid, msgno fields and my object still saved. I cant use check before save for reject saving object. I just can give some alert messages. It always saves the object eventhough there are error messages or reject_save = abap_true.