Show TOC

Background documentationExtensibility of Transaction Viewer Locate this document in the navigation structure

 

The transaction viewer function uses Web Dynpro ABAP, and gives you the ability to make modification-free enhancements, using the concept of enhancement implementations. This not only includes source text enhancements, but also enhancements to individual elements of the corresponding Web Dynpro components. For more information about modification-free enhancements of Web Dynpro applications using enhancement implementations, see http://help.sap.com/saphelp_nw74/helpdata/en/49/cc8b49506573ffe10000000a421937/frameset.htm.

New Columns for a Table

The Transaction Viewer uses SAP List Viewer (ALV) for all data that is shown in the form of a table. The displayed columns of a table are based on a DDIC structure, where each field in the structure can be shown as a column (except for fields that are only required for the program logic, and are so intentionally categorized as "technical"). If you want to add your own columns to a table, you first need to create an append with the new fields for the corresponding DDIC structure (see table below).

Setting Up Data Supply

The new fields must be filled with appropriate values. To enable this, create an implementation of BAdI /POSDW/LPA_TAV_ENHANCEMENTS. This BAdI defines two methods for each table; one CONFIGURE method to configure the corresponding SAP List Viewer (ALV), and an ENRICH method to fill the columns of a table with data. Data that was already determined by the standard coding must not be read for the supply of new fields. Therefore, data that has already been read and is related to the data in a table is transferred to the ENRICH method for reuse (for example, read transaction data).

Making New Columns Visible

Columns that are added to a table are not immediately visible by default. They first need to be included in the group of visible columns. You can use the personalization of SAP List Viewer to do this. For more information, see http://help.sap.com/saphelp_nw74/helpdata/en/86/916011b96f4d4bb6279b5f369e3534/frameset.htm.

Alternatively, you can switch the new columns to "visible" for the ALV table via coding, using the corresponding CONFIGURE method of BAdI/enhancement spot /POSDW/LPA_TAV_ENHANCEMENTS.

Data Supply for New UI Elements

If you use an enhancement implementation to add completely new UI elements to the application, these UI elements also need to be supplied with appropriate data. The BAdI method ENRICH_CUSTOM_DATA is available for this, to which the system transfers the complete context of COMPONENTCONTROLLER of the Web Dynpro component. You can use this BAdI method to change this context in any way you require. The BAdI method is called at the point when the context contains all the data that should be displayed within the application.

Technical Information

Web Dynpro component: /POSDW/LPA_WDC_TXN_VIEWER

BAdI: /POSDW/LPA_TAV_ENHANCEMENTS

Table

DDIC Structure

ENRICH Method in BAdI

CONFIGURE Method in BAdI

Loyalty program

/POSDW/LPA_LOYALTY_STY

ENRICH_TENDER_ITEM

CONFIGURE_TENDER__ITEM

Tender details

/POSDW/LPA_TENDER_DETAILS

ENRICH_TENDER_ITEM

CONFIGURE_TENDER_DETAILS_ALV

Active pattern

/POSDW/LPA_PATTDETAIL

ENRICH_ACTIVE_PATTERN

CONFIGURE_ACTIVE_PATTERN_ALV

Transaction line items

/POSDW/LPA_ITEM_DETAILS

ENRICH_RT_LINE_ITEM

CONFIGURE_RT_LINE_ITEMS_ALV

Line item discounts

/POSDW/LPA_ITEM_DISCOUNTS

ENRICH_ITEM_DISCOUNT

CONFIGURE_ITEM_DISCOUNTS_ALV

Example

The line item table must be enhanced with the field Charge (BATCHID).

  • You create an append for the structure /POSDW/LPA_ITEM_DETAILS, with the corresponding field.

  • You create an implementation for the BAdI /POSDW/LPA_TAV_ENHANCEMENTS, and implement the corresponding method ENRICH_RT_LINE_ITEMS.

  • In the method, supply the new field with the value of the same field from the provided structure for the corresponding receipt item:

    Syntax Syntax

    1.  cs_lpa_item-batchid = is_retail_item-batchid
    End of the code.
  • New columns are not visible by default in an ALV table. To make the field immediately visible for every user, the configuration of the ALV must be adapted using the corresponding CONFIGURE BAdI method CONFIGURE_RT_LINE_ITEMS_ALV:

    Syntax Syntax

    1. DATA: mo_column TYPE REF TO cl_salv_wd_column.
      
      mo_column = 
        io_config_table->if_salv_wd_column_settings~get_column( 'BATCHID' ).
      mo_column->set_visible( cl_wd_uielement=>e_visible-visible ).
    End of the code.
  • You activate all changes and call up the Transaction Viewer function. The field Charge should now be displayed in the table.