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: 

How to add input fields dynamically in module pool ?

Former Member
0 Kudos

Dear Experts,

I have to create a module pool report for QC test certificates. The number of items in a test certi. is not fixed.

So while inputting the data I want to have a button which on pressed every time creates a new row of labels/input boxes/radio buttons/check boxes dynamically. And when the data is saved all the items' data is stored in database table.

I have searched this forum for this but I only found such requirements for WebDynpros and not for module pools.

So pls help me with this requirement.

Thanks,

Vishal.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

In module pool it will be difficult for you to add labels and fields and radio buttons dynamically..

One simple solution what i feel is if you have the complete format of the certificate layout with the maxium attibutes on the screen.....Then design the screen with the maxium attibutes one will use and u can make the fiedls invisbile according to you requirements.......Depending on the users you the make the appropriate fields visbile for  him.

Use of table control is suggested for this. (But depends on your requirements)

With regrads

Suneesh

6 REPLIES 6

ronaldo_aparecido
Contributor
0 Kudos

Hi Vishal.

You are using alv oo with container? or table control?

In both cases is possible.

Please inform us.

0 Kudos

Hey Ronaldo,

I am trying to use table control from screen painter but no luck yet.

Pls suggest the process to achieve this..

Thanks,

Vishal

Former Member
0 Kudos

Man,

Did you tried Step Loop before?

You can solve this using this option...

Take a look below:

http://saptechnical.com/Tutorials/ABAP/Steploop/Index.htm

I hope it helps...

Former Member
0 Kudos

Hi

In module pool it will be difficult for you to add labels and fields and radio buttons dynamically..

One simple solution what i feel is if you have the complete format of the certificate layout with the maxium attibutes on the screen.....Then design the screen with the maxium attibutes one will use and u can make the fiedls invisbile according to you requirements.......Depending on the users you the make the appropriate fields visbile for  him.

Use of table control is suggested for this. (But depends on your requirements)

With regrads

Suneesh

arnab_das5
Explorer
0 Kudos

Hi Vishal,

    As per as my understanding, I tried ur requirement. Please check this below codes.

******* Create dynamic internal table and assign to FS

  CALL METHOD cl_alv_table_create=>create_dynamic_table

      EXPORTING

          it_fieldcatalog  = ifc

          i_length_in_byte = 'X'     

      IMPORTING

         ep_table         = dy_table.

  ASSIGN dy_table->* TO <dyn_table>.

******* Create dynamic work area and assign to FS

  CREATE DATA dy_line LIKE LINE OF <dyn_table>.

  ASSIGN dy_line->* TO <dyn_wa>.

with regards

Arnab....

Former Member
0 Kudos

Hi,

I think it is not possible to add input fields dynamically in module pool screen. One think you can do is to add maximum fields in the screen and make it visible/invisible as per your requirement.

Sample code to visible a field is:

loop at screen.

      if screen-name eq 'your_screen_name'.

           screen-active = 1.

      endif.

endloop.

Regards,

Riju Thomas