01-09-2018 9:10 PM
Hello all!
I was needing to retrieve operations that have been deleted in IW32 with an REL status. It seems that I could use the bapi BAPI_ALM_ORDER_GET_DETAIL by requesting use of the ET_OPERATIONS parameter. However the code hits a FM called CO_MK_DISTRIBUTION_FLAG_GET to determine a Boolean on the variable lv_distribution. This determines whether or not the deleted operations will be retrieved as part of the return results. It is currently always returns false which means ultimately that it will not return any deleted operations if any.
Is there another way to return deleted operations through this bapi or is there an alternative?
Thanks!
Rene
01-10-2018 7:54 PM
I found an alternative that I thought I would pass along in case someone needs it.
TYPES: BEGIN OF t_deleted_ops,
aufpl TYPE co_aufpl,
ops TYPE vornr,
END OF t_deleted_ops.
DATA: lt_deleted_ops TYPE TABLE OF t_deleted_ops.
DATA: lt_ops TYPE <your itab>.
SELECT aufpl vornr
FROM afvc INTO TABLE lt_deleted_ops
FOR ALL ENTRIES IN lt_ops
WHERE aufpl = lt_ops-aufpl
AND phflg = 'X'.
lt_deleted_ops now has the deleted operations for the aufpl from the AFVC table.
Rene
01-10-2018 7:54 PM
I found an alternative that I thought I would pass along in case someone needs it.
TYPES: BEGIN OF t_deleted_ops,
aufpl TYPE co_aufpl,
ops TYPE vornr,
END OF t_deleted_ops.
DATA: lt_deleted_ops TYPE TABLE OF t_deleted_ops.
DATA: lt_ops TYPE <your itab>.
SELECT aufpl vornr
FROM afvc INTO TABLE lt_deleted_ops
FOR ALL ENTRIES IN lt_ops
WHERE aufpl = lt_ops-aufpl
AND phflg = 'X'.
lt_deleted_ops now has the deleted operations for the aufpl from the AFVC table.
Rene
04-27-2022 12:29 PM
You can call FM CO_MK_DISTRIBUTION_FLAG_set before you call the BAPI and
than you will get the deleted operations as well.
Example:
CALL FUNCTION 'CO_MK_DISTRIBUTION_FLAG_SET'
EXPORTING
flag_distribution = abap_true.
CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
EXPORTING
number = ls_sel_order-orderid
* IMPORTING
* ES_HEADER =
* ES_SRVDATA =
* ES_REFORDER_ITEM =
* ES_JVA_DATA =
TABLES
* ET_PARTNER =
et_operations = it_oper
* ET_COMPONENTS =
* ET_RELATIONS =
* ET_SRULES =
* ET_OLIST =
* ET_OPROL =
* ET_TEXTS =
* ET_TEXT_LINES =
* ET_PRTS =
* ET_COSTS_SUM =
* ET_COSTS_DETAILS =
return = it_ret_detail
* EXTENSION_IN =
* EXTENSION_OUT =
* ET_REFORDER_SERNO_OLIST =
* ET_SERVICEOUTLINE =
* ET_SERVICELINES =
* ET_SERVICELIMIT =
* ET_SERVICECONTRACTLIMITS =
* ET_PERMIT =
* ET_PERMIT_ISSUE =
* ET_ADDITIONAL_TEXTS =
.
CALL FUNCTION 'CO_MK_DISTRIBUTION_FLAG_SET'
EXPORTING
flag_distribution = abap_false.