cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict exe file as an attachment in shopping cart sap srm

Former Member
0 Kudos

Hi,

I want to restrict the user from attaching the exe file to the shopping cart items. I need a warning message also to be displayed when the user does that. I tried implementing the BADI BBP_ATT_CHECK which will restrict uploading only if the file contains the virus i.e., by adding the error message

e014(bbp_att) into the log. I cannot give a warning message to the user.

I also tried implementing the BADI BBP_DOC_CHECK_BADI. I restricted the exe file upload as an attachment by calling the BAPI BBP_PD_SC_UPDATE and marking the exe attachment as deleted (del_ind = 'X' ) if any. Even if i populate et_messages table with warnings at this stage after deleting the file, it doesnt show them.

Either a popup showing the message or just like an error during check on portal is fine with me.

Help me in this issue.

Thanks & Regards,

Karthik Babu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I the case of BBP_DOC_CHECK_BADI, it may be getting called twice. So when its called first time, you delete the attachment and raise the warning. Next time its called, the attachment is already deleted, so no warning is raised.

Even if you raise the warning, most users wont even notice it and may be surprised to see attachment missing.

My suggestion is to try a pre-exit for method ONACTIONON_SAVE of view V_DODC_ADDATTACHMENT of webdypro /SAPSRM/WDC_DODC_NA.

Here you can check the extension of the file name for .exe and stop the file from being uploaded and throw the error on the attachment upload popup itself.

This way the file is not uploaded in the first place and the user does not miss the error.

Let me know if this helps.

Former Member
0 Kudos

This worked. Instead of pre-exit, I used overwrite-exit. Because Pre-Exit will not inhibit the call of original method.

Thanks a lot Sushil.

Answers (0)