2019 Feb 22 4:31 PM
Hello,
I have a complex design requirement. Please throw some light on design approach.
This is traditional Module-pool design. ( NOT webdynpro or other latest UI ).
Details:
Below is the sample design.
Based on my internal table entries values extend ( like Test1, Test2...Testn vertically)
All the values in below sample design come from one custom table, except notes.
I am struck on how to proceed. Is it really possible to do it in normal table control?
Or what is the approach i should go for the getting the below design.
FYI, already discussed and no design change accepted at user end.

2019 Feb 27 6:06 PM
Thanks so much for your guidance.
Now I am able to achieve the required design using HTML code you provided and cl_gui_html_viewer. Thanks again.
2019 Feb 22 6:03 PM
That's a huge problem that people tell you to do something, that is actually impossible. Really clever guys. Now comes your responsibility...
2019 Feb 22 9:01 PM
Hi, dynamic entries from internal tables can be displayed using object oriented ALV. You need to append entries in the internal table as per your design. Use field catalog properties to achieve the required output. In object oriented ALV you need to create a screen with custom container and display ALV in it using method "set_table_for_first_display" of class "cl_gui_alv_grid".
2019 Feb 22 9:11 PM
Thanks for the reply with some positive light.
I am OK with other fields, but check box one next to another is the problem. How to do I achieve it in internal table.?
One checkbox below another is fine, but one next to another is my problem. Let me know if you have any idea. Thanks.
2019 Feb 23 8:15 PM
TYPES:BEGIN OF ty_tab,
field1 TYPE char10,
field2 TYPE char30,
field3 TYPE char10,
field3x TYPE char1,
field4 TYPE char10,
field4x TYPE char1,
field5 TYPE char10,
field5x TYPE char1,
END OF ty_tab.
DATA: c_cont2 TYPEREFTO cl_gui_custom_container,
c_alv2 TYPEREFTO cl_gui_alv_grid,
ty_lay2 TYPE lvc_s_layo,
it_fcat TYPE lvc_t_fcat,
ty_fcat TYPE lvc_s_fcat,
lt_tab TYPETABLEOF ty_tab,
ls_tab TYPE ty_tab.
START-OF-SELECTION.
CALL SCREEN 101.
*&---------------------------------------------------------------------*
*& Module STATUS_0101 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0101 OUTPUT.
*Check if the Custom container exists.
IF c_cont2 IS INITIAL.
*Creating container object
CREATEOBJECT c_cont2
EXPORTING
container_name ='CUST_CONT'.
*creating ALV grid for interactive list
CREATEOBJECT c_alv2
EXPORTING
i_parent = c_cont2.
ty_lay2-grid_title ='FIELDS'.
ty_lay2-zebra ='X'.
REFRESH it_fcat.
CLEAR ty_fcat.
ty_fcat-fieldname ='FIELD1'.
ty_fcat-scrtext_l ='FIELD1'.
ty_fcat-col_pos = 1.
ty_fcat-outputlen = 10.
ty_fcat-tabname ='LT_TAB'.
APPEND ty_fcat TO it_fcat.
CLEAR ty_fcat.
ty_fcat-fieldname ='FIELD2'.
ty_fcat-scrtext_l ='FIELD2'.
ty_fcat-col_pos =2.
ty_fcat-outputlen =30.
ty_fcat-tabname ='LT_TAB'.
APPEND ty_fcat TO it_fcat.
CLEAR ty_fcat.
ty_fcat-fieldname ='FIELD3'.
ty_fcat-scrtext_l ='FIELD3'.
ty_fcat-col_pos =3.
ty_fcat-outputlen =10.
ty_fcat-tabname ='LT_TAB'.
APPEND ty_fcat TO it_fcat.
CLEAR ty_fcat.
ty_fcat-fieldname ='FIELD3X'.
ty_fcat-scrtext_l ='FIELD3X'.
ty_fcat-col_pos =4.
ty_fcat-outputlen =1.
ty_fcat-tabname ='LT_TAB'.
ty_fcat-checkbox ='X'.
APPEND ty_fcat TO it_fcat.
CLEAR ty_fcat.
ty_fcat-fieldname ='FIELD4'.
ty_fcat-scrtext_l ='FIELD4'.
ty_fcat-col_pos =5.
ty_fcat-outputlen =10.
ty_fcat-tabname ='LT_TAB'.
APPEND ty_fcat TO it_fcat.
CLEAR ty_fcat.
ty_fcat-fieldname = 'FIELD4X'.
ty_fcat-scrtext_l = 'FIELD4X'.
ty_fcat-col_pos = 6.
ty_fcat-outputlen = 1.
ty_fcat-tabname = 'LT_TAB'.
ty_fcat-checkbox ='X'.
APPEND ty_fcat TO it_fcat.CLEAR ty_fcat.
ty_fcat-fieldname ='FIELD5'.
ty_fcat-scrtext_l ='FIELD5'.
ty_fcat-col_pos =7.
ty_fcat-outputlen =10.
ty_fcat-tabname ='LT_TAB'.
APPEND ty_fcat TO it_fcat.
CLEAR ty_fcat.
ty_fcat-fieldname ='FIELD5X'.
ty_fcat-scrtext_l ='FIELD5X'.
ty_fcat-col_pos =8.
ty_fcat-outputlen =1.
ty_fcat-tabname ='LT_TAB'.
ty_fcat-checkbox ='X'.
APPEND ty_fcat TO it_fcat.
ENDIF.
ls_tab-field1 ='Test1'.
ls_tab-field2 ='Description Details Test1'.
APPEND ls_tab TO lt_tab.
CLEAR ls_tab.
ls_tab-field1 ='Value Test1'.
ls_tab-field2 ='Additional Information on Test1'.
APPEND ls_tab TO lt_tab.
CLEAR ls_tab.
ls_tab-field3 ='Val1'.
ls_tab-field4 ='Val2'.
ls_tab-field5 ='Val3'.
APPEND ls_tab TO lt_tab.
CLEAR ls_tab.
ls_tab-field3 ='Val4'.
ls_tab-field4 ='Val5'.
APPEND ls_tab TO lt_tab.
CLEAR ls_tab.
ls_tab-field1 ='Notes'.
APPEND ls_tab TO lt_tab.CLEAR ls_tab.
APPEND ls_tab TO lt_tab.
ls_tab-field1 ='Test2'.
ls_tab-field2 ='Description Details Test2'.
APPEND ls_tab TO lt_tab.CLEAR ls_tab.
ls_tab-field1 ='Value Test2'.
ls_tab-field2 ='Additional Information on Test2'.
APPEND ls_tab TO lt_tab.CLEAR ls_tab.
ls_tab-field3 ='Val1'.
ls_tab-field4 ='Val2'.
ls_tab-field5 ='Val3'.
APPEND ls_tab TO lt_tab.CLEAR ls_tab.
ls_tab-field3 ='Val4'.
ls_tab-field4 ='Val5'.
APPEND ls_tab TO lt_tab.CLEAR ls_tab.
ls_tab-field1 ='Notes'.
APPEND ls_tab TO lt_tab.
*ALV for display field details
CALLMETHOD c_alv2->set_table_for_first_display
EXPORTING
is_layout = ty_lay2
CHANGING
it_outtab = lt_tab
it_fieldcatalog = it_fcat.
SET PF-STATUS 'ZPFSTATUS'.
ENDMODULE." STATUS_0101 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0101 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0101 INPUT.
CASE sy-ucomm.
WHEN'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE." USER_COMMAND_0101 INPUT

2019 Feb 23 7:13 AM
Certainly impossible using table controls. But gui controls might make it work.
2019 Feb 23 7:17 AM
With gui controls - not just the alv - you can use splitter containers to have different controls in different portions of the screen. You can add as many controls within a single container in this way and build up exactly what your user needs.
Probably for each test, you'll need an entry with container references as a record in an internal table. That way, you can have many tests, all one one screen.
If you make the initial container a docking container, then the size can be expanded according to the number of tests you need to display at runtime.
2019 Feb 23 9:37 AM
Then I guess that the easiest way is to do everything with the HTML control only (CL_GUI_HTML_VIEWER). All buttons should be handled via the HTML control, so displayed inside the HTML control, so it's best to create a dynpro without toolbar. Note: I don't advise to use the CL_DD_* classes (Dynamic Documents) for this kind of complex dialog, they have so many flaws with "forms" and unsupported "do not use" methods.
2019 Feb 25 9:42 PM

Corresponding HTML:
<html><body>
<form method="POST" action="SAPEVENT:SUBMIT">
<input type="submit"/>
<br/><br/>
<table border="1">
<tr><td>Test1</td><td colspan="4" style="text-align:center">Description details Test 1</td></tr>
<tr><td rowspan="3">Value Test1</td><td colspan="4" style="text-align:center">Additional information on Test 1</td></tr>
<tr><td>Val1<input type="checkbox" checked="checked">Check</td><td>Val2<input type="checkbox">Check</td><td>Val3<input type="checkbox">Check</td><td> </td></tr>
<tr><td>Val4<input type="checkbox">Check</td><td>Val5<input type="checkbox">Check</td><td> </td><td> </td></tr>
<tr><td>Notes:</td><td colspan="4"><textarea name="thetext" rows="3" cols="80">...</textarea></td></tr>
</table>
<br/>
<table border=1>
<tr><td>Test2</td><td colspan="4" style="text-align:center">Description details Test 2</td></tr>
<tr><td rowspan="3">Value Test1</td><td colspan="4" style="text-align:center">Additional information on Test 2</td></tr>
<tr><td>Val1<input type="checkbox" checked="checked">Check</td><td>Val2<input type="checkbox">Check</td><td>Val3<input type="checkbox">Check</td><td> </td></tr>
<tr><td>Val4<input type="checkbox">Check</td><td>Val5<input type="checkbox">Check</td><td> </td><td> </td></tr>
<tr><td>Notes:</td><td colspan="4"><textarea name="thetext" rows="3" cols="80">...</textarea></td></tr>
</table>
</form>
</body></html>
2019 Feb 25 9:55 PM
2019 Feb 23 6:47 PM
Please, the ANSWER corresponds to one solution so don't post 3 answers for only one solution. Instead, either EDIT your answer, or use the button COMMENT on your answer.
2019 Feb 23 6:47 PM
Please, the ANSWER corresponds to one solution so don't post 3 answers for only one solution. Instead, either EDIT your answer, or use the button COMMENT on your answer.
2019 Feb 25 3:07 AM
I think using HTML format is a good way for this design, you may check demo: SAPHTML_SCRIPT_DEMO to have more ideal about it.
another way, may not very good, is using WRITE to write all data in a loop...your layout only have text and checkbox so WRITE can handle it.
2019 Feb 25 8:01 PM
Thanks for your inputs. I did something like below. But in vain, user does not want it and stick to original design.
I am thinking on something like dynamic documents.
Thanks for HTML and WRITE ideas. Write is good option, only thing I am not able to increase the row height for 'Notes' field. If yes, then that would be somewhat near to expected solution.
2019 Feb 26 12:21 AM
With WRITE, you have to manual do alot of things thats why i said its not a good option, one way to "increase" height is split your text in 2 or more then WRITE it with CRLF (/)... its just write your data to screen so there is no such thing like auto wrap text...anw i really think its better to use HTML, try out sandra.rossi sample.
2019 Feb 27 9:14 PM
Amdap ps Please use the COMMENT button. ANSWER is only for proposed solutions.
2019 Feb 26 5:39 PM
2019 Feb 27 9:15 PM
Amdap ps Please use the COMMENT button. ANSWER is only for proposed solutions.
2019 Feb 27 6:06 PM
Thanks so much for your guidance.
Now I am able to achieve the required design using HTML code you provided and cl_gui_html_viewer. Thanks again.