on 01-30-2015 11:44 AM
Ashish,
If I understand it correctly, you need to display the dates in a WD screen in Horizontal format where all the days are displayed based on month. This isn't for any F4 help, but in particular for a requirement like for example Time sheets where no. of hours are captured and displayed.
How about using a table for display? You can always create a dynamic table based on the number of days available (use standard DATE functionality FM's). Table is one option, you can also dynamically create layout using other UI elements like text view for example. This is pretty much possible with dynamic layout creation. Please check with Dynamic Creation if UI Elements with WD abap and if possible, will post a solution sooner.
Here's are example for dynamic programming.
Creating UI Elements Dynamically in Abap Webdynpro Application - Web Dynpro ABAP - SCN Wiki
Thanks,
Santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh,
Thanks for the reply.
Yes, you understood the requirement correctly. I need to display table where as in the header line will be the dates of the month. The dates should populate as 1,2,3 .... till the last day of the month selected earlier.
Can you please help me more on this. As in some more details on UI in View and coding.
Regards,
Ashish.
Hi Ashish,
I think, Santhosh has given you the best solution. you have to create dynamic table UI for your requirement.
Step1 : you have to create node and attribute also dynamic or else you can create a static node with 31 attributes (date is not going to be more than 31 in a month).
Step 2: Create a Dynamic Table UI for the node ( Santhosh has given the link for Dynamic Creation of table UI )
Step 3: Use the FM : SG_PS_GET_LAST_DAY_OF_MONTH to get last date for the given month
Step 4: Make the columns invisible based on last date. For Ex: if the last date is 30.04.2015, make 31st column as invisible
Step 5: Use FM :DATE_CONVERT_TO_FACTORYDATE to check whether the date is working or not. If the importing parameter date is same as given date, then the given day is working.
Step 6: Based on the working indicator, you can assign color for the column.
Regards,
Manikandan S
Am sorry, going bit busy. For the following layout below, I've used button and text view. Use any date related FM to calculate the number of days in Month and display accordingly. You can even design an entire horizantal calendar dynamically this way with "Previous Month" and "Next Month" buttons.
DATA:
lr_container TYPE REF TO cl_wd_transparent_container,
lr_datecont1 TYPE REF TO cl_wd_transparent_container,
lr_datecont2 TYPE REF TO cl_wd_transparent_container,
lr_grid_layout TYPE REF TO cl_wd_grid_layout,
lr_button TYPE REF TO cl_wd_button,
lr_textview TYPE REF TO cl_wd_text_view.
*&- Get Root UI Element Container Reference
lr_container ?= view->get_element( `ROOTUIELEMENTCONTAINER` ).
cl_wd_flow_layout=>new_flow_layout( container = lr_container ).
*&- Add A New Transperant Container
CALL METHOD cl_wd_transparent_container=>new_transparent_container
EXPORTING
id = 'TC_DAT1'
RECEIVING
control = lr_datecont1.
cl_wd_flow_data=>new_flow_data( element = lr_datecont1 ).
*&- Set Container Layout
cl_wd_grid_layout=>new_grid_layout( container = lr_datecont1 ).
*&- Add Child to Container
lr_container->add_child( lr_datecont1 ).
*&- Add Button to the Container
lr_button = cl_wd_button=>new_button( text = '02/01/2015' ).
cl_wd_grid_data=>new_grid_data( element = lr_button ).
lr_datecont1->add_child( lr_button ).
*&- Add Text View to Container
lr_textview = cl_wd_text_view=>new_text_view( text = '8' ).
cl_wd_grid_data=>new_grid_data( element = lr_textview ).
lr_datecont1->add_child( lr_textview ).
*&- Set View Properties
lr_textview->set_layout( value = '00' ).
lr_textview->set_h_align( value = '01').
lr_textview->set_semantic_color( value = '02').
Here's the basic code rfor above display and you can add more functionalities to it.
Adding for reference, in case, if dynamic programming needs to be avoided, use an ALV instead. This would require to create Context Node with 31 attributes, create ALV usage and bind the context. In ALV rendering, make sure, if the column index is greater than no of days hide the extra column. In ALV properties, do remove the toolbar options (including, download to excel and layout) so that you can have only the table display. With this approach, even column colors can be provided easily.
Cheers,
VS
Thankyou everyone for the help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Experts,
Any update/Suggestions on this please.
Is my requirement clear ?
Regards,
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.