Dear experts,
In transaction IW32, we do a 'fixed price' on the components-tab ... By doing this, we automatically fill the field profile (PMSDO-FFPRF) on the control-tab with a corresponding value ... So far so good ... We save the service order and everything is fine !
But then we go bach to the same order and we manually delete the component-lines ! After this, we save immediately and our problem will occur ! At this moment, the value on the field PMSDO-FFPRF should be changed to another one ... We do this in enhancement ZXWOCU07 using the following code :
<i>CLEAR: lv_comp_ok.
CALL FUNCTION 'CO_BC_GET_RESBV'
EXPORTING
aufnr_imp = caufvd_imp-aufnr
TABLES
resbv_tab = li_resbp.
ASSIGN (lv_name2) TO <lf_pmsdo>.
IF sy-subrc = 0.
li_pmsdo[] = <lf_pmsdo>.
LOOP AT li_pmsdo WHERE objnr = caufvd_imp-objnr.
IF li_pmsdo-ffprf <> 'CSMS0001'.
SELECT *
INTO TABLE li_comp_inp
FROM ycs_srv_comp_inp.
LOOP AT li_resbp.
READ TABLE li_comp_inp WITH KEY matnr = li_resbp-matnr.
IF sy-subrc = 0.
lv_comp_ok = 'X'.
ENDIF.
ENDLOOP.
>>> begin of issue 887 on 03.09.2007 by AWXQV
AWYLH
*
IF sy-subrc NE 0.
lv_comp_ok = 'X'.
ENDIF.
AWYLH
IF li_resbp[] IS INITIAL.
CLEAR: lv_comp_ok.
ENDIF.
<<< end of issue 887 on 03.09.2007 by AWXQV
IF lv_comp_ok = ''.
li_pmsdo-ffprf = 'CSMS0001'.
MODIFY li_pmsdo.
ASSIGN (lv_name3) TO <lf_caufvdb>.
IF sy-subrc = 0.
li_caufvdb[] = <lf_caufvdb>.
LOOP AT li_caufvdb WHERE aufnr = caufvd_imp-aufnr.
li_caufvdb-flg_pmsd = 'X'.
MODIFY li_caufvdb.
ENDLOOP.
<lf_caufvdb> = li_caufvdb[].
ENDIF.
ASSIGN (lv_name4) TO <lf_pmsdo_info>.
IF sy-subrc = 0.
li_pmsdo_info[] = <lf_pmsdo_info>.
LOOP AT li_pmsdo_info WHERE objnr EQ caufvd_imp-objnr
AND flg_upd IS initial.
li_pmsdo_info-flg_upd = 'U'.
MODIFY li_pmsdo_info.
ENDLOOP.
<lf_pmsdo_info> = li_pmsdo_info[].
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
<lf_pmsdo> = li_pmsdo[].</i>
Problem now is that the changed value does not appear after we enter the service order again ?
Does anyone know what I'm doing wrong ???
Greetz,
Kurt.