LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Extract data using BAPI function

    Employee
    Posted 05-22-2014 02:01

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: sree

    Hi Team,

    The requirement is to extract data using BAPI function. We need to give 2 input parameters � EMP NUMBER and DATE. While date is fixed = 01/04/2014, we have multiple EMP NUMBERS ( 45000) to extract. We have tried using Extract ERP Metadata and also used ERP connector and gave the corresponding scalar parameters.

    However we are able to get only 1 record as output from ERP connector. Can you please let us know if it is possible to given multiple values � EMP_NUMBER = 10, 20, 30 etc and call the BAPI function.
    For reference here i attached screen shot .
    LS SAP.jpg


  • 2.  RE: Extract data using BAPI function

    Employee
    Posted 05-22-2014 03:24

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Hi,

    As of LAL 2.18 and greater, the ERP Connector node now supports the ability for the node to execute multiple BAPI calls per node execution.
    Obviously, more calls will take longer to process - however if the BAPI you are looking at using only takes the input parameter via a scalar, then unfortunately, the function will need to be executed once for each EMP_NUMBER and DATE.

    The way to do this is to provide your parameters to the node via an input.
    Since these are scalar parameters, you need to create an input pin called "Scalar Parameters" to the node.

    This was possible prior to LAL 2.18.

    What is new as of LAL 2.18 is that in the Scalar Parameters input you can now have multiple records.
    Each of these records must also have a unique identifier which indicates the "execution identifier".

    On this input, each scalar parameter which is to be passed to the BAPI needs to have it's own field - so you would have the fields EMP NUMBER, and DATE, plus the execution identifier field - you can name this field whatever you want, but for reference, I'll call this "Id".

    As per your example, you would have 3 records, like:

    Id:int,EMP_NUMBER:int,DATE:date
    1,10,2014-04-01
    2,20,2014-04-01
    3,30,2014-04-01
    Then, within the node, on the "Optional" tab, you need to set the ExecutionIdentifierField parameter to the name of the execution identifier field in your input (in the example above, this would be Id).
    If you want, you can choose to output these execution identifiers as well, by setting the OutputExecutionIdentifiers parameter (again on the "Optional" tab) to true.

    Hope this helps,
    Tim.


  • 3.  RE: Extract data using BAPI function

    Employee
    Posted 05-23-2014 01:54

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: sree

    Thanks Tim for your help.
    can you please give the solution for the below details...
    "We do not have any unique identifier and the requirement is to just give EMP_NUMBER and DATE,
    both of which are scalar parameters. So we have used ERP Connector and were able to give value against EMP_NUMBER
    and get 1 record every time we run the node.
    whether it is possible to get with 2 parameters or need unique identifier also in the function to pass as parameter�
    If we use ID and assign unique number the error says
    Attached error for reference LS SAP2.jpg


  • 4.  RE: Extract data using BAPI function

    Employee
    Posted 05-23-2014 01:57

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    The node in your attached screenshots does not have any inputs.

    Please re-read my previous post - you will need to create the data and provide that as an input to the node as discussed in the previous post, and configure the node to use the fields from that input....


  • 5.  RE: Extract data using BAPI function

    Employee
    Posted 05-23-2014 03:42

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: sree

    Originally posted by: Tim Meagher
    					

    The node in your attached screenshots does not have any inputs.

    Please re-read my previous post - you will need to create the data and provide that as an input to the node as discussed in the previous post, and configure the node to use the fields from that input....
    Hi Tim,
    Thank you for your quick responses.
    " I kept �3_groups_PERNR� as input and passed �PERNR� to ERP Connector with Scalar Parameter EMP_NUMBER=PERNR.
    Now getting error with data type as EMP_NUMBER is defined as num (N) in the SAP function and the input we pass PERNR is UNICODE even I converted to int/long but still not accepting.".
    Please let me know what i need to do to come out this error.


  • 6.  RE: Extract data using BAPI function

    Employee
    Posted 05-23-2014 03:56

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    While it's somewhat difficult to decipher, it sounds like the problem is you are providing and input called "3_groups_PERNR" to the node.
    The input should be called Scalar Parameters as mentioned previously.

    Then, it sounds like in the node's parameter ScalarParameters, you are specifying: EMP_NUMBER=PERNR

    There should be nothing specified in the node's ScalarParameters parameter at this point.

    The names of the fields within the "Scalar Parameters" input simple need to be the names of the parameters that SAP is expecting.

    Once the Scalar Parameters input is provided, the node will take the data from that input to provide to the SAP parameters.

    So, assuming I've understood correctly, you need to:
    1. Rename the node's input to "Scalar Parameters"
    2. Unset the value of the node's "ScalarParameters" parameter
    3. Make sure that the execution identifier is set as mentioned in my first reply.
    Tim.


  • 7.  RE: Extract data using BAPI function

    Employee
    Posted 05-28-2014 02:27

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: sree

    Hi Tim,
    Thanks for providing the details and sharing sample brg file with us.
    Following the steps provided by you (in the below mail) and referring to brg we could execute the BAPI function through ERP Connector without any errors and could see the output.

    Our requirement is to pass the data dynamically rather than using Static Data Node as we have got nearly 96000 employee records to be executed via SAP Function.
    I tried using excel file as input and passed employee records by converting the data type of input matches �LAE Field Type�

    1.jpg

    We were able to read the input data from excel and write into excel as output.
    2.png

    Current Issue that we face is related to Performance �
    1. For 1000 records the time taken to process � 33 minutes
    3.jpg

    2. If we pass 96000 records at a time to be processed via ERP Connector is taking long time to execute � still running even after crossing 3+ hours and could see only 11000 records processed so far.
    Not able to get the complete output as it keep processing.

    4.png

    Options tried -
    For performance reasons, we tried to deactivate certain export parameters thinking that would help function to execute significantly less time.
    Option 1: Tried to do that via the node parameter "DeactivateExportParameters" by listing the fields to be deactivated
    5.png

    Option 2: The other way by passing the fields as an input pin for "Deactivate Parameters".



    But not able to achieve that in either of the ways�still we could that deactivated fields getting passed as output.

    Can you please let us know how to deactivate export parameters and also is there any other way to optimize the performance of BAPI Function execution through Lavastorm.

    Thanks for your support and guidance!!!


  • 8.  RE: Extract data using BAPI function

    Employee
    Posted 05-28-2014 04:23

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    [Responded separately over email, just posting some insights here for the good of anyone else in the community struggling with the same problem]
    Hi,


    This sort of poor performance is to be expected if the BAPI function has to execute 96,000 times.

    I can�t find any reference to the ZPEP_HR_MSS_EMP_PERF_RATING_IT BAPI anywhere online.
    So I assume this is a custom BAPI on your system.

    If there is another way to provide the EMP_NUMBER - either via a min and max value for the EMP_NUMBER to extract via the BAPI then this could reduce the number of function executions required.
    Alternately, if you are able to provide all EMP_NUMBERs to a table parameter to be exported to SAP, then the function would only need to be exported once.
    If it's a custom BAPI on your system, and these options aren't available, maybe you could look at modifying the BAPI to be able to take the EMP_NUMBER in one of these formats.

    Another alternative would be if you don't need to provide the EMP_NUMBER, and if it is blank data for all employees is extracted from the BAPI.
    In that case, you would retrieve more data than you require, but it would still only need to execute the function once and you could do a lookup with your set of EMP_NUMBER fields to discard all of the records you don�t care about.


    However .....

    If the BAPI is written in such a way that you need to execute the function once per EMP_NUMBER then this is going to take a long time due to the fact that the overhead per function call is generally what takes the most time in executing a node.

    If it isn�t possible to modify either the BAPI, leave the EMP_NUMBER empty and retrieve all records, or provide the list of EMP_NUMBER fields via a table input then the best way of improving performance is to look at using connection pooling on the node.

    Due to the fact I�m running the node on a LAE server in one continent over a VPN to a SAP Router in another continent, which is then connecting to a SAP instance (which is probably somewhere else, I have no idea), the performance numbers I have aren�t too useful as raw performance data in and of themselves.

    However, the comparison between running the same function multiple times with or without connection pooling turned on should give a rough guide as to the sort of performance benefits that can be achieved via using pooled connections.

    Here are some example performance numbers from running the BAPI_GET_BANK_DETAIL function numerous times with different ConnectionMethod specified in the node:


    Function Calls 1 10 100 1000
    Execution Time (sec) No Connection Pooling 16 31 183 1656
    Execution Time (sec) With Connection Pooling (default settings) 8 13 55 535



    This means that on my simple example, running for 1000 input records without connection pooling would take about 28 minutes, which is pretty similar to what you are seeing.
    With connection pooling, this takes around 9 minutes.
    Extrapolating this, for the full 96,000 records, you would be looking at it taking around 44 hours.
    Even with connection pooling (using the example with a PoolCapacity of 50 and peak limit of 100) you would still be looking at around 12 hours.

    So if you�re left with no other option, then simply using connection pooling probably won�t be enough to get you the performance you want.
    I think in that case, your only option left would be to split up the EMP_NUMBERs from the input using a HashSplit node, and run multiple concurrent ERP Connector nodes with Connection Pooling switched on.
    If you were to do this, and were about to split the EMP_NUMBER inputs into 10 relatively equal batches, and process 10 ERP Connector node�s simultaneously (and subsequently rejoin the data returned from the BAPI function using a Cat node) then you should be able to get this processing time down to around an hour.

    This is obviously still not ideal, but if the function needs to be executed 96,000 times, and you can�t change the BAPI or find another BAPI to extract the information, then I think you are going to be stuck with these sort of processing times.


    I believe these factors will be much more important than deactivating parameters � depending on the BAPI.
    However, in order to know what is going wrong with the deactivation of parameters, I'd need to see the Extract ERP Metadata node from each of its output pins for the Scalar, Structure and Table parameters, in order to determine what is going wrong with your parameter disabling. That can probably just be done over email though.

    Regards,
    Tim.