I want to know using workflow, how can I block a customer the moment it is created or changed via transaction XD01 and XD02. I am in version 4.5B SAP.
I created an object ZKNA1 and delegated it to KNA1. There I wrote 2 methods block/unblock, where I wrote update commands on KNA1 on fields AUFSD, SPERR and CASSD. Now XD01 and XD02 does not have any system triggered events, so I created an event ONSAVE in ZKNA1 and triggered it in the exit EXIT_SAPMF02D_001 using FM SWE_EVENT_CREATE. This is triggering my workflow, but the following problems occur.
In XD01 transaction, the customer number KNA1-KUNNR is not yet created at the user exit EXIT_SAPMF02D_001 (before save), hence kunnr field is blank. There is only one user exit in XD01/02. Hence my workflow does not get the customer number in CREATE (XD01) mode.
In XD02 transaction, the customer number is passed, but the update command does not work in the background, if I set the Activity in workflow as background. I have to keep the work item as background, because I cannot ask the user to execute the workitem in foreground and hence force the user to block customer by executing the workitem and hence effect the blocking.
Please enlighten me in this case. If the post was not very explanatory, then please ask me what more feedback is required.
Answers will be rewarded.