‎2008 Jan 08 5:04 AM
Hi,
I have a field name. Now i want to find to which table this field belongs to.
eg: I have field MATNR. Now in my program i want to find to which table this field belongs to.
How can this be done?
Points will be rewarded!!
regards,
Ashish Gupta
‎2008 Jan 08 6:04 AM
do the following steps
1. put the cursor on the field name.
2. press F1 key.
3. Go to technical info, here you will find the table name.
‎2008 Jan 08 6:04 AM
do the following steps
1. put the cursor on the field name.
2. press F1 key.
3. Go to technical info, here you will find the table name.
‎2008 Jan 08 6:30 AM
‎2008 Jan 08 7:31 AM
Hi,
There can be many number of tables using the same field. inside the program just double click on the field. If it is used only by one table it will navigate to the table. Else a list of tables will be displayed whereever the field is used.
Regards,
Renjith Michael.
‎2008 Jan 08 7:42 AM
Hi,
Basically the same field is used in so many tables like mara,marc,mard,vbap...
But for matnr , MARA is the master table.It means entry should be there in mara table .but no need of entry in other tables like mrac,mard,vbap..etc.
But some times this value is picked from other tables also not only from mara to get other corresponding values like storage location or sales order number..etc.
Program may access other tables also depending on requirement.
so just check in the program from which database table this value is getting populated using SELECT stmt .
you can put breakpoint at all the select stmt and debugg the program.you will get noticed from which database table its getting populated and from which table its value getting processed.
Like suppose we use select stmt on vbap to get sales order number and then we goto MARD table to get corresponing storage location.
so finally we will get the value from MARD table.
just i will write simple code .
data:it_mara like mara occurs 0 with header line.
data:it_vbap like vbap occurs 0 with header line.
data:it_mard like mard occurs 0 with header line.
start-of-selection.
select * from mara into table it_mara up to 100 rows.
if not it_mara[] is initial.
select * from mara into table it_vbap
for all entries in it_mara
where matnr = it_mara-matnr.
endif.
if not it_vbap[] is initial.
select * from mard into table it_mard
for all entries in it_vbap
where matnr = it_vbap-matnr.
endif.
loop at it_mard.
write: / it_mard-matnr,it_mard-lgort.
endloop.
so finally we are printing matnr from mard table eventhough matnr exists in mara table also.
Regds
Sivaparvathi
Please dont forget to reward points if helpful...
‎2008 Jan 08 8:23 AM
I want to fetch the table name of the field at runtime. If a field belongs to multiple tables, we can pick any one table.
So Whats the logic to code this in a ABAP report.
‎2008 Jan 08 6:06 AM
To check out the table a field belongs to:
Goto SE11 -> DD03L -> Utilities -> Table Contents -> Display-> Execute (F8) with <FIELDNAME>.
or
Go to se11 and give ur field name under data type select tables in the dialog box select the where used list in the application bar ..
You will find all the tables where this field has been use.
Regards,
Maha
‎2008 Jan 08 6:30 AM
‎2008 Jan 08 1:23 PM
Hi,
data:
begin of fs_table,
table like dd03l-tabname,
endof fs_table.
data:
t_table like standard table of fs_table.
select tabname into table t_table from dd03l where fieldname eq 'matnr'.
loop at tabname into fs_table.
write: / fs_table-table.
endloop.
write select atetement as u want u r requirement ok
plzz reward if it is useful....
for any further quiries plzz contact me on [email protected]