so we implemented and tested our header entity set and entity type let's do with item the same thing so if I go item here it will give me an error which says that method is not implemented I know which method to implement I'll go to my backend and then try to implement it so I'll be quick this time so I'm at my back-end system now I know what I have to implement so if I need multiple entries I will implement this and if I want one entry I'll implement this so let's do the multiple one one first go to our workbench it will say that it has not been implemented yes we know it and now we want to implement it I go to the methods I will usually check an inherited methods and then I'll just expand a little so item entity set get entities this one so I'll just right click here and you know what to do redefine so you got it i'll just activate it we have activated it now we need to write our code so we'll do the similar thing like earlier we'll remove this line of code commented line of codes and then we'll write our select star up to let's do 13 records up to 13 rows from v BRP into table what is the table you know that is the output parameter this is the one ET and PT set so do this and let's do a pretty printer check the syntax all clear and activate so we are done so now let's test it quickly in the front end so we are in our front end system let's test it so earlier it was giving not implemented let's see what it gets now bingo so we have the data so if you check this so you have this header uh sorry this item details and this is the web length that is billing head billing number and the billing item number and you see billing number billing item number and then some sequence number quantity unit material and plan so If you want to see this in the browser, you can just copy this as we did earlier. I'll copy this. I'll go to the browser.
I'll just put this guy here and here you see the billing item. And also if you want to check it in JSON format, you now need to know that what you need to give a question mark, dollar, format is going to JSON. Bingo.
So you have this items here. Right? So let's go back and if you want to play around I can also play and say how many tell me the count so it should give me how many 13 right because we have hard coded it and also let's let's remove the count and let's try to read one entry from the item so how do I do that look here so everything is there in this XML so I'll just copy this guy and I'll just paste it over here remove this extra and then execute so what should happen so it should fail now because we are trying to read one entry which is by providing the primary key but we have not yet implemented the get entity type method right so if I execute it it will say not implemented it's a bad request and it is not implemented all right so let's go to the back end and implement it so we are at the back end system now let's right click this get entity Then redefine so it will generate the bunch of code We'll just remove it and then what we have to do just like in the previous one We have to read the key right so so what I'll do is read table it key Underscore tab into I'll use the inland data declaration as earlier LS key tab with key name equals to what is the name that is webland vbln so if psi sub rc equal to zero then i will save it in a variable so vbln equals to ls ky underscore tab i'll just hit space it will give me value right so i forgot to show you that and now i have to declare a data type which says LVBBLN equals type VBLN underscore VF.
This is the type. so in the same go let's declare the item as well because we'll need it so POSNR type POSNR underscore VF, VF is for billing IO and then what I'll do I'll again do another read table ITKEY TAB into I'll use the same key that's why I'm not using data now with key name is equal to what is the name now POSNR right so if so I a cbrc equal to 0 then what we'll do LV POS nr is equal to LS ke y TAB and what will give all its value so we have the header and the item I'll just do a pretty printer alright so now we need to select it from maybe our P so if so I'll just put a clause saying that if we have the header keys if evil is not initial and LV POS NR is not initial then select star from select okay select star from select as a single star from VBRP into what is that tell me into this guy so this is the output parameter where what is where vb eln is equal to lv vb eln and posner equal to lv pos nr plus to the pretty printer let's check the syntax and let's activate it good now let's test it okay we are at the front end g g w underscore client uh let's test it so last time we got a error it was bad request i think there was a slash over here that time that's why it said bad request so when you say 400 series it is a front-end error and if you see 500 series is back end so 400 last time was front end but it should have been 500 because we did not have the method in backend as well so i'll just correct this and then i'll execute this let's see here you go So you get one entry. So you get the details of VBELN over here and the item here.
So you will have only one entry because you are passing the complete primary key. So hope you understood the concept right. Whenever you need to do multiple selects you have to do build entity set and you have to redefine the get entity set method and when you want just one entry. when you know the primary keys or you want to select just one entity then you have to redefine the get entity method all right so we just now completed this step 7 and 8 where we implemented the entity type and entity set for the item and we also tested the entity type and entity set for the items