Application Development 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: 

regup - SQL call time out and no result

Former Member
0 Kudos

Dear Experts:

The below SQL has very bad performance. It's never get the result.

Please advise how to improve the run time and complete the SQL statement?

SELECT zbukr "Paying company code

vblnr "Payment Document

bukrs "Company Code

belnr "Accounting Document Number

gjahr "Fiscal Year

FROM regup "Processed items from payment program

INTO CORRESPONDING FIELDS OF TABLE gt_regup

FOR ALL ENTRIES IN lt_bseg

WHERE lifnr = lt_bseg-lifnr AND

bukrs = lt_bseg-bukrs AND

belnr = lt_bseg-belnr AND

gjahr = lt_bseg-gjahr .

Thank you very much!

Helen

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I'm not sure there's much you can do with this query.

You might consider changing your approach. You know lbukrs, belnr gjahr and lifnr. So why not go to BSAK (vendor cleared items) first? That will give you the clearing date. You can check to see if this is the same as REGUP-LAUFD. If so, that should help a whole lot.

Rob

6 REPLIES 6

Former Member
0 Kudos

I'm not sure there's much you can do with this query.

You might consider changing your approach. You know lbukrs, belnr gjahr and lifnr. So why not go to BSAK (vendor cleared items) first? That will give you the clearing date. You can check to see if this is the same as REGUP-LAUFD. If so, that should help a whole lot.

Rob

0 Kudos

Thank you for your response.

Do you mean the BSAK-AUGDT = REGUP-LAUFD ?

Thanks,

Helen

0 Kudos

Yes - but you need to check that.

Rob

0 Kudos

Bob,

Thank you for your confirmation.

I would like to ask you another general ABAP data base access question:

1. Should I extract (SELECT) the records from the table into internal table,

then READ later to extract the data from the internal table.

2. Should I just do the SQL call for particular record to get the data for that record --- no internal table.

I currently use the method 1. Is SAP recommended method 1?

Should I use the method 2 in this REGUP case?

Thank you very much!

Helen

0 Kudos

Well first of all, you are really only supposed to ask one question per thread. That makes it easier for people who are searching the forum to find an answer. So If your first question is answered, please close the thread.

But in general, I don't think there are any specific recommendations on this. But I would go whichever way was most readable and therefore maintainable so long as it doesn't introduce serious performance problems. And I don't think that would be a problem in either case here.

Rob

0 Kudos

Bob,

Thank you very much for your answer.

Helen