Skip to Content

to show to date and from date field.

Hi all ,

In web ui i have created a view and added builChangeHistory Node.
The change history can be seen in the view.

In the context node there is only one field " UDATE".
This date can be treated as FromDate i. e. This Data is valid from this date , as it is updated now.

now I have to show the TO DATE field i.e. the date of next update in the same field value.

FOR eg.

let say customer Group 4 value is XXX from 01.08.2011 and now I am changing the value today to YYY.

the table display should be like this :

Value From Date To date YYY 07.08.2012 31.12.9999 XXX 01.08.2011 07.08.2012

Do I need to create an another attribute and then code in the get value node???
I am very new to abap and less exposed to OOP programming .

Kindly help as it is urgent.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2012 at 06:27 PM

    Hi,

    You can extend the table context with a value attribute to display TO_DATE field.

    Now in the GET_TO_DATE method you need to modify the wizard generated code slightly and place the logic to populate the value depending upon the entry in change history.

    if iterator is bound.

    current = iterator->get_current( ).

    else.

    current = collection_wrapper->get_current( ).

    endif.

    if current is bound.

    if iterator is not bound.

    lr_iter = collection_wrapper->get_iterator( ).

    else.

    lr_iter = iterator.

    endif.

    if lr_iter is bound.

    << if value field is unique , you need not filter the collection , else filter by value>>>

    lr_iter->filter_by_property( iv_attr = 'VALUE ' value= XXXXX').

    lr_iter->find( iv_bo = current).

    lv_index = lr_iter->get_current_index( ).

    if lv_index = 1.

    value = '99991231'

    elseif lv_index > 1.

    <<< if current entry is old entry ,get new updated entry 'udate' value in table

    lv_index = lv_index - 1.

    lr_curr = lr_iter->get_by_index( iv_index = lv_index).

    if lr_curr is bound.

    lr_curr->get_property_as_value( iv_attribute = 'UDATE' value = lv_from_date).

    value = lv_from_date.

    endif.

    endif.

    endif.

    Check the syntax of the code , its not error free. Here lr_iter is same type as iterator, lr_curr is same type as current and lv_index is type i.

    Regards,

    Nithish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2012 at 02:58 PM

    Hi,

    you need to create a table view and select corresponding BOL enity as builChangeHistory and select all the attributes. In customization you can display only the required fields.

    for example go to standard component BP_DATA and check the below view.

    BP_DATA/AccountChangeHistoryOV .

    If you already did not create the view as table view i think you have to delete that and create a new one.

    hope this helps..

    Thanks,

    Rajini Aleti

    Add a comment
    10|10000 characters needed characters exceeded