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

Time limit exceeded while processing select query

former_member612655
Participant
0 Likes
1,024

Hi experts,

if it_datatab is not INITIAL.
    select belnr
           buzei
           koart
           from
           bseg into table it_bseg FOR ALL ENTRIES IN it_datatab
           where belnr = it_datatab-belnr and koart = 'K'.
      endif.
*delete it_bseg where koart ne 'K'.
loop at it_datatab into wa_datatab .
*READ TABLE it_bseg into wa_bseg with key belnr = wa_datatab-belnr.
*if sy-subrc  eq 0  and wa_datatab-gjahr = '2020'.
perform bdc_dynpro      using 'SAPMF05L' '0102'.
perform bdc_field       using 'BDC_CURSOR'
                              'RF05L-BELNR'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'RF05L-BELNR'
                              wa_datatab-belnr.
perform bdc_field       using 'RF05L-BUKRS'
                              wa_datatab-bukrs.
perform bdc_field       using 'RF05L-GJAHR'
                              wa_datatab-gjahr.
READ TABLE it_bseg into wa_bseg with key belnr = wa_datatab-belnr.
if sy-subrc  eq 0  and wa_datatab-gjahr = '2020'.
perform bdc_field       using 'RF05L-BUZEI'
                              wa_bseg-buzei.
perform bdc_field       using 'RF05L-XKKRE'
                              'X'.
perform bdc_dynpro      using 'SAPMF05L' '0300'.

perform bdc_field       using 'BDC_CURSOR'
                              'BSEG-SGTXT'.
perform bdc_field       using 'BDC_OKCODE'
                              '=AE'.
perform bdc_field       using 'BSEG-ZUONR'
                              wa_datatab-zuonr.
perform bdc_field       using 'BSEG-SGTXT'
                             wa_datatab-sgtxt.
perform bdc_field       using 'DKACB-FMORE'
                              'X'.
perform bdc_dynpro      using 'SAPLKACB' '0002'.

perform bdc_field       using 'BDC_CURSOR'
                              'COBL-PRCTR'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ENTE'.
endif.


CALL TRANSACTION 'FB09' USING bdcdata MODE 'A' UPDATE 'S'
MESSAGES INTO messtab.

when i check the code in debug mode my select query is running out of time.That means time limit       exceeded while processing the select query
Even though when i am comparing only key field in select query again it says maximum time limit is    exceeded.Can you please say why it is running out of time.


Regards,
Bhavani.
3 REPLIES 3
Read only

Sandra_Rossi
Active Contributor
938

In your system, probably BSEG is defined as a table of type Cluster (see in SE11), and so you should only access it via the columns of the primary key, i.e. BELNR, BUKRS, GJAHR. Note that how you currently do it is incorrect because the same BELNR number may exist for several companies and year.

Read only

former_member612655
Participant
0 Likes
938

Thank You now query processing.

But my data is not updating into zunor and sgtxt fields from excel to sap

Read only

Sandra_Rossi
Active Contributor
938

It's a completely-different topic. You should not mix your current task all in one question, if it's about several questions. When you ask a new question, please indicate what error message you get from batch input, and what you see when you run it screen by screen.