‎2007 Nov 04 6:20 PM
Hi Friends,
in the sample below I want to fill the field tdcount with 1, 2, 3 etc.
I have no Idea how to manage this.
Any help would be apreciated.
Rg. Jimbob
data : begin of out_head occurs 0,
tdcount(6) type N,
TDOBJECT(10) type C,
TDNAME(70) TYPE C,
TDID(4) type c,
TDSPRAS(1) TYPE C,
end of out_head.
select TDOBJECT TDNAME TDID TDSPRAS from stxh into CORRESPONDING FIELDS OF TABLE out_head
Now it looks like this.
000000 ANKA 00001000 LTXT D
000000 ANKA 00001000 LTXT D
000000 ANKA 00001000 LTXT D
but it should like this.
000001 ANKA 00001000 LTXT D
000002 ANKA 00001000 LTXT D
000003 ANKA 00001000 LTXT D
‎2007 Nov 04 8:43 PM
Hi Abhishek,
I want to use it as an import file in LSMW to import long text.
I tried this below but it does not work.
I can see in the debugger the value of the out_head-tdcount is changed to 000001
but it is not saved in the out_head structure.
select TDOBJECT TDNAME TDID TDSPRAS from stxh into CORRESPONDING FIELDS OF TABLE out_head
where tdobject in objekt.
loop at out_head.
out_head-tdcount = SY-TABIX.
commit work.
endloop.
There is a trick?
‎2007 Nov 04 7:01 PM
Hi,
What exactly will be the use of Count Field?
I don't see any method other than looping at the internal table and modifing the field.
If the requirement is just the identification of the row. Then you can use the SY-TABIX field. You will mostly be reading the table or looping at the table. In both the cases the Sy-tabix will indicate the count.
‎2007 Nov 04 8:43 PM
Hi Abhishek,
I want to use it as an import file in LSMW to import long text.
I tried this below but it does not work.
I can see in the debugger the value of the out_head-tdcount is changed to 000001
but it is not saved in the out_head structure.
select TDOBJECT TDNAME TDID TDSPRAS from stxh into CORRESPONDING FIELDS OF TABLE out_head
where tdobject in objekt.
loop at out_head.
out_head-tdcount = SY-TABIX.
commit work.
endloop.
There is a trick?
‎2007 Nov 04 9:39 PM
Change your code to this
loop at out_head.
out_head-tdcount = SY-TABIX.
modify out_head.
endloop.
‎2007 Nov 04 9:52 PM