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: 

code wanted - to input data into R/3

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

16 REPLIES 16

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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.

0 Kudos

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

0 Kudos

What kind of access key, a developer key or an object key?

Regards,

Rich Heilman

0 Kudos

How do I "Connect to the R/3 Online Service System" to get my developer access key?

0 Kudos

It says "register object" and there is an access key field.

0 Kudos

You may use this developer key for the NSP system.

29671482393151224771

Regards,

Rich Heilman

0 Kudos

What is the object that it is saying that you are trying to access?

Regards,

Rich Heilman

0 Kudos

It says "Register Object" when I try to create the table via se11.

object: R3TR TABL KEVIN1

SAP Release: 640

Installation: DEMOSYSTEM

0 Kudos

I tried that key. IT says "incorrect object"

0 Kudos

Oh, make sure that you begin with "Z", call it ZKEVIN1. You need to use the customer name space for all custom objects.

Regards,

Rich Heilman

0 Kudos

That key was for your developer key, not the object key.

Regards,

Rich Heilman