cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a row in bottom using dynamic programming

Former Member
0 Kudos

Hi Experts,

I am working with dynamic programming... to create the 4 input fileds in one row.

I have a add button once I click on the add button on the view its creating a row with 4 input fileds.

But problem is if press 2 times the new row is creating on top .. But my req is that it should create the new row in the bottom.

Below methods I am using.

CALL METHOD cl_wd_input_field=>new_input_field

CALL METHOD lr_container->add_child

Please let me know how can i achive this...

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi anil,

Please go through this link...

Cheers,

Kris.

Former Member
0 Kudos

Hi Kris,

Thanks for your reply.

The links which you have provied is good but in that mentioned how to create, I am able to create but i am not finding the option in that to create a row in the bottom. Is there any option Adding a row in bottom using dynamic programming not on top.

saravanan_narayanan
Active Contributor
0 Kudos

Hello Anil,

Normally if you add a new child to the container it will automatically add it as last element. I'm wondering why its not case with your application. Its really strange.

What you can do it

1. Get the number of children in the container (check in CL_WD_TRANSPARENT_Container) there will be a method to get the number of children

2. while adding a new child, set the index as well( here index should be number of children in the container + 1)

Alternatively, you can post your dynamic UI element creation code (complete code) we can check and point out the error if any.

BR, Saravanan

Former Member
0 Kudos

Hi Saraa_n

Thanks for your reply.....

below is the code I am using. Please check and suggest me if any

lr_container ?= view->get_element( 'TC_HEALTH_TEXT' ).

lr_container->SET_VISIBLE( '02' ).

gv_id = ls_add-add_att.

        • Delete Button

gv_id = gv_id + 1.

CONCATENATE 'CHAR' gv_id INTO gv_char.

lr_button = cl_wd_button=>new_button( ).

lr_button->SET_VISIBLE( '02' ).

      • For Grid

lr_grid = cl_wd_grid_data=>new_grid_data( lr_button ).

CALL METHOD lr_grid->set_padding_left

EXPORTING

value = '01'.

  • value = '182'.

CALL METHOD lr_container->add_child

EXPORTING

index = 1

the_child = lr_button.

lr_button->set_text( 'Delete').

lr_button->set_width( '65' ).

lr_button->set_on_action( 'DELETE_H').

lr_button->set_tooltip( 'Delete Current Department Objective').

    • Complete By Field

gv_id = gv_id + 1.

CONCATENATE 'CHAR' gv_id INTO gv_char.

if wd_comp_controller->GV_NUM = '00'.

wd_comp_controller->GV_NUM = '01'.

endif.

CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZCOMPLETE' into gv_complete.

CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZDESC' into gv_desc.

CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZBSC_CODE' into gv_bsc_code.

wd_comp_controller->GV_NUM = wd_comp_controller->GV_NUM + 1.

CALL METHOD lr_grid->set_padding_left

EXPORTING

value = '95'.

CALL METHOD cl_wd_input_field=>new_input_field

EXPORTING

bind_value = gv_complete

id = gv_char "'CHAR3'

width = '68'

RECEIVING

control = lr_input.

gv_id = gv_id + 1.

CONCATENATE 'CHAR' gv_id INTO gv_char.

      • For Grid

lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).

lr_input->set_layout_data( lr_grid ).

CALL METHOD lr_container->add_child

EXPORTING

index = 1

the_child = lr_input.

        • To Create Description field

CALL METHOD lr_grid->set_padding_left

EXPORTING

value = '30'.

CALL METHOD cl_wd_input_field=>new_input_field

EXPORTING

bind_value = gv_desc

id = gv_char "'CHAR2'

width = '700'

RECEIVING

control = lr_input.

      • For Grid

lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).

lr_input->set_layout_data( lr_grid ).

CALL METHOD lr_container->add_child

EXPORTING

index = 1

the_child = lr_input.

                                • To Ceate BSC Code

CALL METHOD lr_grid->set_padding_left

EXPORTING

value = '70'.

gv_id = gv_id + 1.

CONCATENATE 'CHAR' gv_id INTO gv_char.

CALL METHOD cl_wd_input_field=>new_input_field

EXPORTING

bind_value = gv_bsc_code

id = gv_char "'CHAR1'

width = '25'

  • READ_ONLY = 'X'

RECEIVING

control = lr_input.

      • For Grid

lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).

lr_input->set_layout_data( lr_grid ).

CALL METHOD lr_container->add_child

EXPORTING

index = 1

the_child = lr_input.

saravanan_narayanan
Active Contributor
0 Kudos

Hello Anil,

While adding the child dont pass the index value. this will solve the problem. If you dont pass the index, the framework will add the new child as last element.

remove the following statement from all the lr_container->add_child method call


index = 1

BR, Saravanan

Former Member
0 Kudos

Hi Saraa_n

Thanks for your reply.....

below is the code I am using. Please check and suggest me if any

lr_container ?= view->get_element( 'TC_HEALTH_TEXT' ).

lr_container->SET_VISIBLE( '02' ).

gv_id = ls_add-add_att.

        • Delete Button

gv_id = gv_id + 1.

CONCATENATE 'CHAR' gv_id INTO gv_char.

lr_button = cl_wd_button=>new_button( ).

lr_button->SET_VISIBLE( '02' ).

      • For Grid

lr_grid = cl_wd_grid_data=>new_grid_data( lr_button ).

CALL METHOD lr_grid->set_padding_left

EXPORTING

value = '01'.

  • value = '182'.

CALL METHOD lr_container->add_child

EXPORTING

index = 1

the_child = lr_button.

lr_button->set_text( 'Delete').

lr_button->set_width( '65' ).

lr_button->set_on_action( 'DELETE_H').

lr_button->set_tooltip( 'Delete Current Department Objective').

    • Complete By Field

gv_id = gv_id + 1.

CONCATENATE 'CHAR' gv_id INTO gv_char.

if wd_comp_controller->GV_NUM = '00'.

wd_comp_controller->GV_NUM = '01'.

endif.

CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZCOMPLETE' into gv_complete.

CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZDESC' into gv_desc.

CONCATENATE 'ZHGOALS' wd_comp_controller->GV_NUM '.ZBSC_CODE' into gv_bsc_code.

wd_comp_controller->GV_NUM = wd_comp_controller->GV_NUM + 1.

CALL METHOD lr_grid->set_padding_left

EXPORTING

value = '95'.

CALL METHOD cl_wd_input_field=>new_input_field

EXPORTING

bind_value = gv_complete

id = gv_char "'CHAR3'

width = '68'

RECEIVING

control = lr_input.

gv_id = gv_id + 1.

CONCATENATE 'CHAR' gv_id INTO gv_char.

      • For Grid

lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).

lr_input->set_layout_data( lr_grid ).

CALL METHOD lr_container->add_child

EXPORTING

index = 1

the_child = lr_input.

        • To Create Description field

CALL METHOD lr_grid->set_padding_left

EXPORTING

value = '30'.

CALL METHOD cl_wd_input_field=>new_input_field

EXPORTING

bind_value = gv_desc

id = gv_char "'CHAR2'

width = '700'

RECEIVING

control = lr_input.

      • For Grid

lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).

lr_input->set_layout_data( lr_grid ).

CALL METHOD lr_container->add_child

EXPORTING

index = 1

the_child = lr_input.

                                • To Ceate BSC Code

CALL METHOD lr_grid->set_padding_left

EXPORTING

value = '70'.

gv_id = gv_id + 1.

CONCATENATE 'CHAR' gv_id INTO gv_char.

CALL METHOD cl_wd_input_field=>new_input_field

EXPORTING

bind_value = gv_bsc_code

id = gv_char "'CHAR1'

width = '25'

  • READ_ONLY = 'X'

RECEIVING

control = lr_input.

      • For Grid

lr_grid = cl_wd_grid_data=>new_grid_data( lr_input ).

lr_input->set_layout_data( lr_grid ).

CALL METHOD lr_container->add_child

EXPORTING

index = 1

the_child = lr_input.

Former Member
0 Kudos

Hi Saraa_n,

Thanks for information. My issue is resolved. Thanks for your help

Answers (0)