‎2006 Dec 27 6:15 PM
Hi All,
I am quering bseg table to get tax jurisdiction code and code is:
loop at itab
SELECT SINGLE TXJCD FROM BSEG INTO C_TXJCD
WHERE
BUKRS = it_tab-BUKRS AND
GJAHR = P_RYEAR AND
GSBER = itab-gsber AND
HKONT = it_itab-hkont.
endloop.
but getting dump, could you please suggest a way to avoid dump
Thanks and appreciate you help
jog
‎2006 Dec 27 6:19 PM
Hi
Which dump?
U should use BSIS and/or BSAS table instead of BSEG, if you need to do a query for the G/L items
Max
‎2006 Dec 27 6:18 PM
Hi,
what is the dump you are getting??
also did you declare c_txjcd like bseg-txjcd.
DATA: C_TXJCD LIKE BSEG-TXJCD.
Thanks,
Naren
‎2006 Dec 27 6:19 PM
Hi
Which dump?
U should use BSIS and/or BSAS table instead of BSEG, if you need to do a query for the G/L items
Max
‎2006 Dec 27 6:44 PM
HI,
Iam getting time out error,
I need jurisdiction code field based on the selection fields
Thanks
jog
‎2006 Dec 27 9:52 PM
You have to do as Max says - go to BSIS and BSAS. That will give you BUKRS, BELNR, GJAHR and BUZEI. Then, if you need a field in BSEG or BKPF that is not in BSIS or BSAS, you use these fields to do a fully indexed select (on BKPF or BSEG) to get the field.
Rob
‎2006 Dec 28 6:23 PM
Rob,
Thanks for that,
one more question
do I need to put mandt field while querying BSEG, to make it unique,
Please suggest and also can I add other (non key fields ) in querying bseg and how does it effect.
Thanks
jog
‎2006 Dec 28 6:34 PM
Hi
No you don't! The client (MANDT) is automatically used by the system because it know in which client you're querying the table.
U should only specified the client only if you need to query a table of another client.
If you need to improve the performance of reading using no key fields, you should create a new index (trx SE11) for them.
Max
‎2006 Dec 28 6:59 PM
You can add other non-key fields to the select on BSEG, but since you have all the primary keys, it won't help much.
Since BSEG is a cluster table, I don't think it's possible to put an index on it.
Rob
‎2006 Dec 27 6:20 PM
Hi,
try in this way
DATA: C_TXJCD LIKE BSEG-TXJCD.
loop at itab
SELECT SINGLE TXJCD INTO C_TXJCD FROM BSEG INTO C_TXJCD
WHERE
BUKRS = it_tab-BUKRS AND
GJAHR = P_RYEAR AND
GSBER = itab-gsber AND
HKONT = it_itab-hkont.
endloop.
‎2006 Dec 27 6:51 PM
try to avoid loop for select statment and that to for BSEG.
go for any other way.
reward if useful
‎2006 Dec 29 8:00 PM
Hi,
Add this code also after select query.
IF Sy-SUBRC <> 0.
CLEAR C_TXJCD.
ENDIF.
If data is not available in the system, sometimes select query also creates short dump.
Ashven
‎2007 Jan 01 6:19 AM
Your query was going against all of BSEG. This will not change if you add BSAD/BSID into the game. It will just speed things up a bit...
What you really need to do is work with the functional side of the business to be able to limit the data (either in time or better in time and document type etc...)
Note that a full year of data may be waaay tooo much for a table like BSEG...
This will allow you to go against a finite chunck of data instead of dealing with an ever growing sample.
Enjoy