Skip to Content
Technical Articles
Author's profile photo Abhishek Agrawal

S4 HANA Error: The use of this object is not permitted

We faced this peculiar error while implementing a BADI and had to spend some time to figure out the root cause, hence thought of writing this short blog so that others do not have to struggle when they face a similar issue.

Problem:

We implemented the BADI “MMPUR_WORKFLOW_AGENTS_V2” in S4 HANA for one of the business requirement and when we tried writing a Select query on any table inside the method “IF_MMPUR_WORKFLOW_AGENTS_V2~GET_APPROVERS” or tried using any custom CDS view inside this BADI we were getting below error:

The method was only allowing us to use some standard CDS views like i_purchaseorderitemapi01.

Here is your quick solution:

Go to BADI implementation class and check what is set for ‘ABAP Language Version’, if it is set to ‘ABAP for Key Users’ then this is causing the issue, change it to ‘Standard ABAP(Unicode)’ and then you should be able to write Select statements inside this method.

 

Cheers,

Abhishek

Assigned tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Florian Henninger
      Florian Henninger

      When providing such tips there is one question left. Why don't you use the key-user extensibility to extend it.

       

      Author's profile photo Abhishek Agrawal
      Abhishek Agrawal
      Blog Post Author

      Hi Florian,

      Actually, the purpose of writing this short blog is to let people know what to do when they get this error. However, if I ever write a blog on extensibility I will remember to add Key-User extensibility.

      Abhishek

       

      Author's profile photo Florian Henninger
      Florian Henninger

      Hi Abhishek,

      got it. The point is, that normally it is not recommended to change such things. Reason is easy, some other things won't work as expected, so it can become very complicated and most of the time, people who change those things have to argument why to do so. So it's just fair, to tell the whole story and also let people know what are the consequences.

      ~Florian

      Author's profile photo Abhishek Agrawal
      Abhishek Agrawal
      Blog Post Author

      You are absolutely right, hope your comment and this blog will help our fellow SAP practitioners to make the right decision when they face such scenarios.

      Author's profile photo dinesh k
      dinesh k

      Thanks Abhishek for sharing this. Do you foresee upgrade or any other impact if we do this?

      Hi Florian,

      I have a question on similar lines... In the same BADI, i have to call an external custom application to pull the agents and for that i have to make a REST call which seems almost impossible since it doesn't permit to use 'cl_http_client' in 'abap for key users' and there isn't any suitable alternative on premise 1909.  Do you think of any other way?

      Author's profile photo Patrick Villeneuve
      Patrick Villeneuve

      Many thanks Abhishek!

      Author's profile photo Rafael Pereira
      Rafael Pereira

      Thank you for the hint! Straight to the point 🙂

      Author's profile photo Jeyhun Hajiyev
      Jeyhun Hajiyev

      Thank you Abhishek . It helped me solve the problem quickly.