04-27-2009 2:24 PM
Hi,
I have an issue related to void check. We have a weekly payroll, on 04/15, a check was void for the payperiod 16 for the week 04/05 to 04/11. The weekly interface that ran for the current period (payperiod 17) did not pick this void check. I understand the reason for it, but need assistance how to fix it. The code goes somehting like this to fetch the payperiods in the interface.
get rgdir
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
PERSNR = PERNR-PERNR
IMPORTING
MOLGA = MOLGA
TABLES
IN_RGDIR = RGDIR
EXCEPTIONS
NO_RECORD_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
**INCLUDE THE void checks in the file
LOOP AT RGDIR WHERE
( IPEND BETWEEN IP_BEG AND IP_END
and void is initial ) OR
( IPEND BETWEEN IP_BEG AND IP_END
****to pick up the void checks run for the week
( RUNDT BETWEEN IP_BEG AND IP_END
and void = 'V' ).
MOVE-CORRESPONDING RGDIR TO INPER_DIRECTORY_ENTRY.
COLLECT INPER_DIRECTORY_ENTRY INTO INPER_DIRECTORY.
ENDLOOP.
LOOP AT INPER_DIRECTORY INTO INPER_DIRECTORY_ENTRY.
CLEAR EVP_INPER. REFRESH EVP_INPER.
CALL FUNCTION 'CD_EVALUATION_PERIODS'
EXPORTING
BONUS_DATE = INPER_DIRECTORY_ENTRY-IPEND
INPER_MODIF = INPER_DIRECTORY_ENTRY-IPERM
INPER = INPER_DIRECTORY_ENTRY-INPER
PAY_TYPE = INPER_DIRECTORY_ENTRY-INPTY
PAY_IDENT = INPER_DIRECTORY_ENTRY-INPID
TABLES
RGDIR = RGDIR **** returns null
EVPDIR = EVP_INPER
IABKRS =
EXCEPTIONS
NO_RECORD_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
the code is causing an error here. The FM is returning null value for pp16, I understand that because it is looking for INPER results for payperiod 17. It is causing a problem everytime we have an void check done for the previous week in the current week.
How can I fix this issue? Any help or leads is appreciated.
Thanks,
VG
07-23-2009 6:30 PM