‎2021 Jan 11 6:08 AM
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.
‎2021 Jan 11 6:24 AM
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.
‎2021 Jan 11 6:47 AM
Thank You now query processing.
But my data is not updating into zunor and sgtxt fields from excel to sap
‎2021 Jan 11 7:26 AM
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.