SAP Function STATUS_OBJECT_CREATE - Create Status Object

Parameter Reference Type Length Default Optional Text
CHGKZ JSTO-CHGKZ C 1 SPACE X Ind. Creation of Change Documents for Object
CLIENT SYST-MANDT C 3 SY-MANDT X Client
IONRA_IMP 0 X IONRA Structure for Object Number Management: Obsolete
I_OBJECTKEY 0 X Object Key for Obect Number Management
OBJNR JSTO-OBJNR C 22 SPACE X Object Number
OBTYP JSTO-OBTYP C 3 Object Category
ONLY_E_STATUS XFELD C 1 SPACE X Checkbox; User Status Only
STSMA JSTO-STSMA C 8 SPACE X Status Profile

Parameter Reference Type Length Text
OBJNR JSTO-OBJNR C 22 Object Number
STONR TJ30-STONR N 2 Status Number

Exception Text
OBTYP_INVALID Invalid object type
STATUS_OBJECT_ALREADY_EXISTS Status Object Already Exists
STSMA_INVALID Invalid Status Profile
STSMA_OBTYP_INVALID Status Profile Not Created for Object Type

Functionality
The function module generates a status object.
Take the object number from the object number management (functionmodules OBJECT_NUMNBER_GET_xx).
If no object number is given, the module takes a temporary objectnumber that must be replaced later (function moduleSTATUS_OBJECT_SWITCH_NUMBER).

Example

Creating an internal order with number 100123 (object type "ORC") forstatus profile "STATSCHEM" with final object number
call function 'OBJECT_NUMBER_GET_OR'
exporting
aufnr = '100123'
importing objnr = objektnummer.
call function 'STATUS_OBJECT_CREATE'
exporting
objnr = objektnummer
obtyp = 'ORC'
stsma = 'STATSCHEM'.
commit work.
data: objectkey like ionra.
* TBO00-REFSTRUCT for object type 'OR' is 'IONRA'
objectkey-aufnr = '100123'.
call function 'STATUS_OBJECT_CREATE'
exporting
i_objectkey = objectkey
obtyp = 'ORC'
stsma = 'STATSCHEM'.
importing
objnr = objektnummer.
call function 'OBJECT_NUMBER_GET_OR'
exporting
aufnr = '100123'
importing objnr = objektnummer_neu.
call function 'STATUS_OBJECT_SWITCH_NUMBER'
exporting
objnr_old = objektnummer
objnr_new = objektnummer_neu.
commit work.

Notes
Do not use the IMPORT parameter IONRA. Fill the parameter I_OBJECTLEYinstead. This untyped parameter must be 'like'd to the structureassigned to the object type in table field TBO00-REFSTRUCT.

Description
Object number taken from the object number management
(function modules OBJECT_NUMBER_GET_xx ).
Entry of the object number is optional. If one is not entered, a sotemporary object number (TMxxxxxxx) is given by the system.
These temporary objects cannot be written to the database, so beforethe "COMMIT WORK" the temporary object numbers must be replaced withreal ones using the function moduleSTATUS_OBJECT_SWITCH_NUMBER.
If this does not take place, the status changes are lost.

Value range
Object number or INITIAL

Default
INITIAL

Description
Status number
If a user status with status number is flagged with initial status,this status number is returned here. Otherwise 00 is returned.

Value range
00 - 99

Description
If this flag is set, the creation of change documents for this objectnumber is activated. Once activated the creation of change documentscannot be deactivated.

Value range
INITIAL or 'X'

Default
INITIAL

Description
This structure is transfered to the function moduleOBJECT_NUMBER_GET_TM if the objectnumber is missing. It contains the object key for the temporary objectnumber to be generated.

Default
INITIAL

Description
Object number taken from the object number management
(function modules OBJECT_NUMBER_GET_xx ).
Entry of the object number is optional. If one is not entered, a sotemporary object number (TMxxxxxxx) is given by the system.
These temporary objects cannot be written to the database, so beforethe "COMMIT WORK" the temporary object numbers must be replaced withreal ones using the function moduleSTATUS_OBJECT_SWITCH_NUMBER.
If this does not take place, the status changes are lost.

Value range
Object number or INITIAL

Default
INITIAL

Description
Object type for which a status object is to be created

Value range
The object types allowed are defined in table TJ03
(maintainenance with transaction BS12).

Description
Status profile for which the object is to be created.
This parameter is optional. If it is missing a status object is createdwithout a status profile. This then just has system status.
The status profile can be assigned later in dialog by the end user(function module STATUS_MAINTAIN).

Value range
Check table is TJ20 (maintain with transaction BS02).

Default
INITIAL

914792No status change docs for production resources and tools
706885No status change documents for components
627044No status change documents for operations