cancel
Showing results for 
Search instead for 
Did you mean: 

Does any one know the FM/BAPI "Assign Door for TU" like /SCWM/TU transaction?

former_member198721
Participant

I am using service class for the creation of TU and using method

ADD_TU_DOOR of service class /SCWM/CL_SR_BO_TU , but I am not getting my code right.Its not saving in database.

Does any body know the sequence of steps for same?

xyla
Participant
0 Kudos

Did you manage to solve the problem? I'm facing the same problem with this method

View Entire Topic
former_member198721
Participant
0 Kudos

I figured it out, it was tricky but once known then piece of cake for other operations on TU:

Below is snippet for same;

DATA:
LT_BO_TU TYPE /SCWM/TT_BO_TUNIT,

LO_SR_BOM TYPE REF TO /SCWM/CL_SR_BOM.

Logic:

LOOP AT LT_BO_TU ASSIGNING FIELD-SYMBOL(<LFS_BO_TU>).

<LFS_BO_TU>-BO_REF->GET_DATA(IMPORTING ES_BO_TU_DATA = ES_DETAILS ).

*getting internal tu num.

LST_TU_DOOR-TU_NUM = ES_DETAILS-TU_NUM.

LST_TU_DOOR-START_PLAN_TSTFR = ES_DETAILS-START_PLAN_TSTFR.
LST_TU_DOOR-START_PLAN_TSTTO = ES_DETAILS-START_PLAN_TSTTO.
LST_TU_DOOR-END_PLAN_TSTFR = ES_DETAILS-END_PLAN_TSTFR.
LST_TU_DOOR-END_PLAN_TSTTO = ES_DETAILS-END_PLAN_TSTTO.

*&-- assign door to tu

GET TIME STAMP FIELD DATA(L_TIME).

LST_TU_DOOR-END_PLAN_TSTFR = L_TIME.
LST_TU_DOOR-END_PLAN_TSTTO = L_TIME + L_DIFF.

<LFS_BO_TU>-BO_REF->ADD_TU_DOOR (
EXPORTING
IS_BO_TU_DOOR = LST_TU_DOOR
IMPORTING
EO_BO_DOOR = LO_BO_DOOR ).

LO_SR_BOM->SAVE().
COMMIT WORK AND WAIT.