2006 Jun 05 12:10 PM
Hello,
Can anybody tell me what is the name of DDIC table used for storing ABAP structure definition and also its related tables.
Thanks&Regards,
Prajesh
Hello,
Can anybody tell me what is the name of DDIC table used for storing ABAP structure definition and also its related tables.
Thanks&Regards,
Prajesh
2006 Jun 05 12:12 PM
Hi prajesh,
1. DD03L
This is the table where all fields are stored
of a structure and tables.
regards,
amit m.
2006 Jun 05 12:14 PM
You can use the FM 'NAMETAB_GET' and pass the table name to get the details of the fields and the structure.
or
DD03L(Table Fields)
Hope this helps
2006 Jun 05 12:14 PM
2006 Jun 05 1:19 PM
Hello,
Thanks for your quick reply. But the thing I am not clear by looking into this table is how the component relationship is maintained. For example structure 'S1' do have a defnition as given below,
begin of S1,
fld1,
S2,
fld3,
end of S1.
Here 'S2' also a structure with definition,
begin of S2,
fld1,
fld2,
end of S1.
But if I go and see inside the table DD02L for info related to 'S1', I can see 'fld1' do have two entries, one for 'S1' and another for 'S2'. But how can I differentiate between them.
2006 Jun 05 1:55 PM
Hi Prajesh,
To differentiate between the two fields, do the following:
TYPES:
fld TYPE char10,
BEGIN OF s2,
fld1 TYPE fld,
fld2 TYPE fld,
END OF s2,
BEGIN OF s1,
fld1 TYPE fld,
fs2 TYPE s2,
fld2 TYPE fld,
END OF s1.
DATA:
v1 TYPE s1,
v2 TYPE s2,
vfld1 TYPE fld,
vfld2 TYPE fld,
vfld3 TYPE fld,
vfld4 TYPE fld.
* Assign values
v2-fld1 = 'S2 Field 1'.
v2-fld2 = 'S2 Field 2'.
v1-fld1 = 'S1 Field 1'.
v1-fs2 = v2.
v1-fld2 = 'S1 Field 2'.
* Now reading (only with V1 structure)
vfld1 = v1-fld1.
vfld2 = v1-fs2-fld1.
vfld3 = v1-fs2-fld2.
vfld4 = v1-fld2.Hope this answers your question.
Regards,
Rob.
2006 Jun 05 2:03 PM
Hi,
But my goal is to read DD03L table for structure and show it in a tree structure in GUI. Here I do not know anything about target structure.
regards,
Prajesh
2006 Jun 05 2:08 PM
2006 Jun 05 2:18 PM
Hi Prajesh,
If you take a careful look at the contents on DD03L you will see that "Include" or "Append" structures are also mentioned. They always start with a dot "." and they do not have the field ROLLNAME (= data element) filled. Instead the field PRECFIELD filled with the name of the include.
"include" structures are named .INCLUDE as fieldname.
"append" structures are named .INCLU--AP as fieldname.
You could then re-access DD03L with the include name to identify the fields.
Regards,
Rob.
2006 Jun 05 2:20 PM
Hi Amit,
This will be the case for all the DDIC structure you are
going to create. I jsut created a structure definition as I mentioned earlier(S1 and S2).May be if you have time you can also try it out and see the result in DD03L.
2006 Jun 05 2:25 PM
Hello,
But this is not about INCLUDE or APPEND. I mean inside a structure I do have a component whose component type is structure.
2006 Jun 05 2:35 PM
Hi again,
1. There is one more field
in DD03L table.
2. DEPTH
3. Normally this field will be blank.
4. In your case,
u have 2 common fields.
eg. F2
5. Then
it will be like this in table
F2 - space
F2 - 1
6. The second entry is for DEPTH.
regards,
amit m.
2006 Jun 05 2:49 PM
Hi Prajesh,
OK. You will find in DD03L that any structured "field" (e.g. field with a structured type) that the field DD03L-DATATYPE contains the type "STRU" and field DD03L-COMPTYE contains a letter "S" (fields INTTYPE and INTLEN are not filled).
With the field DD03L-ROLLNAME you can find out the names of the fields in question. To have to diffirentiate between fields of the same name you need to take a look at the DD03L-POSITION field. All fields from the structured field come behind its declaration in DD03L. Obviously you need to do some programming to distinguise between a direct field and a field via a structred field.
Regards,
Rob.
2006 Jun 06 2:16 PM
Hello Amit and Rob,
Thanks for the all helps you have done. I think DEPTH field will help me to distinguish that.
Regards,
Prajesh
2006 Jun 05 1:21 PM
Hello,
correction to my previous reply. Table name is DD03L.
2006 Jun 05 1:34 PM
Hi again,
1. there u need to FILTER
for the tablename first.
regards,
amit m.
2006 Jun 05 1:40 PM
Hello Amit,
But if I do a filtering based tabname with value 'S1', query result will contain two entries for 'fld1'. One from 'S1' and another from internal structure 'S2'. My question is how can I differentiate between them? I hope the filter you meant is the same as I said above.
Regards,
Prajesh
2006 Jun 05 1:47 PM
Hi again,
1. It ideally cannot happen !
2. Just give the name of the standard sap
table / strucutre u are checking !
regards,
amit m.
2006 Jun 05 1:54 PM
Hello Amit,
But I do have example with me !! So I am wondering how can I differentiate it..
Regards,
Prajesh