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

Performance issue while selecting from dbtable

Former Member
0 Likes
601

Hi ,

I have used the following code in my program to provide F4 help for JOBNAME and VARIANT.

&----


*& AT SELECTION SCREEN ON VALUE REQUEST

&----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.

*Subroutine to provide F4 help for variant

PERFORM f4_p_vari.

&----


*& AT SELECTION SCREEN ON VALUE REQUEST

&----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_job.

*Subroutine to provide F4 help for jobname

PERFORM f4_p_jobname.

form F4_P_JOBNAME .

select jobname

from tbtcp

into table it_jobname.

if sy-subrc = 0.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'JOBNAME'

  • PVALKEY = ' '

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'P_JOB'

value_org = 'S'

TABLES

value_tab = it_JOBNAME.

ENDIF.

endform. " F4_P_JOBNAME

SELECT variant "ABAP: Name of variant (without program name)

FROM vari "ABAP/4: Variant storage (similar to INDX)

INTO TABLE it_vari.

IF sy-subrc = 0.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'VARIANT'

  • PVALKEY = ' '

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'P_VARI'

value_org = 'S'

TABLES

value_tab = it_vari.

ENDIF.

ENDFORM.

When I check the code using CODE INSPECTOR , 2 Errors are shown.

1)Large table VARI: No WHERE condition

2)Large table TBTCP: No WHERE condition

Can any one help me in overcomming the above errors.

Thanks,

Indira

4 REPLIES 4
Read only

Former Member
0 Likes
557

Hi Parvatha

Now selecting from these tables is going to give you a huge list (even bigger in production systems) which will not look good when doing F4. I suggest you create search helps (SE11) for these two fields so that the user may enter other details for the fields too.

Thanks

Pushpraj

Read only

Former Member
0 Likes
557

Hi Parvatha Reddy Indira Priyadarshini,

As you are not providing any where conditon while seletcting data from these tables, it will going to fetch full table data which may take a long time.

I would like to suggest you to create elementory/Collective search help for this requirement where user can provide some data in selction criteria in your case user can enter REPORT Name..

Eg go to MM03

in material field press F4 it will display F4 help where user can provide some related input to get desired Material....

table VARI stores all the variant information including standard report variants.. So If your requirement meets for only Z Developed reports then you can use LIKE Keyword and filter REPORT LIKE 'Z*' ..

anyhow it's not meaningfull too to display full result in F4 help as normally it will display 500 records and so other all records will get eliminated in the list..

Better to give some where condition( Primary Key or indexes)... it will only going to improve the performance..

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

Read only

Former Member
0 Likes
557

Hi,

I have tried with the Function Module 'REPOSITORY_INFO_SYSTEM_F4'

I could get the F4 help for VARIANT by using the following code.

FORM f4_p_vari.

CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'

EXPORTING

object_type = 'VARI'

object_name = p_VARI

suppress_selection = 'X'

IMPORTING

object_name_selected = p_VARI

EXCEPTIONS

OTHERS = 0.

ENDFORM. " F4_P_VARI

Butin case of JOBNAME , i could not find out the exact value for the exporting parameter

object_type.

Need some help for that

Thanks,

Indira

Read only

0 Likes
557

You cannot use this function module for jobs, because jobs are not respository objects.

Why are you selecting job steps from TBTCP and not job headers from TBTCO? In the latter table, you could narrow down at least by client or job status, check your requirements.

Thomas