2009 Feb 09 11:31 AM
Hello everyone,
I heard of a function module which converts a structure into a table.
Afterwards every line of the table represents a field of the converted structure. Does anyone know the name of this function module?
thx
Stephan
2009 Feb 09 11:36 AM
hi bro....
u can use fm
FICO_CONVERSION_AMTPOS
for ur purpose
regards
2009 Feb 09 11:37 AM
Hi
you can check this MS_GET_MASTERDATA_STRUCT_TABLE
Thanks
Viquar Iqbal
2009 Feb 09 11:38 AM
Hi Stephen,
Use the Method CL_WD_DYNAMIC_TOOL=>CREATE_TABLE_FROM_NODE
Thanks
kalyan B
2009 Feb 09 12:37 PM
Hi,
Not sure if this is the one you are looking for. REUSE_ALV_FIELDCATALOG_MERGE . This function takes a structure as an input and returns the field catalogue.
regards,
Advait
2009 Feb 09 4:59 PM
Hello again!
No, my problem doesn´t concern field catalogues.
Unfortunately i have also problems making any of the other function modules work.
MS_GET_MASTERDATA_STRUCT_TABLE seems to fit best for my problem, however as i said i cannot make it run as a have problems with the parameters. Do i have to modify the function modules to work with my wanted structure or is it possible without modifying?
Again for explanation:
I have a structure containing: name/city/country/gender
Now i want to convert this structure into a table with the lines:
name
city
country
gender
(I need that convertation to be able to loop over the table and define some selectioncriterias.)
greez
Stephan
2009 Feb 09 5:10 PM
Can you do something like this?
REPORT zz_temp.
TYPES: BEGIN OF ty_table,
tabline(60) TYPE c.
TYPES: END OF ty_table.
DATA:
g_s_tstc TYPE tstc,
g_s_tab TYPE ty_table,
g_t_tab TYPE TABLE OF ty_table,
g_lines TYPE i.
FIELD-SYMBOLS: <fs_component> TYPE ANY.
SELECT * FROM tstc
INTO CORRESPONDING FIELDS OF g_s_tstc
WHERE tcode = 'SE38'.
ENDSELECT.
DO.
ASSIGN COMPONENT sy-index
OF STRUCTURE g_s_tstc TO <fs_component>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
g_s_tab-tabline = <fs_component>.
APPEND g_s_tab TO g_t_tab.
WRITE:/ g_s_tab-tabline.
ENDDO.
DESCRIBE TABLE g_t_tab LINES g_lines.
WRITE g_lines.
2009 Feb 09 7:27 PM
I have a structure containing: name/city/country/gender
Now i want to convert this structure into a table with the lines:
name
city
country
gender
You can use the method DESCRIBE_BY_DATA method of the class cl_abap_structdescr. This will return you a reference to the CL_ABAP_TYPEDESCR class and then you can cast this to an object of the cl_abap_structdescr class and then use the attribute components to get the list of compnents.
regards,
Advait