on 06-10-2013 5:05 PM
Hi,
I am new to dynamic programming in web dynpro abap. I have the following layout and I want to develop with dynamic programming.
1. Root UI element layout = Matrix layout
2. Group element layout = Grid layout. Column count 2.
Could you guide me on how to achieve the above layout using web dynpro abap dynamic programming ?
Regards
Venkat.O
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
there is step by step how to create ui element in the runtime.
Best regards,
Jerry
Thank you guys for your helpful links. I started to design for the above output. I managed to get GROUP container in the output.
Code - 01.
METHOD WDDOMODIFYVIEW.
CASE FIRST_TIME.
WHEN ABAP_TRUE.
DATA LR_ROOT_CONTAINER TYPE REF TO CL_WD_UIELEMENT_CONTAINER.
DATA LR_TRANSP_CONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
DATA LR_GROUP TYPE REF TO CL_WD_GROUP.
DATA LR_CAPTION TYPE REF TO CL_WD_CAPTION.
DATA LR_INPUT_FIELD TYPE REF TO CL_WD_INPUT_FIELD.
DATA LR_LABEL TYPE REF TO CL_WD_LABEL.
"Layouts
DATA LR_FLOW_DATA TYPE REF TO CL_WD_FLOW_DATA.
DATA LR_GRID_DATA TYPE REF TO CL_WD_GRID_DATA.
DATA LR_MATRIX_DATA TYPE REF TO CL_WD_MATRIX_DATA.
DATA LR_MATRIX_HEAD_DATA TYPE REF TO CL_WD_MATRIX_HEAD_DATA.
DATA LR_GRID_LAYOUT TYPE REF TO CL_WD_GRID_LAYOUT.
"Variables
DATA LV_READ_ONLY TYPE WDY_BOOLEAN.
DATA LV_TEXT TYPE WDY_MD_TRANSLATABLE_TEXT.
"Get a pointer to the RootUIElementContainer
LR_ROOT_CONTAINER ?= VIEW->GET_ROOT_ELEMENT( ).
CL_WD_MATRIX_LAYOUT=>NEW_MATRIX_LAYOUT( CONTAINER = LR_ROOT_CONTAINER ).
"Create GROUP UI element
CALL METHOD CL_WD_GROUP=>NEW_GROUP
EXPORTING
ID = 'GRP_4_PMGMT_SKILLS'
DESIGN = CL_WD_GROUP=>E_DESIGN-SECONDARYCOLOR
WIDTH = '100%'
RECEIVING
CONTROL = LR_GROUP.
"Create Caption
CALL METHOD CL_WD_CAPTION=>NEW_CAPTION
EXPORTING
ID = 'CAPTION'
TEXT = 'Project Management Skills'
RECEIVING
CONTROL = LR_CAPTION.
"Set caption to GROUP header
CALL METHOD LR_GROUP->SET_HEADER
EXPORTING
THE_HEADER = LR_CAPTION.
"Set the layout of the GROUP UI element
CL_WD_MATRIX_LAYOUT=>NEW_MATRIX_LAYOUT( CONTAINER = LR_GROUP ).
CL_WD_MATRIX_HEAD_DATA=>NEW_MATRIX_HEAD_DATA( ELEMENT = LR_GROUP ).
"Add Group to ROOT element
LR_ROOT_CONTAINER->ADD_CHILD( LR_GROUP ).
WHEN OTHERS.
ENDCASE.
ENDMETHOD.
Points from above code.
Output for the above code is
Next requirement
Expecting input on how to keep input fields in transparent container which is child of Group container which is child of ROOT element.
Regards
Venkat.O
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
Please check below very useful links for abap webdynpro for dynamic programming.
Best regards,
Madhu Sudhan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The layout of the container and the layout data of the embedded UI element must always match. So it is not possible to create
Root UI element layout = Matrix layout
Group element layout = Grid layout. Column count 2.
Regards,
Sreenivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
Please do some readings on this link: http://help.sap.com/saphelp_nw74/helpdata/en/11/ba74412cba127de10000000a155106/content.htm
I haven't tried out but I guess we can make use method SET_LAYOUT of interface CL_WD_UIELEMENT_CONTAINER, with parameter as an instance of CL_WD_LAYOUT
E.g.
data: lr_matrix_layout type ref to cl_wd_matrix_layout.
lr_matrix_layout = cl_wd_matrix_layout=>new_matrix_layout(
container = cr_root_container
stretched_horizontally = abap_false
stretched_vertically = abap_false ).
cr_root_container->set_layout( lr_matrix_layout ).
Please let me know if it works. Hope it helps. Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.