cancel
Showing results for 
Search instead for 
Did you mean: 

User exit to set user status

geir_kronkvist1
Explorer
0 Kudos

Hi,

We have a requirement to implement our own status management for SD orders. I have configured a new SD item object status profile in transaction BS02. Now I need to program the logic to update the item object status when the user is saving the sales order. I have looked at the relevant user exits in MV45AFZZ, but not found a way to update the item status upon saving.

Has anyone faced a similar problem and know a good way to update the item object status upon sales order save?

Thanks in advance!

Kind regards,

Geir Kronkvist

Accepted Solutions (1)

Accepted Solutions (1)

geir_kronkvist1
Explorer
0 Kudos

Thanks a lot!

Former Member
0 Kudos

Hi Gier,

Did my solution accomplish your requirements or you figured it yourself.

I did not see any points allocated to this thread. hence this question.

Answers (1)

Answers (1)

Former Member
0 Kudos

I had accomplished this requirement as follows.

Step 1:-

There is an SAP function module STATUS_UPDATE. This FM should be invoked in update task.

Reason: SAP internally invokes this FM as an update task during the Sales order save process. Hence your updates should follow SAP's status update process.

Step 2:

Created a report program with 2 form routines to export and import JEST entries as follows.

form set_usrstat tables it_jest_upd structure jest_upd.

  • Export internal table into memory

export it_jest_upd to memory id 'it_jest_upd'.

  • Execute only after the next commit statement

perform zset_status on commit.

endform.

&----


*& Form set_status

&----


  • Form for updating status after commit

----


form zset_status.

data: it_jest_ins like jest_upd occurs 0,

it_jest_upd like jest_upd occurs 0 with header line,

it_jsto_ins like jsto occurs 0,

it_jsto_upd like jsto_upd occurs 0,

it_obj_del like onr00 occurs 0.

  • Import data from Memory

import it_jest_upd from memory id 'it_jest_upd'.

  • Run function module to update the status

CALL FUNCTION 'STATUS_UPDATE' in update task

TABLES

jest_ins = it_jest_ins

jest_upd = it_jest_upd

jsto_ins = it_jsto_ins

jsto_upd = it_jsto_upd

obj_del = it_obj_del

.

endform. " zset_status

Step 3:

If you want to set a user status fill the i_jest_upd internal table accordingly and invoke the perform statement as follows.

  • Execute only after the commit

PERFORM set_usrstat(zsd_status_update) TABLES i_jest_upd.