Quantcast
Channel: SAP CRM: Webclient UI - Framework
Viewing all 188 articles
Browse latest View live

Navigation from view BP_DATA/AccountRelationshipsEF back to account overview not possible

$
0
0

The navigation from account relationship view BP_DATA/AccountRelationshipsEF to account overview page by click "done" or "back" button is always not possible, for instance, no response or keep a blank page.

 

 

To resolve the problem, please make sure the following notes been implemented in the system, if not, implement the following notes in order:

<1> 1943769 - Restore the Pagination state when Assignment block is left for navigation.

<2> 1979904 - Exception when clicked on Done button in BP_DATA/AccountRelationshipsEF.

<3> 2036792 - Side effect note 1979904, navigation not possible from BP_DATA/AccountRelationshipsEF

 

 

If the issue persists after applying the above notes, please check the following customizing:

<1> SPRO-> Customer Relationship Management -> UI Framework -> UI Framework Defination -> Maintain Runtime Framework Profile

<2> Select profile "Default"

<3> In the "History Settings" section, the value of "Operation Mode" should be maintianed as "N" (Application Controlled Recording).


Parametrise a view with your own attributes

$
0
0

I think most of readers at least once have parametrized their WebUI components, applications or views with some values or parameters depending on some information about user, runtime or whatever. For example, current business role or its configuration key is taken into consideration. Recently I found for myself pretty convenient way to configure (e.g. parametrized) own or enhanced WebUI views with a set of attributes. There is a standard way to assign a set of values to WebUI view configuration, named "General View Settings". In this way sets of parameters will depend on well-known ones: configuration key, component usage, UI object type, UI object subtype.

 

Let's start from the beginning. First of all we need a structure which represents a set of attributes we'd like to have. For example, I'll take a simple one.

Structure.png

 

Then we need to enter our component, view and structure in maintenance view BSPC_DL_VIEWS:

bspc_dl_views.png

 

After that on Configuration tab of our view in BSP_WD_CMPWB we will have an additional button Attributes.

For configurable view:

ConfigView.png

For table view:

TableView.png


Going there we'll see a view to maintain values for attributes from our structure. To maintain a value for an attribute select the row of this attribute.

Maintenance.png

 

But we're not finished yet. Now we need to utilize these maintained parameters. Let's assume that my view does some search in DO_PREPARE_OUTPUT and then depending on parameters sort the result collection. For example, in view controller in DO_PREPARE_OUTPUT method. So here the code to get current set of parameters:

 

DATA: lr_config_descr  TYPE REF TO if_bsp_dlc_config_attrib,            ls_config_attr   TYPE zst_example_parameters.     lr_config_descr ?= me->configuration_descr.     IF lr_config_descr IS BOUND.       me->configuration_descr->get_config_data( ).       lr_config_descr->get_attributes( CHANGING cs_attributes = ls_config_attr ).
 ENDIF. 

 

Originally this feature seems to be developed to help in CRM-BI integration. See Using Attributes for Assignment Blocks - Fact Sheet - SAP LibraryMainly the system uses such attributes to define BI connection or to store parameters for search/filter use cases. You can explore how these attributes are used in standard components/views referring entries maintained in BSPC_DL_VIEWS.

 

But who cares? I think we can use it for our own good

The change of the component/view for a FS BP after upgrading

$
0
0

Background:

 

Prior to CRM 7.0 EHP3, when creating a FS BP, the system takes the view to BPFS_HEAD/BPHeadOverview.

But after update to EHP3, the system was navigating to view BP_HEAD/BPHeadOverview.

 

The overview page for the FS Business Partner technically would then be BP_HEAD/BPHeadOverview as opposed to BPFS_HEAD/BPHeadOverview.

This is to take full advantage of any standard Business Partner functionality.

 

 

How to change it back to component BPFS_HEAD:

 

If you would like to use the previous component BPFS_HEAD as the lower release, you can switch off the business function CRM_FS_BPHEAD_UI via Tcode SFW5.

Step by step to Create Column Chart in Sap CRM Webclient ui

$
0
0

Requirement:In an organization To differentiate the business partners based on country, this  count of business Partnerdetails i need to display like graphical charts.

 

Creation Web UI Component Using the Transaction BSP_WD_CMPWB enter component Name (e.gZHK_GRAPH3) in field component and click on create .

Enter the description and window name (e.g. Mainwindow) and click on continue.Choose a Package and click on continue and provide workbench request.

In the component structure browser, right click on view and choose create. A wizard will be displayed Enter the following data in wizard


View Name -   Main

View Type  -    Empty View


Do not change on following screen and finish the wizard. Your component will looks as given  below


8.png

 

Double click on MAIN view. In right hand side, double click on main.htm to maintain the graph data. For this write the given code.


Create the page attributes as following screenshot

 

9.png

 

Add the following code in layout tab :


<%@page language="abap" %>

<%@extension name="htmlb" prefix="htmlb" %>

<%@extension name="graphics" prefix="graphics" %>

<%@extension name="htmlb" prefix="abap" %>



<%

data: line type igs_data.


line-x        = 'Business Partner'.
line-y        = 1900.
line-color    = 9.
line-groupid  = 'Business Partner Count'.
append line to lt_data1.


line-x        = 'Within INDIA'.
line-y        = 1100.
line-color    = 17.
line-groupid  = 'INDIA Count'.
append line to lt_data1.


line-x        = 'Within USA'.
line-y        = 8000.
line-color    = 25.
line-groupid  = 'USA Count'.
append line to lt_data1.

%>


<htmlb:page title = "Business Partner Details/ Element: Chart" marginTop = "100">


<htmlb:chart
id                   = "LineChart1"
data                 = "<%=lt_data1%>"
width                = "1000"
height               = "300"
title                = "Business Partner Details"
chartType            = "COLUMNS"
legendPosition       = "SOUTH"
colorOrder           = "STRAIGHT" />

</htmlb:page>

</body>


Save, check and activate the component.Go to Runtime Repository Editor, Add view to the window and Don't forget to check and save it. Otherwise 'Runtime repository Editor' will not get updated with latest changes.and then execute the application.

The final output  would be displayed as shown below.


result1.png


Thanks & Regards,

Harikrishna Malladi.

Step by step to Create Column Chart in Sap CRM Webclient ui

$
0
0

Requirement:In an organization To differentiate the business partners based on country, this  count of business Partnerdetails i need to display like graphical charts.


Creation Web UI Component Using the Transaction BSP_WD_CMPWB enter component Name (e.gZHK_GRAPH3) in field component and click on create .

Enter the description and window name (e.g. Mainwindow) and click on continue.Choose a Package and click on continue and provide workbench request.

In the component structure browser, right click on view and choose create. A wizard will be displayed Enter the following data in wizard


View Name -   Main

View Type  -    Empty View


Do not change on following screen and finish the wizard. Your component will looks as given  below


scn1.png


Double click on MAIN view. In right hand side, double click on main.htm to maintain the graph data. For this write the given code.


Create the page attributes as following screenshot


scn2.png

 

Add the following code in layout tab :


<%@page language="abap" %>

<%@extension name="htmlb" prefix="htmlb" %>

<%@extension name="graphics" prefix="graphics" %>

<%@extension name="htmlb" prefix="abap" %>



<%

data: line type igs_data.


line-x        = 'Business Partner'.
line-y        = 1900.
line-color    = 9.
line-groupid  = 'Business Partner Count'.
append line to lt_data1.


line-x        = 'Within INDIA'.
line-y        = 1100.
line-color    = 17.
line-groupid  = 'INDIA Count'.
append line to lt_data1.


line-x        = 'Within USA'.
line-y        = 8000.
line-color    = 25.
line-groupid  = 'USA Count'.
append line to lt_data1.

%>


<htmlb:page title = "Business Partner Details/ Element: Chart" marginTop ="100">


<htmlb:chart
id                   = "LineChart1"
data                 = "<%=lt_data1%>"
width                = "1000"
height               = "300"
title                = "Business Partner Details"
chartType            = "COLUMNS"
legendPosition       = "SOUTH"
colorOrder           = "STRAIGHT" />

</htmlb:page>

</body>


Save, check and activate the component.Go to Runtime Repository Editor, Add view to the window and Don't forget to check and save it. Otherwise 'Runtime repository Editor' will not get updated with latest changes.and then execute the application.

The final output  would be displayed as shown below.

 

scn3.png


Thanks & Regards,

Harikrishna Malladi.

Work center with work area groups creation in SAP CRM Webclient UI

$
0
0

Requirement: This blog shows how to create new work center with work area groups consisting of relevant links to Create, Search,Report and Opportunity etc.. group creation in sap crm web ui.

 

Prerequisite: Need the basic knowledge SAP CRM.

 

Step 1. Creation of WEB UI Component.

 

Go to SAP IMG --> Customer Relationship Management --> UI Framework --> UI Framework Definition --> Access UI Component Workbench or transaction BSP_WD_CMPWB.

Enter component name in field component and click on create.

Enter the description and window name and click on continue.Choose a package and click on continue and provide workbench request.

 

Step 2. Creation of view.

 

In the Component Structure browser, right click on view and choose create. A wizard will be displayed.enter the following data in the wizard

 

View Name : Create

View Type   : Empty View

 

Do not change the following screen and finish the wizard,Similarly create another three views like Oppurtunity,Reports and Search.

Your component will looks as given below.

 

2.png

 

Step 3. Creation of Overview Page


It is used to display the entire information of particular business object (Multiple views into a single view).

Go to the component structure browser and right click on views and select the option create overview page.

Give name to overview page (e.g. Grouplinks ). Save the entries and then go to Runtime Repository Editor Under the view set node,you can find the Overview Page.

Click on Edit button and expand the view set.Right Click on view area of Overview Page and choose the option add view. In the next popup,choose the views like  Create,Oppurtunity,  Reports and Search.

We have successfully assigned the views to the Overview Page.

3.png

Next step, We need  to assign the Overview Page to the Window.

 

3.1.png

 

Step 4. Configure the Overview Page

Go to the Configuration tab of Overview Page. Click on Edit and choose the radio button Work Center Page  --> Continue

4.png

In the next step, We can see all the views available in the Work Center Page Available Assignment Blocks section as we added this views to the overview page.

5.png

 

Select the views and move it to the displayed assignment blocks section and save the configuration.Here we can give the meaningful title to our assignment block in the title column.

 

6.png

Save and Execute the Component, The out will be displayed  as shown in the blow screen shot.

 

8.png

Step 4. Group links creation

 

Go to Component Structure Browser and double click on Search View, In right hand side doble click on Search.htm and add the buttons code.


Add the following code in layout tab

 

<%@extension name="htmlb" prefix="htmlb" %>

<htmlb:link id = 'ACCOUNT_HIER'

             text = 'Account Hierarchies'

             onClick = 'ACCOUNT_HIER' />

<br>

<htmlb:link id = 'ACCOUNTS'

             text = 'Accounts'

             onClick = 'ACCOUNTS' />

<br>

<htmlb:link id = 'CONTACTS'

             text = 'Contacts'

             onClick = 'CONTACTS' />

<br>

 

Save,check and activate the component and then execute the Component.

 

9.png

 

In this we have created three buttons, But this buttons not working because we didn't Implement the event to be triggered when the button is clicked.In my next blog i will explain Work Center Group links navigation with buttons  and Work Center integrated to Business Role in web ui .

 

Thanks&Regards,

Harikrishna M.

CRM Rapid Applications - An Advanced Tutorial (Part 1)

$
0
0

Introduction

Recently I started to play around with the CRM Rapid Applications (Rapid Applications - SAP Library). I wanted to use it to create a little application with some basic functionality. The test application should prefill some data by e.g. using some number range object. Furthermore, it should perform some data validation. As I had attended sitMUC (SAP Inside Track Munich 2014 - Community Events - SCN Wiki) just a few weeks ago where Daniel Ridder and Tobias Trapp gave a presentation on BRFplus (SAP Business Rules Management) I wanted to implement the validations using BRFplus rules.

As with most of the interesting SAP technologies there are basic tutorials available for both, CRM Rapid Applications (e.g. SAP CRM 7.0 EhP1 - Rapid Applications (Part 1) and SAP CRM 7.0 EhP1 - Rapid Applications (Part 2) by Tzanko Stefanov) and BRFplus. However, more advanced tutorials (like e.g. AXT Rapid Applications Currency/Quantity fields by Luis Pérez Grau) are hard to find.

Therefore, I took me quite a while to implement my sample application. I only succeeded by asking questions in the BRFplus forum and by extensive debugging in the CRM Rapid Application framework. Consequently, I decided to collect the knowledge gained in the process in this mini blog series in order to provide an advanced tutorial for CRM Rapid Applications as well as BRFplus. The first part of the blog series is focused on the Rapid Application part and the integration of BRFplus, the second part (CRM Rapid Applications - An Advanced Tutorial (Part 2)) will provide details on the design of the the BRFplus rules.

 

The Application Design

The applications shown in the existing rapid application tutorials are based on existing database tables. In contrast to that I will show how to create an application from scratch including the data base tables using only the rapid application functionality. For the sample application I defined the following requirements which are quite common in business applications. The application should be able to store:

  1. Header data and corresponding attributes
  2. The header should consist of an ID, a reference to a business parter, a creation and change date and user
  3. The attributes should be simple key value pairs.

In addition to that

  • It should be possible to add but not to delete records
  • The ID should be taken from a number range object
  • The creation date and user and change date and user should be set automatically by the system
  • The validity of the attributes should be check according to the following rules
    1. "Attribute 1" is mandatory, "Attribute 2" is optional.
    2. Allowed values for "Attribute 1" are "A", "B" and "C",
    3. Depending on the value of "Attribute 1" the following values are allowed for "Attribute 2"
      Attribute 1Attribute 2
      A1 - 99
      B100 - 299
      C300 - 999

According to these requirements the following table show valid records for the sample application:

 

IDBusiness PartnerCreated AtCreated ByChanged AtChanged By
0000000001100009001.11.2014DRUMM2.11.2014DRUMM
0000000002140001233.11.2014DRUMM3.11.2014DRUMM

 

Header IDAttributeValue
0000000001Attribute1A
0000000002Attribute2B
0000000002Attribute2125

 

These requirements seemed simple enough for an introductory  tutorial when I defined them in the first place. However, it turned out, that there are quite some difficulties hidden in them, both for CRM Rapid Applications and the BRFplus implementation.

 

Creating the Rapid Application

Rapid Applications are created using a wizard provided by the Rapid Application framework. The wizard is started by creating a new Rapid Application. As the example application for this blog should be based on database table select "Create from DB Table" to create the new application.

2014-11-04 16_42_21-Manage Rapid Applications - [SAP] - Internet Explorer bereitgestellt von Ihrer r.png

The Rapid Application wizard consists of the following steps:

1.    Defining name and package for the application

2.    Defining the database model

3.    Defining the UI model

4.    Optionally assigning the application to some UI profiles.

During each steps it is possible to generate and test the application. For this blog I created the application ZCD_RAPIDAPP_EX in the $TMP package.

2014-11-04 16_43_59-Manage Rapid Applications - [SAP] - Internet Explorer bereitgestellt von Ihrer r.png

Defining the Database Model

As mentioned above the goal of this blog is to show how to create a Rapid Application from scratch. Therefore, the next step is to define the database model. First the table to store the header data needs to be created. In order to create a new database table click on the "New" in the "DB Model" step of the wizard. This creates a new database table with an empty field list. Initially the new database table has a auto-generated name (ZCTAB000000N in the screen shot below). It is possible to change this name by clicking on "Details" and providing a custom name for the table (ZCD_RAE_HEADER in the screen shot below).

2014-11-04 16_47_41-Manage Rapid Applications - [SAP] - Internet Explorer bereitgestellt von Ihrer r.png

Although the field list initially appears to be empty the Rapid Application framework automatically generates some "technical" database fields. These field are CLIENT, RECORD_ID, PARENT_ID and OBJECT_ID, with CLIENT and RECORD_ID being the key fields of the database. The auto-generated fields are used by the framework to e.g. link entries in different tables.

The next step is to define the table fields required by the application. The following screen shot shows the table fields I generated for the table ZCD_RAE_HEADER. Note that the field ZZ_OBJECT_ID is defined as a logical key. The definition of a logical key is optional. However, in order to being able to define dependant tables a logical key is required in the superordinate table. Furthermore note, that some of the fields (e.g. ZZ_PARTNER or ZZ_CREATED_BY) have the field type "Application Reference". Fields of type Application Reference are used to store references to other business objects like e.g. account or employee. Application references are used during the execution of the application to provide links in the UI to the respective objects. Finally, the fields available as search criteria need to be defined. This is done in the details view for each field.

2014-11-04 16_54_47-.png

To complete the database model for the application I created the dependent table ZCD_RAE_ATTRIBS to store the attributes. The following screen shot shows the details of this table. Note, that for the field ZZ_ATTRIBUTE I created a list of possible values. The values will be rendered as a drop down list when the application is executed.

2014-11-04 21_13_40-Field Details -- Webseitendialog.png

Defining the UI Model

The next step is to define the UI model. The definition of the UI model consists of two steps, generating the views and adjusting the UI customizing. The first step is to automatically generate the UI model. This will create a search page, an overview page and a embedded search page. After the views have been generated the next step is to adjust the view. The only necessary adjustment for the example application is to remove the delete function from the overview page (cf. the following screen shot).

2014-11-04 21_26_49-Manage Rapid Applications - [SAP] - Internet Explorer bereitgestellt von Ihrer r.png

I didn't add the the Rapid Application to a UI profile for this blog. Consequently, the final step is to save and generate the application. After the application has been generated it can be tested using the "Test" button. Note however, that not the complete functionality of the application is available in the test mode. For example, navigating to different business objects is not supported in the test mode.

The final step in defining the UI is to adjust the UI configuration. As with all SAP CRM applications this can either be done using the configuration mode or transaction BSP_WD_CMPWB_NEW. I change the standard configuration of the header details view as shown in the screen shot below. The business partner field is defined as mandatory, all other fields are display only. The other field should be automatically filled when a new record is created.

2014-11-04 22_19_54-http___srv06164.dataw1.de_8000_sap(bD1lbiZjPTEwMCZkPW1pbg==)_bc_bsp_sap_bspwd_cm.png

Extending the Rapid Application

In order to automatically populate the read only fields as well as to check the attributes according to the rules defined above it is necessary to extend the rapid application. In order to execute custom code during creating, changing and checking of a record the BAdI AXT_RT_TABLES_API is provided by SAP. The BAdI provides the methods ON_CREATE, ON_CHANGE, CHECK and QUERY. In this blog I will use the methods ON_CREATE, ON_CHANGE and CHECK to implement the requirements defined in the application design.

 

Automatically Populating Fields

The application design defines the following requirements:

  1. The Record ID should be taken from a number range object
  2. The creation date and user and change date and user should be set automatically by the system.

In order to achieve this I created the implementation ZCD_AXT_TABLES_RAE_HEADER_IMPL of the BAdI AXT_RT_TABLES_API. The execution of the BAdI is controlled by a filter on the table name. Therefore, I created the filter value ZCD_RAE_HEADER = TABLE_ID (see screen shot below).

2014-11-05 20_45_42-ABAP - CFD_100_drumm_en_[CFD] ZCD_RAPID_APPS_EX_ENH - Eclipse.png

The code snipped below shows the implementation of the ON_CREATE and ON_CHANGE methods of the BAdI implementation class. In the ON_CREATE method a new ZZ_OBJECT_ID is taken from a number range (lines 7 - 21). Besides that, only the fields ZZ_CREATED_BY, ZZ_CREATED_AT, ZZ_CHANGED_BY and ZZ_CHANGED_AT are initialized. The method GET_PARTNER_GUID_FOR_UNAME used in line 29 and 43 is a simple functional wrapper around the function module BP_CENTRALPERSON_GET.

 

  METHOD if_ex_axt_rt_tables_api~on_create.    DATA: header_data TYPE zcd_rae_header_work,          partner_guid TYPE bu_partner_guid.            header_data = cs_work_structure.    IF header_data-zz_object_id IS INITIAL.      CALL FUNCTION 'NUMBER_GET_NEXT'        EXPORTING          nr_range_nr             = '01'          object                  = 'ZCD_RAPID'        IMPORTING          number                  = header_data-zz_object_id        EXCEPTIONS          interval_not_found      = 1          number_range_not_intern = 2          object_not_found        = 3          quantity_is_0           = 4          quantity_is_not_1       = 5          interval_overflow       = 6          buffer_overflow         = 7          OTHERS                  = 8.      IF sy-subrc <> 0.        RETURN.      ENDIF.    ENDIF.    IF header_data-zz_created_by IS INITIAL.      partner_guid = me->get_partner_guid_from_uname( ).      header_data-zz_created_by = partner_guid.      header_data-zz_created_at = sy-datum.      header_data-zz_changed_by = partner_guid.      header_data-zz_changed_at = sy-datum.    ENDIF.    cs_work_structure = header_data.  ENDMETHOD.  METHOD if_ex_axt_rt_tables_api~on_change.    DATA: header_data TYPE zcd_rae_header_work.    header_data = cs_work_structure.    header_data-zz_changed_by = me->get_partner_guid_from_uname( ).    header_data-zz_changed_at = sy-datum.  ENDMETHOD.

Issue Invoking the BAdI

The problem with the current status of the example application is that the BAdI implementation ZCD_AXT_TABLES_RAE_HEADER_IMPL will never get called. The reason is, that the Rapid Application framework checks if a logical key (the field ZZ_OBJECT_ID in the example application) before calling the BAdI. If the logical key is initial, an error message is raised an the BAdI is not called. Consequently it is impossible to implement the requirement to get the object ID from a number range object using only the BAdI AXT_RT_TABLES_API.

The only solution I found to circumvent this problem was to overwrite the DO_CREATE_ROOT method in the implementation class of the overview page ZCD_RAE_HEADER_OVP.

2014-11-12 17_02_20-ABAP - CFD_100_drumm_en - Eclipse.png

In general I don't like the idea of having to enhance the overview page to enable the automatic creation of the object ID. Because the Rapid Application framework forces me to do this I have the logic to create an object is distributed across different parts of the application. However, I found a rather elegant solution for overwriting the method DO_CREATE_ROOT, which is shown in the following code snippet.

In order to create the root entity I simply invoke ON_CREATE method of the BAdI implementation in line 8. The loop in lines 17-22 then maps the resulting data to the creation parameters of the root entity. The root entity is then create in line 24.

 

METHOD do_create_root.    DATA: header_data TYPE zcd_rae_header_work.    DATA(bol_core) = cl_crm_bol_core=>get_instance( ).    DATA(entity_factory) = bol_core->get_entity_factory( mv_main_entity ).    DATA(creation_params) = entity_factory->get_parameter_table( ).    NEW zcl_axt_tables_rae_header_impl( )->if_ex_axt_rt_tables_api~on_create(      EXPORTING        iv_object_id      = ''        iv_parent_id      = ''        iv_record_id      = ''      CHANGING        cs_work_structure = header_data    ).    LOOP AT creation_params ASSIGNING FIELD-SYMBOL(<creation_param>).      ASSIGN COMPONENT <creation_param>-name OF STRUCTURE header_data TO FIELD-SYMBOL(<comp>).      IF <comp> IS ASSIGNED.        <creation_param>-value = <comp>.      ENDIF.    ENDLOOP.    DATA(bol_col) = bol_core->root_create( iv_object_name = mv_main_entity                                           iv_create_param = creation_params                                           iv_number = 1 ).    eo_entity =  bol_col->get_first( ).  ENDMETHOD.

Checking the Attribute Validity

In order to check the attribute validity using BRFplus I created another implementation  ZCD_AXT_TABLES_RAE_ATTRIB_IMPL of the BAdI AXT_RT_TABLES_API. For this implementation, however, the filter value ZCD_RAE_ATTRIBS = TABLE_ID is used (see screen shot below).

2014-11-12 18_15_17-ABAP - CFD_100_drumm_en_[CFD] ZCD_RAPID_APPS_EX_ENH - Eclipse.png

In the implementation class of the BAdI only the CHECK method is used. The code snippet below shows the implementation of the method. In order to check the attributes validity according to the defined rules, it is important to get all attributes of a header record. This is done by first getting the current attribute entity using the RECORD_ID and PARENT_ID in lines 8-13. From the current attribute entity the header entity is read in lines 19. In lines 24-34 all attribute entities related to the header entity are read and the attribute table for the invocation of the BRFplus function is prepared. The simplest way to find the correct entity names and relations is, as with other CRM applications, to use the BOL Model Browser in the transaction BSP_WD_CMPWB_NEW. Finally, the BRFplus function is invoked in line 36.

  METHOD if_ex_axt_rt_tables_api~check.    DATA: bol_key TYPE axts_ca_bol_key,          attrib_properties TYPE zcd_rae_attribs_attr,          attrib_properties_tab TYPE STANDARD TABLE OF zcd_rae_attribs_attr.    DATA(bol_core) = cl_crm_bol_core=>get_instance( ).    ASSIGN COMPONENT 'RECORD_ID' OF STRUCTURE is_work_structure TO FIELD-SYMBOL(<record_id>).    ASSIGN COMPONENT 'PARENT_ID' OF STRUCTURE is_work_structure TO FIELD-SYMBOL(<parent_id>).    bol_key-parent_id = <parent_id>.    bol_key-record_id = <record_id>.    DATA(current_entity) = bol_core->get_entity(                                        EXPORTING                                          iv_object_name = 'ZAET_CA_CTAB000014 '                                          iv_object_id   = cl_crm_genil_container_tools=>build_object_id( is_object_key = bol_key ) ).    CHECK current_entity IS BOUND.    DATA(header_entity) = current_entity->get_parent( ).    CHECK header_entity IS BOUND.    DATA(attrib_entities) = header_entity->get_related_entities( iv_relation_name = 'ZAET_CA_TO_CTAB000014' ).    DATA(iterator) = attrib_entities->get_iterator( ).    DATA(attrib_entity) = iterator->get_first( ).    WHILE attrib_entity IS BOUND.      attrib_entity->get_properties(        IMPORTING          es_attributes = attrib_properties      ).      APPEND attrib_properties TO attrib_properties_tab.      attrib_entity = iterator->get_next( ).    ENDWHILE.    ct_messages = me->execute_checks_using_brfplus( attrib_properties_tab ).  ENDMETHOD.

Summary

The implementation of the second BAdI concludes the first part of the application. With only a few lines of code an mostly only configuration of the Rapid Application the result is a running example application that already fulfils most of the requirements stated in the application design. In the second part of the blog I'll show how implement the validity checks for the attributes (ie. the implementation of the method EXECUTE_CHECKS_USING_BRFPLUS  as well as the underlying BRFplus function.

 

Christian

Read Simple field metadata from View Configuration

$
0
0

Recently, I came across a requirement where I had to read some field metadata from view configuration (say for instance Field Name & Field Label)

Since I couldn't find a ready-to-use "SAP-Standard" way to do this, I had to tweak some of the view configuration related methods to achieve this. I would like to share the same via this post.

 

1. Create a simple transformation for reading the fields from a view configuration. Let me call this as zz_tr_field_list.Code snippet shown below.

 

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"                xmlns:sapxsl="http://www.sap.com/sapxsl"                xmlns:asx="http://www.sap.com/abapxml" version="1.0">   <xsl:output indent="yes" method="xml"/>   <xsl:strip-space elements="*"/>   <xsl:template match="/">     <asx:abap><asx:values><xsl:element name="FIELDS">         <!-- get mandatory fields from form configuration   -->         <xsl:for-each select="//gridcell/*[@id]">           <xsl:element name="FIELDS">             <xsl:value-of select="@id"/>           </xsl:element>         </xsl:for-each>     </xsl:element></asx:values></asx:abap>   </xsl:template></xsl:transform>

2.  Using the configuration manager and configuration descriptor classes, call the above transformation to get the fields. I am pasting here below a small sub-routine (which we will call in a later step).

FORM read_fields_from_config USING       iv_target_view_name        TYPE string       iv_role_key                 TYPE bsp_dlc_role_key       iv_object_type             TYPE bsp_dlc_object_type       iv_sub_object_type         TYPE bsp_dlc_object_sub_type       iv_component_usage         TYPE bsp_dlc_component_usage       CHANGING lt_ums_field      TYPE STANDARD TABLE.   DATA : lt_current_view_fields  TYPE bsp_dlct_field,          lt_table_view_fields    TYPE bsp_dlc_column_descr_tab,          ls_table_view_fields    LIKE LINE OF lt_table_view_fields.   TRY.
 *       Get configuration manager for business role       CREATE OBJECT lr_configuration_manager         TYPE         cl_bsp_dlc_config_manager2         EXPORTING           iv_role_key = iv_role_key.
 *       ... takes role configuration key and ui object type into account       lr_result =  lr_configuration_manager->get_configuration( iv_viewname = iv_target_view_name                                                               iv_view_comp_id = 'C16_W61_V62' ) ##no_text.       IF iv_component_usage IS NOT INITIAL.         CALL METHOD lr_result->set_component_usage           EXPORTING             iv_component_usage = iv_component_usage.       ENDIF    .       lr_configuration_descriptor2 ?= lr_result.       lr_configuration_descriptor2->set_object_type( iv_object_type ).       lr_configuration_descriptor2->set_object_sub_type( iv_sub_object_type ).       CALL METHOD lr_result->get_config_data         RECEIVING           rv_result        = lv_configuration_xml         EXCEPTIONS           foreign_lock     = 1           config_not_found = 2           OTHERS           = 3.       IF sy-subrc <> 0.         RETURN.       ENDIF.
 *       ... Perform XML transformation
 *       -> Result is list of all fields/headings       TRY.           CALL TRANSFORMATION zz_tr_field_list           SOURCE XML lv_configuration_xml           RESULT fields = lt_result.         CATCH cx_root.           RETURN.       ENDTRY.

 

3. The above call transformation will work very fine for an Overview Page. So what if we have a table view? Here's the code that follows.

 

IF lt_result IS INITIAL. "Possibly Table View...         lt_table_view_fields = cl_bsp_dlc_table_utility=>get_table_from_config_xml( lv_configuration_xml ).       ENDIF.

4. Now we are almost done. We still need to get the Field Labels. Let us use the following code to achieve this.

 

*       Get names of configured search criteria       lr_view_descriptor = lr_result->get_property_descriptor( ).       IF lt_result IS NOT INITIAL.         LOOP AT lt_result INTO lv_result.           CHECK lv_result CP '//*'. "could be a guid of heading           ls_field-field_name = lv_result. "example for field name //HEADER/STRUCT.FIRSTNAME           APPEND ls_field TO lt_current_view_fields.         ENDLOOP.       ENDIF.       IF lt_table_view_fields IS NOT INITIAL.         LOOP AT lt_table_view_fields INTO ls_table_view_fields WHERE name NE 'THTMLB_OCA'. "#EC CI_STDSEQ           ls_field-field_name = ls_table_view_fields-title.           APPEND ls_field TO lt_current_view_fields.         ENDLOOP.       ENDIF.
 *       Determine labels       lr_view_descriptor->get_field_labels( CHANGING ct_fields = lt_current_view_fields ).

5. Let us see how to use the above snippet in a report program.

Eg: We would like to get the field metadata for Account Details View. We set the required parameters for the above sub-routine and then call it as seen below.

 

lv_target_view_name ='BP_HEAD/AccountDetails'.  lv_role_key = <<Give Role Config Key here>>.  lv_object_type = 'BP_ACCOUNT'.  lv_sub_object_type = 'INDIVIDUAL'.  lv_component_usage = 'BP_HEAD'.  PERFORM read_fields_from_config USING lv_target_view_name                                        lv_role_key                                        lv_object_type                                        lv_sub_object_type                                        lv_component_usage                                  CHANGING lt_ums_field.

 

 

Hope this was a useful read..!!


WEBCUIF EhP3 SP00 - Release Notes

$
0
0

These Release Notes focus on new features and enhancements delivered as part of the Web Client UI Framework EhP3 Support Package 00.


The WEBCUIF development team is doing his best to provide those new developments on older releases. So if you are interested in a specific feature, verify its availability by checking the corresponding SAP Note.

 

 

New Features and Enhancements

 

New WEBCUIF skin based on the CORBU theme

 

CORBU is a fresh, modern and unique visual identity for SAP Business Suite. It is named after Charles-Édouard Jeanneret, aka Le Corbusier, Swiss Architect and Designer. The design is intentionally neutral to blend with variety of legacy content. The visual identity harmonizes the look & feel of SAP Business Suite products that are built on different technologies and frameworks.

 

corbu.png

 

See SAP Note: 1821042

 

Performance improvement on BOL queries

 

It is now possible to improve the response time of your BOL queries by restricting the attributes list to be retrieved. This can save unnecessary time consuming joins in the backend databases and improve the user experience with faster query results.

 

See SAP Note: 1819334

 

Enhancement to the Add Tag F4 help

 

In order to help the user find tags  more easily (for tagging business objects), we enhanced the Tag F4 help and added options to search with one own tags or all created tags:

 

f4.png

 

See SAP Note: 1792873

WEBCUIF EhP3 SP01 - Release Notes

$
0
0

These Release Notes focus on new features and enhancements delivered as part of the Web Client UI Framework EhP3 Support Package 01.

 

The WEBCUIF development team is doing his best to provide those new developments on older releases. So if you are interested in a specific feature, verify its availability by checking the corresponding SAP Note.

 

 

New Features and Enhancements

 

Table Personalization & Configuration

 

The personalization and configuration of tables was only allowing the user to set the widths and column order. This has now been enhanced to let the user personalize and configure the fixed columns, sorting and filtering. You can now configure and personalize these table features. You can configure and personalize the fixed columns and sorting features while the filtering feature can only be personalized. You also have the option to enable automatic saving of personalization when making changes directly on the front end.


table_pers.png


See SAP Note: 1855398



If you missed them, check out the WEBCUIF EhP3 SP00 - Release Notes.

WEBCUIF EhP3 SP02 - Release Notes

$
0
0

These Release Notes focus on new features and enhancements delivered as part of the Web Client UI Framework EhP3 Support Package 02.

 

The WEBCUIF development team is doing his best to provide those new developments on older releases. So if you are interested in a specific feature, verify its availability by checking the corresponding SAP Note.

 

 

New Features and Enhancements

 

SAP GUI Transactions via the Transaction Launcher

 

Up to now the Transaction Launcher was only able to make use of SAP GUI for HTML or URLs. With this new development it is now possible to use the Transaction Launcher in order to display BOR and FOP based pure SAP GUI Transactions.

 

See SAP Note: 1890755

 

Navigation Through Search Results

 

In order to enhance the user experience on a Search Page, you can now add "Next" and "Previous" buttons in main toolbar. Those buttons will allow the user to easily navigate from one search result to the next or the previous one. Adding those buttons requires some development, refer to the cookbook attached to the SAP Note.

 

See SAP Note: 1867097

 

 

If you missed them, check out the WEBCUIF EhP3 SP01 - Release Notes.

WEBCUIF EhP3 SP03 - Release Notes

$
0
0

These Release Notes focus on new features and enhancements delivered as part of the Web Client UI Framework EhP3 Support Package 03.

 

The WEBCUIF development team is doing his best to provide those new developments on older releases. So if you are interested in a specific feature, verify its availability by checking the corresponding SAP Note.

 

 

New Features and Enhancements

 

Browser Cache Buster

 

Timestamps are now added to commonly cached files (e.g. *.js, *.css) in order for browsers to download them whenever those files have been modified. The timestamps allow for uniquely identifying the latest versions of those files, therefore allowing the browser to override the previously cached content of the corresponding files. For those files, there is no more need to manually erase browser and server caches, while maintenance is performed on a CRM system.

 

See SAP Note: 2065907 (see also 1855979 and 1920638)



If you missed them, check out the WEBCUIF EhP3 SP02 - Release Notes.

WEBCUIF EhP3 SP04 - Release Notes

$
0
0

These Release Notes focus on new features and enhancements delivered as part of the Web Client UI Framework EhP3 Support Package 04.


The WEBCUIF development team is doing his best to provide those new developments on older releases. So if you are interested in a specific feature, verify its availability by checking the corresponding SAP Note.

 

 

New Features and Enhancements

 

Asynchronous Loading for Recent Items


In the aim of optimizing the user experience, an asynchronous initialization procedure has been introduced. The initialization of recent items requires the reading of some attributes of BOL objects and this might be time consuming depending of the complexity of the business objects, the number of items to display and possible errors in the loading. When the UI is rendered for the first time the Recent items link group will not perform the initial load and will show the message “Loading…”.


recent_items.png


After the UI is rendered, an AJAX callback is automatically sent to the back end to perform the recent items initial loading and to complete its rendering. In this way the UI options will be rendered and available for the user to interact and meanwhile the Recent Items list gets populated.


See SAP Note: 1968050



Categories for Saved Searches

 

Saved Searches are saved search attributes, and can be used to execute the same search again from the Central Search or the Homepage. So far there was no possibility to group the Saved Searches. This development enabled users and managers to create categories for Saved Searches, so they can be found more easily.

 

categ_saved_search.png

 

See SAP Notes: 1965319

 

Conditional Formatting of Cellerator cells


Conditional formatting of a cellerator cell's background colour is now available.  Developers can return the desired background colour via the relevant P-GETTER method. In the example below, the cells are colourized depending on the gross amount value.

 

cellerator_color.png

 

See SAP Note: 1937399

 

 

If you missed them, check out the WEBCUIF EhP3 SP03 - Release Notes.

WEBCUIF EhP3 SP05 - Release Notes

$
0
0

These Release Notes focus on new features and enhancements delivered as part of the Web Client UI Framework EhP3 Support Package 05.

 

The WEBCUIF development team is doing his best to provide those new developments on older releases. So if you are interested in a specific feature, verify its availability by checking the corresponding SAP Note.

 

 

New Features and Enhancements

 

Save the Result List Layout with a Saved Search

 

When creating a Saved Search, you have now the option to also save the layout of your Result List along with it. This way if a specific set of columns is more meaningful for your Saved Search, you can save it and have it automatically load each time you launch this Saved Search. And if you decide to share your Saved Search with other users via the Central Sharing tool, you will also be able to share the Result List layout as well.

 

save_layout.png

 

See SAP Note: 1987296

 

Type Ahead support for the Smart Value Help

 

The Smart Value Help (SVH) is available for input fields with an input help also known as F4 help. With the WEBCUIF Ehp3 SP5 the SVH has been enhanced to support the so called type-Ahead help objects that perform multicolumn and fuzzy background searches.

 

svh.png

 

See SAP Note: 2002900

 

Islamic Calendar support for the Date Picker

 

WEBCUIF supports two Islamic calendars after implementing SAP Note 1947571 or upgrading to the corresponding Support Package. The Hijri calendar (computation based) and the Umm Al-Qura calendar (tabular based). When end-users select the "Islamic Date 1" in their user profile, the Date Picker will render the Hijri Calendar. When "Islamic Date 2" is selected the Date Picker will render the Umm Al Qura Calendar.

 

hijri_cal.png

 

See SAP Note: 1947571

 

 

If you missed them, check out the WEBCUIF EhP3 SP04 - Release Notes.

WEBCUIF EhP3 SP06 - Release Notes

$
0
0

These Release Notes focus on new features and enhancements delivered as part of the Web Client UI Framework EhP3 Support Package 06.

 

The WEBCUIF development team is doing his best to provide those new developments on older releases. So if you are interested in a specific feature, verify its availability by checking the corresponding SAP Note.

 

 

New Features and Enhancements

 

Default Values for Advanced Search Pages

 

Advanced Search pages can now be loaded with pre-filled values. This can be done on a user basis or across an entire Business Role.

 

default_advanced_search.png

 

See SAP Note: 2045936

 

Assign a Custom Logo to a Business Role


The Business Role customizing has been enhanced in order to provide a way for the customer to assign a custom logo for a given Business Role.

 

brole_logo.png

 

See SAP Notes: 2023680

 

Mass Tagging from the Search Result List

 

It is now possible to tag objects based on the selected elements of a search result list (also Embedded Search result lists). In the result lists the items which should be tagged are selected and with a click on the tag icon the tag can be defined and all selected objects will be tagged at once.

 

When displaying the tagged objects in a mixed list it is now also be possible to have a mass delete tags.

 

mass_tag1.png

 

See SAP Note: 2045716

 

Cancel Running Search

 

There are many searches in CRM that can last very long if the user enters unsuitable parameters. This leads most times to poor search request durations, long and useless result lists or even to timeouts. Moreover these searches acquire a high amount of system resources that take down the overall system performance.

 

The Searches in the Web Client UI Framework have now been extended by a “Cancel” button. Upon hitting Cancel, the session of the user will be restarted and the user will land on the Home Page.

 

cancel_search.png

 

See SAP Note: 2044841

 

Automatic Save on the Frontend

 

Text entered in "text-areas" and "input-fields" controls will be maintained in front-end local storage as long as the form is in an overview page, regardless of the completion or validation of the entered data. When navigating away from the page by clicking the save or the cancel button, the local storage would get cleared. In case the browser crashes while entering data in a given form, when the user navigate back to the same form the information entered previously will be restored.

 

See SAP Note: 2046890

 

Auto-Adjust "dirty" Personalization

 

After configuration changes have been transported, they should automatically be reflected on users personalizations. So far this was not the case, and this feature enables it.

 

See SAP Notes: 2045421

 

Read Access Logging Integration

 

Data drives your business, and a seamless flow of information across your enterprise can give your business the edge it needs to stay competitive. The more that data flows, however, the more open it is to improper access — and not just from hackers outside of your company, but also from within the organization, whether intentional or inadvertent. To adhere to legal and organizational requirements, as well as industry standards, you need to be able to immediately identify who accessed what, when it was accessed, and where it was accessed; and you need to be able to deal with any potential data security violations.

 

To address these needs, SAP delivered Read Access Logging (RAL). RAL is a new security functionality that allows customers to log and monitor user access to sensitive or classified data.

 

See SAP Note: 1995340

 

 

If you missed them, check out the WEBCUIF EhP3 SP05 - Release Notes.


WEBCUIF EhP3 SP07 - Release Notes

$
0
0

These Release Notes focus on new features and enhancements delivered as part of the Web Client UI Framework EhP3 Support Package 07.

 

The WEBCUIF development team is doing his best to provide those new developments on older releases. So if you are interested in a specific feature, verify its availability by checking the corresponding SAP Note.

 

 

New Features and Enhancements

 

Message Area Usability Enhancement


The user has now a new option in his settings to "Enable automatic message preview and expansion". This will make the Message Area drop down appear automatically if the message is of type error. For messages of type success and warning, the usual and more discreet toast up is used.

 

message_area_ux_enh.png

 

See SAP Note: 2062604

 

 

If you missed them, check out the WEBCUIF EhP3 SP06 - Release Notes.

Alert Notification Step-by-Step

$
0
0

Here is a step-by-step example for enabling alert notification for Account changes.

 

1. Define Connection to Central Alert Server

In transaction SPRO go to path Customer Relationship Management->Basic Functions->Alert
Management->Define Connection to Central Alert Server.

temp1.png

 

Use search help to select the RFC destination for the system (and client) in which your Central Alert Management is running. The alerts are forwarded from this system by RFC to the central alert server, from where they are delivered centrally. Alert categories must be defined on the central alert server.

 

If this system is the central system, on which all alert categories are defined, and from which the alerts are delivered, enter NONE as the RFC destination.

 

2. Define alert classifications

This step is optional. These are useful to group alert categories.

temp2.png

temp3.png

3. Define alert categories

 

 

 

The  category contains various properties and other specifications that define the alerts within that category, for example expiry date, or the escalation recipient. For example, you can create the alert categories Contract Cancelled and Decrease in Sales. When the critical situation defined in the alert category arises, the system recognizes this and sends an alert instance of this category to the recipients determined. The alerts can always be found in the display programs configured for the recipient (UWL, application-specific program, or alert inbox). Additionally, the alerts are sent via eventual external communication channels, such as e-mail, sms, or fax.

temp5.png

 

temp6.png

On the Container tab page, define any variables that you may want to use in the short text or long text.

temp7.png

temp8.png

On the Long and Short Text tab page, enter texts for the alert category.

temp10.png

You can include text variables referring to elements of the alert container or system symbols.

temp9.png

 

 

4. Determine recipients

temp11.png

temp12.png

5. Triggering alerts

Alerts of a particular category must be triggered by an application at runtime. Triggering alerts can be done in various ways. You can call a function module
directly or use middleware components that trigger alerts, such as the Business Object Repository (BOR), Post Processing Framework (PPF), SAP Workflow, or CCMS.

In this example the alert is triggered by function module call in the Save event handler of the UI component view. This is done in transaction BSP_WD_CMPWB - UI Component Workbench.

 

temp13.png

 

 

eh_onsave.

 
CALL METHOD super->eh_onsave

   
EXPORTING

      htmlb_event   
= htmlb_event

      htmlb_event_ex
= htmlb_event_ex

   
IMPORTING

      ev_success    
= ev_success.



 
DATA: lr_builheader    TYPE REF TO cl_crm_bol_entity,

        l_t_swcont_alert
TYPE TABLE OF swcont,

        l_s_swcont      
TYPE swcont,

        lv_bpnumber     
TYPE        bu_partner.



  lr_builheader ?= me
->typed_context->builheader->collection_wrapper->get_current( ).

 
check lr_builheader is bound.

  lr_builheader
->get_property_as_value( EXPORTING iv_attr_name = 'BP_NUMBER'

                                      
IMPORTING ev_result    = lv_bpnumber ).



  l_s_swcont
-element = 'BP_NUMBER'.

  l_s_swcont
-value   = lv_bpnumber.

 
APPEND l_s_swcont TO l_t_swcont_alert.



 
IF l_t_swcont_alert IS NOT INITIAL.

*     build container via macros

   
CALL FUNCTION 'RSRAS_BUILD_CAM_CONTAINER'

     
TABLES

        c_t_swcont
= l_t_swcont_alert.

 
ENDIF.



*** trigger SAP alert

 
CALL FUNCTION 'SALRT_CREATE_API'

   
EXPORTING

      ip_category           
= 'ZBP_CHANGE'

      ip_wait_on_commit     
= ' '

   
TABLES

*     it_activities          = l_t_activity

      it_container          
= l_t_swcont_alert

   
EXCEPTIONS

      alert_category_unknown
= 1

      alert_no_recipients   
= 2

      alert_error_unknown   
= 3

      destination_undefined 
= 4

      communication_failure 
= 5

      system_failure        
= 6

     
OTHERS                 = 7.

ENDMETHOD.

 

6. Result

After Save button is pushed on the Account overview page, the alert is sent to the specified recipients.

temp15.png

temp16.png

 

7. Reference

 

More info about Alert can be found on the page below.

http://help.sap.com/saphelp_crm700_ehp03/helpdata/en/49/47823a37042221e10000000a42189d/frameset.htm

Web UI Data Load Utility - Preferably custom customizing tables

$
0
0

Usually , there is a need for custom customizing tables to accommodate project specific requirements. Uploading the data into these tables through "Table maintenance" can get difficult for each and every table ( if the records are more or more columns are there in table).  In such situations , we typically write custom (SE38) programs / LSMW to load the data into these tables using data files. Also, we need to provide GUI access along with Web UI access to maintain these tables.

 

To overcome all these complexities, I developed a custom Web UI component to facilitate data load for any given custom table ( preferably customizing tables).

 

Features of this tool:

 

1. Works with any table.

2. Provided table columns will be displayed dynamically.

2. Uploaded file data will be displayed in the assignment block columns in sequential order of the file data.

3. Works with text and csv files.

4. File data gets saved to the specified table.

 

However , depending on your additional requirements - like data validation, mismatch of file columns order with table columns order etc, you have to develop further to meet your requirements.

 

Please follow below steps to develop this component:

 

Component.jpg

Component Details :

 

Created a component "Z_TABL_UPD" with MainWindow, then created three views - "TableView", "FileUpload" , "DataView" and an overview page "FileUpdOvrPage".

 

Created a custom component "CuCoDataUpd" with context nodes ‘FILEPARAM’ and 'DBTABLE' then performed context node binding with views - "FileUpload" view context node ‘FILEPARM’, "TableView"  view context node 'DBTABLE'.

 

 

Custom Component "CuCoDataUpd" Details :

Custom Controller.JPG

 


OverviewPage "FileUpdOvrPage" Details :

 

OverViewPage.jpg

Over View Page Configuration.JPG

 

 

"FileUpload" View Details:


FileUpload-1.JPG

 

 

 

FileUpload-2.jpg

 

Upload Event Details :

 

It is same like GS_FILE_UPLOAD component , View VFileUpload , Event "Upload"  and Bounded the FILEPARAM context node with custom controller context node.

 

Custom Controller FILEPARAM Bounding.JPG

 

File Type Selection Event Details :

 

METHOD eh_onsel_fltyp.

 

  DATA : lv_selection   TYPE string,

         lr_htmlb_ddlb  TYPEREFTO cl_htmlb_event_selection.

 

  IF htmlb_event_ex->event_class EQ'CL_HTMLB_EVENT_SELECTION'.

    lr_htmlb_ddlb ?= htmlb_event_ex.

    lv_selection  = lr_htmlb_ddlb->selection.

    me->typed_context->fileparam->set_type( attribute_path = '//FILEPARAM/TYPE'value = lv_selection ).

  ENDIF.

 

ENDMETHOD.

 

 

 

"DataView" View Details :

 

DataView-1.jpg

 

 

DataView-2.jpg

 

 

 

Context Node INIT Method :

METHOD if_bsp_model~init.

 

  DATA:

        lr_custom_controller TYPEREFTO zl_z_tabl_u_cucodataupd_impl,

        lr_controller        TYPEREFTO zl_z_tabl_u_dataview_impl,

        lr_coll_wrapper      TYPEREFTO cl_bsp_wd_collection_wrapper,

        lr_entity            TYPEREFTO cl_crm_bol_entity,

        lr_table             TYPEREFTO if_bol_bo_property_access,

        lv_table             TYPE string,

        lv_tabname           TYPE ddobjname,

        lt_fields            TYPE ddfields,

        ls_field             TYPE dfies,

        lt_columns           TYPE abap_component_tab,

        ls_column            TYPE abap_componentdescr,

        lr_element           TYPEREFTO cl_abap_datadescr,

        lr_struct            TYPEREFTO  cl_abap_structdescr,

        lr_itab              TYPEREFTO cl_abap_tabledescr,

        lr_line              TYPEREFTOdata,

        lr_dref              TYPEREFTOdata,

        lr_value_node        TYPEREFTO cl_bsp_wd_value_node,

        lr_bo_coll           TYPEREFTO if_bol_bo_col.

 

 

  super->if_bsp_model~init(id   = id

                            owner = owner ).

 

 

  CHECK owner ISBOUND.

 

  lr_controller       ?= owner.

  lr_custom_controller = lr_controller->get_cust_controller().

  gr_cuco             ?= lr_custom_controller.

 

  lr_coll_wrapper = lr_custom_controller->typed_context->dbtable->get_collection_wrapper().

  lr_table       ?= lr_coll_wrapper->get_current().

  lv_table       = lr_table->get_property_as_string( iv_attr_name = 'TBMA_VAL').

 

  lv_tabname = lv_table.

 

  CHECKNOT lv_tabname ISINITIAL.

 

  CALLMETHOD lr_custom_controller->get_table_fields

    EXPORTING

      iv_tabname = lv_tabname

    IMPORTING

      et_fields = lt_fields.

 

 

  LOOPAT lt_fields INTO ls_field.

 

    lr_element        ?= cl_abap_elemdescr=>describe_by_data( ls_field-datatype ).

    ls_column-name    = ls_field-fieldname.

    ls_column-type    = lr_element.

    INSERT ls_column INTOTABLE lt_columns.

 

  ENDLOOP.

 

  gt_columns[] = lt_columns.

 

* Create the structure type

  lr_struct ?= cl_abap_structdescr=>create( p_components = lt_columns p_strict = abap_false  ).

 

* Create data with reference to the type object

  CREATEDATA lr_dref

         TYPE HANDLE lr_struct.

 

* Create a value node

  CREATEOBJECT lr_value_node

    EXPORTING

      iv_data_ref = lr_dref.

 

* Create a BO collection

  CREATEOBJECT lr_bo_coll TYPE cl_crm_bol_bo_col.

 

* Add the value node to the BO collection

  lr_bo_coll->add( lr_value_node ).

 

* Set the collection wrapper

  set_collection( lr_bo_coll ).

 

ENDMETHOD.

GET_TABLE_LINE_SAMPLE Method :

 

METHOD get_table_line_sample.

 

  DATA:

      lr_custom_controller TYPEREFTO zl_z_tabl_u_cucodataupd_impl,

      lr_coll_wrapper      TYPEREFTO cl_bsp_wd_collection_wrapper,

      lr_entity            TYPEREFTO cl_crm_bol_entity,

      lr_table             TYPEREFTO if_bol_bo_property_access,

      lv_table             TYPE string,

      lv_tabname           TYPE ddobjname,

      lt_fields            TYPE ddfields,

      ls_field             TYPE dfies,

      lt_columns           TYPE abap_component_tab,

      ls_column            TYPE abap_componentdescr,

      lr_element           TYPEREFTO cl_abap_datadescr,

      lr_struct            TYPEREFTO cl_abap_structdescr,

      lr_itab              TYPEREFTO cl_abap_tabledescr,

      lr_line              TYPEREFTOdata,

      lr_dref              TYPEREFTOdata.

 

  FIELD-SYMBOLS :

      <fs_outtab_t>        TYPEANYTABLE,

      <fs_outtab_s>        TYPEany.

 


  lr_custom_controller ?= gr_cuco.

  lr_coll_wrapper = lr_custom_controller->typed_context->dbtable->get_collection_wrapper().

  lr_table       ?= lr_coll_wrapper->get_current().

  lv_table       = lr_table->get_property_as_string( iv_attr_name = 'TBMA_VAL').

 

  lv_tabname = lv_table.

 

  CHECK lv_tabname ISNOTINITIAL.

 

  CALLMETHOD lr_custom_controller->get_table_fields

    EXPORTING

      iv_tabname = lv_tabname

    IMPORTING

      et_fields = lt_fields.


  LOOPAT lt_fields INTO ls_field.


    lr_element        ?= cl_abap_elemdescr=>describe_by_data( ls_field-datatype ).

    ls_column-name    = ls_field-fieldname.

    ls_column-type    = lr_element.

    INSERT ls_column INTOTABLE lt_columns.

 

  ENDLOOP.


  gt_columns[] = lt_columns.


  IF lt_columns ISNOTINITIAL.


    lr_struct ?= cl_abap_structdescr=>create( p_components = lt_columns  p_strict = abap_false ).

    lr_itab   ?= cl_abap_tabledescr=>create( lr_struct ).

 

*   Create a data with reference to type object

    CREATEDATA lr_dref TYPE HANDLE lr_itab.

    ASSIGN lr_dref->* TO<fs_outtab_t>.

 

*   Create dynamic work area and assign to FS

    CREATEDATA lr_line LIKELINEOF<fs_outtab_t>.

    rv_sample = lr_line.

 

  ENDIF.


ENDMETHOD.


Save Data Method :

 

METHOD eh_onsave.

 

  DATA:

      lr_coll_wrapper              TYPEREFTO cl_bsp_wd_collection_wrapper,

      lr_entity                    TYPEREFTO if_bol_bo_property_access,

      lr_table                     TYPEREFTO if_bol_bo_property_access,

      lv_table                     TYPE string,

      lv_selection                 TYPE string,

      lv_tabname                   TYPE ddobjname,

      lt_fields                    TYPE ddfields,

      ls_field                     TYPE dfies,

      lt_tabledata                 TYPEREFTOdata,

      lv_sy_subrc                  TYPE sy-subrc VALUE 0,

      lv_field_name                TYPE char40,

      lt_dref_seltable             TYPEREFTOdata,

      ls_dref_line                 TYPEREFTOdata,

      lt_field                     TYPE string_table,

      lt_field_val                 TYPE string_table,

      lv_last_field                TYPE string,

      lv_index                     TYPE i,

      lv_tabix                     TYPE i,

      lr_value_node                TYPEREFTO cl_bsp_wd_value_node,

      lr_res_coll                  TYPEREFTO if_bol_bo_col,

      lv_counter                   TYPE i,

      lv_file_content_string       TYPE string,

      lr_custom_controller         TYPEREFTO zl_z_tabl_u_cucodataupd_impl,

      lr_collection                TYPEREFTO if_bol_bo_col,

      lr_msg_service               TYPEREFTO cl_bsp_wd_message_service.

 

  FIELD-SYMBOLS:

     <lv_field>                    TYPE string,

     <lv_field_val>                TYPE string,

     <ls_field>                    TYPEany,

     <fs_dyn_table>                TYPEtable,

     <fs_tabline>                  TYPEany.

 

  CONSTANTS:

         lc_comma                  TYPE c VALUE','.

 

  lr_custom_controller   = me->get_cust_controller().

  lr_coll_wrapper        = lr_custom_controller->typed_context->dbtable->get_collection_wrapper().

  lr_table               ?= lr_coll_wrapper->get_current().

  lv_table               = lr_table->get_property_as_string( iv_attr_name = 'TBMA_VAL').

 

  lr_coll_wrapper        = lr_custom_controller->typed_context->fileparam->get_collection_wrapper().

  lr_entity              ?= lr_coll_wrapper->get_current().

  lv_file_content_string = lr_entity->get_property_as_string( iv_attr_name = 'FILEDATA').

  lv_selection           = lr_entity->get_property_as_string( iv_attr_name = 'TYPE').

 

  CHECK lv_table ISNOTINITIAL.

 

  lv_tabname = lv_table.

 

  CALLMETHOD lr_custom_controller->get_table_fields

    EXPORTING

      iv_tabname = lv_tabname

    IMPORTING

      et_fields = lt_fields.

 

 

  SPLIT lv_file_content_string AT cl_abap_char_utilities=>cr_lf INTOTABLE lt_field.

 

 

  TRY.

      CREATEDATA lt_dref_seltable TYPETABLEOF(lv_tabname)  .

    CATCH cx_sy_create_data_error.

      RETURN.

  ENDTRY.

  ASSIGN lt_dref_seltable->* TO<fs_dyn_table>.

 

  TRY.

      CREATEDATA ls_dref_line LIKELINEOF<fs_dyn_table>.

    CATCH cx_sy_create_data_error.

      RETURN.

  ENDTRY.

  ASSIGN ls_dref_line->* TO<fs_tabline>.

 

  lv_counter = 1.

  LOOPAT lt_field ASSIGNING<lv_field>.

 

    IF lv_counter EQ1.

      READTABLE lt_fields INTO ls_field INDEX lv_counter.

      CONCATENATE'<fs_tabline>-' ls_field-fieldname INTO lv_field_name.

      ASSIGN(lv_field_name)TO<ls_field>.

      <ls_field> = sy-mandt.

      lv_counter = lv_counter + 1.

    ENDIF.

 

    CASE lv_selection.

      WHEN'1'.

        SPLIT<lv_field>AT cl_abap_char_utilities=>horizontal_tab INTOTABLE lt_field_val.

      WHEN'2'.

        SPLIT<lv_field>AT lc_comma INTOTABLE lt_field_val.

    ENDCASE.

 

    LOOPAT lt_field_val ASSIGNING<lv_field_val>.

 

      lv_tabix = sy-tabix.

      READTABLE lt_fields INTO ls_field INDEX lv_counter.

      CONCATENATE'<fs_tabline>-' ls_field-fieldname INTO lv_field_name.

      ASSIGN(lv_field_name)TO<ls_field>.

      <ls_field> = <lv_field_val>.

      lv_counter = lv_counter + 1.

 

    ENDLOOP.

 

    APPEND<fs_tabline>TO<fs_dyn_table>.

    lv_counter = 1.

 

  ENDLOOP.

 

  IFNOT<fs_dyn_table>[] ISINITIAL.

    CALLFUNCTION'ENQUEUE_E_TABLEE'

      EXPORTING

        mode_rstable  = 'E'

        tabname       = lv_tabname

*       VARKEY         =

*       X_TABNAME      = ' '

*       X_VARKEY       = ' '

*       _SCOPE         = '2'

*       _WAIT          = ' '

*       _COLLECT       = ' '

      EXCEPTIONS

        foreign_lock  = 1

        system_failure = 2

        OTHERS        = 3.

    IF sy-subrc EQ0.

      MODIFY(lv_tabname)FROMTABLE<fs_dyn_table>.

      IF sy-subrc EQ0.

 

        lr_msg_service = cl_bsp_wd_message_service=>get_instance().

 

        lr_msg_service->add_message( iv_msg_type   = 'S'

                                     iv_msg_id     = '00'

                                     iv_msg_number = '001'

                                     iv_msg_v1     = 'Data Saved Successfully').

 

        COMMITWORK.

      ELSE.

        ROLLBACKWORK.

      ENDIF.

 

      CALLFUNCTION'DEQUEUE_E_TABLEE'

        EXPORTING

          mode_rstable = 'E'

          tabname     = lv_tabname.

*         VARKEY       =

*         X_TABNAME    = ' '

*         X_VARKEY     = ' '

*         _SCOPE       = '3'

*         _SYNCHRON    = ' '

*         _COLLECT     = ' '

 

    ENDIF.

  ENDIF.

ENDMETHOD.

 

 

 

Display Data :

 

 

 

METHOD do_prepare_output.

 

  DATA:

        lr_coll_wrapper              TYPEREFTO cl_bsp_wd_collection_wrapper,

        lr_entity                    TYPEREFTO if_bol_bo_property_access,

        lr_table                     TYPEREFTO if_bol_bo_property_access,

        lv_table                     TYPE string,

        lv_selection                 TYPE string,

        lv_tabname                   TYPE ddobjname,

        lt_fields                    TYPE ddfields,

        ls_field                     TYPE dfies,

        lt_tabledata                 TYPEREFTOdata,

        lv_sy_subrc                  TYPE sy-subrc VALUE 0,

        lv_field_name                TYPE char40,

        lt_dref_seltable             TYPEREFTOdata,

        ls_dref_line                 TYPEREFTOdata,

        lt_field                     TYPE string_table,

        lt_field_val                 TYPE string_table,

        lv_last_field                TYPE string,

        lv_index                     TYPE i,

        lv_tabix                     TYPE i,

        lr_value_node                TYPEREFTO cl_bsp_wd_value_node,

        lr_res_coll                  TYPEREFTO if_bol_bo_col,

        lv_counter                   TYPE i,

        lv_file_content_string       TYPE string,

        lr_custom_controller         TYPEREFTO zl_z_tabl_u_cucodataupd_impl,

        lr_collection                TYPEREFTO if_bol_bo_col.

 

  FIELD-SYMBOLS:

       <lv_field>                    TYPE string,

       <lv_field_val>                TYPE string,

       <ls_field>                    TYPEany,

       <fs_dyn_table>                TYPEtable,

       <fs_tabline>                  TYPEany.

 

  CONSTANTS:

        lc_comma                     TYPE c VALUE','.

 

  lr_custom_controller = me->get_cust_controller().

  lr_coll_wrapper     = lr_custom_controller->typed_context->dbtable->get_collection_wrapper().

  lr_table            ?= lr_coll_wrapper->get_current().

  lv_table            = lr_table->get_property_as_string( iv_attr_name = 'TBMA_VAL').

 

  lr_coll_wrapper   = lr_custom_controller->typed_context->fileparam->get_collection_wrapper().

  lr_entity              ?= lr_coll_wrapper->get_current().

  lv_file_content_string = lr_entity->get_property_as_string( iv_attr_name = 'FILEDATA').

  lv_selection           = lr_entity->get_property_as_string( iv_attr_name = 'TYPE').

 

  CHECK lv_table ISNOTINITIAL.

 

  CALLMETHOD super->do_prepare_output.

*  EXPORTING

*    iv_first_time = ABAP_FALSE


  lv_tabname = lv_table.

 

  CALLMETHOD lr_custom_controller->get_table_fields

    EXPORTING

      iv_tabname = lv_tabname

    IMPORTING

      et_fields = lt_fields.

 

  SPLIT lv_file_content_string AT cl_abap_char_utilities=>cr_lf

   INTOTABLE lt_field.


  TRY.

      CREATEDATA lt_dref_seltable TYPETABLEOF(lv_tabname)  .

    CATCH cx_sy_create_data_error.

      RETURN.

  ENDTRY.

  ASSIGN lt_dref_seltable->* TO<fs_dyn_table>.

 

  TRY.

      CREATEDATA ls_dref_line LIKELINEOF<fs_dyn_table>.

    CATCH cx_sy_create_data_error.

      RETURN.

  ENDTRY.

  ASSIGN ls_dref_line->* TO<fs_tabline>.

 

  lv_counter = 1.

  LOOPAT lt_field ASSIGNING<lv_field>.

 

    IF lv_counter EQ1.

      READTABLE lt_fields INTO ls_field INDEX lv_counter.

      CONCATENATE'<fs_tabline>-' ls_field-fieldname INTO lv_field_name.

      ASSIGN(lv_field_name)TO<ls_field>.

      <ls_field> = sy-mandt.

      lv_counter = lv_counter + 1.

    ENDIF.

 

    CASE lv_selection.

      WHEN'1'.

        SPLIT<lv_field>AT cl_abap_char_utilities=>horizontal_tab

         INTOTABLE lt_field_val.

      WHEN'2'.

        SPLIT<lv_field>AT lc_comma INTOTABLE lt_field_val.

    ENDCASE.

 

    LOOPAT lt_field_val ASSIGNING<lv_field_val>.

      lv_tabix = sy-tabix.

      READTABLE lt_fields INTO ls_field INDEX lv_counter.

      CONCATENATE'<fs_tabline>-' ls_field-fieldname INTO lv_field_name.

      ASSIGN(lv_field_name)TO<ls_field>.

      <ls_field> = <lv_field_val>.

      lv_counter = lv_counter + 1.

    ENDLOOP.

    APPEND<fs_tabline>TO<fs_dyn_table>.

    lv_counter = 1.

  ENDLOOP.

 

  CREATEOBJECT lr_collection TYPE cl_crm_bol_bo_col.

 

  LOOPAT<fs_dyn_table>ASSIGNING<fs_tabline>.

 

    CREATEOBJECT lr_value_node

      EXPORTING

        iv_data_ref = ls_dref_line.

 

    lr_value_node->set_properties(<fs_tabline>).

 

    CALLMETHOD lr_collection->add

      EXPORTING

        iv_entity = lr_value_node.

 

  ENDLOOP.

 

* Display data

  me->typed_context->filedata->set_collection( lr_collection  ).

 

ENDMETHOD.

 

Passing Table Name to .htm page :

METHOD set_models.

 

  DATA :

     lv_table                TYPE tabname16,

     lr_custom_controller    TYPEREFTO zl_z_tabl_u_cucodataupd_impl,

     lr_coll_wrapper         TYPEREFTO cl_bsp_wd_collection_wrapper,

     lr_entity               TYPEREFTO cl_crm_bol_entity,

     lr_table                TYPEREFTO if_bol_bo_property_access,

     lv_tabname              TYPE ddobjname.



  lr_custom_controller = me->get_cust_controller().

  lr_coll_wrapper     = lr_custom_controller->typed_context->dbtable->get_collection_wrapper().

  lr_table            ?= lr_coll_wrapper->get_current().

  lv_table            = lr_table->get_property_as_string( iv_attr_name = 'TBMA_VAL').

 

  CALLMETHOD super->set_models

    EXPORTING

      view = view.

 

  view->set_attribute(

         name   = 'TableName'                              "#EC NOTEXT

         value  = lv_table ).

 

ENDMETHOD.

 


Iterator Details :

 

Created a class ZCL_HTMLB_TABLEVIEW_ITERATOR , added interface IF_HTMLB_TABLEVIEW_ITERATOR implemented Method GET_COLUMN_DEFINITIONS and also implemented CONSTRUCTOR to pass columns data


DataView-3.jpg


Iterator Get Column Definitions Method details :

 

METHOD if_htmlb_tableview_iterator~get_column_definitions.

 

  DATA:

        ls_table_view  TYPE tableviewcontrol,

        lt_table_view  TYPE tableviewcontroltab,

        lr_filedata    TYPEREFTO zl_z_tabl_u_dataview_cn00,

        lt_columns     TYPE abap_component_tab,

        ls_column      TYPE abap_componentdescr.

 

  lt_columns[] = gr_filedata->gt_columns[].

 

  LOOPAT lt_columns INTO ls_column.

 

    ls_table_view-columnname          = ls_column-name.

    ls_table_view-title               = ls_column-name.

    ls_table_view-wrapping            = abap_false.

    ls_table_view-width               = '100px'.

    ls_table_view-horizontalalignment = 'LEFT'.

 

    APPEND ls_table_view TO p_column_definitions.

 

  ENDLOOP.

 

ENDMETHOD.

 


Constructor Details :

 

METHOD constructor.

  gr_filedata ?= ir_context_node.

ENDMETHOD.

 

 

 

TableView Details :

 

TableView-1.JPG

 

TableView-2.jpg

 

GET_V Method

 

METHOD get_v_tbma_val.

 

  DATA:

   ls_map    TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,

   lt_inmap  TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,

   lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.

 

  ls_map-context_attr = 'TBMA_VAL'.

  ls_map-f4_attr     = 'TABNAME'.

  APPEND ls_map TO: lt_inmap,lt_outmap.

 

  CREATEOBJECT rv_valuehelp_descriptor TYPE

    cl_bsp_wd_valuehelp_f4descr

    EXPORTING

      iv_help_id       = 'AXT_DBTABLE_SEARCH_HELP'

      iv_help_id_kind  = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name

      iv_input_mapping = lt_inmap

      iv_output_mapping = lt_outmap.


ENDMETHOD.

 


Runtime Repository Details :

 

The below snapshot shows the final runtime repository objects.
Runtime Repository.JPG

 

 

Component Execution Details :

 

File Types:

FileTypes.jpg

 

File Contents - Text File :

 

File Contents Example - TXT.jpg

 

File Contents - CSV File

 

File Contents Example - CSV.jpg

 

 

 

Sample Table - 1:

Table-1.jpg


Sample Table -2 :

 

Table-2.jpg

 

Table ZCONFIG_DATA_1  provided in the component , columns displayed in the table view as per the provided table , selected the text file and loaded the text file using "Upload" button:


Table-1 Load.jpg

 

Saved the data using "Save" button , table data after successful data load

Table-1 Data.jpg

 

 

Table ZCONFIG_DATA_2  provided in the component , columns displayed in the table view as per the provided table , selected the CSV file and loaded the CSV file using "Upload" button:

 

 

Table-2 Load CSV.JPG

 

 

Table-2 Load CSV Data.JPG

 

Saved the data using "Save" button , table data display after successful data load

Table-2 Data.jpg

Set Default Values in UI Search

$
0
0

Scenario : We have multiple transaction types  in use under quotations and reps who are using CRM wants to see one transaction type search data by default.

 

Multiple ways of doing it...one way!

 

Step 1 : UI Component and View  -> BT115QS_SLSQ

image001.png

 

Step 2 : BSP_WD_CMPWB - UI Component Workbench

 

image003.png

 

Step 3 : Click on Enhance Component

image005.png

 

Step 4 : Assign Enhancement Set -> Choose from drop down

image007.png

 

Step 5 :  Name Application (Ex Z of Component)

 

image009.png

Step 6 : Click  on Yes, when system confirms with pop up of (The BSP application does not exist. Do you want to create it?)

image011.png

 

Step 7 : Click on Continue, when system confirms with pop up of Input of Runtime Repository Storage Location -> Page = Repository.xml

 

image013.png

 

Step 8: System confirms with pop up of Workbench Request to add in TR

image015.png

 

Step 9 : We assigned to Ehn Set and  Enhanced Component.

image017.png

 

Step 10 : Transaction Code SM 34

-> Enter View Cluster : BSPWDVC_CMP_EXT

-> Display

-> Select Enhancement Set

-> Enhancement Definition - > Select Component Name -> Details

image019.png

 

Note : No entries under Controller Substitutes

 

 

Step 11 : Go back to transaction code BSP_WD_CMPWB

->Enter component BT115QS_SLSQ - Display

->Views

->Select  view - BT115QS_SLSQ/SlsQuotSQ

->Right Click-> Enhance

->Class is not Z

 

image021.png

 

Step 12 : System confirms with pop up of Workbench Request to add in TR

 

Step 13 : Assign Package or put it in Local Object if you don’t consider to move transport.

 

Step 14 : View color changes to Black and Class is in Z now..

Note: Repeat Step 10, you will find one entry under Controller Substitutes

image027.png

 

Step 15 : Double click on Implementation Class ZL_BT115QS__SLSQUOTSQ_IMPL

->Uncheck Filter if it is Checked

image029.png

 

Step 16 :

->Click on Edit

->Search Method  DO_PREPARE_OUTPUT

->Select and Click on Redefine

image031.png

 

Step 17 : Next screen looks like this .

 

image033.png

Step 18 : Copy Paste below code and change your Transaction Type

 

 

METHOD do_prepare_output.

* demo coding for prefilling a search attribute in the search UI

* the prefilling happens on the first time,

* the user can then also change the attribute in the UI later on

 

  DATA: lr_qs           TYPE REF TO cl_crm_bol_dquery_service,

        lr_search_node  TYPE REF TO cl_bsp_wd_context_node_asp,

        lr_col          TYPE REF TO if_bol_bo_col ,

        lr_iterator     TYPE REF TO if_bol_bo_col_iterator ,

        lr_param        TYPE REF TO if_bol_bo_property_access,

        ls_selection    TYPE genilt_selection_parameter,

        lv_low          TYPE string,

        lv_attr_name    TYPE name_komp ,

        lv_value_set    TYPE abap_bool .

 

* the attribute that shall be prefilled:

* note they have to be available in the search view configuration

* not necessarily as visible, but as available (in the ddlb)

 

  lv_attr_name = 'PROCESS_TYPE'. " for the Transaction Type filling

 

* the value for prefilling.

  lv_low = 'ZSAG' . "(Default only ZSAG on Search.)"

 

  IF iv_first_time EQ  abap_true.

 

* to initialize the search view.

    CALL METHOD super->do_prepare_output

      EXPORTING

        iv_first_time = iv_first_time.

 

* fetch the search node and its content.

    lr_qs = me->get_current_dquery( ).

    lr_col = lr_qs->get_selection_params( ).

 

* check the currently visible search attributes.

    lr_iterator = lr_col->get_iterator( ).

    lr_param    = lr_iterator->get_first( ).

 

    WHILE lr_param IS BOUND.

 

* get the parameters

      lr_param->get_properties( IMPORTING es_attributes = ls_selection ).

      IF ls_selection-attr_name = lv_attr_name .

 

* SET_PROPERTIES

        ls_selection-low = lv_low .

        CALL METHOD lr_param->set_properties

          EXPORTING

            is_attributes = ls_selection.

        lv_value_set = abap_true .

        EXIT.

      ENDIF.

      lr_param = lr_iterator->get_next( ).

    ENDWHILE.

 

    IF lv_value_set EQ abap_false .

 

* it was not part of the visible attributes, then add it at the end.

      CALL METHOD lr_qs->add_selection_param

        EXPORTING

          iv_attr_name = lv_attr_name

          iv_sign      = 'I'

          iv_option    = 'EQ'

          iv_low       = lv_low.

    ENDIF.

 

 

* for a proper display of the added / changed attribute.

    lr_search_node = get_dquery_cnode( ).

    lr_search_node->build_parameter_tab( ).

 

  ELSE.

* non first time call - just delegate to superclass.

    CALL METHOD super->do_prepare_output

      EXPORTING

        iv_first_time = iv_first_time.

  ENDIF.

 

ENDMETHOD.

 

 

Step 19 : Syntax Check, Save and Activate

 

image035.png

 

Step 20 : Click on Back, now your method color is in Black.

If you click on filter,  method DO_PREPARE_OUTPUT also be shown because you added logic.

 

 

image038.jpg

 

Test Result : Quotation Type is Set to ZSAG under Search->Quotations

image040.jpg

WEBCUIF EhP3 SP08 - Release Notes

$
0
0

These Release Notes focus on new features and enhancements delivered as part of the Web Client UI Framework EhP3 Support Package 08.

 

The WEBCUIF development team is doing his best to provide those new developments on older releases. So if you are interested in a specific feature, verify its availability by checking the corresponding SAP Note.

 

 

New Features and Enhancements

Timeout Warning Popup and Countdown Clock

 

Thanks to the Timeout Warning Popup, the user will get notified a few minutes before the back end system timeout and will have the option to keep his session alive. This can be quite useful for a user who is working on the same page for a long time (e.g. entering text). An optional count down clock can also be displayed in the Application Frame header.

 

time_out.png

 

SAP Note: 2119701

 

Multi File Upload via Drag and Drop

 

The thtmlb:fileUpload BSP Tag can now support the upload of multiple files and offers as well a custom drag and drop functionality based on HTML5 standards.

 

drag_and_drop_files.png

 

SAP Note: 2106969

 

New Rich Text Editor

 

The Web UI Client Framework is now offering a new frontend Rich Text Editor. The BSP Tag thtmlbx:rteMCE is using the TinyMCE WYSIWYG editor to offer state of the art editing capabilities. This editor is meant to replace the older thtmlbx:btf.

 

Slide4.GIFSlide5.GIFSlide6.GIFSlide7.GIFSlide8.GIF

 

SAP Note: 2117779

 

Keyboard Shortcuts for Save, New, Print and Cancel Buttons

 

For improved usability, the "Save", "New", "Print" and "Cancel" buttons now come up with keyboard shortcuts, i.e:

  • Ctrl+Q for the CANCEL buttons
  • Ctrl+N for the NEW buttons
  • Ctrl+P for the PRINT buttons
  • Ctrl+S for the SAVE buttons

 

Shortcuts.png

 

SAP Note: 2084861

 

 

If you missed them, check out the WEBCUIF EhP3 SP07 - Release Notes.

Viewing all 188 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>