2022 Mar 29 2:31 PM
Hi Expert.
I have a problem.I have a table named ZSO_IGSCANLI and in this table I have a field with tbl_name. There are 9050 records in total in the tbl_name field. These records are all in a table or structure. The number of lines inside these tables or structures is requested. And then i will print alv output. My only problem is that I can't find how to create the line numbers of the tables and structures in the table. I am asked to do it with select count(*) operation. Can you help or guide me?
2022 Mar 31 4:07 PM
Solution of the problem.
DATA lv_tabname(50).
LOOP AT gt_igstbl INTO gs_igstbl.
CLEAR gs_igstbl-nmbr.
lv_tabname = gs_igstbl-tbl_name.
SELECT COUNT(*) FROM (lv_tabname)
INTO lv_count.
SELECT COUNT(*) FROM dd03l
WHERE tabname = lv_tabname
AND fieldname = 'MANDT'.
gs_igstbl-nmbr = lv_count.
INSERT gs_igstbl INTO gt_igstbl.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM gt_igstbl.
2022 Mar 29 5:17 PM
2022 Mar 31 4:06 PM
I solved my problem. Thank you for your interest, I leave my code below with the intention of helping the future.
2022 Mar 31 4:07 PM
Solution of the problem.
DATA lv_tabname(50).
LOOP AT gt_igstbl INTO gs_igstbl.
CLEAR gs_igstbl-nmbr.
lv_tabname = gs_igstbl-tbl_name.
SELECT COUNT(*) FROM (lv_tabname)
INTO lv_count.
SELECT COUNT(*) FROM dd03l
WHERE tabname = lv_tabname
AND fieldname = 'MANDT'.
gs_igstbl-nmbr = lv_count.
INSERT gs_igstbl INTO gt_igstbl.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM gt_igstbl.