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: 

Integrating a Z Business Object with SAP Standard general status mangement?

frankluzat
Participant
0 Kudos

Hi,

I would like to integrate my custom business object (not a subtype of a standard BOR Object) with the SAP standard general status management process as it is used for example by equipments, production orders etc.

Researching on that topic I didn't find any way to do it.

My assumption is that it is not possible:

This is because table TJ02 (system status) has delivery class 'S' (Maintenance only by SAP) which makes it impossible to define my own system status for my custom business object.

Is anyone of you able to shed some light on this?

1 ACCEPTED SOLUTION

rdiger_plantiko2
Active Contributor
0 Kudos

Frank,

if it is a completely own BOR object, I don't see a reason why you would like to change a system status (= internal status). System status can be changed only programmatically, and this is coded in the objects to which they belong.

The recommended procedure is to work with custom status ( = external status). Endow your SAP standard object (equipment, ... ) with a status profile via customizing. Most object have a field STSMA in their application-specific top-level customizing table (like order types). Define a status profile via transaction BS02, and add status to the with the semantics that you want to add.

Set or reset these status with your custom object, for example by implementing a BOR method which calls the function module STATUS_CHANGE_EXTERN.

Each user status can be defined to allow or disallow certain "business processes" - which in turn are used by the SAP standard code to set the system status (internal status). For example, in service orders there is a business process RELE which will set the order to "Released" - which is a system status. If a certain user status is defined to disallow process RELE, the order can't be released unless that user status will be reset.

Is there a reason why this way isn't viable for you?

Regards,

Rüdiger

P.S.: In case you know what you are doing, you can change the system status programmatically with function module STATUS_SET_INTERN / STATUS_RESET_INTERN / STATUS_CHANGE_INTERN - but this is not recommended.

5 REPLIES 5

rdiger_plantiko2
Active Contributor
0 Kudos

Frank,

if it is a completely own BOR object, I don't see a reason why you would like to change a system status (= internal status). System status can be changed only programmatically, and this is coded in the objects to which they belong.

The recommended procedure is to work with custom status ( = external status). Endow your SAP standard object (equipment, ... ) with a status profile via customizing. Most object have a field STSMA in their application-specific top-level customizing table (like order types). Define a status profile via transaction BS02, and add status to the with the semantics that you want to add.

Set or reset these status with your custom object, for example by implementing a BOR method which calls the function module STATUS_CHANGE_EXTERN.

Each user status can be defined to allow or disallow certain "business processes" - which in turn are used by the SAP standard code to set the system status (internal status). For example, in service orders there is a business process RELE which will set the order to "Released" - which is a system status. If a certain user status is defined to disallow process RELE, the order can't be released unless that user status will be reset.

Is there a reason why this way isn't viable for you?

Regards,

Rüdiger

P.S.: In case you know what you are doing, you can change the system status programmatically with function module STATUS_SET_INTERN / STATUS_RESET_INTERN / STATUS_CHANGE_INTERN - but this is not recommended.

0 Kudos

Hi Rüdiger,

I think this is a viable way.

What are the mandytory steps to use status management with my custom Z Business Object?

- Create new Objecttyp (BS12)

- Maintain status profile (BS02)

- Define own subscreen dynpro for display on the standard status maintenance dynpro (FM STATUS_MAINTAIN)

- Enter new object instance into table JSTO with corresponding status profile and object type (Any function modules available for doing this?)

Any further steps?

Do I have to add a field "OBJNR" in the main table of my business object and also add this number to table ONR00 when a new instance of my object is created?

0 Kudos

Frank,

your questions point to another direction than the way I proposed in my answer. What you intend is to create status for your own business objects - while I recommended you to manipulate custom status of existing objects (the "other" objects that you want to influence: equipments, ... )

But, yes: In principle it should be possible to create an own status object as a customer, too --> transaction BS12. To avoid more conflicts with the standard, you should avoid internal status (BS22) and processes (BS32) and work with external status instead (BS02).

But: with an own status object you won't be able to influence the business processes of other status objects. If this is not your primary interest anyway - proceed. Otherwise: Use events and methods of your BOR object to set user statusses on the BOR object that you intend to influence, instead (as I recommended above).

Here are some thoughts concerning the creation of an own system status object:

Associated to the three-letter status object type (OBTYP), there is also a two-letter constant (data type J_OBART) which is used as prefix for the status object numbers in tables JSTO and JEST. Ever since, I have worked with existing status objects, so I don't know how to associate OBTYP to OBART. But it should be possible. Have a look at the usages of tables ONR00...

If you have own maintenance dynpros for the status, the subscreen dynpro number and program for status maintenance can be declared in transaction BS12. But usually, the standard should suffice.

For maintaining the status in your transaction, you use:

Function module STATUS_OBJECT_CREATE: to create a new status object when you create a new instance of your custom business object. You can pass the OBJNR there (you best work with the standard convention that the first two letters are the OBART), or  switch it later, when the user hits "SAVE" in your self-defined maintenance transaction for creating new instances of your busines object. In the latter case, you call the STATUS_OBJECT_SWITCH_NUMBER to switch the temporary number to its final number. Best practice is to hold the OBJNR in one of the data tables of the data model that you have designed for your custom business object.

Once the status object is created, you can set status on it with the function module STATUS_CHANGE_EXTERN. The changes will be registered for commit with a PERFORM STATUS_UPDATE ON COMMIT internally, so they will be saved to JSTO / JEST automatically with the next COMMIT WORK.

In change mode, you simply skip the STATUS_OBJECT_CREATE step. You directly call the STATUS_CHANGE_EXTERN with the OBJNR that you have saved in the database tables of your own business object's data model.

Hope this helps,

Rüdiger

0 Kudos

Rüdiger,

thank you very much for this detailed information.

I think there was a misunderstanding at first: I only want to maintain status for my own custom business object - no dependent objects.

Your latest reply contains all the information I need for implementing this process. Thank you again!

0 Kudos

Hi Frank and Rüdiger,

The above explanation seems unabsorbable. My requirement is to attach a standard function module with a "Normal Function Module" Processing Type in Attributes to a Customised BOR (ZABC).

Is there any possible way to attach that standard FM to a ZABC( BOR ) without creating any Z for FM??

Kindly elaborate the steps.

Thanks in advance.

Regards,

DD