‎2008 Jul 08 3:48 PM
Can anyone please tell me the use of function module STATUS_CHECK in case of sales order creation and how do we select or activate or remove the status using the above function module
‎2008 Jul 08 4:08 PM
‎2008 Jul 08 3:52 PM
Hi,
Checks whether a status is set or not.
If the status is set, the function module terminates without an exception.
If the status is not set, the exception STATUS_NOT_ACTIVE is triggered.
CALL FUNCTION 'STATUS_CHECK'
EXPORTING
OBJNR = CAUFVD-OBJNR
STATUS = STATUS_PRINT
EXCEPTIONS
OBJECT_NOT_FOUND = 01
STATUS_NOT_ACTIVE = 02.
CHECK SYST-SUBRC = 2. " status is not yet active,
*.. when not yet set, then we should set it now.
CALL FUNCTION 'STATUS_CHANGE_FOR_ACTIVITY'
EXPORTING
ACTIVITY_ALLOWED = ' '
NO_CHECK = 'X'
SET_CHGKZ = 'X'
OBJNR = CAUFVD-OBJNR
VRGNG = Y_RMDR " print status activity
EXCEPTIONS
ACTIVITY_NOT_ALLOWED = 01
OBJECT_NOT_FOUND = 02
STATUS_INCONSISTENT = 03
STATUS_NOT_ALLOWED = 04
WRONG_INPUT = 05.
Regards,
Sujit
Edited by: Sujit Pal on Jul 8, 2008 4:56 PM
‎2008 Jul 08 4:08 PM