Go on link..

link us with ...

Tuesday, December 28, 2010

MM032 PHYINV 0400 PAI

*&---------------------------------------------------------------------*
*& Include ZVVF_MM032_PHYINV_0400_PAI *
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module CALCULATE_FILLED_QTY INPUT *
*&---------------------------------------------------------------------*
MODULE CALCULATE_FILLED_QTY INPUT.

CLEAR WA_PHYINV-ZVVF_PHYSTK.
WA_PHYINV-ZVVF_PHYSTK = ( ( ( WA_PHYINV-ZVVF_HEIGHT
- WA_PHYINV-ZVVF_DRYDIP )
* WA_PHYINV-ZVVF_CALIBRATION ) / C_DIVISOR )
+ WA_PHYINV-ZVVF_VOLUME.
if wa_phyinv-zvvf_phystk < 0.
message E010(ZMM).
else.
CLEAR : W_DIFF,WA_PHYINV-DIFF.
W_DIFF = WA_PHYINV-ZVVF_BKSTK - WA_PHYINV-ZVVF_PHYSTK.
WA_PHYINV-ZVVF_DIFF = W_DIFF.
WA_PHYINV-DIFF = W_DIFF.
CONDENSE WA_PHYINV-DIFF.
PERFORM TOGGLE_BUTTONS.
endif.

ENDMODULE. " CALCULATE_FILLED_QTY INPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0400_SAVE INPUT *
*&---------------------------------------------------------------------*
MODULE USER_COMMAND_0400_SAVE INPUT.

SAVE_OK = OK_CODE.
CLEAR OK_CODE.

CASE SAVE_OK.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'GI'.
PERFORM CHECK_DATA_EXISTS.
W_MTYPE = '961'.
W_FLAG500 = 0.
CALL SCREEN 500.
WHEN 'GR'.
PERFORM CHECK_DATA_EXISTS.
W_MTYPE = '962'.
W_FLAG500 = 0.
CALL SCREEN 500.
WHEN 'PI'.
PERFORM CHECK_DATA_EXISTS.
EXPORT WA_PHYINV-ZVVF_PHYSTK TO MEMORY ID 'ZVVF_BKSTK'.
CALL SCREEN 700.
ENDCASE.

CLEAR SAVE_OK.

ENDMODULE. " USER_COMMAND_0400_SAVE INPUT
*&---------------------------------------------------------------------*
*& Module CHECK_400DATA INPUT
*&---------------------------------------------------------------------*
MODULE CHECK_400DATA INPUT.

SELECT SINGLE * FROM T001W
WHERE WERKS = WA_PHYINV-ZVVF_WERKS.

IF SY-SUBRC NE 0 .
MESSAGE E002(ZMM).
ENDIF.

SELECT SINGLE * FROM T001L
WHERE LGORT = WA_PHYINV-ZVVF_LGORT.

IF SY-SUBRC NE 0 .
MESSAGE E003(ZMM).
ENDIF.

IF WA_PHYINV-ZVVF_MATNR CA W_STR.
ELSE.
shift WA_PHYINV-ZVVF_MATNR right deleting trailing space.
overlay WA_PHYINV-ZVVF_MATNR with '000000000000000000'.
ENDIF.

SELECT SINGLE * FROM MARA
WHERE MATNR = WA_PHYINV-ZVVF_MATNR.

IF SY-SUBRC NE 0 .
MESSAGE E004(ZMM).
ENDIF.

SELECT SINGLE * FROM ZVVF_MT032_PHINV
WHERE ZVVF_WERKS = WA_PHYINV-ZVVF_WERKS
AND ZVVF_LGORT = WA_PHYINV-ZVVF_LGORT
AND ZVVF_MATNR = WA_PHYINV-ZVVF_MATNR.

IF SY-SUBRC = 4.
MESSAGE E006(ZMM).
endif.

ENDMODULE. " CHECK_400DATA INPUT
*&---------------------------------------------------------------------*
*& Form CHECK_DATA_EXISTS
*&---------------------------------------------------------------------*
FORM CHECK_DATA_EXISTS.

SELECT SINGLE * FROM T001W
WHERE WERKS = WA_PHYINV-ZVVF_WERKS.

IF SY-SUBRC NE 0 .
MESSAGE E002(ZMM).
ENDIF.

SELECT SINGLE * FROM T001L
WHERE LGORT = WA_PHYINV-ZVVF_LGORT.

IF SY-SUBRC NE 0 .
MESSAGE E003(ZMM).
ENDIF.

SELECT SINGLE * FROM MARA
WHERE MATNR = WA_PHYINV-ZVVF_MATNR.

IF SY-SUBRC NE 0 .
MESSAGE E004(ZMM).
ENDIF.

SELECT SINGLE * FROM ZVVF_MT032_PHINV
WHERE ZVVF_WERKS = WA_PHYINV-ZVVF_WERKS
AND ZVVF_LGORT = WA_PHYINV-ZVVF_LGORT
AND ZVVF_MATNR = WA_PHYINV-ZVVF_MATNR.

IF SY-SUBRC NE 0.
MESSAGE E006(ZMM).
ELSE.
PERFORM ONCOMMIT.
ENDIF.

ENDFORM. " CHECK_DATA_EXISTS

No comments:

link us...

For Visitors

if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours

email-id :- avinashkr_raj@yahoo.com(any email)

email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)