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

Z report not executing

Former Member
0 Likes
1,390

Hi,

We have a z report to display the service tax of customers. This report was executing as required till the previous month but wen we tried to execute it this month we are not getting either the report or errors.

When checked in SM50 we got the details listed below.

No Ty. PID Status Reasn Start Err Sem CPU Time Cl. User

1 DIA 1331222 Running Yes 157:02 1929 320 BASIS

Report / Spool action

ZFI_SERVICE_TAX

Main Program

ZFI_SERVICE_TAX

Action Table

Sequential Read RFBLG.

Could any one suggest me the reason and a solution for this issue.

Thanks in advance,

Neela

Edited by: Neela M B on Oct 8, 2010 12:02 PM

1 ACCEPTED SOLUTION
Read only

Rui_Dantas
Active Contributor
0 Likes
1,297

Hi.

1) Double click the line on SM50.

2) Copy the line "Last SQL statement".

3) Go to ST05, press "Enter SQL Statement"

4) Paste there the statement and press Explain

And then post here the result.

Rui Dantas

9 REPLIES 9
Read only

Former Member
0 Likes
1,297

Seems to be a performance problem ...

Please post your SELECT command on this table (BKPF, BSEG, ...)

Read only

Rui_Dantas
Active Contributor
0 Likes
1,298

Hi.

1) Double click the line on SM50.

2) Copy the line "Last SQL statement".

3) Go to ST05, press "Enter SQL Statement"

4) Paste there the statement and press Explain

And then post here the result.

Rui Dantas

Read only

0 Likes
1,297

Hi,

In st05 when i pasted the last sql statement and executed i am getting an error

Error received from Explain SQL.

Kindly suggest.

Thanks in advance,

Neela.

Read only

0 Likes
1,297

Can you post it here so we can see what is wrong?

Read only

0 Likes
1,297

Hi,

I have pasted the "Last SQL statement".

SELECT

"MANDT" , "BUKRS" , "BELNR" , "GJAHR" , "PAGENO" , "TIMESTMP" , "PAGELG" , "VARDATA"

FROM

"RFBLG"

WHERE

"MANDT" = :A0

ORDER BY

"MANDT" , "BUKRS" , "BELNR" , "GJAHR" , "PAGENO"#

But this statement is not used in the program.

Thanks in advance,

Neela.

Read only

0 Likes
1,297

The select you posted should work in ST05; just make sure you don't include the last #.

RFBLG is the database table behind table BSEG (so in ABAP you have a select BSEG, not to RFBLG). Basically you are making a FULL access to BSEG, so yes, it is pretty bad.

Can you post the SELECT to BSEG you have in your ABAP program?

Also, is it inside a LOOP or executed only once?

Regards,

Rui Dantas

Read only

0 Likes
1,297

Hi,

I am pasting the code below.

IF I_BSAD[] IS NOT INITIAL.

SELECT DMBTR BELNR REBZG BUZEI FROM BSEG

APPENDING TABLE I_BSAD_ST

FOR ALL ENTRIES IN I_BSAD

WHERE BELNR EQ I_BSAD-REBZG

AND BUKRS EQ P_BUKRS

AND GJAHR EQ I_BSAD-REBZJ

AND HKONT EQ '0011404501'

OR HKONT EQ '0011404502'.

ENDIF.

Kindly suggest.

Thanks in advance,

Neela

Read only

0 Likes
1,297

I think it should be

WHERE BELNR EQ I_BSAD-REBZG
AND BUKRS EQ P_BUKRS
AND GJAHR EQ I_BSAD-REBZJ
AND (HKONT EQ '0011404501'
OR HKONT EQ '0011404502').

Read only

0 Likes
1,297

Yep, correct the parenthesis and you should be alright.