‎2008 Mar 27 3:05 PM
Is there a way to programmatically calculate the record size of a given table? Better yet, is this information stored in some table that an ABAP program can read and not even have to calculate it.
For example given tables, VBAK, BSEG, VBRK, etc., I need to know the record lengths of these tables. (I need this information for about 200 tables... so a manual calculation would be rather labor intensive).
‎2008 Mar 27 3:13 PM
‎2008 Mar 27 3:07 PM
Hi,
use system variable SY-DBCNT
Regards,
V.Balaji
Reward if Usefull...
‎2008 Mar 27 3:26 PM
no no
the field LENGTH is in SY-TLENG
or you can use the DESCRIBE FIELD ... LENGTH ... statement
‎2008 Mar 27 3:13 PM
‎2008 Mar 27 3:15 PM
By record size I mean the following:
Suppose we have a table with this definition
MANDT
VBELN
NETWR
....
...
...
I want to know how wide this record definition is, i.e. 4(MANDT) + 10(VBELN) + .... etc
‎2008 Mar 27 3:31 PM
I guess there are lots of ways to do it. Here is one way.
REPORT zjc_temp.
DATA: BEGIN OF g_s_ddic,
tabname TYPE dd02l-tabname,
intlen TYPE dd03l-intlen.
DATA: END OF g_s_ddic.
DATA:
g_t_ddic LIKE TABLE OF g_s_ddic,
g_v_len TYPE i.
SELECT t~tabname f~intlen
INTO CORRESPONDING FIELDS OF TABLE g_t_ddic
FROM dd02l AS t
INNER JOIN dd03l AS f
ON f~tabname = t~tabname
AND f~as4local = t~as4local
AND f~as4vers = t~as4vers
WHERE t~tabclass = 'TRANSP'
AND t~tabname in ('BSEG')'
ORDER BY t~tabname.
LOOP AT g_t_ddic INTO g_s_ddic.
g_v_len = g_v_len + g_s_ddic-intlen.
AT END OF tabname.
WRITE:/ g_s_ddic-tabname, g_v_len.
g_v_len = 0.
ENDAT.
ENDLOOP.
‎2008 Mar 27 3:27 PM
hi check this ...
tables:pa0000.
data: begin of itab occurs 0.
include structure pa0000.
data: end of itab.
data: i type i.
data:string type string.
select * from pa0000 into table itab .
i = strlen( itab ).
loop at itab.
write:/ i.
endloop.
regards,
venkat.