11-17-2013 11:32 AM
Hi all,
We are using badi MB_MIGO_BADI in order to display additional detail Sub screens.
In our implementing class we have this piece of code:
Method: IF_EX_MB_MIGO_BADI~PBO_HEADER:
During PBO we go and check the document for the presence of certain "Movement Type"
based on the result we initiate the display of the extra tab.
* i_action come from method IF_EX_MB_MIGO_BADI~MODE_SET .
DATA: rg_bwart TYPE RANGE OF godefault_tv-bwart .
APPEND 'IEQ102' TO rg_bwart .
APPEND 'IEQ541' TO rg_bwart .
APPEND 'IEQ301' TO rg_bwart .
* Display mode .
* A03 = Cancellation
* A04 = Display
DATA: rg_action_d TYPE RANGE OF godefault_tv-action .
APPEND 'IEQA03' TO rg_action_d .
APPEND 'IEQA04' TO rg_action_d .
DATA: it_mseg TYPE TABLE OF mseg .
* Check for display mode
IF i_action IN rg_action_d .
SELECT * INTO TABLE it_mseg
FROM mseg
UP TO 1 ROWS
WHERE
mblnr EQ st_mkpf-mblnr AND
mjahr EQ st_mkpf-mjahr AND
bwart IN rg_bwart AND
sobkz EQ 'Q' .
ENDIF .
Some time we are getting time out for the select statement.
The number of lines in given document is less then 10 rows.
Can we improve on the select statement ? is the problem is in programing ? did you encounter similar problems ?
Thank you in advance for any response.
Regards.
11-17-2013 12:37 PM
Hi,
Since we are only checking if a record exists and the key is being passed ,can we try the following options...
(a) SELECT count(*) FROM mseg
WHERE
mblnr EQ st_mkpf-mblnr AND
mjahr EQ st_mkpf-mjahr AND
bwart IN rg_bwart AND
sobkz EQ 'Q' .
(b) Select single * from Mseg
WHERE
mblnr EQ st_mkpf-mblnr AND
mjahr EQ st_mkpf-mjahr AND
bwart IN rg_bwart AND
sobkz EQ 'Q' .
(c) Last but not the least,run the program in SE30 (ABAP Objects Runtime Analysis) to see where/which statement if taking a hit and when.
Hope it helps.
Regards
11-17-2013 12:37 PM
Hi,
Since we are only checking if a record exists and the key is being passed ,can we try the following options...
(a) SELECT count(*) FROM mseg
WHERE
mblnr EQ st_mkpf-mblnr AND
mjahr EQ st_mkpf-mjahr AND
bwart IN rg_bwart AND
sobkz EQ 'Q' .
(b) Select single * from Mseg
WHERE
mblnr EQ st_mkpf-mblnr AND
mjahr EQ st_mkpf-mjahr AND
bwart IN rg_bwart AND
sobkz EQ 'Q' .
(c) Last but not the least,run the program in SE30 (ABAP Objects Runtime Analysis) to see where/which statement if taking a hit and when.
Hope it helps.
Regards
11-17-2013 1:04 PM
Hi,
Thanks for the comments.
Option (a) worth a try since the select is only to check the existence of data.
I wish that there was something like "TRANSPORTING NO FIELDS" in SQL .
Regards.
11-17-2013 12:43 PM
Rosenberg,
I have checked the same query in the abap editor it is workign fine. the only thing which concern me that one document will always have one movement type then why are you using different movement type to check to check the single document.
Regards,
11-17-2013 1:11 PM
Hi,
Thanks for the response.
My first name is Eitan.
The same document can have more then one "movement type" .
We want to display the additional detail Sub screen if one of those "movement types"
participate in a given document.
This is not a new code.
Regards.