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: 

doubt

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

Hi guys

I got it, now its working fine.

thank you one and all.

Regards

Rajaram