2011 May 11 11:43 AM
Hi Gurus,
My requirement is to add the OPERAND pertaining to the installation fact. The values to be set come from workflow.
For example, workflow sends the new operand values for a given installation as
(1) SENIOR
(2) FARM
Currently, I am using Master data template as u2018'ISU_CRM_PRODUCT_CHANGE'
CALL FUNCTION 'ISU_CRM_PRODUCT_CHANGE'
EXPORTING
x_vertrag = im_vertrag <<<contract for a given installation
x_keydate = im_vbeginn <<<change date
x_prodid = l_wa_crmguid-prodid
x_product = l_wa_crmguid-crm_product
x_container = container
X_DISPLAY_LOG =
IMPORTING
errorlog = l_log
EXCEPTIONS
NOT_FOUND = 1
ACTION_FAILED = 2
OTHERS = 3
.
When I execute the aforementioned MDT, two new records get inserted in ETTIFN table as required.
ANLAGE OPERAND AB BIS INAKTIV
5000047666 FARM 05/21/2011 12/31/9999
5000047666 SENIOR 05/11/2011 12/31/9999
However, next time when workflow sends u2018FARMu2019 as an operand value for a different date, letu2019s say 05/31/2011..then records are looking like:
ANLAGE OPERAND AB BIS INAKTIV
5000047666 FARM 05/21/2011 05/30/2011
5000047666 FARM 05/31/2011 12/31/9999
5000047666 SENIOR 05/11/2011 12/31/9999
But, ideally, before adding a new operand, if the same operand already exists, then that operand should become inactive, that is INAKTIV flag should be set (X).
ANLAGE OPERAND AB BIS INAKTIV
5000047666 FARM 05/21/2011 05/30/2011 X
5000047666 FARM 05/31/2011 12/31/9999
5000047666 SENIOR 05/11/2011 12/31/9999
Any idea on how to achieve the same?
As using MDT 'ISU_CRM_PRODUCT_CHANGEu2019 simply adds a new operand record without making an existing operand as inactive.
2011 May 11 2:17 PM
Hello,
Generally I don't fully agree to the claim that when a new Operand is added the old one should become inactive. There are cases where the BIS field of the old should be updated (new AB - 1) to represent a time split.
I usually use the standard FM ISU_DB_ETTIFN_UPDATE and take care of setting inactive flags or time splits by myself.
I was not really satisfied with ISU_DB_ETTIFN_UPDATE because it does not support the Change Installation Fact in the Environment.
Thus, I made a 'Z' FM out of it using following FM's in addition:
CHANGEDOCUMENT_OPEN
CHANGEDOCUMENT_SINGLE_CASE
CHANGEDOCUMENT_CLOSE
Best Regards,
Diana Abu-Gosh
2011 May 12 1:02 PM
Hi ,
As per your requirement you have handle the operands active / inactivity in your code itself.
You have to manipluate the values of AB & BIS of the operand when same operand is coming for updation.
I have used the following FM to manipulate the operands in the installation facts.
Used to read the installation facts.
CALL FUNCTION 'ISU_S_INSTLN_PROVIDE'
EXPORTING
x_anlage = xv_anlage
x_keydate = sy-datum
x_wmode = lc_mode
x_prorate = gc_true
x_no_dialog = gc_true
IMPORTING
y_auto = lwa_auto
EXCEPTIONS
not_found = 1
invalid_keydate = 2
foreign_lock = 3
not_authorized = 4
invalid_wmode = 5
general_fault = 6
OTHERS = 7.
lwa_auto-contr-use-data = gc_true.
lwa_auto-contr-use-okcode = gc_true.
lwa_auto-contr-okcode = lc_save.
to make the changes in the facts.
CALL FUNCTION 'ISU_S_INSTLN_CHANGE'
EXPORTING
x_anlage = xv_anlage
x_keydate = sy-datum
x_prorate = gc_true
x_upd_online = gc_true
x_no_dialog = gc_true
x_auto = lwa_auto
IMPORTING
y_db_update = lv_update
y_exit_type = lv_exit
EXCEPTIONS
not_found = 1
foreign_lock = 2
not_authorized = 3
cancelled = 4
input_error = 5
general_fault = 6
OTHERS = 7.
Thanks,
Vishal