doubt on internal tables

Question: hi,

i hav a doubt and wud be thankful if anyone can answer it...

i hav a task to update a database table with data from a flat file(.txt).
I used gui_upload function call to get data from flat file into a internal table.

Can we insert data from an internal table into database table????

thank u...

Answer:
If you say SAP standard database tables, the answer is NO unless you do so via BAPIs or standard functions.

If you say custom table/s, you can do almost whatever you want, insert, delete and modify.

Answer:
offcourse u can do.

Even if it is a sap standard table u can use UPDATE,INSERT, DELETE to load the data.

Just loop at that internal table and use INSERT statement.

And before that check for that perticular record already exist or not , (primary key) if that is the case use UPDATE statement.

regards,

Answer:
Firstly the title says internal tables, the contents say databases tables. Maybe you want to clarify which one you mean (or find out the difference) before going any further.

Even if it is a sap standard table u can use UPDATE,INSERT, DELETE to load the data.
While it certainly is possible to do this, it isn't a particularly good idea. In fact it's very dangerous and would be against the rules on 99% of sites.

Oh, and the rules say no SMS speak.

Answer:
If the structure of internal table is the same as the structure of the database table, and if you have only new rows (respectively updated rows) you can use command INSERT (respectively UPDATE) with option FROM TABLE itab. See documentation of INSERT and UPDATE. As said before, don't do it on SAP standard tables; it is technicaly possible but very dangerous for the database integrity.
If you are speaking about SAP standard tables, please give the name of the tables.

Answer:
hi,
Thank u all for ur replies...

Well what i am trying to do is insert data from a .TXT file on PC frontend into a database table (LFA1).

The .TXT file has records with following structure.
Each record has the following fields vendor number, name, country and city.

I could do the data updations using BDC sessions by recording a particular transaction which could save data into database. but using that i had to exclusively goto SM35 to process the session.

But i wanted to know if i could do with datasets/ gui_upoad using internal tabs...

I tried to Just loop at that internal table and use INSERT statement but it was resulting in an error that the internal table is not long enough.

I think u should hav the internal table structure and the database table structure same, as mentioned by Hachel.

So what are the possible ways u can do it ...
BDC, LSMW, IDOCS/BAPI....????
Please suggest....

Thanks,
Cheetoo

Answer:
WARNING
Updating SAP standard tables is really good way of destroying your system, and can result in a hefty bill from SAP, for the time they spend restoring the referential integrity of the database.

DO NOT DO IT.

LSMW, BDC, BAPI and IDOCs are the way forward.

m@t
_________________
TULY The quality of answers is roughly proportional to the quality of the question.

The downside of being better than everyone else is that people tend to assume you're pretentious.

Answer:
See also program RFBIKR00.
Copyright ?2007 - 2008 www.jt77.com