‎2007 Jan 29 7:08 AM
Hi all,
I want to know the funtion module which can be used to download a table fields into an internal table by mentioning the table name For ex: If i give MARA a a parameter to a function module the table fields must be downloaded to some internal table
‎2007 Jan 29 7:17 AM
‎2007 Jan 29 7:17 AM
‎2007 Jan 29 7:19 AM
Hi,
We have a FM in HR Module named HR_READ_INFOTYPE where we can pass the Infotype name and pass other Exporting Parameters and we can get the data from the Transparent table to the internal table. This is possible because we have common Primary fields in most of the HR Tables. But, as it is not the same case with the Other Modules, I think we wont be having any such FM.
Regards,
Ishaq.
‎2007 Jan 29 7:19 AM
hi ramprabhu,
to get the fields of the db table u can use this fm
CACS_GET_TABLE_FIELDS
hope this helps,
sampath
all the best
*award helpful answers and close the thread
‎2007 Jan 29 7:27 AM
‎2007 Jan 29 7:41 AM
‎2007 Jan 29 7:52 AM
Hi Prabhu,
Run this code,
REPORT zex33 .
TABLES: dfies,
x030l.
DATA: BEGIN OF inttab OCCURS 100.
INCLUDE STRUCTURE dfies.
DATA: END OF inttab.
PARAMETERS: tablenm TYPE ddobjname DEFAULT 'MARA'.
*fieldnm TYPE dfies-fieldname DEFAULT 'MATNR'.
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-fieldname,inttab-leng , inttab-datatype.
ENDLOOP.
‎2007 Jan 29 8:13 AM
Hi,
You have to write a Zfunc module using the following code in tcode se37
FUNCTION Z_TMP_UXDOWNLOAD .
*"----
""Local interface:
*" IMPORTING
*" REFERENCE(I_FILE) LIKE RLGRAP-FILENAME
*" REFERENCE(I_SEP) TYPE ANY
*" TABLES
*" I_TABLE
*" I_OUT OPTIONAL
*" EXCEPTIONS
*" FILE_ERROR
*"----
Global data declarations
field-symbols: <f1>.
data: w_line(2000) type c,
t_line like w_line occurs 0 with header line.
loop at i_table.
do.
assign component sy-index of structure I_TABLE to <f1>.
if sy-subrc ne 0.
exit.
endif.
if sy-index eq '1'.
w_line = <f1>.
else.
concatenate w_line <f1>
into w_line
separated by i_sep.
endif.
enddo.
append w_line to t_line.
clear w_line.
endloop.
loop at t_line.
i_out = t_line.
append i_out.
endloop.
open dataset i_file for output in text mode.
if sy-subrc ne 0.
message e398(00) with 'File open error' raising FILE_ERROR.
endif.
loop at t_line.
transfer t_line to i_file.
endloop.
close dataset i_file.
ENDFUNCTION.
Please reward for the same.
‎2007 Jan 29 8:32 AM