Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Funtion Module Help

Former Member
0 Likes
870

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
833

use table<b> DD03L</b> for the same.

8 REPLIES 8
Read only

Former Member
0 Likes
834

use table<b> DD03L</b> for the same.

Read only

Former Member
0 Likes
833

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.

Read only

Former Member
0 Likes
833

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

Read only

Former Member
0 Likes
833

try this FM

DDIF_TABL_GET or DDIF_FIELDINFO_GET

Read only

0 Likes
833

use FM - RM_TABLE_FIELDS_GET

Read only

Former Member
0 Likes
833

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.

Read only

Former Member
0 Likes
833

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.

Read only

Former Member
0 Likes
833

Hi all,

It works .Thanks to all