Hello experts,
I used the first time dynamic documents, to put input fields into containers. If i want to disable both input fields with the Method set_display, the one on the bottom will not be rendered.
![Unbenannt.PNG]()
If i disable only one input field, both will be displayed correctly. I searched for sap notes already, but couldn't find one.
Here is the code i'm using:
METHOD initialize_document.
DATA: lo_form TYPE REF TO cl_dd_form_area,
lo_input TYPE REF TO cl_dd_input_element.
DATA: lo_table TYPE REF TO cl_dd_table_element,
lo_column_1 TYPE REF TO cl_dd_area,
lo_column_2 TYPE REF TO cl_dd_area.
CREATE OBJECT go_document.
CALL METHOD go_document->display_document
EXPORTING
parent = go_split->get_container( row = 1
column = 1 ).
* Create Table
CALL METHOD go_document->add_table
EXPORTING
no_of_columns = 2
border = '0'
IMPORTING
table = lo_table.
CALL METHOD lo_table->add_column
IMPORTING
column = lo_column_1.
CALL METHOD lo_table->add_column
IMPORTING
column = lo_column_2.
* Create first row
CALL METHOD lo_column_1->add_text
EXPORTING
text = 'Gruppe'(003).
CALL METHOD lo_column_1->add_gap
EXPORTING
width = 2.
CALL METHOD lo_column_2->add_form
IMPORTING
formarea = lo_form.
CALL METHOD lo_form->add_input_element
EXPORTING
value = go_gname->get_gname( )
name = 'GNAME'
size = 30
maxlength = 20
IMPORTING
input_element = lo_input.
CALL METHOD lo_input->set_display
EXPORTING
disabled = abap_true.
* Create second row
CALL METHOD lo_table->new_row.
CALL METHOD lo_column_1->add_text
EXPORTING
text = 'Bezeichnung'(001).
CALL METHOD lo_column_1->add_gap
EXPORTING
width = 2.
CALL METHOD lo_column_2->add_form
IMPORTING
formarea = go_form.
CALL METHOD go_form->add_input_element
EXPORTING
value = go_gname->get_text( )
name = 'TEXT'
size = 90
maxlength = 60
IMPORTING
input_element = go_input.
CALL METHOD go_input->set_display
EXPORTING
disabled = abap_true.
* Merge and display document
CALL METHOD go_document->merge_document.
CALL METHOD go_document->display_document
EXPORTING
reuse_control = abap_true
reuse_registration = abap_true.
* Hide document border
CALL METHOD go_document->html_control->set_ui_flag
EXPORTING
uiflag = cl_gui_html_viewer=>uiflag_no3dborder.
ENDMETHOD.