Skip to Content
0
Former Member
Jun 04, 2009 at 07:54 AM

Insertion of Records directly from Internal Table to Database Table

47 Views

HI all,

I want to insert the data to database table directly from internal table .I have written following program.

DATA : IT_TAB1 type table of FAGLFLEXA with header line.

start-OF-SELECTION .

SELECT * FROM FAGLFLEXA into CORRESPONDING FIELDS OF TABLE IT_TAB1

WHERE RYEAR = '2008'

AND DOCNR = '0041017314'

AND RBUKRS = 'NCL'

" AND BSCHL = '50'

AND RACCT = '0000245612' .

LOOP at IT_TAB1 ."where BSCHL = '40'.

IT_TAB1-DOCNR = '0041017314' .

IT_TAB1-DOCLN = '000008' .

IT_TAB1-RACCT = '0000245612' .

IT_TAB1-PRCTR = '0000002001' .

IT_TAB1-PPRCTR = '0000002002' .

IT_TAB1-TSL = '10241.00'.

IT_TAB1-WSL = '10241.00' .

IT_TAB1-HSL = '10241.00' .

IT_TAB1-BUDAT = '20081018' .

IT_TAB1-BSCHL = '50' .

IT_TAB1-DRCRK = 'H' .

IT_TAB1-BELNR = '0041017314' .

MODIFY IT_TAB1 TRANSPORTING DOCNR DOCLN RACCT PRCTR PPRCTR TSL WSL HSL BSCHL DRCRK BELNR .

ENDLOOP .

if IT_TAB1[] is NOT INITIAL .

MODIFY FAGLFLEXA from TABLE IT_TAB1[].

COMMIT WORK.

endif.

It works fine. I want to insert 40 records in database table .How can i insert this records by uploading text or excel file. Please explan it with code.

Regard's

Atul