Posts

SAP, SAP UI5, AngularJS, Digital marketing

Alternative to READ_TEXT Function Module (to fetch multiple long text at one go )

Multi READ_TEXT Code in SAP    *&---------------------------------------------------------------------* *& Report  ZMULTI_READ_TEXT *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT  ZMULTI_READ_TEXT. *---------------------------------------------------------------------* * data declaration *---------------------------------------------------------------------* TABLES  vbap . DATA  curs  TYPE  cursor . TYPES :  BEGIN  OF  ty_stxl ,           tdname  TYPE  stxl - tdname ,           tdid    TYPE  stxl - tdid ,           clustr  TYPE  stxl - clustr ,           clustd  TYPE  stxl - clustd ,          END  OF  ty_stxl . TYPES :  BEGIN  OF  ty_stxh ,           tdobject  TYPE  stxh - tdobject ,           tdname    TYPE  stxh - tdname ,           tdid  TYPE  stxh - tdid ,          END  OF  ty_stxh . TYPES :  BEGIN  OF  ty_tdid
How To add Attribute Dynamical in Existing Context Node *------------------------------------------------------- *  add attribute in existing context node *-------------------------------------------------------    data  LR_PAR_NODE  type  ref  to  IF_WD_CONTEXT_NODE_INFO.    data  LR_NODE      type  ref  to  IF_WD_CONTEXT_NODE_INFO.    data  LT_ATT       type  STRING_TABLE.    data  LR_ATTRIBUTE  type  WDR_CONTEXT_ATTRIBUTE_INFO. *****to get context node information   LR_PAR_NODE = WD_CONTEXT->GET_NODE_INFO( ). * Name of node where you want to add attribute   LR_NODE = LR_PAR_NODE->GET_CHILD_NODE(  `TEST`  ). *  get all existing attribute name   LT_ATT = LR_NODE->GET_ATTRIBUTE_NAMES( ).   LR_ATTRIBUTE-NAME =  `DUMMY` .   LR_ATTRIBUTE-TYPE_NAME = 'CHAR40' . *  check attribute is present or not *  if not present then create attribute in node    read  table  LT_ATT  transporting  no  fields                with  key  TABLE_LINE =  `DUMMY` .   
How to Create Dynamic Node with attribute *---------------------------------------------------------------- *  add node to context *----------------------------------------------------------------    data:    LO_PARENT_NODE_INFO  type  ref  to  IF_WD_CONTEXT_NODE_INFO,    LO_CHILD_NODE_INFO   type  ref  to  IF_WD_CONTEXT_NODE_INFO,    LV_STRUCT_NAME       type  STRING,    LT_CHILD_NODE_MAP    type  WDR_CONTEXT_CHILD_INFO_MAP. *  get context node info    LO_PARENT_NODE_INFO = WD_CONTEXT->GET_NODE_INFO( ). * get all child node of context   LT_CHILD_NODE_MAP = LO_PARENT_NODE_INFO->GET_CHILD_NODES( ). * check node name exist or not which we want to create  * if node name exist then first remove then create     read  table  LT_CHILD_NODE_MAP  transporting  no  fields                     with  table  key  NAME =  `TEST_DYNAMIC` .    if  SY-SUBRC =  0.      " REMOVE_CHILD_NODE     LO_PARENT_NODE_INFO->REMOVE_CHILD_NODE(  `TEST_DYNAMIC`  ).   endif. *  
How to implement the created badi in your program 1: create Badi with any name as I have created badi with name 'ZBADI_TEST' if you are new to create badi please refer previous post. 2: create reference of the badi as I am doing.   2: then call the method of your badi in try catch. DATA lr_badi TYPE REF TO ZBADI_TEST.   TRY.       GET BADI lr_badi.       IF lr_badi IS BOUND.         CALL BADI lr_badi->PROCESS_FIELDS           Exporting             IV_DUMMY                 = LV_DUMMY               Changing             CS_HEADER       = CS_HEADER         Endif.     CATCH cx_badi_not_implemented.       "Throw error   ENDTRY.
Steps to create BADI and Enhancement: Go to transaction SE18 and give a BADI name ( like ZBADI_TEST  for your reference). Every BADI should be there in an enhancement spot. You can either use the existing one or create a new one. It is just a folder. After creating a BADI you can set It for single or multiple use (check flag). Define it as per requirement. Create an interface for the BADI which will have all your methods and parameters. Save the  BADI and go to transaction SE19 Here you create enhancement implementation. Give a name ( as per naming convention) and then give the BADI name which you have given before. Save the enhancement implementation and then create an implementation for the interface of the BADI.  Do the coding here. Kindly use the link http://help.sap.com/saphelp_nw04s/helpdata/en/91/f1e540f8648431e10000000a1550b0/frameset.htm This gives you the entire detail of how to create all the above. If any questions Please Write Good luck.

Types of Abap programs

Report programs Report programs follow a relatively simple programming model whereby a user optionally enters a set of parameters (e.g. a selection over a subset of data) and the program then uses the input parameters to produce a report in the form of an interactive list. The output from the report program is interactive because it is not a passive display; instead it enables the user, through ABAP language constructs, to obtain a more detailed view on specific data records via drill-down functions, or to invoke further processing through menu commands, for instance to sort the data in a different way or to filter the data according to selection criteria. This method of presenting reports has great advantages for users who must deal with large quantities of information and must also have the ability to examine this information in highly flexible ways, without being constrained by the rigid formatting or unmanageable size of "listing-like" reports. The ease with which such in

Where does the Abap program run?

All ABAP programs reside inside the SAP database. They are not stored in separate external files like Java or C++ programs. In the database all ABAP code exists in two forms: source code, which can be viewed and edited with the ABAP Workbench tools, and generated code, a binary representation somewhat comparable with Java bytecode. ABAP programs execute under the control of the runtime system, which is part of the SAP kernel. The runtime system is responsible for processing ABAP statements, controlling the flow logic of screens and responding to events (such as a user clicking on a screen button). A key component of the ABAP runtime system is the Database Interface, which turns database-independent ABAP statements ("Open SQL") into statements understood by the underlying DBMS ("Native SQL"). The database interface handles all the communication with the relational database on behalf of ABAP programs; it also contains extra features such as buffering of frequently acc