on 07-13-2007 7:36 AM
Hi all,
I have arequirement to print the values of wagetypes where amount field has a value. If amount for any wagetype is 0, it should be deleted from internal table.Please see my code and advice how to deleet the line with zero amount.
LOOP AT IT_0001.
DO 20 TIMES VARYING WAGETYPES-E_LGA FROM P0008-LGA01 NEXT P0008-LGA02
VARYING WAGETYPES-E_BET FROM P0008-BET01 NEXT P0008-BET02.
IF WAGETYPES-E_LGA = '1001'.
SELECT SINGLE BETRG FROM T510 INTO T510-BETRG WHERE LGART = '1001' AND
TRFAR = P0008-TRFAR
AND TRFGB = P0008-TRFGB
AND TRFGR = P0008-TRFGR
AND TRFST = P0008-TRFST.
IF SY-SUBRC = 0.
IT_0001-BASIC2 = T510-BETRG.
ENDIF.
ENDIF.
ENDDO.
CALL FUNCTION 'BAPI_BASICPAY_GETDETAIL'
EXPORTING
EMPLOYEENUMBER = PERNR-PERNR
SUBTYPE = P0008-SUBTY
OBJECTID = P0008-OBJPS
LOCKINDICATOR = P0008-SPRPS
VALIDITYBEGIN = P9003-ZZDATE1
VALIDITYEND = '99991231'
RECORDNUMBER = P0008-SEQNR
TABLES
WAGETYPES = WAGETYPES1.
LOOP AT WAGETYPES1 .
IT1-AMOUNT = WAGETYPES1-AMOUNT.
IT1-NAMEOFWAGETYPE = WAGETYPES1-NAMEOFWAGETYPE.
APPEND IT1.
ENDLOOP.
ENDLOOP.
Result after debugging for table IT1:-
1 4200.0000 Basic pay
2 0.0000 DA
3 0.0000 CCA
4 2100.0000 Dearness Pay
5 1050.0000 Non Practicing Allw.
Hi,
<b>DELETE IT1 WHERE AMOUNT = '0.0000 '.</b>
Regards
Sudheer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.