on 09-06-2007 7:44 AM
Hi all,
I am trying to run the pdf HANDLING TRANSACTIONS USING BAPIs,but while running it is giving as error as given below
java.lang.NullPointerException
at com.sap.tut.webdynpro.tutorial.FlightBookingView.wdDoInit(FlightBookingView.java:99)
at com.sap.tut.webdynpro.tutorial.wdp.InternalFlightBookingView.wdDoInit(InternalFlightBookingView.java:255)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:274)
at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
the code at the point where error is occuring
public void wdDoInit()
{
//@@begin wdDoInit()
wdContext.currentUiElementsElement().setGroupVisible(WDVisibility.NONE);
//@@end
}
Hi Padma,
ur wdContext.currentUiElementsElement() is null.have u initialized it??
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Padma,
If you want to initialize the nodelement then you can follow these:
IPrivate<viewname>.I<nodename>Element ele = wdContext.node<nodename>().create<nodename>Element();
ele.setGroupHeader(<value>);
ele.setGroupVisibility(WDVisibility.VISIBLE);
wdContext.node<nodename>().addElement(ele);
This is how you would set the value and initialize the node element.
Regards,
Murtuza
Hi,
I changed the cardinality of the node to 1..n from 0..n
so that error got cleared.But now i have a container with group of UI elements where we have to enter values..followed by button Book,but that container UI elements are not in Editable state.
Can u plz tell me y i am getting this??
Regards
Padma
Hi,
this is the sample tutorila avialable in sap login.
I applied template for the container and i selected data from the context (Bapi_Flbooking_Createfromdata_Input)(Booking_Data)..In this attributes like AirLine,FlightNum..etc
the cardinality of (Bapi_Flbooking_Createfromdata_Input) is 1..n and selction is 0.n
the cardinality of )(Booking_Data) is 0..1 and selection is 0..1..
and the cardinality of )(Booking_Data).. is not in editable state
can any one tell me y the caontainer where i have to enter my data to book flight is not in editable state
Regards
Padma
Padma,
Is Booking Data node of yours is a subnode of Bapi_Flbooking_Createfromdata_Input. If yes then you need to create an object of your Booking Data Node and set the values in there and add that node to your input node.
Bapi_Flbooking_Createfromdata_Input input = new Bapi_Flbooking_Createfromdata_Input();
Booking_data bd = new Booking_Data();
bd.set<attributename>(<value>);
input.add(bd);
wdContext.nodeBapi_Flbooking_Createfromdata_Input().bind(input);
Regards,
Murtuza
Hi Murtuza,
I created an object of that..and that problem got solved.
I have one more dout regarding Insert and Update of data in sap R/3 database.
For ex-i am having a module where i have data of all grocery items.If i want to add some more items to my database should i need to import the same model again and call wdContext.currentPoOrder_Input.modelObject.execute()
Regards
Padma
Padma,
If your RFC accepts table as an input then you can give multiple records to be inserted in one go from WD and you don't have to import everytime as that is a single time process. You need to re-import if there is some change in RFC from back-end.
Just as we added a single element just in the previous reply we can add such multiple elements and then at the end only execute once.
Regards,
Murtuza
Hi Padma,
Bring the attribute '
GroupVisible
' to the context node, and change the code in doInit() as
public void wdDoInit()
{
//@@begin wdDoInit()
wdContext.currentContextElement().setGroupVisible(WDVisibility.NONE);
//@@end
}
I hope, This must sure work for you.
regards,
Prabhakar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
its a better approach if you create value attributes direclty rather than creating node and then attributes.
you are getting error because you are using visibilty property to an element which is not created yet.
so first wdcontext.createUIelement
add that uielement and try the same code
Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check and try changing the cardinality of the node 'UiElements'.
or
Keep the Visibility Attribute directlry under Context.
regards,
Prabhakar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi padma..
u r changing dynamically property of ui element...............
that has to be written in "do modify"
in do modify just write
if(first time)
{
your code
}
it will work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Padma,
Your UiElements node is not being populated and it is empty and thus it is resulting in an error. Where are you adding an element to this node in your application.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Padma
Did you used the following type for your <u><i>setGroupVisible</i></u> value attribute?
com.sap.ide.webdynpro.uielementdefinitions.Visibility
Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Padma,
If you have to just set the header and visibility property then don't put those attributes inside the node and have normal value attributes with the name GroupHeader and GroupVisibility
now you can directly set its value like this:
wdContext.currentContextElement().setGroupHeader("<value>");
wdContext.currentContextElement().setGroupVisibility(WDVisibility.VISIBLE);
//to make it visible
wdContext.currentContextElement().setGroupVisibility(WDVisibility.None);
//Invisible
Regards,
Murtuza
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.