Friday, August 14, 2009

Creating Tables










I thought I would discuss how to create a table using SAP tools.
Compared to creating DDS this is a little strange at first anyway.
Rather then starting an editor start transaction SE11


Key in a table name start it with a "Z" Make the name meaning something your not limited to 6 characters or even 10. Then press the CREATE button.


I am not going to try and explain this screen. Simply key in a description select a Delivery Class and the Data Browser. Read the help on Delivery Class and Data Browser.
Then click on the tab Fields.

The following screen will appear.
You should normaly always have the first field be MANDT then check the Key and Initilize check boxes the data element is the MANDT as well. Now lets add a few fields and make them part of the key.
Key fields should be first fields in a table.
Add BUKRS and KUNNR and make them key fields. They should be the data elements as well. Add a field call it junk then add WRBTR and press enter. You should see a screen that looks like the following.


Now save the table and press the back button.

Click on Domain and key in ZJUNK and press the create button.

Key in a description select a data type in this case we want to make it a character field lets make it 10 long and output length 10 as well. Click on the Lower Case box. This will allow the users to enter lower case characters into the field. If you want to restrict the value use the Value Range Tab but that is not needed for my example. When your finished click on on the test button and assuming you have done everything correct then press the activate button. After its activated press the back button and then click on Database Table and press the change button.

Click on the Data Element ZJUNK a pop up will appear press the YES button.

The screen to the right will appear. Key in a description populate the domain with ZJUNK.

Then press the Field Label box.










The following screen will then appear.

Key in the field labels whatever you want them to be. Then press the test button and assuming everything is OK press the activate. After it's activated press the back button. You will now see the Data Type, Length and Description are now populated.

Couple of thing left to do.

Press the Currency/Quantity Fields tab. Following screen will appear.


Select whatever currency field you want to model your field after in my case I am going to select BSIS for the Table and WAERS for the Field.

Now we have created all the fields we want in the new table. Two last things to do. Press the Technical Settings button. It will ask you to save your new table press Yes.


I am not even going to attempt to explain this screen read the help just know you have to complete the screen once your finished with this screen press save. Then press back final step on the menu select extras then select Enhancement Category. Popup will appear press the check button. Another popup will appear press the Can be enhanced (character-type or numeric) then press the copy button. Then press the test and activate buttons.


Your finished.

Reblog this post [with Zemanta]