0% found this document useful (0 votes)
76 views

Schedule Condition

This document contains the code for a method that evaluates schedule conditions for a production planning framework (PPF). The method checks conditions for automatically creating a wave for a transport order (TU), including verifying the TU key, reading TU header and delivery data, checking an international flag, and checking the material type to determine if a wave should be created.

Uploaded by

suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

Schedule Condition

This document contains the code for a method that evaluates schedule conditions for a production planning framework (PPF). The method checks conditions for automatically creating a wave for a transport order (TU), including verifying the TU key, reading TU header and delivery data, checking an international flag, and checking the material type to determine if a wave should be created.

Uploaded by

suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

METHOD IF_EX_EVAL_SCHEDCOND_PPF~EVALUATE_SCHEDULE_CONDITION.

*******************************************************************************
* Developer : Neelima S(nxsangar) *
* Ticket No : INC000000144157 - SAP Build – Blair *
* TR No : W4DK900719 *
* Requirement : Create Wave for TU automatically *
*FS id/ TS id :
*-----------------------------------------------------------------------------*
*** CHANGE HISTORY ***
*-----------------------------------------------------------------------------*
* CR# DEVELOPER DATE TRANSPORT DESCRIPTION *
* SAMIDH/NXSANGAR 05/22/18 W4DK900719 Original transport. *
*-----------------------------------------------------------------------------*
DATA: LS_BO_TRANS_MEANS_NEW TYPE /SCWM/S_BO_TRANS_MEANS_NEW,
LV_MSG TYPE STRING.

******Start of changes by VSJASTI on 05/10/2021


DATA: LO_TU_PPF TYPE REF TO /SCWM/CL_SR_TU_PPF,
LO_CONTEXT TYPE REF TO /SCWM/CL_SR_CONTEXT_TUPPF,
LT_TU_DLV TYPE /SCWM/TT_BO_TU_DLV,
LS_TUHDR TYPE /SCWM/S_TUNIT_INT,
LV_INT_FLAG TYPE C LENGTH 1.

DATA(LS_CLS) = /SCWM/CL_SR_BOM=>GET_INSTANCE( ).
"cast imported application object to get the TU key;
"check if key is not initial
TRY.
LO_CONTEXT ?= IO_CONTEXT.
LO_TU_PPF ?= IO_CONTEXT->APPL.
CATCH CX_SY_MOVE_CAST_ERROR.
MESSAGE E481(/SCWM/SHP_RCV) INTO LV_MSG.
CL_LOG_PPF=>ADD_MESSAGE(
EXPORTING
IP_PROBLEMCLASS = SPPF_PCLASS_1
IP_HANDLE = IP_PROTOCOL ).
RETURN.
ENDTRY.
READ TABLE LS_CLS->MT_BO_TU INTO DATA(LS_BO_TU) WITH KEY TU_NUM = LO_TU_PPF-
>GET_TU_NUM( ).
IF SY-SUBRC = 0.
TRY.
CALL METHOD LS_BO_TU-BO_REF->GET_DATA
EXPORTING
IV_ADD_INFO = ABAP_TRUE
IMPORTING
* ES_BO_TU_DATA =
* EV_GM_POST =
* EV_OBJSTATE =
ES_TUHDR = LS_TUHDR
* ES_ACT =
ET_TU_DLV = LT_TU_DLV.
* ET_SEAL =
* ET_IDENT =
* ET_STATUS =
* ET_TU_DOOR =
* ET_TU_VEH =
.
CATCH /SCWM/CX_SR_ERROR .
ENDTRY.
ENDIF.
** Start of insertion - CHG0016693 by sxgoud on 10/29/2021
** In case of multiple deliveries, this read statement is always referening to
first delivery which is already assigned to TU.
* READ TABLE LT_TU_DLV INTO DATA(LS_TU_DLV) WITH KEY TU_NUM = LO_TU_PPF-
>GET_TU_NUM( ).
** Check for delivery which is not yet assigned to TU

READ TABLE LT_TU_DLV INTO DATA(LS_TU_DLV) WITH KEY TU_NUM = LO_TU_PPF-


>GET_TU_NUM( ) CHGIND = 'N'.
** End of insertion - CHG0016693 by sxgoud on 10/29/2021
IF SY-SUBRC = 0.
CALL FUNCTION 'ZEWM_PCL_INTL_FLAG'
EXPORTING
DOCID = LS_TU_DLV-DOCID
IMPORTING
EX_INT_FLAG = LV_INT_FLAG.

IF LV_INT_FLAG = 'X'.
LS_TUHDR-MTR = ''.
ENDIF.
ENDIF.
******End of changes by VSJASTI on 05/10/2021
IF LS_TUHDR-MTR <> 'YPCL'. " Added by VSJASTI on 05/10/2021
IMPORT IS_BO_TRANS_MEANS_NEW TO LS_BO_TRANS_MEANS_NEW
FROM MEMORY ID 'ZEIWM_TU_DATE'.
IF SY-SUBRC IS INITIAL.
EP_RC = 0.
ELSE.
EP_RC = 4.
MESSAGE E000(/SCWM/SHP_RCV) WITH 'Create Wave for TU' '-' 'PPF condition is
not met'
INTO LV_MSG .
CL_LOG_PPF=>ADD_MESSAGE(
EXPORTING
IP_PROBLEMCLASS = SPPF_PCLASS_1
IP_HANDLE = IP_PROTOCOL ).
RETURN.
ENDIF.
******Start of changes by VSJASTI on 05/10/2021
ELSE.
EP_RC = 4.
RETURN.
ENDIF.
******End of changes by VSJASTI on 05/10/2021
* FREE MEMORY ID 'ZEIWM_TU_DATE'.
ENDMETHOD.

You might also like