User Status Controlled When Sales Order Created

How can a user status be controlled when a sales order is created?

Depending what is really required here.
I hope you define the status profile and assigned it properly in IMG.

If you want to set status in any of user exits - you can do it using the following code :

read status :

call function 'STATUS_BUFFER_EXPORT_TO_MEMORY' 
exporting 
i_memory_id = 'BSVA_VBK_STATUS' 
exceptions 
others = 1. 
* No need to check the return code 

* Retrieve the user status internal table from memory 
import jest_buf to jest_mem 
from memory id 'BSVA_VBK_STATUS'. 
free memory id 'BSVA_VBK_STATUS'. 

* Check that the internal table jest_mem is filled 
if not jest_mem[] is initial.
....

change status here,

Then call FM :

call function 'STATUS_CHANGE_EXTERN' 
exporting 
client = sy-mandt 
objnr = vbak-objnr 
user_status = tj30t-estat. <<< the status you want to change.

Table :

- tj30t contains a link between status number
-- tj30t – the stat & status description 
--- tj30t-txt04, like 'FINR' shown in VA01,...

Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

More ABAP Tips

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.

ABAP Tips