Include name LCATSF8Q
FORM process_ok_code.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form PROCESS_OK_CODE, Start A*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZCAT2_SAVE_PRICE_UPDATE. "active version
*********** added by - 28.4.2015 - Reg by
*IF SY-TCODE = 'CAT2'." AND SY-uname = 'TESTING1'.
*IF OK_CODE = 'SAVE'.
* DATA: MID1(4).
* EXPORT ICATSD = ICATSD TO MEMORY ID 'MID'.
*ENDIF.
*ENDIF.
IF SY-TCODE = 'CAT2' AND SY-uname = 'TESTING1'.
IF OK_CODE = 'SAVE'.
BREAK TESTING.
DATA : LV_ANSAL TYPE P0008-ANSAL,
LV_ANCUR TYPE P0008-ANCUR,
LV_INDEX TYPE I,
LV_BUKRS TYPE MSEG-BUKRS,
LV_RATIO TYPE ZCAT2_TABLE1-attendance_ratio.
CLEAR : LV_ANSAL,LV_ANCUR.
SELECT SINGLE ANSAL ANCUR FROM PA0008 INTO (LV_ANSAL,LV_ANCUR) WHERE PERNR = CATSFIELDS-PERNR.
CLEAR : LV_BUKRS.
READ TABLE ICATSD INDEX 3.
IF SY-SUBRC = 0.
SELECT SINGLE bukrs FROM t001k INTO lv_bukrs WHERE bwkey = ICATSD-WERKS.
ENDIF.
LV_INDEX = 3.
LOOP AT ICATSD .
IF SY-TABIX > 2.
IF ICATSD-LSTAR IS NOT INITIAL.
CLEAR : LV_RATIO.
SELECT SINGLE ATTENDANCE_RATIO FROM ZCAT2_TABLE1 INTO LV_RATIO
WHERE COMPANY_CODE = LV_BUKRS AND AWART = ICATSD-AWART.
IF LV_RATIO IS NOT INITIAL.
ICATSD-PRICE = ( LV_ANSAL / 1920 ) * LV_RATIO.
ICATSD-TCURR = LV_ANCUR.
ELSE.
ICATSD-PRICE = ( LV_ANSAL / 1920 ).
ICATSD-TCURR = LV_ANCUR.
ENDIF.
MODIFY ICATSD INDEX LV_INDEX TRANSPORTING PRICE TCURR.
LV_INDEX = LV_INDEX + 1.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDENHANCEMENT.
*$*$-End: (1)---------------------------------------------------------------------------------$*$*
No comments:
Post a Comment