Invoice approval workflows have a starting weakness. they start, in most cases, form the DMS document – the scanned invoice. And the workflow which is linked to the invoice in most cases needs to be linked to the DMS document .the process looks a lot of times something like this:
Now the steps may change a bit from organization to organization but the problem in all cases is linking the DMS document to the invoice workflow. The first problem is actually not a workflow one – there is no standard DMS object link to invoices. This can be overcomed in two way, create a Z DMS object type for the invoice or use classification where the attributes are the invoice number and year.
The second problem is raising an event for the workflow invoice object when a DMS object is linked, I will show a solution based on the classification option, but the same logic should work well for a z DMS object.
CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
EXPORTING
objectkey = lv_obj_key
objecttable = 'DRAW'
classnum = <your dms class>
classtype = '017'
TABLES
allocvaluesnum = lt_values_num
allocvalueschar = lt_values_char
allocvaluescurr = lt_values_curr
return = lt_return.
IF lt_values_char IS NOT INITIAL.
READ TABLE lt_values_char WITH KEY charact = 'LOGINV'
INTO ls_value_char.
lv_inv_num = ls_value_char-value_char.
ENDIF.
(Repeat for the 'year' character)
IF lv_inv_num IS NOT INITIAL AND lv_inv_year IS NOT INITIAL.
CLEAR lv_inv_obj_key.
CONCATENATE lv_inv_num lv_inv_year INTO lv_inv_obj_key
RESPECTING BLANKS.
CLEAR ls_simple_container.
ls_simple_container-element = 'DMSKEY'.
ls_simple_container-value = objkey.
APPEND ls_simple_container TO lt_simple_container.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = 'BUS2081'
object_key = lv_inv_obj_key
event = 'SCANNED'
TABLES
input_container = lt_simple_container.
ENDIF.
P.S
There are solutions for a more automated process such as Invoice Management Software | Procurement | SAP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
10 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
2 | |
2 |