Application Development and Automation 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: 
Read only

Querry

Former Member
0 Likes
942

i want to select from bsak table and append the records to the existing records of itab_bsis

wat should be the syntax

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
910

hi,

you can get all the records in one internal table then use loop to get perticuler fields records by using READ statement you will get your result.

try by following code for your table.

SELECT matnr " Material Number

werks " Plants

prctr " Profit Center

FROM marc

INTO TABLE i_marc

FOR ALL ENTRIES IN i_mara

WHERE matnr = i_mara-matnr

AND werks IN s_werks.

ENDIF. " IF i_mara[] IS NOT INITIAL

LOOP AT i_marc INTO wa_marc.

wa_output-matnr

hope this wil be help ful....

regards,

praveena.

8 REPLIES 8
Read only

valter_oliveira
Active Contributor
0 Likes
910

Hello.

With,


SELECT * FROM bsak APPENDING TABLE itab_bsis WHERE ....

You'll keep previous record, contrary to


SELECT * FROM bsak INTO TABLE itab_bsis WHERE ....

Regards,

Valter Oliveira.

Read only

JanStallkamp
Advisor
Advisor
0 Likes
910

Hi.

Type SELECT and APPEND in your ABAP editor, set the cursor on each of the words and press F1. If the online documentation is not sufficient please use SDN's search. You will find a huge number of questions like yours.

Best regards,

Jan Stallkamp

Read only

Former Member
0 Likes
910

HI,

use select * from bsak appending table itab.

se this example below.


DATA:itab type bsak occurs 0.
DATA:lin TYPE sy-tfill.
select * from bsak INTO TABLE itab UP TO 10 rows.
select * from bsak APPENDING TABLE itab UP TO 10 rows.

DESCRIBE TABLE itab LINES lin.

WRITE:/ lin.

rgds,

bharat.

Read only

Former Member
0 Likes
910

Hi,

You need to use appending corresponding fields of table itab statement in your select statement for BSAK.

Thanks,

Sriram Ponna.

P.S. Don;t create new thread for same query.

Read only

Former Member
0 Likes
910

hii,

you can append your fields by using

SELECT carrid connid cityfrom cityto

FROM spfli

INTO (wa-carrid, wa-connid, wa-cityfrom, wa-cityto).

thx

twinkal

Read only

Former Member
0 Likes
910

hi gayathri,

you can get all the records in one internal table then use loop to get perticuler fields records by using READ statement you will get your result.

try by following code for your table.

SELECT matnr " Material Number

werks " Plants

prctr " Profit Center

FROM marc

INTO TABLE i_marc

FOR ALL ENTRIES IN i_mara

WHERE matnr = i_mara-matnr

AND werks IN s_werks.

ENDIF. " IF i_mara[] IS NOT INITIAL

LOOP AT i_marc INTO wa_marc.

wa_output-matnr = wa_marc-matnr.

wa_output-werks = wa_marc-werks.

wa_output-prctr = wa_marc-prctr.

lw_frecid = lw_frecid + 1.

wa_output-frecid = lw_frecid.

APPEND wa_output TO i_output.

ENDLOOP. " LOOP AT i_marc

regards,

sindhu.

Read only

Former Member
0 Likes
911

hi,

you can get all the records in one internal table then use loop to get perticuler fields records by using READ statement you will get your result.

try by following code for your table.

SELECT matnr " Material Number

werks " Plants

prctr " Profit Center

FROM marc

INTO TABLE i_marc

FOR ALL ENTRIES IN i_mara

WHERE matnr = i_mara-matnr

AND werks IN s_werks.

ENDIF. " IF i_mara[] IS NOT INITIAL

LOOP AT i_marc INTO wa_marc.

wa_output-matnr

hope this wil be help ful....

regards,

praveena.

Read only

Former Member
0 Likes
910

Thanks for all your inputs!!