In many projects, we have had the need to have status management for our application. Many a times, we end up creating a new framework or functionality for the same, not knowing there is a standard feature for the same. Here is what you will need to do to configure and set up a new one.

  1. Define a new Object type (Tcode BS12)

Create a new object type which identifies a status object.

/wp-content/uploads/2015/02/bs12_638009.png

2. Maintain status profile (BS02)

Create a new status profile, which can be made up of one or more statuses. Each status has a number and you shall also specify the lowest and the highest status you can navigate to from here. It is not possible to specify minor status transitions like from A you can move to C and not D, but if you place the statuses in the right order, it should be possible to carefully define such transitions.

/wp-content/uploads/2015/02/bs02_638010.png

3. Maintain Business transactions (BS32)

The business transactions are like actions in the system. Some of the actions are possible only in certain statuses, and some of them can also cause a status change.

/wp-content/uploads/2015/02/bs32_638011.png

4. Business transactions valid for Object type

In TcodeBS12, double click on the object type, select all the business transactions that are eligible for this object type.

/wp-content/uploads/2015/02/img4_638012.png

5. Transaction Control

In BS02, double click on each of the status configured to define the transaction control

It is possible to specify which business transactions are possible in a given status and which are not.

As a second step, it is also possible to specify that a certain transaction sets a certain status.

/wp-content/uploads/2015/02/img5_638014.png

ABAP Code for status transition:

**Run business transction in simulation/update mode

CALL FUNCTION ‘STATUS_CHANGE_FOR_ACTIVITY’

EXPORTING

check_only           = iv_simulation_flag

objnr                = lv_objnr

vrgng                = lv_biz_transaction

EXCEPTIONS

activity_not_allowed = 1

object_not_found     = 2

status_inconsistent  = 3

status_not_allowed   = 4

wrong_input          = 5

warning_occured      = 6

OTHERS               = 7.

IF sysubrc <> 0.

MESSAGE e075(zawct_msg) WITH lv_biz_transaction INTO lv_message.

PERFORM bapi_message_collect CHANGING et_messages.

RETURN.

ENDIF.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply