cancel
Showing results for 
Search instead for 
Did you mean: 

Trapping System Form Close Row, Cancel Document, etc

Former Member
0 Kudos

Hi All,

I have an application which maintains Call-Off Sales and Purchase Orders by Creating Child Orders from a Parent. It maintains the outstanding quantities, etc, on the Parent when the Child is created. All of this is working fine, except....

If on CHILD document I select, either by right click or Data menu, the options Cancel, Close, Close Row etc. I cannot trap the event and adjust the Parent Order accordingly.

Running the SAP supplied Event Logger it is showing a Form Loading (Form 0) which is the confirmation request to perform the action. I cannot trap this event in my add-on as it does not seem to be passed outside of the standard SAP application. I have no event filtering on at this time so should be seeing ALL events.

Any ideas?

Many thanks,

David

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you very much Anoop. I don't think I would have found that in a million years! One thing though...Your method works well for the Close/Cancel event but the Close Row/Cancel Row are a bit more tricky. I have managed to do it by saving the Document Rows in a ##TEMP table on DATA_LOAD and then re-reading the rows and comparing the contents on DATA_UPDATE. It works OK but seems a bit messy. Is there a way of identifying the Closed/Deleted rows provided in the API?

Anyway, thank you very much once again.

David

former_member682029
Contributor
0 Kudos

Hi

You can code in the FormDataEvents section. In FormDataEvents there is an event type called FormDataUpdate.

If you cancel a document, you will get the code running through the form data events. It's event type will be FormDataUpdate.

So do this

In form data events, beforeAction = true

collect the value for 'Canceled' from the database.

Also collect the same value when beforeAction = false.

If both values are different, that means, a Cancel document action was initiated.

Anoop