cancel
Showing results for 
Search instead for 
Did you mean: 

urgent getting seq no for the hrt1002 table

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try to debugg which select is not working.In your select,you can add otype and istat and check for the date format of pchobeg , pchoend.

Regards,

Manoj.

Former Member
0 Kudos

while debugging it is getting data,problem i am unable to do seq no ,for eg

if business event has from 0001 to 00005 five description line,i am getting only one line

Former Member
0 Kudos

Hi,

I dont find any issues with your select statement.

SELECT * INTO TABLE t_t1002

FROM hrt1002

WHERE tabnr EQ t_gen-tabnr.

I checked with this code and its is populating t_t1002 properly.

Check the tabnr again.check where its getting deleted in debugging.

Regards,

Manoj.

Former Member
0 Kudos

can give me some suggestion or sample code

Former Member
0 Kudos

Hi,

your code is correct as per my understanding.Have you checked in debugging?IN which part you are getting problem?select?not populating table t_t1002? t_general?

Regards,

Manoj.

Former Member
0 Kudos

I am getting data in internal table but i am unable to insert data into transparent table

pls give ur suggestion i am sending my code also

SELECT *

INTO TABLE t_gen FROM hrp1002

WHERE plvar EQ '01'

AND objid EQ resulttabnew-objt6+2(8)

AND istat EQ '1'

AND subty EQ '0001'

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

READ TABLE t_gen.

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 ,

  • 0 TO t_general-tabseqnr,

t_t1002-tline TO t_general-tline.

APPEND t_general.

  • CLEAR t_general.

ENDLOOP.

ENDLOOP.

LOOP AT t_general.

AT NEW be_id.

CLEAR cnt.

ENDAT.

cnt = cnt + 1.

MOVE cnt TO t_general-seqnr.

MODIFY t_general INDEX sy-tabix TRANSPORTING seqnr.

CLEAR t_general.

IF sy-subrc EQ 0.

describe table t_general lines n.

MOVE-CORRESPONDING t_general TO ztrg_ca_gen_s1.

ENDIF.

ENDLOOP.

  • LOOP AT t_general.

  • describe table t_general lines n.

*

*

  • endloop.

INSERT ztrg_ca_gen_s1.

suresh_datti
Active Contributor
0 Kudos

I guess your itab t_general has the same structure as the custom table ztrg_ca_gen_s1. If that is so, change your insert statement to

<b>insert ztrg_ca_gen_s1 form table t_general.</b>

~Suresh

Former Member
0 Kudos

Hi,

As Suresh said,try to insert into the transparent tbale using form table t_general.If still not possible,then you pls check the transparent table key fields.You might be trying to insert more than one entry with same key fields.

I hope this will resolve your problem.

Regards,

Manoj.

Former Member
0 Kudos

i RETURN THE FUNCTION MODULE,FROM THE FUNCTION MODULE,I GET THE TABLE

AND PASSED THE SEQNO AT NEW BUSINESS EVENT AT END MOVE TO THE COUNT.THANKS FOR YOUR HELP

Answers (0)