on 04-25-2010 7:51 PM
Hi,
I need to display current Date & Time on the page header element of WDA. How can I do so?
Please suggest.
Thanks.
Kumar Saurav.
Hi Saurabh,
Use sy-datum & sy-uzeit to get the current date and time. You can also use the FM "OIL_GET_CURRENT_DATE_TIME"for this by giving the time Zone E.g. INDIA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to use the data globally/Locally in View methods, then you need to create a node say NODE1 with the two attributes as leow:
DATE type sydatum
Time type syuzeit.
Get the Node1 structure using code wizard and set the values with Sy-datum & sy-uzeit in DATE & TIME fileds.
Hope it helps.
Hi Sanket,
Thanks for your answer. I made the node called N_TIMESTAMP under which made two attributes named DATE and TIME.
Now, I have one landing page where I'm embedding all the pages as per navigation required and I've to display Date and Time on all the Views. Hence, I am adding this into my LANDING page. In that page, I added one PageHeader Element. There, using TITLE in Properties, I made the Context-Binding of DATE and TIME.
However, the PageHeader reamains blank.
Can you suggest what is missing out here..?
Thanks.
Kumar Saurav.
Hi Kumar,
I have taested this one in my systema and it's working fine. I think you have not created the N_TIMESTAMP in Component controller.
Do the below steps:
1) Create the N_TIMESTAMP in Comp Controller and the attribute say date & time.
2) In the WDDOINIT method of the Comp controller you need to fill the value as below:\
data:
Node_Node type ref to If_Wd_Context_Node,
Elem_Node type ref to If_Wd_Context_Element,
Stru_Node type If_Main=>Element_N_TIMESTAMP .
navigate from <CONTEXT> to <NODE> via lead selection
Node_Node = wd_Context->get_Child_Node( Name = IF_MAIN=>wdctx_N_TIMESTAMP ).
get element via lead selection
Elem_Node = Node_Node->get_Element( ).
Stru_Node-date = sy-datum.
Stru_Node-time = sy-uzeit.
get all declared attributes
Elem_Node->set_Static_Attributes(
Static_Attributes = Stru_Node ).
3) Map this N_TIMESTAMP in your View, where you are going to bind the Page header title.
4) Then assign the Title property of the two Page headers with Date & time fields of the Node N_TIMESTAMP.
Hope it works for you as well.
HI Kumar ,
For Displaying the Date and time in Page header , add Title content or add insert area , you can see this option when you Right click on your Page Header UI element , You can add only one Tile content and one area for Page header
Surly you have to create a attribute to hold the date & time and bind the attribute to the Title content
Regards
chinnaiya P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.