cancel
Showing results for 
Search instead for 
Did you mean: 

Update main work center(CAUFVD-VAPLZ) user exit IW32

ManojYadav
Explorer
0 Kudos

Dear all,

I have a requirement to change the value of 'Main work center' (Service order, tcode IW32) based on below condition.

Value should be changed when user changes 'Person. no' in first operation and clicks on 'Enter' or 'SAVE'.

I checked exist EXIT_SAPLCOIH_009, EXIT_SAPLCOIH_005, EXIT_SAPLCOIH_007, but is not working.

Code as below:

ls_caufvd = caufvd_imp.

ls_caufvd-vaplz = 'TEST.

CALL FUNCTION 'CO_IH_SET_HEADER'

EXPORTING

caufvd_imp = ls_caufvd.

PERFORM header_update(saplcoih).

Please help to find correct exit. Thank you.

Regards,

Manoj

ManojYadav
Explorer
0 Kudos

Resolved myself by passing value to field CAUFVD-GEWRK (Object ID of the Work Center).

The work center ID is obtained using FM CR_WORKSTATION_CHECK.

CALL FUNCTION 'CR_WORKSTATION_CHECK'
EXPORTING
arbpl = lv_arbpl
werks = lv_plant
IMPORTING
arbid = lv_arbid
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.=
ENDIF.

CLEAR ls_caufvd.
ls_caufvd = caufvd_imp.
ls_caufvd-vaplz = lv_arbpl.
ls_caufvd-gewrk = lv_arbid.

CALL FUNCTION 'CO_IH_SET_HEADER'
EXPORTING
caufvd_imp = ls_caufvd.

PERFORM header_update(saplcoih).

Its workking now.

Accepted Solutions (0)

Answers (0)