Hi all,
I need to update the "User Status" on sales order header when a sales order is saved. As user status reside in JEST, what available user exits are there to change/insert new user statuses? I don't believe the common exits like MV45AFZZ would do.
To clarify, to get to these user statuses, you go to the header of the sales order, select on the 'Status' tab, then click on the "Object Status" pushbutton.
Any help would be greatly appreciated in the form of points!
Thank you.
Liam
Hi Liam,
In the Program MV45AFZZ in the FORM userexit_save_document
you use the following fn module to change the user status
'STATUS_CHANGE_EXTERN'
Example
IF t180-trtyp = 'H'. "Only creation time
READ TABLE xvbap WITH KEY matnr = c_matnr.
IF sy-subrc = 0. "If above material exist then change status
LOOP AT xvbap WHERE cuobj NE space
AND matnr = c_matnr.
l_objnr = xvbap-objnr.
CALL FUNCTION 'STATUS_CHANGE_EXTERN'
EXPORTING
objnr = l_objnr
user_status = 'E0013' "Send ej IDOC
set_chgkz = 'X'
EXCEPTIONS
object_not_found = 1
status_inconsistent = 2
status_not_allowed = 3
OTHERS = 4.
ENDLOOP.
ENDIF.
sy-subrc = 0. "Restore the previous condition
ENDIF.
Reward if helpful *********
Hi Liam
I remember in one my earlier project, i have seen coding done for Status Updation via user exits in include MV45AFZZ. So i can not totally rule out this option.
Only point i want to highlight is that, you have to take care of the OBJNR incase of creating a new order via VA01 for internal number assignment. I mean there will be a temporary number in this case as the order is not yet saved to generate a new document.
Kind Regards
Eswar
Add a comment