Program 4 - List of Materials ( Part 3 )

Siva Prasad
A free video tutorial from Siva Prasad
SAP Trainer and Consultant
4.4 instructor rating • 10 courses • 81,238 students

Lecture description

  • What are Data Elements
  • Why are Data Elements used 
  • Data Elements vs Data Types
  • Field Labels

Learn more from the full course

SAP ABAP Training - in Plain English

ABAP for absolute beginners - No Programming knowledge required

18:30:01 of on-demand video • Updated August 2018

  • Write ABAP Programs
  • Interpret existing ABAP programs
  • Be conversant with most major programming constructs and paradigms, specifically Enterprise Application programming
English [Auto] This column is the primary key. Mendieta number not the material name or description. All right so that was about the primary key that we have created this table saying material is of type character and characters right and description is let's say 20 characters and this is 40 characters right. That's all we have defined this table. We're able to define tables or columns in the table the right way to do that is by using what is called a data element. A data element a data go back and look at the definition of these columns you'll see that we have used Data Types of a particular. Instead of using data elements No why do we need to use data analytics data elements or for something that data types cannot get. Now I'm going to create another people. The Matt 0 1 would almost like a copy of the same table. Nicole S11 it's going to be very similar to this table except you're going to say Z-man underscore Ziegel one way and then on concrete OK same description Teal's and see and deliver the clus OK. And in the piece material simply stood off. Did it pipes. We're going to say data elements. This has to start with huzzy the field name can start with anything you want. The data element has to start with the Z because it plays a much bigger role. So we call it z z TBO. If it's not created by somebody else we can use it looks like it is not. So that. Yes. Local object OK. Data element not available. Do you want to create it. I want to say yes and say it's not all. That's a short description. And then we need it to be of a type care. Right. And then 20 characters. Just like how we are defined to live and and go to the label and the shackling these 10 characters and it's off by material medium length piece of paper 20 30 40 right. So whatever will come back to this later. Now check if everything is OK. See regions of object. Yes. Local object activity. Don't forget to activate it because without activation it does not have any useful effect. Go back and that's that. Now we're going to create a description. OK description. And then of course the description ok into this it has to be a character of my portrait. OK. Double click that. Does not exist. Create a new Bayda element. Yes and put in description type character or link for it. OK then we put a label here description. No it doesn't print. So it's fine. So Chuck local object it. OK it go back and they got it almost done with technical settings. That said this is Category 1. Yep sure it go back to a table activate it. It's not active yet do it but it does occur. That's probably because when you add the primary key sure not a problem material becomes the primary key. Activate it. Yes. Yes. Warnings are good that's fine. Now go create table maintenance in the later no operation to acquire and function easy. Matt on this score. No. 1 it's a one step thing be it the screen see see your local object. I know it's a lot of things that I'm doing here but it's not really a lot because I'm doing the same things again and again and again. OK CBOT Lubeck. So this is the same table right here. Move the table on the left the table on the right are almost similar except for the way the data element is being defined. The columns in the table on the left is defined with database and links whereas the columns on the light table are defining using data elements. What is the use of these data elements. The reason why data elements are created is to form the wrong they hold them. They hoard what is called texts. And without this tex Neff's check what happens when you look at display and these three data elements have free labels that span multiple lengths. Meaning if that column is shown with something that's less than 10 characters or around that it shows the description it is a medium one across this description. It is a really long one. Tredegar party characters you chose this description. So there are different types of description that can be shown on the screen depending on the length or weight of that particular column number one number two is a data element can be associated with a character or word type. This could be used again and again and again. Meaning we have created table of the map let's say and then we have created another table of z order which has which has let's say three columns. OK. Order number just like the way see you get an order number and McDonogh right order number 230. Right. And then where does that door help. It has a material say coffee and something else right now you see that the column material in this table is essentially same as the column material in the z table meaning the definition of columns is really or rather should be really consistent across all the tables that use or that reffer the material right that it makes no sense to have a Middle Eastern ticker to see it. And then we did 10 characters. It causes confusion. And it really doesn't work when you're trying to cross-reference this table. So we'll talk more about that at a later point. But beta elements bring in a level of sanity. When you define these database columns once you define a material of by whatever rate with a particular data type data element you can use that across any table that you define that particular material. Let me show you an example. Let's go back and up pull that same model. That's the title table based basically. And there are more tables of this table uses that derailment from retitling and book called Map not DNA you look at the data element say math. No. Right. Let me open another table. OK. This time I'm going to open a new table called a me a c p r c this did was meant to contain the plant data meaning what all the different factories that this material is stored are created or manufactured in this role and this role right. Build them essentially represent the same type of data Matina number and they're all created using the same data element and not it just happens to be the same name Amedi and it could be any name Z matter or Amedee and out on a scale zero one as long as the names are consistent. And then if you DoubleClick it Mendieta a number because they are using the same data element. The definition of that column for material is consistent it's got picked up off by. But they're using domain in sort of a preferred tiny predefined type. But we'll talk about domains later. You know it takes some more time for us to understand the need for domain but for no you understand that what a data element can do right. It brings a level of uniformity to the way a column in a table can really for example. But we have taken this material. It could be customer. It could be country country keys for example at any time any table declares the country key. It has to be for certain predefined by. No you can define a country key as two characters in one place and three characters in another place you put two characters. It has to be two characters across the board across all the tables in SFP. Right. So that's a data element we create more tables as we go forward. Or we could use just that people that it used and let's just populate this table in the table that you've created and create that list of materials program. That's the intention behind this program right. List of materials so go to see thirty eight and Z. See where you three no materials list the troop 0 0 for 42. Materials list. And we are creating an executable program separate local object. Now you have defined a table already. Right. So tables and people that have created these Z map right you want to pull data from that table. Select from the map what happens to her and then write Z the Matt ash material we go back let's go back to the definition of table the matte material and description the mat description and and select. We just want to write them in a nice little color format that is indexers to the program. And execute it right. We have three columns or three. We have three rows in the table right. CB 0 1 0 2 0 3 then the descriptions. So that's the list of. The Food Program is complete. So if we have learned so many different things in this program the first thing is the parameters. Q What does the parameters keyword. It gives the user a choice of selecting what kind of data he wants from that report the example that we have taken is the list of materials program has a list of materials. So many of them we only wanted materials created by a particular user and that was easy. We created a key word. The user can end the parameters there. For example the user me and inside the logic of the program the poorly in Word the user has entered and use the select statement to only get our fetch ralliers or materials from the people based on that use of entry. Right. But with the use of parameters the next just text elements. So when you create these pedometers be have your names be present a score it can have a descriptive mean that you can use text elements to show nice descriptive names that can be heard from the data dictionary. Now after that we moved on to data dictionary so far we have used tables that already existed. We have talked about the reasons why they exist for example why does the market even exist. Why does the list of countries still exist. We have said that ERP packages have been built over the course of time based on the requirements of so many different companies. So there's a whole bunch of data logic that is presented to that's given by SFP out of the box and abab dictionary is the place where it can view the definition of people like what's the definition of a model or another table. TCN is it IP the list of countries Deeble. And that's also the place where you create tables and we created a new table the map post we have created that using data types like characters in medieval typeless characters and the material number was 20 characters the description was 40 characters and we also created a primary key. We have seen what the keys are if we don't understand what's the primary key. What is going to cover to board the plane. The key in the little set of programs Ben we have moved on to the topic of data elements. Why do the elements that are used to create consistency across column definitions across tables how to create data elements how to create different text labels activate data elements and every table needs to be activated as well. We have seen a table maintenance generator that's used to populate data table. This is just temporary stuff. You know you don't really use this kind of way to populate people's respect just so that we can put some data in them then we would on the screen. And then we've seen how to view the data on a machine and then we have seen how to view data in the table like in user data browser as the 16 end user report and then sort of using the standard model they will be I've used this table Z map array to select statement the data up the database table the ones that we have created. In short on the screen. So this concludes the list of programs for Diwan. Before you move on today to that is an exercise that I want you to do. So here is the exercise.