2007 Aug 09 4:36 AM
Hi Experts,
i am facing a problem to creating a Function Module.
Problem: i want to get the data from 20 Database tables standard.there is no relationship in between. Import Parameter is Field_id (Table field) based on this we want Result : Field_id, Field code, field Text.
Example: field id = MTART (METARIAL TYPE) TABLE T134T
MBRSH ( industry type ) TABLE : T137T
Result : MTART (metarial code) ,MTBEZ (metarial Text)
Can any body tell me how i can do this function module.
your answer will be very usefull.
Thanks .
Hi Experts,
i am facing a problem to creating a Function Module.
Problem: i want to get the data from 20 Database tables standard.there is no relationship in between. Import Parameter is Field_id (Table field) based on this we want Result : Field_id, Field code, field Text.
Example: field id = MTART (METARIAL TYPE) TABLE T134T
MBRSH ( industry type ) TABLE : T137T
Result : MTART (metarial code) ,MTBEZ (metarial Text)
Can any body tell me how i can do this function module.
your answer will be very usefull.
Thanks .
2007 Aug 09 4:39 AM
Hi
You can build a FM to bring data from 20 tables. Question is how will you relate data from one table to another?
You cant just bring all data from these tables. There should be a valid relation between the tables and the data.
You can use optimized code to make your FM an effective one.
Regards
Raj
2007 Aug 09 4:54 AM
Hi Raj,
i give you example .in the tables there is no relationship between them.
only i want to select only three field from every table then display in to one table.
if you have any idea please suggest me.
Thanks
2007 Aug 09 5:38 AM
Hi Rashmi,
Check these tables:
Domain: <b>DD01L & DD01T</b>
values for the domains <b>DD07L & DD07T</b>
Data elements : <b>DD04L & DD04T</b>
Table Fields: <b>DD03L & DD03T</b>
Foreign key fields: <b>DD05S</b>
Tables: <b>DD02L & DD02T</b>
Technical settings of tables <b>DD09L</b>
Texts on SQL tables <b>DD06T</b>
Pool, Cluster structures: <b>DD06L</b>
Relationship definitions : <b>DD08L & DD08T</b>
now, for your requirement do the followings:
1. se11 and try to see the content of table DD03L (table for table fields) provding the fieldID (MTART). so result will show all the tables which uses the given field.
2. now you can write your FM for the same.
it is just simple select statement from table DD03L where fieldID = MTART (example). also you can retreive the description text of same fieldID from DD03T proving the fieldID.
Hope it is useful.
Regards,
Sukhee
2007 Aug 09 5:47 AM
Hi,
Check this code
REPORT ZTABLEFIELDNAME.
TABLES: DFIES,
X030L.
DATA: BEGIN OF INTTAB OCCURS 100.
INCLUDE STRUCTURE DFIES.
DATA: END OF INTTAB.
PARAMETERS: TABLENM TYPE DDOBJNAME DEFAULT 'MSEG',
FIELDNM TYPE DFIES-FIELDNAME DEFAULT 'MENGE'.
call function 'DDIF_FIELDINFO_GET'
exporting
tabname = TABLENM
FIELDNAME = FIELDNM
LANGU = SY-LANGU
* LFIELDNAME = ' '
* ALL_TYPES = ' '
* IMPORTING
* X030L_WA = WATAB
* DDOBJTYPE =
* DFIES_WA =
* LINES_DESCR =
TABLES
DFIES_TAB = INTTAB
* FIXED_VALUES =
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE:/ 'Field name not found'.
endif.
LOOP AT INTTAB.
WRITE:/ INTTAB-TABNAME, INTTAB-FIELDNAME, INTTAB-FIELDTEXT.
ENDLOOP.
*** End of Program
aRs
2007 Aug 09 6:31 AM
Hi, thanks for your reponse.
but i want to display the data from standard Table (T134) .
plese see my first Message.
Thanks.
2007 Aug 09 6:51 AM
Hi Rashmi,
your requirement is not that clear. What i understood is your FM will import only one parameter which is the field name and will do something , finally will return 3 parameters.
I want to know whether those 20 standard tables are known or unknown.
And could you just explain the 3 outputs (Field_id, Field_code, Field_text) ?
actually what is Field_code?
from your first example it is difficult to know what are those.
Regards,
Sukhee
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |