Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Overwrite existing BOPF Save method

Former Member
0 Likes
5,063

I have created a Business Object and I am trying to change the standard way of how it saves the data. I have implemented the BOPF for salesorder generation and it works properly but when the save button is pressed , I would like to call a different API for saving that particular salesorder. Currently it saves directly in the database table.

11 REPLIES 11
Read only

cwolter90
Participant
3,493

You can implement a data access class for each node. You can use the super class /BOBF/CL_DAC_IMPLEMENTATION. I guess the default class is /BOBF/CL_DAC_TABLE.

Read only

Former Member
0 Likes
3,493

Thanks Christian .Can you please help me with somewhat detailed explanation. I am sort of new to BOPF development.

Read only

3,493

You create your own data access class inheriting from /BOBF/CL_DAC_IMPLEMENTATION or maybe the class which is used by your BOPF. Then you have to redefine the write method for saving the data.

You have to set this new class in the BOPF (tcode BOBX) for the node or for the whole BOPF. Maybe the data acess class is only visible in the extend view of BOBX.

Read only

cyclingfisch_
SAP Mentor
SAP Mentor
0 Likes
3,493

What is the reason to change the standard way? Maybe there is a better way to solve your requirement.

Cheers,

Martin

Read only

0 Likes
3,493

Hi Martin,

We are trying to invoke our own API so on clicking save I want to call a different API. If you could provide some of your insights on this , it would be really helpful.

Regards

Pratik Solanki

Read only

0 Likes
3,493

You didn't answer Martin's question: Why? You're potentially losing a lot of the benefits of BOPF, so this should be done carefully and with good reason.

Read only

0 Likes
3,493

Hi Mike,

Since the standard Save method directly updates the Database Table which is not ideal in our scenario. Instead we want to use our own BAPI for saving it to the database. There are certain operations that need to perform before we save the record in the database.

Pratik

Read only

0 Likes
3,493

Hi Pratik,

on which release are you? On 7.51 or higher the draft concept might be able to solve your requirement.

Otherwise, maybe it's possible to add different status to your data model and implement the requirement that way. It's a lot of effort to implement your own DAC. To use the standard DAC is for free...


Cheers,

Martin

Read only

0 Likes
3,493

You have an extremely versatile framework, so why not use it to do whatever you want your BAPI to do? Or maybe the question should be the other way around, if the BAPI is so important, why use BOPF?

Read only

Dhivya
Active Participant
0 Likes
3,493

Hi Pratik,

Instead of use the standard 'Save', you can create custom action and call API inside it. After successful execution of API, call standard save action.

Regards,

Dhivya

Read only

Dhivya
Active Participant
0 Likes
3,493

Hi Pratik,

Instead of use the standard 'Save', you can create custom action and call API inside it. After successful execution of API, call standard save action.

Regards,

Dhivya