Application Development 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: 

Link Between Business Object and Transaction

Former Member
0 Kudos

<b>How is Business Object linked to transactions?</b>

For example, how is business object BUS2032 (Sales order) linked to transaction VA01 (Create sales order)?

14 REPLIES 14

Former Member
0 Kudos

It has a function; BAPI_SALESORDER_CREATEFROMDAT2, to create sales order. But it is not used by program SAPMV45A (Tcode:VA01).

As far as I know they are not linked to transactions, however made available for the use of customer developments.

-


Please give points if it helps.

0 Kudos

Hi

Sales order BAPI's very much use program SAPMV5A to create sales orders.

Raj

Peter_Inotai
Active Contributor
0 Kudos

Check for example BUS2002 (Network) method Create. It's linked to ABAP transaction CN21.

Some of them linked to transaction, some of them linked to BAPI (eg. BUS2002/ Getlist: BAPI_NETWORK_GETLIST).

Peter

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Ben,

I guess, you look for general way for searching BAPIs (or transactions when comming from the other side).

I use sometimes SE80. Check for your object, which development class (package since 4.7) is used and enter in SE80. All transactions will be listed, but often BADIs, BAPIs and User-exits are included, too.

Regards,

Christian

0 Kudos

My focus is <b>not</b> to find BAPIs. Let me give two questions for better understanding:

1. If you create your own Business Object, how do you link to other components?

2. After you do some transactions, workflow (based on Business Object) will be invoked. What is the mechanism?

Message was edited by: Ben

0 Kudos

Hi Ben,

Sorry for the delay in replying. I am not sure I understood your question 1. What do you mean by 'other components'? You use SW01 to define your business objects. Here is the place where you will define the business object's interface, key fields, attributes, methods and events. Use SWETYPV transaction to link business object to an event. Use transaction code SWU_EQCD(a wizard transaction) to choose a business object, create an event, link them to change documents etc.

So there are lot of things you need to do, if you are including workflow in the picture. You need to create change document objects, create business objects, events and then link them all together and then workflow needs to be setup, activated and all related workflow config needs to be there.

If you look under SAP initial menu, you will find all the transactions related to business objects, and workflow under Business Framework and Business Workflow folders.

Hope this helps.

Srinivas

0 Kudos

Thanks Srinivas,

Your answer is quite helpful and partialy answer my questions. I still wonder:

How to link a business object and a transaction code?

For example, if I create a sales order (VA01), how is it linked to business object BUS2032 (SalesOrder)?

0 Kudos

Hi Ben,

I'm not sure that you link a business object and a transaction code explicitly. Normally in the business objects methods you have coded what transaction code should be called. Therefore if you use the methods of the business objects it then knows what transaction to call.

Conversely on the workflow side you will find that down in the depths of the coding for VA01 (as an example) it calls workflow function modules and raises events. When doing so it provides the business object id and key to the business object (i.e. the sales order number). Indirectly I guess the change documents that are raised for most things in SAP like sales documents are uniquely identified and therefore can also be translated to the business object key (e.g. sales documents will have their own change document type).

A brief example in my 4.6c system can be found in include LIEDPF4C in the form finsta_kontoauszug_buchen with a call to function SAP_WAPI_CREATE_EVENT. You see the the parameter "object_type" has a variable passed to it "objtype_finsta". If you drill back on objtype_finsta you see that is hardcoded to the value BUS4499.

I guess you could say the developer of the business object knows what transaction codes the business object should use and the developer of the code in the transaction code knows what business objects he should be raising events for if necessary.

Hope this helps.

Regards,

Michael

0 Kudos

Thank you, Michael,

Very good explanation. My understanding is that SAP developer hardcoding business object name in corresponding transaction. There is no direct link from business object defintion to transaction.

<b>I did find a constant in VA01 for business object type BUS2032 (SalesOrder).</b>

Then I think business object technology is not well designed.

0 Kudos

Hi Ben,

We have to understand that VA01 was there in SAP since the very begining of R/3 while business objects concept is relatively new. In order to provide backward compatibility and at the same time move forward with the object oriented coding, SAP has to strike a balance between how much it can leave it to configuration and how much it needs to hardcode.

I don't see hardcoding as such a bad thing, but I think eventually SAP will tie in all these.

If you think our postings helped you, could you please assign poitns to us and close the posting?

Thanks,

Srinivas

0 Kudos

Sometimes we need some hardcoding.

But I feel link between Business Object and transaction is not straight forward inside SAP.

Straightforward, I mean, it should be sth like:

If you click Save in VA01, Method CreateFromDat1 of business object BUS2032 (SalesOrder) is called.

Now situation is like there are two separate stuffs. But it spend much efforts around to make it logically linked.

0 Kudos

I am not sure what you actually mean by "It spends much efforts around to make it logically linked", because it seems a little straightforward to me. Correct me if I am wrong.

For BUS2012(Purchase Order), if you look at the method <b>PurchaseOrder.Edit</b> - it is linked to transaction ME22. Double click on that method and click on ABAP. SO this is how methods are linked to transactions, rather than entire business objects being related to transaction.

Regards,

Subramanian V.

Former Member
0 Kudos

Hello Ben,

If you are looking for all the BAPI's use transaction code BAPI. This will take to you the BAPI explorer.

Here you can find all the business objects by application area and once you get into each method of the business object, you will get the technical implementation details of the methods, which can be a function module or a tcode etc.

Alternatively, if you know your business object, you can go straight to transaction SWO1, enter your business object, do display. In the next screen, expand methods, double click on any of the methods. The ABAP tab will tell you how the method is implemented.

Hope this helps. Please let know if you need more details.

Srinivas

Message was edited by: Srinivas Adavi

Tammie
Participant

Have a look in table SWOTDV where OBJTYPE = business object. This table gives you a list of the methods for business objects and the corresponding transaction or function module (usually a BAPI).

When SWOTDV-ABAPTYPE = 'T', SWOTDV-ABAPNAME gives you the transaction code.

When SWOTDV-ABAPTYPE = 'F', SWOTDV-ABAPNAME gives you the name of the function module.

Hope this helps.