Skip to Content

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

urgent getting seq no for the hrt1002 table

Hi guys,

i do not get the seq no for my code.,can u help me it is very urgent

i need to get description text from table hrp1002 and hrt1002 for business events in seq

urgent

table struture

Transparent table ZTRG_CA_GEN_S1 Active

Short description Training Catalog Description - General Description.

Fields KeyIniField type Data Lgth. Dec.plCheck table Short

MANDT MANDT CLNT 3 0 Client

BE_ID OTJID CHAR 10 0 C

SEQNR NUMC5 NUMC 5 0 5

TLINE HRLINE79 CHAR 79 0 Line

DATA: BEGIN OF t_general OCCURS 0.

INCLUDE STRUCTURE ztrg_ca_gen_s1.

DATA: END OF t_general.

DATA: BEGIN OF t_gen OCCURS 0,

objid LIKE hrp1002-objid,

tabnr LIKE hrp1002-tabnr.

DATA: END OF t_gen.

DATA: t_t1002 LIKE hrt1002 OCCURS 0 WITH HEADER LINE.

SELECT * FROM ztrg_ca_gen_s1 INTO TABLE t_general.

DELETE ztrg_ca_gen_s1 FROM TABLE t_general.

REFRESH: t_gen.

CLEAR: t_gen.

SELECT objid tabnr

INTO CORRESPONDING FIELDS OF TABLE t_gen FROM hrp1002

WHERE plvar EQ '01'

AND objid EQ resulttabnew-objt6+2(8)

AND subty EQ '0001'

AND ( begda >= pchobeg AND begda <= pchoend ).

LOOP AT t_gen.

REFRESH t_t1002.

SELECT * INTO TABLE t_t1002

FROM hrt1002

WHERE tabnr EQ t_gen-tabnr.

LOOP AT t_t1002.

MOVE resulttabnew-objt6 TO t_general-be_id .

move t_t1002-tline TO t_general-tline.

APPEND t_general.

CLEAR t_general.

ENDLOOP.

ENDLOOP.

CLEAR cnt.

LOOP AT t_general.

AT NEW be_id.

CLEAR cnt.

ENDAT.

cnt = cnt + 1.

MOVE cnt TO t_general-seqnr.

MODIFY t_general.

CLEAR t_general.

ENDLOOP.

INSERT INTO ztrg_ca_gen_s1 VALUES t_general.

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