Skip to main content
Kofax

MarkView SAP Integration - What diagnostic steps should I follow and what information should I gather when troubleshooting a MarkView for SAP issue?

Summary 

4401

What diagnostic steps should I follow and what information should I gather when troubleshooting issues with MarkView for SAP?

What to look for when you are having an SAP integration issue in a MarkView application outside SAP?

For example: Web Inbox, Web Inquiry, Invoice Details within Express, Accounting Details (DFM), LOV performance.

Background: MarkView does not have direct access to SAP backend tables. As such, MarkView uses BAPIs (Business APIs) to expose the ERP data it needs to retrieve from SAP. All communication from MarkView to SAP is handled through our BAPIs which get created in the SAP environment during installation of MarkView. A Java middle tier component, the MarkView Gateway for SAP, facilitates all of the communication between the workflow (PL/SQL) and the SAP system (BAPI). Each BAPI can be called directly from PL/SQL using an associated package in the MVSAP% namespace.

High Level Troubleshooting:

  • Review the end-user error reported by the MarkView component
  • Turn on debugging in the MarkView Gateway and reproduce the issue (include the Gateway log file in the any Support Web incident you open)
  • Try to replicate the problem in SAP using transaction code SE37
  • If necessary, generate a Trace Analysis in SAP (include the Trace log in the incident)
  • Try to replicate the problem in PL/SQL by calling the PL/SQL API that accesses the BAPI

Detailed Troubleshooting:

  1. Turn on MarkView Gateway debugging in the database
    • Set the MV_LOG_LEVEL preference to 9
    • Set the MV_LOG_DESTINATION preference to TABLE
    • With database debugging on, the MV_LOG_OUTPUT table will contain timing data for the complete round trip of each BAPI call made by MarkView. For example:
      TEXT
      --------------------------------------------------------------------------------
      2008/04/28 12:40:30 PM - Request to /S170/BAPI_GET_INVOICE_INFO started at 28-AP R-08
      12.40.30.848652000 PM -05:00
      
      2008/04/28 12:40:36 PM - Request to /S170/BAPI_GET_INVOICE_INFO ended at 28-APR- 08
      12.40.36.165622000 PM -05:00
  2. Turn on MarkView Gateway debugging in the application server and reproduce the issue
    • Set the MVERP_GATEWAY_LOGGING_LEVEL preference to DEBUG
    • Restart the Markview Gateway application on the application server (mvsap-gw)
    • Log file can be found on the application server. For OAS, the file is found at: $ORACLE_HOME/j2ee/<instance_name>/log/mvsap-gw.log. Please, include this log file with any Support Web incident you open. Ideally, try and generate a clean log file by stopping the MarkView Gateway, removing any old log files, starting the MarkView Gateway and reproducing the issue in a quiet environment.
    • The Gateway log will show the details of every BAPI call made by MarkView, including the values of the input and output parameters.
      For example:
      DEBUG [HttpRequestHandler-23968266]: Finding Function /S170/BAPI_GET_COMPANY_CODES and
      retrieving JCO Connection...
      DEBUG [HttpRequestHandler-23968266]: Done getting JCO Connection
      DEBUG [HttpRequestHandler-23968266]: Getting Input list definitions from Repository...
      DEBUG [HttpRequestHandler-23968266]: Setting Input parameters...
      DEBUG [HttpRequestHandler-23968266]: Binding Scalar COMP_NAME to
      DEBUG [HttpRequestHandler-23968266]: Binding Scalar COMP_CODE to
      INFO [HttpRequestHandler-23968266]: Executing...
      DEBUG [HttpRequestHandler-23968266]: BAPI Return Code: 1
      DEBUG [HttpRequestHandler-23968266]: Flattening data...
      DEBUG [HttpRequestHandler-23968266]: Finding Parameter: COMPANY_CODES
      DEBUG [HttpRequestHandler-23968266]: Table COMPANY_CODES has 133 rows 
      DEBUG [HttpRequestHandler-23968266]: COMP_CODE:0001
      DEBUG [HttpRequestHandler-23968266]: COMP_NAME:SAP A.G.
      DEBUG [HttpRequestHandler-23968266]: COMP_CODE:0100
      DEBUG [HttpRequestHandler-23968266]: COMP_NAME:IDES Japan 0100
       
      Note the values in bold above. The log file indicates: the name of the BAPI that was called (/S170/BAPI_GET_COMPANY_CODES), the values of the INPUT parameters (COMP_NAME set to null, COMP_CODE set to null) and the OUTPUT (133 rows found).

      Ask yourself: Is the INPUT what I would have expected? Is the OUTPUT what I expected? If the INPUT is not what was expected, then the SAP integration is probably not the issue as the correct INPUT is being lost prior to communicating with SAP. If the OUTPUT is incorrect, then the BAPI itself may be to blame.

      If performance is a concern, the log file provides a timestamp on each line in the log. Review the timestamps to determine if performance of the BAPI call is a concern. If the timestamps in application server log report a similar timing to those found in the database log, then performance on the BAPI is likely a concern. To learn more about the performance of the BAPI, you can execute the BAPI directly in SAP while running a Trace Analysis. If the timestamps in the application server log differ greatly from those found in the database log (because the timestamps in the database are much higher than those on the application server), then performance of the MarkView Gateway may be a concern or, more likely, a network issue is to blame.
  3. Replicate the problem in SAP using transaction code SE37
    • Transaction code SE37 can be used to make a BAPI call directly from SAP. Making the call directly from SAP is useful in order to learn how the BAPI behaves when called directly in SAP as opposed to through the MarkView Gateway. That is, does it produce the same OUTPUTs when called directly? Does it fail when called directly? When it fails directly, does it produce the same error message as the MarkView Gateway?
    • In transaction code SE37, enter the BAPI name as found in the MarkView Gateway log (/S170/BAPI_GET_COMPANY_CODES)
    • Press F8 to execute a Single Test
    • Enter the values for any INPUT (“Import”) parameters reported in the Gateway log
    • Press F8 to Execute the function
    • Review the values for any OUTPUT (“Export”) parameters
    • RETURN Export parameter reports any info, warning or error messages
  4. If performance of the BAPI is a concern, enable a Trace Analysis in SAP
    • Be sure to execute the problem BAPI once (or even better, a few times) prior to enabling a Trace Analysis. Repeated execution will ensure that all buffers and caches are filled and will provide better trace results.
    • Transaction code ST05 can be used to enable a Trace Analysis in SAP
    • Ensure that the SQL Trace and RFC Trace boxes are checked under Select Trace
    • Press the Activate Trace button to turn tracing on for the current user (or Activate Trace with Filter to turn tracing on for another user)
    • Execute the BAPI in transaction code SE37 as described above
    • Return to transaction code ST05 and press the Deactivate Trace button
    • Press the Display Trace button and lookup the most recent trace
    • From the menu, select Trace List -> Save as local file. Saving as an HTML document works well. Please provide this trace file when logging a Support Web incident.
  5. Finally, it may be worthwhile to reproduce the problem by calling the BAPI from PL/SQL.
    • Each BAPI has an associated PL/SQL package that “wraps” the BAPI
    • Procedures in these PL/SQL packages can be used to call the BAPI from within PL/SQL.
    • The PL/SQL package name will be MVSAP_[BAPI Name] where [BAPI Name] is the name displayed in the MarkView Gateway log. Except! Remove the /S170/BAPI_ from the BAPI name. So, /S170/BAPI_GET_COMPANY_CODES becomes MVSAP_GET_COMPANY_CODES
    • The IN and OUT parameters in the PL/SQL package will match the parameters used in SE37. In addition, each procedure has a ReturnRec OUT parameter for reporting on the info, warning and error message reported by SAP.
      For example:
      SQL> set serveroutput on
      SQL> declare
       2    l_company_codes   MVERP_Org.Org_T;
       3    l_return_rec      MVSAP_BAPI_Util.Return_R;
       4    begin
       5    MVSAP_Get_Company_Codes.GetCompanyCodes(
       6    CompanyCode   => NULL,
       7    CompanyName   => NULL,
       8    CompanyCodes  => l_company_codes,
       9    ReturnRec     => l_return_rec );
      10    dbms_output.put_line ( 'Company Codes found = ' || 1_company_codes.COUNT);
      11    dbms_output.put_line ( '1_company_codes(1).OrgShortName);
      1_company_codes(1).OrgShortName);
      12    dbms_output.put_line ( '1_company_codes(1).OrgName = ' ||
      1_company_codes(1).OrgShortName);
      13    dbms_output.put_line ( 'l_company_codes(2).OrgShortName = ' ||
      1_company_codes(2).OrgShortName);
      14    dbms_output.put_line ( 'l_company_codes(2).OrgName = ' ||
      1_company_codes(2).OrgName);
      15  end;
      16  /
      Company Codes found = 133
      1_company_codes(1).OrgShortName = 0001
      1_company_codes(1).OrgName = SAP A.G.
      1_company_codes(2).OrgShortName = 0100
      1_company_codes(2).OrgName = IDES Japan 0100
      
      PL/SQL procedure successfully completed.

What to look for when you are having an issue with a MarkView integration inside SAP?

For example: MarkView Console, Get Next Button.

Background: MarkView uses RFCs (Remote Function Calls) from within SAP to expose MarkView data to the SAP system. All communication from SAP to MarkView is handled through these RFCs. A Java middle tier component, the MarkView Gateway for SAP, facilitates all of the communication between the SAP System and MarkView (PL/SQL + Java).

High Level Troubleshooting:

  • Review the end-user error reported in the SAP GUI
  • Generate a Trace Analysis of the issue in SAP
  • If necessary, turn on debugging in the MarkView Gateway and reproduce the issue
  • Try to replicate the problem in PL/SQL by calling the PL/SQL API that is used by the RFC

Detailed Troubleshooting:

  1. Review the end-user error reported in the SAP GUI
    1. There two basic types of errors reported in the SAP GUI: Interactive errors, Runtime errors (stack dumps)
    2. Interactive errors appear in the status bar at the bottom of the SAP GUI window
      1. Info messages are in green, Warning messages are in yellow, Error messages are in red
      2. BE SURE TO DOUBLE CLICK THE ERROR MESSAGE TO VIEW A DIALOG BOX WITH MORE INFORMATION
      3. Upload the complete text of the error message to the incident
    3. Runtime errors (stack dumps) can be viewed in transaction code ST22
      1. Double click the error for more details
      2. Please provide the complete text of the runtime error when logging a Support Web incident
  2. The next step is to generate a Trace Analysis that reproduces the problem. This is especially useful for performance related issues, but can also be helpful to understand the RFC calls made during a given action in SAP.
    1. Be sure to reproduce the problem once (or even better, a few times) prior to enabling a Trace Analysis. Repeated execution will ensure that all buffers and caches are filled and will provide better trace results.
    2. Transaction code ST05 can be used to enable a Trace Analysis in SAP
    3. Ensure that the SQL Trace and RFC Trace boxes are checked under Select Trace
    4. Press the Activate Trace button to turn tracing on for the current user (or Activate Trace with Filter to turn tracing on for another user)
    5. Reproduce the issue in the SAP GUI
    6. Return to transaction code ST05 and press the Deactivate Trace button
    7. Press the Display Trace button and lookup the most recent trace
    8. From the menu, select Trace List -> Save as local file. Saving as an HTML document works well. Please provide this trace file when logging a Support Web incident.
    9. Poor performing SQL and RFC calls are highlighted in red. RFC calls are shown in gray. This is useful to understand which MarkView RFCs are called during a given action in SAP.
  3. If further examination of the MarkView RFC calls is necessary, turn on debugging in the MarkView Gateway in the application server
    1. Set the MVERP_GATEWAY_LOGGING_LEVEL preference to DEBUG
    2. Restart the Markview Gateway application on the application server (mvsap-gw)
    3. Log file can be found on the application server.
      For OAS, the file is found at:
      $ORACLE_HOME/j2ee/<instance_name>/log/mvsap-gw.log. Include the log file with every incident. Ideally, try and generate a clean log file by stopping the MarkView Gateway, removing any old log files, starting the MarkView Gateway and reproducing the issue in a quiet environment.
    4. The Gateway log will show the details of every RFC call made by MarkView, including the SQL query executed and any bind variables.
  4. If necessary, replicate the problem in PL/SQL
    1. Using the SQL and inputs reported in the Gateway log, execute the statement directly in SQL*Plus (or similar).
    2. Please provide the output of the query or procedure when logging a Support Web incident.

Keywords: diag, info