on 09-14-2009 11:36 AM
Hi All,
We have an issue when generating invoice output from a billing document. The issue is when I click on print preview after some 10-15 mniutes, I get a dump saying TIME OUT ERROR.. We asked the BASIS team to increase time but even after increasing time It give a dump...
This is definitely a performance issue with the print program. The dump clearly show the dump in the below part of the code...
SELECT vbeln auart
FROM vbak
INTO TABLE gi_vbak
FOR ALL ENTRIES IN c_vkdfif
WHERE vbeln EQ c_vkdfif-vbeln.
IF sy-subrc EQ 0.
SORT gi_vbak BY vbeln.
LOOP AT c_vkdfif.
READ TABLE gi_vbak WITH KEY vbeln = c_vkdfif-vbeln
INTO gwa_vbak BINARY SEARCH.
IF sy-subrc EQ 0.
IF ( gwa_vbak-auart EQ c_zc04 ) OR ( gwa_vbak-auart EQ c_zcr4 ).
DELETE TABLE c_vkdfif.
ENDIF.
ENDIF.
CLEAR gwa_vbak.
ENDLOOP.
ENDIF.
can you please suggest as to how what best can we do to avoid this dump....
Thanks
Abhii.....
Hi Abhi,
Check whether the internal table c_vkdfif is initial,if its initial then thats the reason its trying to fecth all the contents from the database table vbak.Check what should be the condition if c_vkdfif internal table is initial.
Thanks,
Ahsan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i do not know if it helps, but change your code as follows:
if not c_vkdfif is initial.
SELECT vbeln auart
FROM vbak
INTO TABLE gi_vbak
FOR ALL ENTRIES IN c_vkdfif.
WHERE vbeln EQ c_vkdfif-vbeln
IF sy-subrc EQ 0.
SORT gi_vbak BY vbeln.
LOOP AT c_vkdfif.
READ TABLE gi_vbak WITH KEY vbeln = c_vkdfif-vbeln
INTO gwa_vbak BINARY SEARCH.
IF sy-subrc EQ 0.
IF ( gwa_vbak-auart EQ c_zc04 ) OR ( gwa_vbak-auart EQ c_zcr4 ).
DELETE TABLE c_vkdfif.
ENDIF.
ENDIF.
CLEAR gwa_vbak.
ENDLOOP.
ENDIF.
endif.
In fact it is the same solution as above. If c_vkdfif is empty you are reading the complete vbak table. Also on the database server this can be take a TOO long time.
success.
Gr., Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi I am sorry the actual code was as below :-
IF NOT c_vkdfif IS INITIAL.
SELECT vbeln posnr lfrel banfn
INTO TABLE gi_vbep
FROM vbep
FOR ALL ENTRIES IN c_vkdfif
WHERE vbeln EQ c_vkdfif-vbeln.
CHECK sy-subrc = 0.
SORT gi_vbep BY vbeln ASCENDING.
Begin of changes:DD1K902390
SELECT vbeln auart
FROM vbak
INTO TABLE gi_vbak
FOR ALL ENTRIES IN c_vkdfif
WHERE vbeln EQ c_vkdfif-vbeln.
IF sy-subrc EQ 0.
SORT gi_vbak BY vbeln.
LOOP AT c_vkdfif.
READ TABLE gi_vbak WITH KEY vbeln = c_vkdfif-vbeln
INTO gwa_vbak BINARY SEARCH.
IF sy-subrc EQ 0.
IF ( gwa_vbak-auart EQ c_zc04 ) OR ( gwa_vbak-auart EQ c_zcr4 ).
DELETE TABLE c_vkdfif.
ENDIF.
ENDIF.
CLEAR gwa_vbak.
ENDLOOP.
ENDIF.
Can you please provide me a solution...
Hi Sandra,
C_VKDFIF is a tables parameter in the Functional Module Exit EXIT_SAPLV60P_008, which is of type dictionary structure VKDFIF.
In the Functional Module Interfact in Table parameters it is declared as bwloe : -
CVKDFIF LIKE VKDFIF.
Also Let me tell u When I put a BREAK- POINT on the read statement & execute the control doesnt go to this debug point where as it goes to dump.
Kindly suggest...
hi,
a refresh of our abap knowledge
DELETE TABLE itab [FROM wa].
Effect
Behaves similarly to variant 2. The values for the table key are taken from the corresponding components of the (structured) field wa. The field must be compatible with the table line of itab. This method allows you to delete from a table without the table key having to be known in advance. If the internal table has a header line, you can leave out the FROM wa addition; the system then takes the key values from the header line.
Seems OK to me, because the header line is filled properly.
Gr.,Frank
What I meant was that statement probably loops at all records until the right is found, thus it does not use binary search, so it's not good for performance, while DELETE c_vkdfif is a direct access. So don't use DELETE TABLE c_vkdfif.
It is not sufficient to explain why there is a timeout of course (400 records without binary search would do an estimated average of only 80.000 loops). The reason could be found only by a debug, we, SDNers, can't do that.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.