Skip to Content

Hello,

I often wondered how the SQL-Select-Statement of a Query in WebUI looks like. For this you could use the SQL-trace of transactions ST01 or ST05. Alternatively you could put a breakpoint in class CL_CRM_REPORT_ACC_DYNAMIC method DATABASE_ACCESS.

Situation: You have some kind of business query in WebUI and you wonder how the SQL_Select-Statement is

/wp-content/uploads/2014/06/1_484198.png

Step 1: You put a break-point in the mentionned method

/wp-content/uploads/2014/06/2_484215.png

Here you see the From- and Where-statements.

Step 1a: Add a dynamic break-point for select-statements by pressing F9

/wp-content/uploads/2014/06/3_484216.png

Of course this will give you much more positions in coding.

Good luck when investigating.

Best regards,

Thomas Wagner

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Umashankar Dasari

    Hi Thomas Wagner,

    I am happy to see this information on online. I really appreciate your time.

    After struggling and found this in debug like you. I was using this class and method from more than 2 years to check actual SQL statement on dynamic search query and it is my saver always.

    Few points adding from side.

    1. The method of lr_cod_helper->preprocess in BTIL search class (method IF_CRM_QUERY_RUNTIME_BTIL~GET_DYNAMIC_QUERY_RESULT) will play big role in preparing the where clause.

    2. You do the search with partner functions (like, sold to party, employee name, etc…) then observe the where clause in the CL_CRM_REPORT_ACC_DYNAMIC method DATABASE_ACCESS.

    This observation helps how to override the limitation of search with more than 2 partner functions at a time.

    Thanks,

    Umashankar.

    (0) 
  2. Parveen Kumar

    Hello Thomas,

    Thanks for sharing. Adding to this , I have noticed that the value in the variable i_up_to_n puts the limit on the number of GUIDs which are returned from the crmd_order_index. This value at times is increased to 5199 in inbox searches and further filtering is carried out after reading all the attributes of the transactions.

    Thanks,

    Parveen

    (0) 

Leave a Reply