2008 Aug 08 2:07 PM
Hi Abapper,
I have to take the input of structures into the Parameter.
Now I have to define a workarea of the structure which are inputted into the Parameter.
How to do that?
Please reply
Regards,
Rahul
2008 Aug 08 2:13 PM
You may use some of the following function module in a AT SELECTION-SCREEN ON VALUE REQUEST form.
- RS_COMPLEX_OBJECT_CHANGE
- RS_COMPLEX_OBJECT_CREATE
- [RS_COMPLEX_OBJECT_EDIT|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=rs_complex_object_edit&cat=sdn_all]
- RS_COMPLEX_OBJECT_HEADER
- RS_COMPLEX_OBJECT_TREE
- RS_COMPLEX_OBJECT_TYPEINFO_GET
These are the "structure editor" function modules used when you test a function module, could look like
REPORT zrgstst.
PARAMETERS param LIKE t002.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR param.
CALL FUNCTION 'RS_COMPLEX_OBJECT_EDIT'
EXPORTING
object_name = 'T002'
mode = 'X'
CHANGING
object = param.
Regards
2008 Aug 08 2:17 PM
Check this..
https://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI
2008 Aug 08 2:23 PM
Are you expecting similar kind of solution...
REPORT ytest_dynamic.
TYPE-POOLS : abap.
DATA : table_des TYPE REF TO cl_abap_structdescr.
DATA : ifields TYPE abap_compdescr_tab,
wa_field LIKE LINE OF ifields.
DATA: it_fieldcat TYPE lvc_t_fcat,
wa_fieldcat TYPE lvc_s_fcat.
DATA: i_tab TYPE REF TO data.
FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE.
PARAMETERS: p_table(30) TYPE c DEFAULT 'SFLIGHT'.
"Create the Table definiton using the table name
table_des ?= cl_abap_typedescr=>describe_by_name( p_table ).
"Transfer all the fields to a table.
ifields = table_des->components.
LOOP AT ifields INTO wa_field.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = wa_field-name .
wa_fieldcat-datatype = wa_field-type_kind.
wa_fieldcat-inttype = wa_field-type_kind.
wa_fieldcat-intlen = wa_field-length.
wa_fieldcat-decimals = wa_field-decimals.
wa_fieldcat-coltext = wa_field-name.
wa_fieldcat-outputlen = wa_field-length.
APPEND wa_fieldcat TO it_fieldcat.
ENDLOOP.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcat
IMPORTING
ep_table = i_tab
* e_style_fname =
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2
.
IF sy-subrc ne 0.
ENDIF.
ASSIGN i_tab->* TO <fs>. "Internal Table will be created.
2008 Aug 13 9:30 AM