*eject
*&---------------------------------------------------------------------*
*& Constants *
*& *
*&---------------------------------------------------------------------*
constants: c_1(1) type c value '1' ,
c_3(1) type c value '3' ,
c_i(1) type c value 'I' ,
c_x(1) type c value 'X' ,
c_eq(2) type c value 'EQ' .
* c_pl03 like p0001-werks value 'PL03'.
*eject
*&---------------------------------------------------------------------*
*& Internal tables *
*& *
*&---------------------------------------------------------------------*
* Internal Table for Output
data: begin of t_output occurs 0 ,
pernr like pernr-pernr ,
lgart1 type LGART,
betrg1 type PAD_AMT7S,
lgart2 type LGART,
betrg2 type PAD_AMT7S,
lgart3 type LGART,
betrg3 type PAD_AMT7S,
lgart4 type LGART,
betrg4 type PAD_AMT7S.
data: end of t_output .
data: lgart type lgart,
betrg type PAD_AMT7S.
data: count type i.
*eject
*&---------------------------------------------------------------------*
*& Initialization *
*& *
*&---------------------------------------------------------------------*
Initialization.
* Initialize Selection-Screen values
perform init_selction_screen.
* Read Infotype 0
rp-provide-from-last p0000 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
* Check if employee is active
check p0000-stat2 in pnpstat2. "pernr Active
* Check if emp belongs to Active Group
check p0001-persg in pnppersg.
* Read Infotype 8
rp-provide-from-last p0008 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
sort p0008 by endda descending.
describe table p0008 lines count.
* Gather latest wagetypes
clear t_output.
read table p0008 index 1.
if sy-subrc eq 0.
move pernr-pernr to t_output-pernr.
DO 40 TIMES VARYING LGART FROM P0008-LGA01 NEXT P0008-LGA02
VARYING BETRG FROM P0008-BET01 NEXT P0008-BET02.
if LGART = '1000'.
move: lgart to t_output-lgart1,
betrg to t_output-betrg1.
append t_output.
endif.
if LGART = '1011'.
move: lgart to t_output-lgart2,
betrg to t_output-betrg2.
append t_output.
endif.
if LGART = '1020' .
move: lgart to t_output-lgart3,
betrg to t_output-betrg3.
append t_output.
endif.
if LGART = '1030' .
move: lgart to t_output-lgart4,
betrg to t_output-betrg4.
append t_output.
endif.
ENDDO.
endif.
clear: t_output,
p0008.
* Gather earliest wagetypes
read table p0008 index count.
if sy-subrc eq 0.
move pernr-pernr to t_output-pernr.
DO 40 TIMES VARYING LGART FROM P0008-LGA01 NEXT P0008-LGA02
VARYING BETRG FROM P0008-BET01 NEXT P0008-BET02.
if LGART = '1000'.
move: lgart to t_output-lgart1,
betrg to t_output-betrg1.
append t_output.
endif.
if LGART = '1011'.
move: lgart to t_output-lgart2,
betrg to t_output-betrg2.
append t_output.
endif.
if LGART = '1020' .
move: lgart to t_output-lgart3,
betrg to t_output-betrg3.
append t_output.
endif.
if LGART = '1030' .
move: lgart to t_output-lgart4,
betrg to t_output-betrg4.
append t_output.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.