Saturday, December 26, 2020

Does Pool table and Cluster table concept exist in S4HANA ?

 A-No .Pool table like A001 and cluster table like BSEG exist but not as pool table and cluster table .It is as Transparent table .

Wednesday, November 18, 2020

What is Parallel Cursor in SAP ABAP ? How to increase Performance using Parallel Cursor?

 Parallel Cursor Algorith- Parallel cursor is a technique to increase performance of ABAP Programs .

Suppose in Any program you have to use nested loop i.e loop inside loop , and if we use nested loop in  ABAP report it will take lot of time .So to avoid that we use Parallel Cursor .

Verdict: Use the parallel cursor method whenever there is a need to process data in a nested loop.

In Parallel cursor we avoid where clause and set sy-tabix instead of where clause .

Program Without Parallel Cursor Algorithm .

LOOP AT IT_MARA INTO WA_MARA.

  LOOP AT IT_MVKE INTO WA_MVKE WHERE MATNR = WA_MARA-MATNR.

    WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MATKL, WA_MVKE-VKORG, WA_MVKE-VTWEG.

  ENDLOOP.

ENDLOOP.

Program With Parallel Cursor Algorithm .

DATA V_INDEX TYPE SY-TABIX.

LOOP AT IT_MARA INTO WA_MARA.

  READ TABLE IT_MVKE INTO WA_MVKE WITH KEY MATNR = WA_MARA-MATNR BINARY SEARCH.

  IF SY-SUBRC = 0.

    V_INDEX = SY-TABIX.

    LOOP AT IT_MVKE INTO WA_MVKE FROM V_INDEX. "Avoiding Where Clause

      IF WA_MVKE-MATNR <> WA_MARA-MATNR.

        EXIT.

      ENDIF.

      WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MATKL, WA_MVKE-VKORG, WA_MVKE-VTWEG.

    ENDLOOP.

  ENDIF.

  CLEAR: WA_MARA, WA_MVKE.

ENDLOOP.



What is Logical Database (LDB) in SAP ABAP HR ? How it is advantageous over normal report ?

 1. LBD is a hierarchical structured table that retrieves several tables collectively and brings them and stores them in RAM to filter the selected output.


2. The T-code is SE36.

3. The three main concepts involved in LDB are :

a )Selection screen


b )Authorization check


c )Fetching up of data.


Advantage of Logical databases:


1-Less coding s required to retrieve data compared to normal internal tables.


2-Tables used LDB are in hierarchical structure.


Types of LDBs

PNP

PNP is a logical database in SAP ABAP HR which is mainly used for administering human resources, time management of human resources and payroll processes.


PNPCE

This is a customized version of PNP which handles the payroll, time management and administration of human resources with concurrent employment functions.


PCH

This SAP ABAP HR logical database handles data pertaining to organizational management, event management, and training & personality development duties of an organization.


PAP

This is a logical database in SAP ABAP HR which is dedicated to the recruitment process of human resources.

Sample structure of basic ABAP-HR report program


REPORT zreport.


INFOTYPES: 0001.       “This is the info type declaration area


TABLES: pernr.         “Key fields for Personnel Admin infotypes


START-OF-SELECTION.



GET PERNR.             “Get PERNR gets all data related to a PERNR


PROVIDE * FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.


WRITE:/ P0001-PERNR,


        P0001-STELL,


        P0001-BEGDA.


ENDPROVIDE.


Infotypes are basically used to group related together. They provide information and store data for specific time periods. In the above sample program the INFOTYPE statement declares an internal table which is populated at the GET PERNR event.


For example if we have


INFOTYPE: 0001.


This instruction creates an internal table with structure p0001 and which is filled at the GET PERNR event. We also add MODE N to this instruction.


INFOTYPE: 0001 MODE N.


The addition of MODE N restricts data from filling into the internal table at GET PERNR.


GET PERNR statement is basically an event which triggers the data read operation into respective infotypes which have declared by using the INFOTYPES statement for each PERNR (Personnel Number) that satisfies the selection criteria.


Tuesday, November 17, 2020

Type and Like in SAP ABAP

 TYPE : It will allocate memory during execution (object type).

       TYPE will improve performance.
       It is used when userdefined object link with SAP system data type.
       TYPE refers to the user defined data types
       TYPE,assign datatype directly to the data object while declaring.
     
LIKE :  Tt will allocate memory immediatly.
        It is when data object link with the other data object.
        LIKE refers to existing data type of data object
        LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.

DATA : name TYPE char10. (Here the variable ‘name’ takes the property or character length 10 ).
DATA : myname LIKE name (myname refers to the property of name and thus gets assigned with character length 10).
Note: char10 here is data type not data object.

Wednesday, November 11, 2020

Parallel Processing in Workflow

 Q-What is Parallel Processing in Workflow?

A-Suppose you want to do two activity at same time parallely ,so for this we use 'FORK' step in Workflow .Exmple Sending mail to Employee and Manager at same time ,for that we use Parallel Processing .

LUW and SAP LUW

 Q-What is LUW ? What is the use of it ? What is SAP LUW?

A-A “LUW” (logical unit of work) is the span of time during which any database updates must be performed Either they are all performed ( committed ) , or  they are all thrown away ( rolled back ).

It can be 5 sec or 3 sec .

Database LUW and SAP LUW - 

1- SAP LUW > Database LUW .

2- DB LUW is small it do small changes ,but to bundle all changes we use SAP LUW .

3- Suppose in Module pool screen three screen involves and my requirement is to update all the tables when data is consistent in all three screen ,otherwise roll back all the changes done to the table .

So To achieve this we use SAP LUW .

We can achive this using CALL FUNCTION… IN UPDATE TASK statement .

COMMIT-WORK Statement

 Q-What is COMMIT-WORK Statement ? Why it is used ? What if we don't Use it?

A- COMMIT-WORK statement is used to updated the database base changes .Suppose you write 

statement without commit statement like 

modify ZTEST FROM WA_TEST .

Here in this statement ZTEST table will get modify implicity .Means SAP Update the table but it is not visible to user .

But if we write 

modify ZTEST FROM WA_TEST .

COMMIT-WORK .

Here we are explicity defining to update the database table .

So if in nut shell ,if we want to perform series of changes like after one table update second table must update otherwise no table should get update ,we use COMMIT-WORK Statement .


Procure to PAY Cycle

  SAP Tcodes in Procure to Pay ( P2P ): In the Procure-to-Pay (P2P) process in SAP ECC several transaction codes (T-codes) are commonly used...