Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Please help me debug my code

Hi guys! Kindly Check my codes. I'm having a hard time to debug it. I have the same records on the first 2 rows.

DATA: BEGIN OF lt_skills OCCURS 0,

qid TYPE hrobjid,

qkid TYPE hrobjid,

qgrp TYPE stext,

qname TYPE stext,

scale_id TYPE scale_id,

adatanr TYPE hradatanr,

pstext TYPE profc_text,

rating TYPE rating.

DATA: END OF lt_skills.

      • Qualification Name - QID, QNAME

SELECT DISTINCT x~objid

y~stext

x~adatanr

INTO (lt_skills-qid,

lt_skills-qname,

lt_skills-adatanr)

FROM HRP1001 as x JOIN HRP1000 as y

ON xobjid = yobjid

AND xotype = yotype

AND xotjid = yotjid

AND xplvar = yplvar

WHERE y~langu = 'E'

  • AND x~sobid = employee_no

AND x~plvar = '01'

  • AND x~subty = 'B032'

AND x~otype = 'Q'.

      • Qualification Group - QKID, QGRP

IF lt_skills-qid IS NOT INITIAL.

SELECT SINGLE x~objid

y~stext

INTO (lt_skills-qkid,

lt_skills-qgrp)

FROM HRP1001 as x JOIN HRP1000 as y

ON xobjid = yobjid

AND xotype = yotype

WHERE y~langu = 'E'

AND x~sobid = lt_skills-qid

  • AND x~subty = 'BO30'

AND y~otype = 'QK'.

      • SCALE - SCALE

IF lt_skills-qkid IS NOT INITIAL.

SELECT SINGLE scale

INTO lt_skills-scale_id

FROM HRP1033

WHERE objid = lt_skills-qkid

AND otype = 'QK'.

      • RATING - RATING

IF lt_skills-scale_id IS NOT INITIAL.

SELECT SINGLE chara

INTO lt_skills-rating

FROM HRPAD31

WHERE adatanr = lt_skills-adatanr.

      • PROFICIENCY - PROFICIENCY TXT

IF lt_skills-rating IS NOT INITIAL.

SELECT SINGLE pstext

INTO lt_skills-pstext

FROM T77TP

WHERE langu = 'E'

AND scale_id = lt_skills-scale_id

AND rating = lt_skills-rating.

IF sy-subrc EQ 0.

APPEND lt_skills.

CLEAR lt_skills.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDSELECT.

    • Move Internal Table to SKILLS

DATA: limit TYPE string,

qgroup TYPE string.

READ TABLE lt_skills.

LOOP AT lt_skills.

CASE lt_skills-scale_id.

      • SKILLS

WHEN '9' OR '10'.

skills-qid = lt_skills-qid.

skills-qname = lt_skills-qname.

skills-scale_id = lt_skills-scale_id.

IF sy-subrc IS NOT INITIAL.

APPEND skills.

CLEAR skills.

ENDIF.

ENDCASE.

ENDLOOP.

THE OUTPUT:

7 Entries

QNAME QID SCALE_ID

Layout 50000372 00000009

Layout 50000372 00000009

Cutting 50000373 00000009

Machining 50000374 00000009

Assembly 50000375 00000009

Pipe Installation 50000376 00000009

Welding/Gouging 50000380 00000010

THANKS!

Former Member
Not what you were looking for? View more on this topic or Ask a question