Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get deleted operations through code

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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

simon_filiz
Member
0 Kudos

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.