‎2007 Aug 03 8:29 AM
hi experts
I have all my data in it_bseg1, based on that am using the following queries also.
if not it_bseg1[] is initial.
*- Ekko
SELECT EBELN LIFNR
FROM EKKO INTO table it_ekko
FOR ALL ENTRIES IN it_bseg1
WHERE EBELN = IT_BSEG1-EBELN.
if sy-subrc = 0.
sort it_ekko by ebeln lifnr.
*-Lfa1
SELECT LIFNR NAME1 FROM LFA1
INTO table it_lfa1
FOR ALL ENTRIES IN it_ekko
WHERE LIFNR = IT_EKKO-LIFNR.
if sy-subrc = 0.
sort it_lfa1 by lifnr.
endif.
endif.
endif.
now my problem is, i want all my data into it_bseg1 for display.
how can i do this , advise me on this.
Thanks in advance.
Regards
Rajaram
‎2007 Aug 03 8:34 AM
Hi,
Wite code like:
if not it_bseg1[] is initial.
*- Ekko
SELECT EBELN LIFNR
FROM EKKO INTO table it_ekko
FOR ALL ENTRIES IN it_bseg1
WHERE EBELN = IT_BSEG1-EBELN.
if sy-subrc = 0.
sort it_ekko by ebeln lifnr.
*-Lfa1
SELECT LIFNR NAME1 FROM LFA1
INTO table it_lfa1
FOR ALL ENTRIES IN it_ekko
WHERE LIFNR = IT_EKKO-LIFNR.
if sy-subrc = 0.
sort it_lfa1 by lifnr.
endif.
endif.
endif.
loop at it_bseg1.
read table it_lfa1 with key lifnr = it_bseg1-lifnr.
if sy-subrc = 0.
it_bseg1-name = it_lfa1-name.
modiyf it_baseg1 transporting name.
endif.
endloop.
‎2007 Aug 03 8:32 AM
Hi
Write a select statement to <b>BSIK and BSAK</b> Tables instead of BSEG table (as it consumes lot of time) by passing LIFNR and EBELN fields to them and fetch the related data which you wants to fetch from BSEG..
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Aug 03 8:34 AM
Hi,
Wite code like:
if not it_bseg1[] is initial.
*- Ekko
SELECT EBELN LIFNR
FROM EKKO INTO table it_ekko
FOR ALL ENTRIES IN it_bseg1
WHERE EBELN = IT_BSEG1-EBELN.
if sy-subrc = 0.
sort it_ekko by ebeln lifnr.
*-Lfa1
SELECT LIFNR NAME1 FROM LFA1
INTO table it_lfa1
FOR ALL ENTRIES IN it_ekko
WHERE LIFNR = IT_EKKO-LIFNR.
if sy-subrc = 0.
sort it_lfa1 by lifnr.
endif.
endif.
endif.
loop at it_bseg1.
read table it_lfa1 with key lifnr = it_bseg1-lifnr.
if sy-subrc = 0.
it_bseg1-name = it_lfa1-name.
modiyf it_baseg1 transporting name.
endif.
endloop.
‎2007 Aug 03 8:36 AM
Hi,
First you include the all fields into it_bseg1.
sort it_ekko by ebeln.
sort it_lfa1 by lifnr.
Then loop at that table.
loop at it_bseg1 into wa_bseg1.
Read table it_ekko into wa_ekko with key ebeln = it_bseg1-ebeln binary search
if sy-subrceq 0.
read table it_lfa1 into wa_lfa1 with key lifnr = it_ekko-lifnr binary search.
if sy-subrc eq 0.
Move : the req, fields into it_bseg1.
modify the table it_bseg1.
endif.
endif.
endloop.
if it helps dont forget giving REWARD points....
rgds
harris
‎2007 Aug 03 8:44 AM
hai,
using modify statement u can do this.
loop at it_bseg1 into line_bseg1. ( if ur internal table without header line).
read table it_ekko into line_ekko with key ebeln = line_bseg1-ebeln.
if sy-subrc = 0.
line_bseg1-lifnr = line_ekko-lifnr.
modify it_bseg1 from line_bseg1 index sy-tabix transporting lifnr.
endif.
endloop.
before doing this u need to have lifnr in your it_bseg1 internal table structure.
reward points if useful.
bye.
‎2007 Aug 03 9:05 AM
Hi Raja
Try like this
Append lines of it_lfa11 to it_bseg1.or
Modify it_lfa1 transporting it_bseg1 Check this links regarding performance tuning
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_Introduction.asp
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_SelectionCriteria.asp
Reward all helpfull answers
Regards
Pavan
Message was edited by:
Pavan praveen
‎2007 Aug 03 9:44 AM
Hi guys
I got it, now its working fine.
thank you one and all.
Regards
Rajaram