‎2011 Jun 23 6:38 AM
Hi experts,
could you please take a look into the converted program to access archived data? I converted it using the /pbs/select_into_table but it just time out
Original Program
if not orderno is initial.
select bukrs gjahr belnr buzei bldat xblnr blart monat
into (wa-bukrs, wa-gjahr, wa-belnr, wa-buzei, wa-bldat,
wa-xblnr, wa-blart, wa-monat)
from bsis where aufnr in orderno
and bukrs in company
and budat in postdate
and hkont in costelem
and gsber in busarea
and belnr in docno
and bldat in docdate
AND XBLNR IN ZXBLNR
and blart in doctype
and kostl in costctr.
wa-bsis_count = wa-bsis_count + 1.
perform get_details.
endselect.
else.
...
endif.
-
Converted program
IF NOT ORDERNO IS INITIAL.
SELECT * INTO CORRESPONDING FIELDS OF TABLE TAB1523 "PBS
FROM BSIS
WHERE AUFNR IN ORDERNO AND BUKRS IN "PBS
COMPANY AND BUDAT IN POSTDATE AND HKONT IN COSTELEM "PBS
AND GSBER IN BUSAREA AND BELNR IN DOCNO AND BLDAT "PBS
IN DOCDATE AND XBLNR IN ZXBLNR AND BLART IN DOCTYPE "PBS
AND KOSTL IN COSTCTR. "PBS
CALL FUNCTION '/PBS/SELECT_INTO_TABLE' "PBS
EXPORTING "PBS
ARCHIV = 'CFI' "PBS
OPTION = '' "PBS
TABNAME = 'BSIS' "PBS
CLR_ITAB = '' "PBS
SCHL1_NAME = 'BUKRS' "PBS
SCHL2_NAME = 'HKONT' "PBS
TABLES "PBS
I_TABELLE = TAB1523 "PBS
SCHL1_IN = COMPANY "PBS
SCHL2_IN = COSTELEM "PBS
EXCEPTIONS EOF = 4 "PBS
OTHERS = 2. "PBS
LOOP AT TAB1523
WHERE ( AUFNR IN ORDERNO AND BUKRS "PBS
IN COMPANY AND BUDAT IN POSTDATE AND HKONT IN "PBS
COSTELEM AND GSBER IN BUSAREA AND BELNR IN DOCNO "PBS
AND BLDAT IN DOCDATE AND XBLNR IN ZXBLNR AND BLART "PBS
IN DOCTYPE AND KOSTL IN COSTCTR ). "PBS
MOVE TAB1523-BUKRS TO WA-BUKRS . "PBS
MOVE TAB1523-GJAHR TO WA-GJAHR . "PBS
MOVE TAB1523-BELNR TO WA-BELNR . "PBS
MOVE TAB1523-BUZEI TO WA-BUZEI . "PBS
MOVE TAB1523-BLDAT TO WA-BLDAT . "PBS
MOVE TAB1523-XBLNR TO WA-XBLNR . "PBS
MOVE TAB1523-BLART TO WA-BLART . "PBS
MOVE TAB1523-MONAT TO WA-MONAT . "PBS
WA-BSIS_COUNT = WA-BSIS_COUNT + 1.
PERFORM GET_DETAILS.
ENDLOOP . " BKPF
else.
...
endif.
Any suggestions why that program times out? Could please insert the appropriate solution for me?
Regards
‎2011 Jun 23 7:02 AM
Hi Blaiso ;
Did you run program with debug?
Where is program most spending time? For example select or func. or loop?
I'm waiting your answer and then I will continue.
Best regards.
‎2011 Jun 24 2:10 PM
Hi Melih,
Thanks for replying, syntaxtically that program is correct...it's time out belong on the long search on the key field like HKONT and BUKRS, which are the only to available based on /pbs/se16. So I added 1 more field BELNR which is a key field on BSIS...still not resolved.
What is the suitable tool to troubleshoot a program that time out in ABAP? Keep in mind that the syntax is correct....somewhere it's taking to much time to fetch the data... I was thinking about the runtime analysis but since it's time out we won't be able to evalute performance data file...may I right?
Any advice please!!!!
Regards.
‎2011 Jun 24 2:24 PM
Hi Blaiso ;
I think your problem in select statement.
Because you dont use PK or any index.
If we don't use PK or any index on table, We spend a lot of time.
So I suggest you 2 way;
1. You can use index with on table.
2. You can create new index on table according your where cond.
Best regards.
‎2011 Jun 24 3:55 PM
resolved... thanks for your input
Edited by: Blaiso on Jul 25, 2011 3:35 PM