April 2016 - Sap 4 All

Latest

Sunday, 24 April 2016

The following function module can be used to wrap long text (Split Text) in ABAP.

SAP ABAP Function Module to Wrap Text
RKD_WORD_WRAP
Find the code below to test the above Function Module.

Import Parameters:

TEXTLINE
DELIMITER
OUTPUTLEN

OutPut Parameters:

OUT_LINE1
OUT_LINE2
OUT_LINE3

Sample Code:
REPORT ZTEST_WORDWRAP.
Data: d_text(110),
d_text1(110),
d_text2(110),
d_text3(110),
d_text4(110),
d_oline1(110),
d_oline2(110),
d_oline3(110).
 
Data: Begin of int_text occurs 0,
o_lines(100),
End of int_text.
 
Move: 'THIS IS LONG TEXT DESCRIPTION WHICH NEEDS TO BE WRAPPED' to d_text1,
'IN TO SEVERAL LINES AS IT IS TOOL LONG FOR ONE LINE.' to d_text2.
 
Concatenate d_text1 d_text2 INTO d_text. 
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
TEXTLINE = d_text
DELIMITER = ' '
OUTPUTLEN = 35
IMPORTING
OUT_LINE1 = d_oline1
OUT_LINE2 = d_oline2
OUT_LINE3 = d_oline3
TABLES
OUT_LINES = int_text
EXCEPTIONS
OUTPUTLEN_TOO_LARGE = 1
OTHERS = 2.
 
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 int_text.
write: int_text-o_lines.
endloop

Wednesday, 20 April 2016

In Feb 2015, SAP introduced S/4 HANA. SAP S/4 HANA is short for SAP Business Suite 4 SAP HANA.
SAP marketing it as their biggest innovation since R/3.
At its launch event in New York, SAP executive CEO Bill McDermott referred S/4 HANA as Simple fourth generation HANA.

SAP Major Product release time line:
SAP Major product release
Core principals:-
SAP S/4HANA delivers massive simplifications in all aspect of application - customer adoption, data model, user experience, business processes. It’s SAP response to new generation innovations (Internet of Things, Big Data and mobile).

S/4 HANA is based on following principals:
Simplified Data models
Completely Fiori
Guided configuration.

Simple data models: Since S/4 HANA is based on HANA, With HANA SAP got luxury to redesign the core process flow eliminating aggregates, indices and redundant tables. They drastically reduced the number of tables required for all major transaction processing.
For example a finance application which was running with more than 20 tables, can now be supported with 4 tables. SAP introduced Simple finance powered by SAP HANA and it lies at the core of S/4 HANA.
  
Completely Fiori: Thanks to Fiori, SAP finally updated their User interface and it’s a major welcoming change. It’s a HTML5/UI5 based user interface supported on all kind of devices. It will run smoothly on tablets, mobile and even on smart watches.
  
Guided Configuration: S/4 HANA is a role based application and it uses step by step guided process flow to walk you through the tasks. This will reduce the learning curve for end users. Developers can customize/configure this guided process flow.

Deployment Options:-
Since S/4 HANA is fueled by HANA it gives all the installation options provide by HANA - On-premise, Cloud (managed and public) and Hybrid. Currently SAP opened up with on-premise installation only and later this year they will open the other two options too.

Where S/4 HANA fits in HANA bandwagon?

It all started in 2011 with launch of HANA as a DB and Application platform. It was first Row + Column based database which resides completely in memory. Being a columnar database it has various advantages like huge compression ratio and faster read operations. This was a perfect product to run OLAP application and hence SAP launched Business Warehouse (BW) on HANA in 2012.

Till then, only OLAP applications were supported by HANA and in 2013, SAP changed the game by running OLTP and OLAP combined in HANA .They introduced Business suite running on HANA as primary database. SAP optimized the core of its Business suite application to take advantage of HANA.

Since they have established the concept that an OLTP system can run on an in-memory columnar database, they started working on a complete simplified redesign of their Business Suit. They slimmed down the data models and that gave another boost to performance. 

In 2014 they introduced SAP Simple Finance - a new advanced version of ERP finance running with simplified redundancy free data models promoting single point of truth.

At the top of the chain, in 2015 SAP introduced S/4 HANA based on concept of simplified, real time data models supported by SAP HANA, SAP FIORI.

Advantages of S/4 HANA:-
Multi tenancy: S/4 HANA takes advantages of HANA's multi tenancy feature , with this option we can run ECC and CRM or any other satellite system on one box. A typical ECC - CRM data transfer accounts for 60% of overall system load, with this multi tenancy option this data transfer load will go away.
Simplified Data models: SAP removed the redundant tables required for aggregates and indices. This leads us to fewer table to work upon, that means less table locks, less data to manipulate and better performance.
Guided procedures results in faster rollout and reduced learning curve for end users.
Agile implementation:  With S/4 HANA SAP gave us the option to easily integrate with cloud applications like Ariba , SuccessFactor , Big Data and even IoT(internet of things). This leads us to faster and simplified integration.

Real time insight: With S/4 HANA we got access to real time data insights which helps us in decision making, less efforts in planning, simulation, execution and prediction.
Less time to market: New customers can take advantage of prebuilt functionality and with minimal customization a new product or a business line can be plugged into the system.
Reduced TCO because of smaller IT landscape footprint, Simplified data models, faster rollouts, reduced learning curve and more productivity because of faster systems and guided procedures.

Tuesday, 19 April 2016

A many of times I found people included me who ran away from Smartforms. 
This document will help any ABAPER to throw their fear from learning smartforms.
One can create and learn Smartform step by step and further explore more on smartforms.
I am going to make below mentioned Smarform step by step.
we will be using MARA, MAKT, MARC and MARD tables for display data on smarforms. 




















Sunday, 17 April 2016

SAPUI5 is a new user interface technology from SAP that is based on the open standards HTML5 and CSS3, the JavaScript scripting language, and the jQuery library.
This blog talks about how to install SAPUI5 in Eclipse IDE. SAP has provided SAPUI5 Tools for Eclipse which can be downloaded and installed as Eclipse plugins.

Step 1 – Install Java Development Kit



Step 2 – Install Eclipse

As a first step, download Eclipse Kepler from http://eclipse.org/downloads/packages/release/Kepler/SR2.
Note
At the time of writing this blog, SAPUI5 Tools are only available for Eclipse Kepler.
Select the package solution called Eclipse IDE for Java EE Developers. Make sure to select the installer according to your platform (32/64 bit of Windows/Linux/Mac). For this post, I’m using 64-bit Windows 7 OS.
Download Eclipse for Java JEE
After downloading the Eclipse installer, simply unzip it and click on the eclipse.exe file to run Eclipse.
Click on eclipse exe to run Eclipse
Provide a workspace folder where you can create all your SAPUI5 related projects.
Provide a workspace for SAP UI5 projects

Step 3 – Install an application server

Although a web container like Tomcat might be enough to deploy basic SAPUI5 applications in the initial phase, I would recommend installing an application server like Widlfly (formerly known as JBoss). Please refer to my blog How to install Wildfly in Eclipse for the detailed steps.

Step 4 – Install SAPUI5 plugin in Eclipse

Open the web page https://tools.hana.ondemand.com/ and copy the update site URLhttps://tools.hana.ondemand.com/kepler for SAPUI5 Tools.


Open HANA tools web page
In Eclipse, go to the menu option Help -> Install New Software… In the Available Software window, click on the link,Available Software Sites. In the window, click on Add button. In the pop-up window, provide any name to the site and paste the SAPUI5 update site URL copied from the above step and click on OK.
Go to option Install New Software in Eclipse
Click on Available Software Sites
Click on Add to create a new software site
Add a new site for SAP UI5 Tools
Now that the SAPUI5 Tools update site has been added, in the Available Software window, select the newly created site from the drop down and wait. Eclipse will fetch the list of plugins available for installation.


Note
While updating Eclipse in a corporate network, a proxy authentication error might be thrown in case the proxy settings are not maintained in Eclipse. Please refer to my blog How to add proxy settings in Eclipse for solving proxy issues in Eclipse.
Proxy Authentication Error in Eclipse
Select the package named, UI Development Toolkit for HTML5 and click Next. Accept the license agreement and clickFinish to begin the installation of plugin.
Select the SAP UI5 Tools packages for downloading
Accept the EU License
Restart Eclipse after the installation is finished.
Restart Eclipse
To validate the installation of SAPUI5 Tools, go to the menu option File -> New -> Other.. There should be an option forSAPUI5 Application Development as shown below.
SAP UI5 is installed
This completes the installation of SAPUI5 Tools.


Saturday, 16 April 2016



    Urgently looking for SAP MM & PP Consultant ,Client location: Ahmedabad Exp: 4+ years, interested candidate kindly shares their updated resume on jobs@realworldhr.in

    Urgently hiring for SAP ABAP HR Consultant with about 2+years of SAP ABAP HR consulting with strong HR Related development experience. Location: Mumbai Number of position:4 .Interested Candidates can kindly send me your CV on urmila.thakur@aakit.com

    Greetings from Cronos Consulting Ind Pvt ltd 
    We have Urgent SAP Demands,kindly forward your updated CV to n.neethu@cronos-india.com 


    Looking for SAP ABAP Developer with 6 years of experience in handling the Development and Enhancement projects independently. Location : Bangalore || Experiance Level 6 to 8 Years || Notice Period : immediate Send resume to kalyan.ravi@spsoftglobal.com

    Please find the Code Snippets to Call a Webdynpro ABAP Application from a R/3 Transaction
    Create a ABAP Program from SE38 and associate a transaction to it and Call the same.

    REPORT  ZWD1.

    ***data declarations
    DATA:gv_url_string TYPE string,
         gv_url_c(250) TYPE c.

    CONSTANTS:gc_login_auth TYPE string VALUE '?sap-system-login-basic_auth=X',
              gc_client     TYPE string VALUE '&sap-client=',
              gc_lang       TYPE string VALUE '&sap-language='.

    ***Get the Url of Webdynpro Applicaion with HTTPS Protocol
    CALL METHOD cl_wd_utilities=>construct_wd_url
      EXPORTING
        application_name = 'WDR_TEST_NAVIGATION'
        in_protocol      = 'HTTPS'
      IMPORTING
        out_absolute_url = gv_url_string.

    ***If the server and port have not got added, try without HTTPS Protocol
    IF gv_url_string CS '//:/'.
      CALL METHOD cl_wd_utilities=>construct_wd_url
        EXPORTING
          application_name = 'WDR_TEST_NAVIGATION'
        IMPORTING
          out_absolute_url = gv_url_string.

    ***If server and port have still not got added
      IF gv_url_string CS '//:/'.
    **Raise a Error Message
      ENDIF.
    ENDIF.

    ***Build the URL
    CONCATENATE gv_url_string
                gc_login_auth
                gc_client sy-mandt
                gc_lang   sy-langu
      INTO gv_url_c.


    ***Call the Browser
    CALL FUNCTION 'CALL_BROWSER'
      EXPORTING
        url                    = gv_url_c
      EXCEPTIONS
        frontend_not_supported = 1
        frontend_error         = 2

        prog_not_found         = 3
        no_batch               = 4
        unspecified_error      = 5
        OTHERS                 = 6.

    1)   Types of ABAP UI Technologies
          Ans: Webdynpro for ABAP, BSP
    2)   MVC Architecture Concepts and usage of the same in ABAP Webdynpro
          Ans: As per the MVC Architecture there is a clear separation between flow logic, view and the Business
                  Logic. View holds all the UI elements that are visible in the UI, Controllers have the flow logic.
                  Controllers are of different kind (Component Controller, View Conroller,Window Controller).
                  Business logic is held in the Model which is in the form of Assistance class
                  in webdynpro context.  
    3)   Difference Between the View Container and the Transparent Container
          Ans: View Container holds the views, there can be multiple views assigned to the view container but only
          one view can be active(viewed) at a time. Transparent holds the webdynpro UI elements, A layout type
          can be associated  with it.
    4)   What does a Model Class Consists of
          Ans: Model Class is the Assitance class in webdynpro. It contains the Business logic in the form of
          methods, Global data & Constants in the form of Class Attributes. The Model class can be accessed in
          webdynpro component using the attribute wd_assist->. Note: All the visibility properties of the
          Class are applicable when accessing the class using the object wd_assist.
    5)   What is an Assistance Class and How is it Instantiated in Webdynpro
           Ans: Assistance Class is the model class which would act as the data provider  for the webdynpro
           component and it is instantiated by the webdynpro component during the run time and no explicat
           instantation is required.
    6)   Design Patterns in Webdynpro(GAF,OIF,QAF Etc)
          Refer to the link:
          FPM Concepts in Webdynpro
    7)   How do you debug an web based Application
          (Could be from ABAP Webdynpro, BSP or CRM Web UI)
           Ans: External break-points should be used to debug web UI's.
    8)   How do you create a ALV Report/Editable ALV in Webdynpro
          Ans: ->Add the Standard ALV component to the web dynpro Component.
                  ->Use Components tab: Ex: ALV_MATS  type SLV_WD_TABLE
                  ->Create a context node with the table field information to be displayed
                  ->Write the ALV Default Code for table display
                  ->Set the read only attribute to false to switch to editable mode using
                     the method set_read_only of the interface
                    IF_SALV_WD_TABLE_SETTINGS implementing class
                    CL_SALV_WD_CONFIG_TABLE).
    9)   How do you Navigate between Views in Webdynpro
           Ans: Navigation between Views is through Plugs(Inbound and Outbound),
    10) Usage of Plugs in Webdynpro
           Ans: Plugs are used to Navigate between the views. Parameters can be passed using the plugs similar to
           interface parameters of function module or a class method.
    11) Usage of Webdynpro Component Controller
           Ans: Component controller is used to the store the Global attributes and Methods of the component.
           Attributes/methods declared in the component controller are visible through out the component and they
           are accessed using the attribute wd_comp_controller outside of component  controller(like
           views,windows etc) All the context nodes defined in the component controller are
           visible in all the views and windows of the component.
           Ex: if a variable called gv_count is defined in the component controller, it can be accessed in the view
           using the syntax wd_comp_controller->gv_count.
    12) How do you access a Context Nodes and elements Programmatically
          Code required for accessing the Context Nodes can be written using the webdynpro code wizard.
          For Ex: if there exists a Node Node1 with cardinality 1:1 and has 3 Attributes to it Att1, Att2,Att3. The
          attributes can be accessed using the below code.

          data: lo_nd_node1 type ref to if_wd_context_node.
          data: lo_el_node1 type ref to if_wd_context_element.
          data: ls_node1 type wd_this->element_node1.

          lo_nd_node1 = wd_context->get_child_node
          ( name = wd_this->wdctx_node1 ).
          lo_el_node1 = lo_nd_node1->get_element( ).

    **Read Node1
          lo_el_node1->get_static_attributes(
              importing
              static_attributes = ls_node1 ).

    **Write to Node1
          lo_el_node1->set_static_attributes(
              exporting
              static_attributes = ls_node1 ).

    13) Message Areas in Webdynpro
          Message areas are created in views to display messages (Error,Success,Warning,Info).
          WD allows to have multiple Message errors in a view but throws an error when the view is displayed.
          Use the code wizard to get code for raising error messages. Few of the message classes and methods
          are: Interface: if_wd_message_manager.
          methods: report_t100_message.(used to report message from the  message class)
    14) Concept of OTR(Online Text Repository) and its Usage
          OTR's are similar to text elements in ABAP. OTR's are created for
          UI texts and texts can be maintained in multiple language.
          OTR's can be created using the transaction: SOTR_EDIT
    15) Concept of Interface Views
           If the views of a different components are need to be used in a webdynpro component mark the view as
           interface view and use it in another component. It's similar to using a include in a program.  A Interface
           view of the component can be used in any no of components. this concept supports the reusuability of
           the views.
    16) Sequence of Webdynpro Events:
          Ex: WDDOINIT,WDMODIFYVIEW,WDAFTERACTION,
          WDBEFOREACTION etc
           Sequence: WDDOINIT of the component controller,
                           WDDOINIT of the Window Controller,
                           WDDOINIT of the View Controller,

          WDMODIFYVIEW(On Input/Display on any UI Element).
          WDBEFOREACTION(Method for validation of user input,
          Once the user action happens on the UI)
          WDAFTERACTION(Method for non-action specific operations
           before Navigation)
          WDDOEXIT( Exit from the View/Window/Component Controller)
          WDPOSTPROCESSING(used to perform exception handling for supply function methods)
    17) Can a Component have Multiple Applications
           Yes, For a given webdynpro component any no of applications can be  created. Applications are similar
           to transactions in SAP.  You can associate different Interface views of the component to create different
           applications using the same component.
    18) How do you launch a Webdynpro Application from a Transaction
          Refer to the previous blog Calling webdynpro application from a Transaction
    19) How do you Navigate between two Webdynpro Components
          You can use Interface views to navigate between components or create a navigation class and
          do a explicit call.
    20) Creating a tree in Webdynpro
          Tree UI element is used to create Tree  in Webdynpro. Tree can be defined as part of the table column.
    21) Usage of Exit Plug in a Webdynpro Window
          Exit plugs are outbound plugs used to close the webdynpro application.  they can be called from the view
          which are embedded in the window  Note: Exit plugs won't work in portal environment.
          Exit plugs can also be used to pass the call to another URL. Here is the sample code snippet of the exit
          plug call:
          method onexit .

            data url type string.
            data close_window type wdy_boolean.
            url = 'url_name'.
            close_window = abap_false.
            wd_this->fire_to_exit_plg( url = url
                                                     close_window = close_window ).
          endmethod.



    22) why FQDN(Frequently Qualified Domain Name) is necessary for running Webdynpro Applications
          Refer to sap help:
          http://help.sap.com/saphelp_erp2005/helpdata/en/67/be9442572e1231e10000000a1550b0/content.htm
    21) Standard ALV Component required to create ALV Reports in Webydnpro
          SALV_WD_TABLE
    22) How do you build Select Options in Webdynpro
          Using the standard webdynpro component WDR_SELECT_OPTIONS
          You can refer to the example: WDR_TEST_SELECT_OPTIONS
    23) How do you build F4 Search Help in Webdynpro
          A F4 help for an input field can be made available by attaching the search help
          to the table field. Usage of standard help component WDR_OVR.
          Creating a component for help and attaching it to the node element as Freely programmed value help
    24) How are Plugs(Inbound/Outbound) bounded in the Window
          Plugs are created in the view and bounded in the window by using the drag drop option in the window
          view.
    25) How do you Control the visibility of the Webdynpro UI elements Programmatically.
          Create a context element of type wdui_visibility and bind to the visibility property of the UI element.
    26) What is the use of Interface views/nodes in Webdynpro.
           Interfaces nodes and views are created to use them in other webdynpro components.
    27) How do you navigate between different Webdynpro applications
          Create a navigation class and trigger the target application to be called.
    28) What are the webdynpro init  events and what is the sequence of trigger

           Sequence: WDDOINIT of the component controller,
                           WDDOINIT of the Window Controller,
                           WDDOINIT of the View Controller,

    29) How are Error messages created and handled in webdynpro
          Create a message UI element in the view and trigger the message required(Error,warning,status) using the
          code generation wizard.
    30) What is an OTR and mention its usage in Webdynpro
           Online Text Repository is the central storage for texts for webdynpro
           applications. An otr can be fetched in the program using the below mentioned code.
           data: lv_string type string.
            lv_string = cl_wd_utilities=>get_otr_text_by_alias(  alias =    
                  'PACKAGE/OTR_NAME' ).

    31) Can text elements be used in webdynpro, if yes how?
           Yes text elements can be used in webdynpro.
           Refer to the below code snippet.
            data: lv_string type string.
            lv_string = wd_assist->if_wd_component_assistance~get_text(  '025' ).    
    32) What is the use of Road Map UI element
           Roadmap UI element is used to display step-by-step workflows. It can used to clearly define a process.
    33) What are exit plugs?How are they created?
          Exit plugs are used to exit from the webdynpro page or an webdynpro window.
          Exit plugs are created in the window.
    34) Is it possible to hide F4 function for an Input element programmatically?
          Yes it is possible to hide F4 function attached to an input field.Use the interface
          if_wd_context_node_info and the method set_attribute_value_help
    35) How do Webydnpro Upload and download functions work, Explain.
          Fileupload UI element is used upload files from desktop the application.
          There is also restriction on the max data volumes that can be uploaded.
          Filedownload UI element is used to download files to the client.
    36) Explain the concept of Road Map UI element in Webdynpro.
          Refer to the link: Road map UI element webdynpro for abap
    37) How to create popups in webdynpro.
          Create a view and embed the view in the window and call the window to trigger the popup.
    38) Explain the concept of OVS and its usage
          WDR_OVS is the standard webdynpro component to generate F4 helps
          for the input field. OVS refers to Object value selector.
    39) Using Radio Buttons/Checkboxes/Dropdown lists in webdynpro
          Radio buttons/Checkboxes are used for objective selection similar to what is available in SAP GUI. An
          event is associated with each UI element for onclick action.
    40) FPM Concept and its usage in webdynpro.->>>>Refer to the link


    41) what is internationalization in webdynpro abap application?
          Internalization refers to creation of texts used in webdynpro application in a specific language and
          providing option to translate to multiple languages if necessary. This is achieved by using OTR's or text
          elements for static texts and performing translation when required.
    42) What is Cardinality of a context node in webdynpro
           Cardinality refers to no of elements a node can accomodate during run time. When a node is created the
           cardinality is assigned to it. Cardinality is of the following kinds:
           0:1 -->At run time, no element or maximum one element can be instantiated
           0:n -->At run time, no element or maximum of n elements can be instantiated
           1:n -->At run time, minimum one element or maximum of n elements can be instantiated
           1:1 -->At run time, only one element should always be instantiated
           if you try violating the cardinality there would be a short dump saying Number of elements of the
           collection of node node_name violates the cardinality
     43) what is Personalization in abap webdynpro application
            Personalization refers to changing the properities of UI elements at runtime. Personalization settings are
            user specific. Configuration controller is used for personalization function.
            ex: Changing the order of columns in a table display.
     44) what are the controller types in webdynpro ABAP
            -Component Controller->Component Controller is global part of the component and each component
              has only one component controller. Global Attributes and  methods required by the component can be
              defined here.
            -Custom Controllers->Custom controllers are defined during design time and  these are optional. The
              visibility Custom controllers is in the entire component and has the life time equal to life time of the
              component. Custom controllers are used if a set of views have to be grouped to perform
              a special function or hold a set of data.
             -View Controller->Flow logic of the views are in view controller and a view can  have only one view
               controller. The visibility of View controller is specific to view only.
             -Configuration Controller->Configuration controller is used achieve personalization function.
             -Window Controller->A window controller exists for each window and can also have methods
               to write coding logic. Every window will have the default method and it is used to  receive
               parameters. The windows controllers are visible in entire component and also in the custom        
               controller.
    45)what are Layout types in Webdynpro and its usage
             ->Flow Layout  : Used for sequential display of WD UI elements.
             ->Row Layout  : here each ui element is displayed on its own column and the width differs from row to
                 row.Rowheaddata is used to insert a break.
             ->Grid Layout  : Ui elements are arranged based the no of columns. line breaks  are inserted based on
                 the size.
             ->Matrix Layout: Matrix layout arranges ui elements in columns. Matrixheaddata is used to insert a line
                break.
                Usage of the appropriate layout to build a webdynpro application is determined during the UI
                design.
     46)what is supply function method in SAP
             ->Supply function method is used to populate the context node or to default values to the context
                 node elements. supply function method is called before the node is accessed for first read.
             ->Using supply function method is optional
    47)what is singleton property of context node
             ->Singleton property is one of the attributes of the context node if this is set there can be only one
                 instance of the respective context node at runtime.
    48)How to default a value to the context attribute
         In the context attribute there is a property to set the default value. Use the same, However the
         default value can be overwritten using the set_attribute method of the interface if_wd_context_element.