Get the Change log for ALV line items

Hello Experts,
I am using editable ALV table to display/change data. When user modifies data from ALV line items manually (direct entry), this change is recorded in get_context_change_log method of context node. Also in the screen I have one button, on click of this button I do some calculation for selected line items in action method and update the context node with new values. But with this second approach (button action) though values gets changed this is not recorded in to get_context_change_log of context node. I tried to use method add_context_attribute_change  in button action method to add attribute changes to change log tabel but it's not adding entries to change log. Does method add_context_attribute_change only works with OVS search helps and freely programmed value helps? And is there any other way for capturing changes(done by using action method and not manually) for ALV line items?
Thanks & Regards
Jayant

Here is code:
METHOD.
This method is in component controller, which gets called from View Action method (on click * of button).
  FIELD-SYMBOLS:<lfs> TYPE  Data.
*Data Declaration
  DATA lo_nd_cn_apc_item TYPE REF TO if_wd_context_node.
  DATA lit_apc_item TYPE wd_this->elements_cn_apc_item.
  DATA lo_el_cn_apc_item TYPE REF TO if_wd_context_element.
  data: l_component type ref to if_wd_component,
        l_context type ref to if_wd_context,
        lfd_added type abap_bool.
  CLEAR:lo_nd_cn_apc_item,lo_el_cn_apc_item.
  navigate from <CONTEXT> to <CN_APC_ITEM> via lead selection
  lo_nd_cn_apc_item = wd_context->get_child_node( name = wd_this->wdctx_cn_apc_item ).
  REFRESH:lit_apc_item.
  @TODO handle non existant child
  IF lo_nd_cn_apc_item IS NOT INITIAL.
    lo_nd_cn_apc_item->get_static_attributes_table( IMPORTING table = lit_apc_item ).
get element via lead selection
    lo_el_cn_apc_item = lo_nd_cn_apc_item->get_element( ).
  ENDIF.
        l_component = wd_this->wd_get_api( ).
        l_context = l_component->get_context( ).
Calculate Cost
  LOOP AT lit_apc_item ASSIGNING  <lfs>.
        <lfs>-cal_amount = ( <lfs>-cost_percent * <lfs>-sec_amount ) / 100.
        lfd_added = l_context->add_context_attribute_change(
            element              = lo_el_cn_apc_item
            attribute_name       = 'CAL_AMOUNT'
            new_value            = <lfs>-cal_amount
  ENDLOOP.
Bind Table.
  lo_nd_cn_apc_item->bind_table( new_items = lit_apc_item set_initial_elements = abap_true ).
ENDMETHOD.

Similar Messages

  • How to find out Last Changed Fields for a line item of a PO

    Dear All,
    Pls let me know is there any FM or procedure to find the last changed fields for each line item of a PO. I should be able to get the details on the basis of Last changed Date. Can u pls guide me in this?

    Hello,
    Check the table CDHDR,CDPOS for PO items,
    Check this code:
    REPORT ZV_GET_LATEST_SO .
    DATA: BEGIN OF ITAB OCCURS 0,
            OBJECTCLAS TYPE CDHDR-OBJECTCLAS,
            OBJECTID TYPE CDHDR-OBJECTID,
            CHANGENR TYPE CDHDR-CHANGENR,
            USERNAME TYPE CDHDR-USERNAME,
            UDATE TYPE CDHDR-UDATE,
            UTIME TYPE CDHDR-UTIME,
            TCODE TYPE CDHDR-TCODE,
            TABNAME TYPE CDPOS-TABNAME,
            TABKEY TYPE CDPOS-TABKEY,
            FNAME TYPE CDPOS-FNAME,
            CHNGIND TYPE CDPOS-CHNGIND,
          END OF ITAB.
    TABLES: CDHDR,CDPOS.
    DATA: LT_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE,
    LT_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
    *REFRESH AUSG.
    CLEAR CDHDR.
    CLEAR CDPOS.
    CDHDR-OBJECTCLAS = 'EINKBELEG'.
    CDHDR-OBJECTID   = '0000001784'.  " Purchase order number
    **SELECT A~OBJECTCLASS A~OBJECTID A~CHANGENR A~USERNAME A~UDATE A~UNAME
    **B~TCODE
    **B~TABNAME B~TABKEY B~FNAME B~CHNGIND INTO TABLE ITAB FROM CDHDR AS A
    **INNER JOIN CDPOS AS B ON A~OBJECTCLASS = B~OBJECTCLASS
    **                         A~OBJECTID    = B~OBJECTID
    **                         A~CHANGENR    = B~CHANGENR
    **                    WHERE OBJECTCLAS = 'VERKBELEG'
    **                      AND OBJECTID = '0000001784'.
    *SELECT * FROM CDPOS INTO TABLE LT_CDPOS WHERE OBJECTCLAS = 'VERKBELEG'
    *                                    AND OBJECTID = '0000001784'.
    *IF NOT LT_CDPOS[] IS INITIAL.
    *  SELECT *
    *  INTO   TABLE LT_CDHDR
    *  FROM   CDHDR
    *  FOR    ALL ENTRIES IN LT_CDPOS
    *  WHERE  OBJECTCLAS = LT_CDPOS-OBJECTCLAS
    *  AND    OBJECTID = LT_CDPOS-OBJECTID
    *  AND    CHANGENR = LT_CDPOS-CHANGENR.
    *ENDIF.
    **  SORT ITAB BY OBJECTCLAS ODJECTID DESCENDING.
    *LOOP AT ITAB.
    *  WRITE: ITAB-UDATE."ITAB-UNAME.
    *ENDLOOP.
    *--- Interne Tabellen -------------------------------------------------
    DATA: BEGIN OF ICDSHW OCCURS 50.       "Ausgabeaufbereitung
            INCLUDE STRUCTURE CDSHW.       "Zwischendatei
    DATA: END OF ICDSHW.
    CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
         EXPORTING
              DATE_OF_CHANGE    = CDHDR-UDATE
              OBJECTCLASS       = CDHDR-OBJECTCLAS
              OBJECTID          = CDHDR-OBJECTID
              TIME_OF_CHANGE    = CDHDR-UTIME
              USERNAME          = CDHDR-USERNAME
         TABLES
              I_CDHDR           = LT_CDHDR
         EXCEPTIONS
              NO_POSITION_FOUND = 1
              OTHERS            = 2.
    LOOP AT LT_CDHDR.
      CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
        EXPORTING
    *   ARCHIVE_HANDLE                = 0
          CHANGENUMBER                  = LT_CDHDR-CHANGENR
    *   TABLEKEY                      = '00000000 '
    *   TABLENAME                     = ' '
    * IMPORTING
    *   HEADER                        =
       TABLES
         EDITPOS                       = ICDSHW
    *   EDITPOS_WITH_HEADER           =
    * EXCEPTIONS
    *   NO_POSITION_FOUND             = 1
    *   WRONG_ACCESS_TO_ARCHIVE       = 2
    *   OTHERS                        = 3
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT ICDSHW.
        IF ICDSHW-TABKEY+3(10) = '0000001784'
           AND ICDSHW-TABKEY+13(6) = '000001'.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    Vasanth

  • How to read/get the document attached to PO line item

    Hi experts,
    I got a requirement wherein I need to read/get the document attached at PO line item and to send that document through mail as an attacment .
    please suggest me how to proceed on this.

    actually your are picking up the correct data from Table EKET (EKET-EINDT) but your are printing that in item data loop for EKET might have already executed in your script and the header of that internal table consist the last entry of the table so for that. Fetch the delivery date explicite from the Table EKET when your in item level processing and print that.
    For Example u can use this code.
    To print you have write the this code in Script item level printing window "MAIN" window
    Following perform is called to get the line item delivery date in PO
    {/: PERFORM GET_DEL_DATE IN PROGRAM ZPerform_prog
    /: USING &EKPO-EBELN&
    /: USING &EKPO-EBELP&
    /: CHANGING &DEL_DATE&
    /: ENDPERFORM}
    {* Dellivery date &DEL_DATE& }
    write the below code in the Z program "ZPerform_prog"
    { FORM get_del_date  TABLES in_par STRUCTURE itcsy
                             out_par STRUCTURE itcsy.
      READ TABLE in_par WITH KEY 'EKPO-EBELN'.
      CHECK sy-subrc = 0.
      $_po_no = in_par-value.
      READ TABLE in_par WITH KEY 'EKPO-EBELP'.
      CHECK sy-subrc = 0.
      $_po_line = in_par-value.
      SELECT *
      FROM eket UP TO 1 ROWS WHERE ebeln EQ $_po_no AND ebelp EQ $_po_line.
        $_del_date = eket-eindt.
        CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
          EXPORTING
            date_internal            = eket-eindt
          IMPORTING
            date_external            = $_del_date
          EXCEPTIONS
            date_internal_is_invalid = 1
            OTHERS                   = 2.
        READ TABLE out_par WITH KEY 'DEL_DATE'.
        CHECK sy-subrc EQ 0.
        out_par-value = $_del_date.
        MODIFY out_par
                    INDEX sy-tabix.
        CLEAR : $_po_no , $_po_line ,$_del_date.
      ENDSELECT.
    ENDFORM.                    "GET_DEL_DATE }

  • Confition type FRC1- how to get the change log,

    Hi,
    When  the condition type FRC1 automatically gets deleted (deletion flag),. and we are not able to see the change log for the same.
    how the Conditions are deleted. Or if at all any one has deleted, how to get the change log,

    Check in
    m/06
    go to utilities
    change log
    If not found  consult BASIS consultant

  • How to check and delete the change logs for DSO

    Hello All,
    I have build a process chain that will delete the change logs for DSO prior to 7 days but when i executed it, the number of entries are still the same within DSO.
    Then i tried deleting directly from "Environment" menu from DSO maintainance but does not work. Can anyone please explain how to resolve this issue or the proper process of deleting the change logs. Appreciated.
    Thanks,
    M

    Hi
    Check out the below two articles
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1058b68f-96c4-2d10-fbb1-de8757ca6a58?QuickLink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02ba9e7-bb6f-2c10-09b4-e86b9fcbad41?QuickLink=index&overridelayout=true
    Regards,
    Venkatesh

  • How to see the change logs for billing document

    Dears,
    Could you please how to see the change logs for billing document.
    My client is using ECC 6.0 & if i use VF03 > Environment > changes > does not show the changes i had made.
    Thanks in advance
    Ranjan

    hello, friend.
    you should be able to see changes done after the initial creation and saving, by going thru Environment > Changes.  try it again, and this time make sure that changes were done to the billing document prior to posting to accounting.
    normally, when configuration of Billing is done correctly, there will be little or no instances of changing anything in the Billing document,  as saving the document after creation will post this to Accounting.  of course, inclusion of a posting block in the billing type will provide you the opportunity for changes. 
    regards.

  • How to get the baselinegrid position for a line?

    Hi All,
    How to get the baselinegrid position for a line in a paragraph?

    Hi,
    2nd line baseline grid for yourPara paragraph is:
    yourPara.lines[1].baseline;
    last line baseline is:
    yourPara.endBaseline;
    Jarek

  • Configure the Change Log for the activity

    Hi to all,
    I would like to know if it is possible to configure the "change log" for the activity.
    Thanks in advanced,
    Matte

    Carlos,
    Can you be more specific on the term 'Configure'.  Change log is automatically generated by SBO.  The only thing you can change is the numbers of Historical instances of the log
    Administration > System Initialization > General Settings.......Services Tab...History or Log Settings.  Be default it is 99 instances.
    Suda

  • How to get the Delivery date in PO line Item in SAPScript

    Hi Gurus,
    I am working on PO Script (MEDRUCK). I copied the Standard to a Z form. ZMM_MEDRUCK, Now I need to print the the Header text at the end of MAIN window.  I put Iem number along with the other line Item informmation like stanadrd PO Script MEDRUCK. I also want to show the delivey date with line Item, so Itried to use EKET-EINDT but it is returning the delivery date of last line item, means while printing the first line and other information it is showing the delivery date of the last line item, I tried with the  PEKPO-EINDT it is also not working.
    Can any body suggest me how i can get the delivery date for the respective line Item  ?
    Regards
    Sony

    actually your are picking up the correct data from Table EKET (EKET-EINDT) but your are printing that in item data loop for EKET might have already executed in your script and the header of that internal table consist the last entry of the table so for that. Fetch the delivery date explicite from the Table EKET when your in item level processing and print that.
    For Example u can use this code.
    To print you have write the this code in Script item level printing window "MAIN" window
    Following perform is called to get the line item delivery date in PO
    {/: PERFORM GET_DEL_DATE IN PROGRAM ZPerform_prog
    /: USING &EKPO-EBELN&
    /: USING &EKPO-EBELP&
    /: CHANGING &DEL_DATE&
    /: ENDPERFORM}
    {* Dellivery date &DEL_DATE& }
    write the below code in the Z program "ZPerform_prog"
    { FORM get_del_date  TABLES in_par STRUCTURE itcsy
                             out_par STRUCTURE itcsy.
      READ TABLE in_par WITH KEY 'EKPO-EBELN'.
      CHECK sy-subrc = 0.
      $_po_no = in_par-value.
      READ TABLE in_par WITH KEY 'EKPO-EBELP'.
      CHECK sy-subrc = 0.
      $_po_line = in_par-value.
      SELECT *
      FROM eket UP TO 1 ROWS WHERE ebeln EQ $_po_no AND ebelp EQ $_po_line.
        $_del_date = eket-eindt.
        CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
          EXPORTING
            date_internal            = eket-eindt
          IMPORTING
            date_external            = $_del_date
          EXCEPTIONS
            date_internal_is_invalid = 1
            OTHERS                   = 2.
        READ TABLE out_par WITH KEY 'DEL_DATE'.
        CHECK sy-subrc EQ 0.
        out_par-value = $_del_date.
        MODIFY out_par
                    INDEX sy-tabix.
        CLEAR : $_po_no , $_po_line ,$_del_date.
      ENDSELECT.
    ENDFORM.                    "GET_DEL_DATE }

  • Hot to get the Cost(Rollup) for an ATO Item

    Can any one let me know how to get the rollup cost for an ATO Model.
    I have created an ATO and through Ordermanagement I created an SO and configured an Assembly now I want to know what is the cost for the New assembly which got created with sales order configurator.
    Thanks & Regards,
    Srinivas

    Pl see if MOS Doc 421782.1 (OEXOEORD - How to Display Cost For ATO Configured Item?) can help
    HTH
    Srini

  • How to get the Change Log Table name of the ODS from the system table

    Hi,
    I have a list of ODSs in the system and I am interested in finding the corresponding Change Log Table and the number of records in that table.
    Can any one please tell me the name of the system table where this information is stored.
    I dont want to get in this information manully (from the Contents tab of the ODS maintenane).
    Regards,
    Harikiran Gunnala

    Hi
    Go to SE16
    Give the table name as "RSTSODS".
    For User application field give CHANGELOG as input
    and execute. You will get all the list of Changelog tables Along with below mentioned data
    PSA
    Version
    To
    Valid from
    Object Status
    Technical ODS name
    Program Name
    Maint  Program
    Object Name
    Last changed by
    UTC Time Stamp in Short Form
    Partition number
    Regards
    Raj

  • Unable to post the accounting doc for Zero line item billing doc

    I have an issue that customer has incidently created the cross company repl delivery with zero line batch qty along with some xx qty batch. PGI and billing also done.  But because of zero qty unable to create accounting document. Asked customer to do the invoice cancel and do reversal of PGI and delete the zero line item in delivery.  But customer has problem in doing of PGI reversal and asked us without doing of PGI reversal process the zero qty billing to be posted to accounting. Customer has reversed the billing doc and created again for XX qty batch and releasd for accounting. But the zero batch line item is pending in billing due list and unable to release for accounting . 
    Thanks in advance.
    Regards,
    R.Sridhar

    Hi
    Try to do the summarization of FI document, so, this item will be merged with others. See SAP Note 36353 - AC interface: Summarizing FI document for further details.
    Regards
    Eduardo
    Edited by: E_Hinojosa on Jul 12, 2011 5:36 PM

  • Values in the change log for activities

    Hi,
    Some fields "Z" that were created in the structure CRMD_ORDERADM_H and had the flag "change document" checked in data element to record changes in the log of changes in activities. These fields on the screen are the picklist format and are registering as old value and new value in the view of the component BTCHIST codes defined for the picklist, but I need the description displayed in the picklist is registering iin these columns of old and new value.
    I would like the log of these fields were as the status field of activity, information internally changed is the status code, but the log displays the status description.
    Thanks and Regards
    Mark

    Hello,
    Sorry if I do not have a solution for your exact problem, but I do know that SAP created an OSS note to fix the behavior you described for marketing scenarios... Kindly check the following note:
    Note 1237443 - Display clear text values for EEW fields in change documents
    So I would recommend to double check on http://service.sap.com/notes if you can find similar note for your issue. Or you can try to implement similar steps as the ones described in this note 1237443 to your component.
    Kind regards,
    Nicolas Busson.

  • How to trace the change log for a program ? both local and release versions.

    Hi experts,
    I encounter a very strange problem.
    I changed a program, created a new version TR, , there are three versions before my version which are all have been released.
    but there is one sentence which is not added by me, could anyone tell me how to find the reason why the sentence in my version.
    Any help would be apprecite!
    BR,
    Summer

    Hi,
    Not all the 3 TRs
    Goto SE03, Click on Find Requests under Requests/Tasks section.
    Give all the 3 requests names in Requests/Tasks, Give User name as *
    See any sub tasks are there in the above requests by double clicking on each request.
    Or
    Goto SE03
    Click on Search for Objects in Requests/Tasks under Objects in Requests
    Select the first entry  R3TR PROG give the program name.
    In below Request/Task Selection , check the status Released.
    See what all Requests are displayed, who are all the persons who changed them.
    Thanks & Regards
    Bala Krishna

  • How to get change log for z-fields in VBAk(Sales order)

    Hi All,
    Please help me in this.
    My requirement is get the change log for z-fields in sales order.
    In the sales order header level we have one tab Additioanl data.
    In this we have z-fields, if we change any of the field value, it is accepting the same and updating in data base as well.
    But it is not appearing in change log<. I.e. Environment->changes.
    How to get the change log for the z-fields.
    In data element level enable the check box of change document.
    Please help me in this.
    Thanks in advance
    Jaya,G

    Hi Jaya,
    For this you need to do some coding. Here is a link which tells you, step by step procedure how to activate Change log for the Z tables.
    THe Object that you need to use for Sales Document   is VERKBELEG
    [https://wiki.sdn.sap.com/wiki/display/ABAP/Maintaining%20Change%20Log%20for%20Database%20Tables]
    Hope this helps..
    This is Primarily a Technical Consultant Job. Take his help before you make any changes.
    Thnks
    Srini

Maybe you are looking for

  • BAPI errors in Purchase Order

    i'm getting following errors plz help to  eradicate then |No instance of object type PurchaseOrder < PO header data still faulty              < Document number 1000222 not within define< Please only use plants with local currenc< |Can delivery date b

  • Urgent Help With Master Data

    Hi to all, I load every day a customer hierarchy from R/3 in Infoobject 0Cust_slaes and from today i have not any values in the hierarchy. After i run RSRV for 0cust_sales Hierarchies i got  the following messge error : The INCFL flag in SID table is

  • How do I overlay a photo

    I see instructions for overlaying video on iMovie using iOS, but on my iPad how do I overlay a photo to replace the portion of the video while using the soundtrack?

  • Photoshop CS6 (mac) - Why is Liquify disabled for smart object?

    I've sent over an image from LR5 into PS CS6 as a smart object. I'm wanting to run the liquify filter, but it isn't open to me as an option. Can someone give me some ideas on what the problem is here? I checked with Help on PS..and it says my copy is

  • TS2570 Where can I download Boot Files for my iMac

    I have fitted a new Hard Drive as my old one crashed. But I no longer have my OSX Install Disk. Where can I download files to make a bootable USB for example?