Skip to Content
Former Member
Sep 21, 2010 at 07:59 PM

How to create a dynamic table?


Hello experts!

I would be very grateful for assistance with a complicated requirement I have gotten.

I am working within a user exit in BI-IP and one of the parameter in the method is a table (whose structure is dynamic):

C_TH_DATA Changing Type HASHED TABLE Transaction Data

Due to the requirements I have I need to create a table based on the C_TH_DATA table BUT with a few additional fields.

I have posted my first attempt below (it is syntactically correct).

Does my approach make sense???

Grateful for any suggestions.





<f_ref_data> type any,

<f_interim_data> type any,

<f_new_data> type any,

<f_itab> type any table,

<f_infoprov> type RSINFOPROV,

<f_infoprov_ref> type RSINFOPROV,

<f_ref_data_BCCMP07> type any,

<f_ref_data_BCCMC02> type any,

<f_spc> type /bic/oiBHSPC0,

<f_spc_ref> type /bic/oiBHSPC0,

<f_blcopem1> type /bic/oiblcopem1,

<f_blcopem1_ref> type /bic/oiblcopem1,

<f_blcalpo0> type /bic/oiblcalpo0,

<f_blcalpo0_ref> type /bic/oiblcalpo0.


l_r_data1 type ref to data,

l_r_data2 type ref to data,

l_d_sumcostpo type f,

l_d_deltacostpo type f,

l_d_sumdeltacostpo type f.

  • Generate new (empty record)

create data l_r_data1 like line of c_th_data.

assign l_r_data1->* to <f_new_data>.


BEGIN OF l_modif_c_th_data,

l_r_itab type ref to data,

thiscostpo type /bic/oiblcopem1,

thiscostto type /bic/oiblcopem2,

thiscostcm type /bic/oiblcopem3,

thismanpo type /bic/oiblmansec1,

thismanto type /bic/oiblmansec2,

thismancm type /bic/oiblmansec3,

END OF l_modif_c_th_data.


l_r_itab type ref to data.

create data l_r_itab type table of l_modif_c_th_data.

assign l_r_itab->* to <f_itab>.

  • Generate new (empty record)

create data l_r_data2 type l_modif_c_th_data.

assign l_r_data2->* to <f_interim_data>.