sábado, 8 de enero de 2011

Antiguo Código de 2lis_03_bf

*&---------------------------------------------------------------------*
*& Form routine_9998
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->DATA_PACKAGE text
* -->P_MONITOR text
* -->P_MONITOR_RECNO text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_9998
TABLES DATA_PACKAGE TYPE _ty_t_SC_1_full
p_monitor STRUCTURE rsmonitor
p_monitor_recno STRUCTURE rsmonitors
CHANGING
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* see OSS note 571669
LOOP AT DATA_PACKAGE.
IF DATA_PACKAGE-stockcat EQ 'V' OR
DATA_PACKAGE-stocktype EQ 'V'.
DELETE DATA_PACKAGE.
ENDIF.
ENDLOOP.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
p_monitor_recno[] = MONITOR_RECNO[].
CLEAR: MONITOR[],
MONITOR_RECNO[].

ENDFORM. "routine_9998

*&---------------------------------------------------------------------*
*& Form routine_0012
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0012
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_9
CHANGING
RESULT TYPE _ty_s_TG_1_full-ISSCNSSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods issue is considered
IF ( COMM_STRUCTURE-processkey EQ '100' "Other Issues
OR COMM_STRUCTURE-processkey EQ '101' "Returns / Vendor
OR COMM_STRUCTURE-processkey EQ '104' "Material Transfer
OR COMM_STRUCTURE-processkey EQ '105' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '106' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '110' ) "Issue from Stock Transfer
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
* only consignment stock is considered
CASE COMM_STRUCTURE-stockcat.
WHEN 'K'.
RESULT = COMM_STRUCTURE-cpquabu.
RETURNCODE = 0.
WHEN space.
IF COMM_STRUCTURE-stocktype CA 'KLM'.
RESULT = COMM_STRUCTURE-cpquabu.
RETURNCODE = 0.
ELSE.
RETURNCODE = 4.
ENDIF.
WHEN OTHERS.
RETURNCODE = 4.
ENDCASE.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0012

*&---------------------------------------------------------------------*
*& Form routine_0014
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0014
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_10
CHANGING
RESULT TYPE _ty_s_TG_1_full-RECCNSSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods receipt is considered
IF ( COMM_STRUCTURE-processkey EQ '000' "Other Receipts
OR COMM_STRUCTURE-processkey EQ '001' "Goods Receipt / Vendor
OR COMM_STRUCTURE-processkey EQ '004' "Material Transfer
OR COMM_STRUCTURE-processkey EQ '005' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '006' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '010' ) "Receipt from Stock Transfer
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
* only consignment stock is considered
CASE COMM_STRUCTURE-stockcat.
WHEN 'K'.
RESULT = COMM_STRUCTURE-cpquabu.
RETURNCODE = 0.
WHEN space.
IF COMM_STRUCTURE-stocktype CA 'KLM'.
RESULT = COMM_STRUCTURE-cpquabu.
RETURNCODE = 0.
ELSE.
RETURNCODE = 4.
ENDIF.
WHEN OTHERS.
RETURNCODE = 4.
ENDCASE.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0014

*&---------------------------------------------------------------------*
*& Form routine_0041
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0041
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_11
CHANGING
RESULT TYPE _ty_s_TG_1_full-GN_VENDOR
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* ... determine consolidated key
IF COMM_STRUCTURE-stockcat EQ 'K'.
PERFORM gn_get_global_key TABLES MONITOR
USING COMM_STRUCTURE-gn_r3_ssy
g_c_bwbeoty_r3vendor
COMM_STRUCTURE-vendor
RECORD_NO
RECORD_ALL
CHANGING RESULT
ABORT.
* if the returncode is not equal zero, the result will not be updated
Endif.
RETURNCODE = 0.


p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0041

*&---------------------------------------------------------------------*
*& Form routine_0010
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0010
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_12
CHANGING
RESULT TYPE _ty_s_TG_1_full-ISSVS_VAL
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods issue is considered
IF ( COMM_STRUCTURE-processkey EQ '100' "Other Issues
OR COMM_STRUCTURE-processkey EQ '101' "Returns / Vendor
OR COMM_STRUCTURE-processkey EQ '104' "Material Transfer
OR COMM_STRUCTURE-processkey EQ '105' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '106' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '110' ) "Issues from Stock Transfers
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cppvlc <> 0
* see OSS note 630254
AND ( COMM_STRUCTURE-stockcat IS INITIAL OR
( COMM_STRUCTURE-stockcat CA 'EQ' AND
COMM_STRUCTURE-indspecstk CA 'AM' ) ).
* result value of the routine
RESULT = COMM_STRUCTURE-cppvlc.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0010

*&---------------------------------------------------------------------*
*& Form routine_0011
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0011
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_13
CHANGING
RESULT TYPE _ty_s_TG_1_full-RECVS_VAL
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods receipt is considered
IF ( COMM_STRUCTURE-processkey EQ '000' "Other Receipts
OR COMM_STRUCTURE-processkey EQ '001' "Goods Receipt / Vendor
OR COMM_STRUCTURE-processkey EQ '004' "Material Transfer / Receipt
OR COMM_STRUCTURE-processkey EQ '005' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '006' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '010' ) "Receipt from Stock Transfer
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cppvlc <> 0
* see OSS note 630254
AND ( COMM_STRUCTURE-stockcat IS INITIAL OR
( COMM_STRUCTURE-stockcat CA 'EQ' AND
COMM_STRUCTURE-indspecstk CA 'AM' ) ).
* result value of the routine
RESULT = COMM_STRUCTURE-cppvlc.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0011

*&---------------------------------------------------------------------*
*& Form routine_0038
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0038
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_15
CHANGING
RESULT TYPE _ty_s_TG_1_full-GN_VENDOR
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* ... determine consolidated key
IF COMM_STRUCTURE-stockcat CA 'KQ' OR
COMM_STRUCTURE-stocktype CA 'QRS'.
PERFORM gn_get_global_key TABLES MONITOR
USING COMM_STRUCTURE-gn_r3_ssy
g_c_bwbeoty_r3vendor
COMM_STRUCTURE-vendor
RECORD_NO
RECORD_ALL
CHANGING RESULT
ABORT.
ENDIF.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0038

*&---------------------------------------------------------------------*
*& Form routine_0033
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0033
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_19
CHANGING
RESULT TYPE _ty_s_TG_1_full-ISSTOTSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods issue is considered
IF ( COMM_STRUCTURE-processkey EQ '100' "Other Issues
OR COMM_STRUCTURE-processkey EQ '101' "Returns / Vendor
OR COMM_STRUCTURE-processkey EQ '104' "Material Transfer
OR COMM_STRUCTURE-processkey EQ '105' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '106' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '110' ) "Issue from Stock Transfer
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0033

*&---------------------------------------------------------------------*
*& Form routine_0034
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0034
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_20
CHANGING
RESULT TYPE _ty_s_TG_1_full-RECTOTSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods receipt is considered
IF ( COMM_STRUCTURE-processkey EQ '000' "Other Receipts
OR COMM_STRUCTURE-processkey EQ '001' "Goods Receipt / Vendor
OR COMM_STRUCTURE-processkey EQ '004' "Material Transfer / Receipt
OR COMM_STRUCTURE-processkey EQ '005' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '006' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '010' ) "Receipt from Stock Transfer
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
* result value of the routine
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0034

*&---------------------------------------------------------------------*
*& Form routine_0035
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0035
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_21
CHANGING
RESULT TYPE _ty_s_TG_1_full-ISSVALSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods issue is considered
IF ( COMM_STRUCTURE-processkey EQ '100' "Other Issues
OR COMM_STRUCTURE-processkey EQ '101' "Returns / Vendor
OR COMM_STRUCTURE-processkey EQ '104' "Material Transfer
OR COMM_STRUCTURE-processkey EQ '105' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '106' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '110' ) "Issues from Stock Transfers
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only movements which are relevant for stock control
* additional check if orders on hand or projekt stock
* and if they are valuated (A or M)
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0
AND ( COMM_STRUCTURE-stockcat IS INITIAL OR
( COMM_STRUCTURE-stockcat CA 'EQ' AND
COMM_STRUCTURE-indspecstk CA 'AM' ) ).
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0035

*&---------------------------------------------------------------------*
*& Form routine_0036
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0036
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_22
CHANGING
RESULT TYPE _ty_s_TG_1_full-RECVALSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods receipt is considered
IF ( COMM_STRUCTURE-processkey EQ '000' "Other Receipts
OR COMM_STRUCTURE-processkey EQ '001' "Goods Receipt / Vendor
OR COMM_STRUCTURE-processkey EQ '004' "Material Transfer / Receipt
OR COMM_STRUCTURE-processkey EQ '005' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '006' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '010' ) "Receipt from Stock Transfer
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only movements which are relevant for stock control
* additional check if orders on hand or projekt stock
* and if they are valuated (A or M)
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0
AND ( COMM_STRUCTURE-stockcat IS INITIAL OR
( COMM_STRUCTURE-stockcat CA 'EQ' AND
COMM_STRUCTURE-indspecstk CA 'AM' ) ).
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0036

*&---------------------------------------------------------------------*
*& Form routine_0040
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0040
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_25
CHANGING
RESULT TYPE _ty_s_TG_1_full-GN_VENDOR
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* ... determine consolidated key
IF COMM_STRUCTURE-stockcat CA 'KQ' OR
COMM_STRUCTURE-stocktype CA 'QRS'.
PERFORM gn_get_global_key TABLES MONITOR
USING COMM_STRUCTURE-gn_r3_ssy
g_c_bwbeoty_r3vendor
COMM_STRUCTURE-vendor
RECORD_NO
RECORD_ALL
CHANGING RESULT
ABORT.
ENDIF.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0040

*&---------------------------------------------------------------------*
*& Form routine_0037
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0037
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_31
CHANGING
RESULT TYPE _ty_s_TG_1_full-VENCONCON
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* see OSS note 607710
* only goods issue is considered
IF ( COMM_STRUCTURE-processkey EQ '100' "Other Issues
OR COMM_STRUCTURE-processkey EQ '101' "Returns / Vendor
OR COMM_STRUCTURE-processkey EQ '104' "Material Transfer
OR COMM_STRUCTURE-processkey EQ '105' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '106' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '110' ) "Issues from Stock Transfers
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cppvlc <> 0
AND COMM_STRUCTURE-stockcat EQ 'K'.
* result value of the routine
RESULT = COMM_STRUCTURE-cppvlc.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0037

*&---------------------------------------------------------------------*
*& Form routine_0013
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0013
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_37
CHANGING
RESULT TYPE _ty_s_TG_1_full-ISSBLOSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods issue is considered
IF ( COMM_STRUCTURE-processkey EQ '100' "Other Issues
OR COMM_STRUCTURE-processkey EQ '101' "Returns / Vendor
OR COMM_STRUCTURE-processkey EQ '104' "Material Transfer
OR COMM_STRUCTURE-processkey EQ '105' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '106' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '110' ) "Issues from Stock Transfers
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only blocked stock is considered
AND COMM_STRUCTURE-stocktype EQ 'D'
AND COMM_STRUCTURE-stockcat NA 'KR'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
* result value of the routine
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.


p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0013

*&---------------------------------------------------------------------*
*& Form routine_0017
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0017
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_38
CHANGING
RESULT TYPE _ty_s_TG_1_full-ISSQMSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods issue is considered
IF ( COMM_STRUCTURE-processkey EQ '100' "Other Issues
OR COMM_STRUCTURE-processkey EQ '101' "Returns / Vendor
OR COMM_STRUCTURE-processkey EQ '104' "Material Transfer
OR COMM_STRUCTURE-processkey EQ '105' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '106' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '110' ) "Issues from Stock Transfers
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only stock in qulality inspection is considered
AND COMM_STRUCTURE-stocktype CA 'BLOR'
AND COMM_STRUCTURE-stockcat NA 'KR'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
* result value of the routine
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0017

*&---------------------------------------------------------------------*
*& Form routine_0023
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0023
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_39
CHANGING
RESULT TYPE _ty_s_TG_1_full-ISSTRANSST
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods issue is considered
IF ( COMM_STRUCTURE-processkey EQ '100' "Other Issues
OR COMM_STRUCTURE-processkey EQ '101' "Returns / Vendor
OR COMM_STRUCTURE-processkey EQ '104' "Material Transfer
OR COMM_STRUCTURE-processkey EQ '105' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '106' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '110' ) "Issues from Stock Transfers
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only stock in transit is considered
AND COMM_STRUCTURE-stocktype CA 'FH'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
* result value of the routine
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0023

*&---------------------------------------------------------------------*
*& Form routine_0018
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0018
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_40
CHANGING
RESULT TYPE _ty_s_TG_1_full-RECBLOSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods receipt is considered
IF ( COMM_STRUCTURE-processkey EQ '000' "Other Receipts
OR COMM_STRUCTURE-processkey EQ '001' "Goods Receipt / Vendor
OR COMM_STRUCTURE-processkey EQ '004' "Material Transfer / Receipt
OR COMM_STRUCTURE-processkey EQ '005' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '006' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '010' ) "Receipt from Stock Transfer
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only blocked stock is considered
AND COMM_STRUCTURE-stocktype EQ 'D'
AND COMM_STRUCTURE-stockcat NA 'KR'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
* result value of the routine
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0018

*&---------------------------------------------------------------------*
*& Form routine_0015
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0015
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_41
CHANGING
RESULT TYPE _ty_s_TG_1_full-RECQMSTCK
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods receipt is considered
IF ( COMM_STRUCTURE-processkey EQ '000' "Other Receipts
OR COMM_STRUCTURE-processkey EQ '001' "Goods Receipt / Vendor
OR COMM_STRUCTURE-processkey EQ '004' "Material Transfer / Receipt
OR COMM_STRUCTURE-processkey EQ '005' "Stock Adjustment InvD
OR COMM_STRUCTURE-processkey EQ '006' "Stock Adjustment Other
OR COMM_STRUCTURE-processkey EQ '010' ) "Receipt from Stock Transfer
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only stock in qulality inspection is considered
AND COMM_STRUCTURE-stocktype CA 'BLOR'
AND COMM_STRUCTURE-stockcat NA 'KR'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
* result value of the routine
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0015

*&---------------------------------------------------------------------*
*& Form routine_0024
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0024
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_42
CHANGING
RESULT TYPE _ty_s_TG_1_full-RECTRANSST
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* only goods receipt is considered
IF ( COMM_STRUCTURE-processkey EQ '000' "Other Receipts
OR COMM_STRUCTURE-processkey EQ '001' "Goods Receipt / Vendor
OR COMM_STRUCTURE-processkey EQ '004' "Material Transfer / Receipt
OR COMM_STRUCTURE-processkey EQ '005' "Stock Adjustment InvD +
OR COMM_STRUCTURE-processkey EQ '006' "Stock Adjustment Other +
OR COMM_STRUCTURE-processkey EQ '010' ) "Receipt from Stock Transfer
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
* only stock in transit is considered
AND COMM_STRUCTURE-stocktype CA 'FH'
* only movements which are relevant for stock control
AND COMM_STRUCTURE-stockrelev EQ '1'
AND COMM_STRUCTURE-cpquabu <> 0.
* result value of the routine
RESULT = COMM_STRUCTURE-cpquabu.
* if the returncode is zero, the result will be updated
RETURNCODE = 0.
ELSE.
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 4.
ENDIF.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0024

*&---------------------------------------------------------------------*
*& Form routine_0029
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0029
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_43
CHANGING
RESULT TYPE _ty_s_TG_1_full-ISSSCRP
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* goods issue posting into scrap
* only standard movement types are considered
* copied scrap movement types must be added in this routine
IF ( COMM_STRUCTURE-movetype EQ '551' "GI scrapping
OR COMM_STRUCTURE-movetype EQ '552' "GI scrapping
OR COMM_STRUCTURE-movetype EQ '553' "GI scrapping QI
OR COMM_STRUCTURE-movetype EQ '554' "GI scrapping QI
OR COMM_STRUCTURE-movetype EQ '555' "GI scrapping blocked
OR COMM_STRUCTURE-movetype EQ '556' ) "GI scrapping blocked
AND COMM_STRUCTURE-bwapplnm EQ 'MM'.
* result value of the routine
RESULT = COMM_STRUCTURE-cpquabu .
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
* if abort is not equal zero, the update process will be canceled
ELSE.
RETURNCODE = 4.
ENDIF.
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0029

*&---------------------------------------------------------------------*
*& Form routine_0030
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MONITOR text
* -->COMM_STRUCTURE text
* -->RESULT text
* -->RETURNCODE text
* -->ABORT text
* -->RAISING text
* -->CX_SY_ARITHMETIC_ERROR text
* -->CX_SY_CONVERSION_ERROR text
*----------------------------------------------------------------------*
FORM routine_0030
TABLES
p_monitor STRUCTURE rsmonitor
USING
COMM_STRUCTURE type _ty_s_SC_1__RULE_51
CHANGING
RESULT TYPE _ty_s_TG_1_full-ISSVALSCRP
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.

* init variables

* fill the internal table "MONITOR", to make monitor entries
* goods issue posting into scrap
* only standard movement types are considered
* copied scrap movement types must be added in this routine
IF ( COMM_STRUCTURE-movetype EQ '551' "GI scrapping
OR COMM_STRUCTURE-movetype EQ '552' "GI scrapping
OR COMM_STRUCTURE-movetype EQ '553' "GI scrapping QI
OR COMM_STRUCTURE-movetype EQ '554' "GI scrapping QI
OR COMM_STRUCTURE-movetype EQ '555' "GI scrapping blocked
OR COMM_STRUCTURE-movetype EQ '556' ) "GI scrapping blocked
AND COMM_STRUCTURE-bwapplnm EQ 'MM'
AND COMM_STRUCTURE-cppvlc <> 0 .
* result value of the routine
RESULT = COMM_STRUCTURE-cppvlc .
* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
* if abort is not equal zero, the update process will be canceled
ELSE.
RETURNCODE = 4.
ENDIF.
ABORT = 0.

p_monitor[] = MONITOR[].
CLEAR MONITOR[].

ENDFORM. "routine_0030

No hay comentarios: