11-16-2005 4:00 PM
Hi-
I have Netweaver installed. I would like some simple code illustrating how to create a new table for containing data in ABAP. I also would like some sample code for accessing and changing data in R/3 tables.
thanks,
Kevin
11-16-2005 4:23 PM
HI Kevin,
If you are specifically looking to change the length of the field in order that it suits yopur requirement(description more than 40 characers), you either have to change the domain of the field or create a custom domain and assign it to the field of the table. Again for this if you are trying to modify a standard table/domain you ought to get the access key from service market place.
11-16-2005 4:05 PM
Create you table via SE11.
Then you can access the data in your table via SELECT statments in your abap program.
report zrich_0001.
data: itab type table of zcustom with header line.
select * into table itab from zcustom
where field1 = 'ABC'.
Check out the help for accessing table using Open SQL
http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3969358411d1829f0000e829fbfe/frameset.htm
Also, check out the help on ABAP dictionary.
http://help.sap.com/saphelp_47x200/helpdata/en/cf/21ea0b446011d189700000e8322d00/frameset.htm
http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb6e446011d189700000e8322d00/frameset.htm
Regards,
Rich HEilman
Message was edited by: Rich Heilman
11-16-2005 4:11 PM
Thanks- you are always a big help! One more thing... we have an ABAP developer here (I'm an accountant actually) who says you can't change the length of a field in a table in R/3. Is this true? We have a field for property descriptions that is set to 40 characters, but it cuts off the descriptions.
11-16-2005 4:15 PM
If they are standard R/3 tables or for that matter any object delivered by SAP should not be changed, unless there is a dire need for such modification. You will need to request an access key from SAP to do such modifications and such modifications may not protected during future upgrades.
Your ABAP programmer is correct in saying don't. You need to come up with some other way to work around it.
Srinivas
11-16-2005 4:08 PM
Can you please explain "I have Netweaver installed"? Is it the sneak preview or the regular licensed version at your work place? Is it ABAP application server or the J2EE application server?
"how to create a new table for containing data in ABAP"
You will not normally use ABAP to create database tables, if that is what you meant. Use transaction SE11 to create new database tables. In ABAP, you will define and use what are called "Internal Tables". You can get sample programs provided in your system. In SE38, enter "DEMO" and look at some of those programs to get an idea.
Also, read the documentation at this link.
http://help.sap.com/saphelp_nw04s/helpdata/en/f3/b2934258a5c76ae10000000a155106/frameset.htm
Regards,
Srinivas
11-16-2005 4:23 PM
HI Kevin,
If you are specifically looking to change the length of the field in order that it suits yopur requirement(description more than 40 characers), you either have to change the domain of the field or create a custom domain and assign it to the field of the table. Again for this if you are trying to modify a standard table/domain you ought to get the access key from service market place.
11-16-2005 4:27 PM
Thanks folks... by the way, I'm using sneak preview. I am creating a table in se11. I made up my own data type (do not know what data type means actually-- I was expecting int, char, etc but instead got a list of other things) and now it is asking me for an access key to finish creating the table. Where do I get an access key?
thanks.
11-16-2005 4:31 PM
In order for you to do development in SAP, you need a developer access key, which is what you just saw. Since you are working with the sneak preview, you should be able to get it from SDN. I haven't done that but I think it should be there in the instructions as to how to get the key. Licensed version require you to go to the service marketplace of SAP and obtain the key there.
Welcome to the wonderful and exciting world of ABAP!!!
Srinivas
11-16-2005 4:32 PM
11-16-2005 4:33 PM
How do I "Connect to the R/3 Online Service System" to get my developer access key?
11-16-2005 4:33 PM
It says "register object" and there is an access key field.
11-16-2005 4:35 PM
11-16-2005 4:36 PM
11-16-2005 4:39 PM
It says "Register Object" when I try to create the table via se11.
object: R3TR TABL KEVIN1
SAP Release: 640
Installation: DEMOSYSTEM
11-16-2005 4:41 PM
I tried that key. IT says "incorrect object"
11-16-2005 4:42 PM
11-16-2005 4:43 PM