Application Development 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: 

Moving Parameter value into Workarea

Former Member
0 Kudos

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

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos

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

former_member188685
Active Contributor
0 Kudos

Check this..

https://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI

former_member188685
Active Contributor
0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos

Did you fulfil you requirement ?

Regards