cancel
Showing results for 
Search instead for 
Did you mean: 

Please help me debug my code on Awards

Former Member
0 Kudos

How will i get DAT35 on this function module?

SELECT DISTINCT dat35

itxex

INTO (lt_awards-dat35,

lt_awards-itxex)

FROM pa0035

WHERE pernr = employee_no

AND subty = '03'

AND itxex = 'X'.

SELECT SINGLE insti

begda

endda

INTO (lt_awards-insti,

lt_awards-begda,

lt_awards-endda)

FROM pa0022

WHERE pernr = employee_no

AND slart = '51'

AND ( begda GE lt_awards-dat35 AND endda LE lt_awards-dat35 ).

IF lt_awards-itxex EQ 'X'.

<b> rp-read-infotype employee_no 0035 p0035 sy-datum sy-datum.

LOOP AT p0035 where subty = '03'

and itxex eq 'X'.

refresh ptext.

move-corresponding p0035 to key.

import ptext from database pcl1(tx) id key.

LOOP AT ptext.

awards-line = ptext-line.

awards-dat35 = lt_awards-dat35.

awards-insti = lt_awards-insti.

APPEND awards.

CLEAR awards.

ENDLOOP.</b> ENDLOOP.

ENDIF.

ENDSELECT.

OUTPUT:

error:

PTEXT DAT35 INSTI

1st honor 03.04.2006 UP

2nd honor 03.04.2007 UP

1st honor 04.04.2006 UP

2nd honor 04.04.2007 UP

it supposed to be like this:

PTEXT DAT35 INSTI

1st honor 03.04.2006 UP

2nd honor 04.04.2006 UP

Accepted Solutions (0)

Answers (1)

Answers (1)

suresh_datti
Active Contributor
0 Kudos

Hi,

You can simply get rid of the duplicates.. ie


sort awards.
delete adajacent duplicates from awards comparing  line.

But , you have put everything inside the SELECT and the program will take a performance hit for high volume.

Regards,

Suresh Datti