Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Making a query performant

Former Member
0 Likes
682

Hi all,

Iam reading data from 2 tables cdhdr,cdpos.

The selection screen contains following inputs from the user

Date,Header BOM material,bom usage(mast-stlan, For Example 8).

select cdhdr~username cdhdr~udate cdpos~changeid cdpos~valuenew
         cdpos~valueold cdpos~tabname cdpos~feldname into CORRESPONDING FIELDS OF TABLE gt_ditab
         from cdhdr inner join cdpos
     on cdhdr~OBJECTCLAS = cdpos~OBJECTCLAS
        and cdhdr~changenr = cdpos~changenr
  where cdhdr~objectclas =
 'stue' and cdhdr~udate in so_date

Is there any more condition I could put in,in the above query so that the query is performant.

Thanks

K

1 ACCEPTED SOLUTION
Read only

former_member776318
Participant
0 Likes
637

Hi,

The additional criteria that can be entered is context dependent & would vary in different cases.

As Krishendu indicated, you can make use of TCODE to specify additional criteria.

However, since you are dealing with change document data, I would recommend you to use the function modules present in the F.group SCD1 & SCD0.

This link should be helpful to you in this regard: [Read and Format Change Documents|http://help.sap.com/saphelp_nw70/helpdata/en/2a/fa01dd493111d182b70000e829fbfe/content.htm]

Regards,

Saurabh

Hi all,

Iam reading data from 2 tables cdhdr,cdpos.

The selection screen contains following inputs from the user

Date,Header BOM material,bom usage(mast-stlan, For Example 8).

select cdhdr~username cdhdr~udate cdpos~changeid cdpos~valuenew
         cdpos~valueold cdpos~tabname cdpos~feldname into CORRESPONDING FIELDS OF TABLE gt_ditab
         from cdhdr inner join cdpos
     on cdhdr~OBJECTCLAS = cdpos~OBJECTCLAS
        and cdhdr~changenr = cdpos~changenr
  where cdhdr~objectclas =
 'stue' and cdhdr~udate in so_date

Is there any more condition I could put in,in the above query so that the query is performant.

Thanks

K

3 REPLIES 3
Read only

Former Member
0 Likes
637

hello,

You can also add Transaction code in selection condition-

if you know which transaction is adding entries in CDHDR table, also can check maximum entries and should have an idea...

Thanks

Read only

former_member776318
Participant
0 Likes
638

Hi,

The additional criteria that can be entered is context dependent & would vary in different cases.

As Krishendu indicated, you can make use of TCODE to specify additional criteria.

However, since you are dealing with change document data, I would recommend you to use the function modules present in the F.group SCD1 & SCD0.

This link should be helpful to you in this regard: [Read and Format Change Documents|http://help.sap.com/saphelp_nw70/helpdata/en/2a/fa01dd493111d182b70000e829fbfe/content.htm]

Regards,

Saurabh

Read only

0 Likes
637

Thanks Guys....