on 09-29-2008 8:17 AM
Hi Experts,
Can it be possible to change Status of Preceding document using Action Profile,
in Action Defination (Process Type) i can see the Method SET_DOCUMENT_STATUS will it be useful,
Please suggest in details.
Thanks in Advance,
Dipesh.
Hi,
Method SET_DOCUMENT_STATUS is used to set the status of the current document.
When do you want to set the status of the preceding document ?
Regards,
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Madhu,
In my scenario i m trying to set the status of preceding document for e.g.I want set the Status of Lead which is preceding document for Opportunity, can it be achived using SET_DOCUMENT_STATUS method
or we can put transaction type of Lead in initial value.
Please Suggest.
Thanks,
Dipesh.
Hi Dipen,
I dont find any standard method which updates the preceding document status.
I had worked on scenario where we have changed service order status upon service confirmation status gets completed
I have used a Zmethod to achieve this. Find the below code which i used. Hope it may be useful to you to create Zmethod.
method IF_EX_EXEC_METHODCALL_PPF~EXECUTE .
data: lv_guid_ref type crmt_object_guid,
lc_action_execute type ref to cl_action_execute,
doc_info type CRMT_DOC_FLOW_WRKT,
doc_links type line of CRMT_DOC_FLOW_WRKT,
header_guid type CRMT_OBJECT_GUID,
object_no type CRM_JSTO-OBJNR,
order_items type CRMT_ORDERADM_I_DU_TAB,
order_item type line of CRMT_ORDERADM_I_DU_TAB.
* get the object GUID for processing
create object lc_action_execute.
call method lc_action_execute->get_ref_object
exporting
io_appl_object = io_appl_object
ip_action = ip_action
ii_container = ii_container
importing
ev_guid_ref = lv_guid_ref.
* If the GUID is not present then get the information from the object
* layer
if lv_guid_ref is initial.
CALL FUNCTION 'CRM_INTLAY_GET_HEADER_GUID'
IMPORTING
EV_HEADER_GUID = lv_guid_ref
.
endif.
* check the GUID before processing
check not lv_guid_ref is initial.
* Read the document flow to retrieve the service order number
CALL FUNCTION 'CRM_DOC_FLOW_READ_OB'
EXPORTING
IV_HEADER_GUID = lv_guid_ref
IMPORTING
ET_DOC_FLOW_WRK = doc_info
.
* CALL FUNCTION 'CRM_DOC_FLOW_READ_DB'
* EXPORTING
* IV_HEADER_GUID = lv_guid_ref
* IMPORTING
* ET_DOC_LINKS = doc_info.
* determine if this service confirmation has a service order
describe table doc_info lines sy-tabix.
check sy-tabix gt 0.
read table doc_info into doc_links with key objtype_a = 'BUS2000116'.
* set the user status to Complete upon save of the
* service confirmation
move doc_links-objkey_a to header_guid.
* call function 'CRM_STATUS_BUFFER_REFRESH'.
* Lock the service order
call function 'CRM_ORDER_ENQUEUE'
exporting
iv_guid = header_guid
exceptions
foreign_lock = 1
system_failure = 2
distributed_lock = 3
no_change_allowed = 4
transferring = 5
others = 6.
* Check if the service order is locked
if sy-subrc = 1 or sy-subrc = 3.
* sent message to the user
endif.
* Change the header status
move header_guid to object_no.
call function 'CRM_STATUS_CHANGE_EXTERN_OW'
exporting
objnr = object_no
user_status = 'E0007'
set_inact = ' '
exceptions
object_not_found = 1
status_inconsistent = 2
status_not_allowed = 3
others = 4.
* Change the line item status
CALL FUNCTION 'CRM_ORDERADM_I_READ_DB'
EXPORTING
IV_HEADER = header_guid
IMPORTING
ET_ORDERADM_I_DB = order_items.
* read each item and change the status
loop at order_items into order_item where itm_type ne 'SRVS'.
move order_item-guid to object_no.
call function 'CRM_STATUS_CHANGE_EXTERN_OW'
exporting
objnr = object_no
user_status = 'E0007'
set_inact = ' '
exceptions
object_not_found = 1
status_inconsistent = 2
status_not_allowed = 3
others = 4.
endloop.
* Save the status
if sy-subrc eq 0.
call function 'CRM_STATUS_UPDATE_DIALOG'.
endif.
* set the return processing status
if sy-subrc eq 0.
rp_status = '1'.
else.
rp_status = '2'.
endif.
endmethod.
Regards,
Madhu
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.