on 09-25-2005 5:42 PM
Hi, I have a little Problem, I hope that you can help me.
i have the following structure (in the View)
->Zbapi_Requisition_Change_Input (Model Node, from bapi, RFC)
--> Requisition_Items_Change (Model Node, table in the Bapi)
-
> Currenci (Model Atribut, from table, in bapi)
-
> Prq_No (Model Atribut, from table, in bapi)
-
> Preq_Item (Model Atribut, from table, in bapi)
-
> Etc...
--> Number (Model Atribut, import from bapi)
now, i Have another structure, a Value Node
-> GetDetailData (value Node)
---> Currenci (Value Atribut)
---> Prq_No (Value Atribut)
---> Preq_Item (Value Atribut)
---> Number (Value Atribut)
---> etc...
this Value node is populate from OVS, but this is not a problems.
The Value node have the value that i need for execute the Bapi Requisition Change (not all).
Then, i need populate de Zbapi_Requisition_Change_Input , whit the GetDetailData value ( the user can change this, via inputfield, in Form)
I write the following sentence in the view:
wdContext.currentZbapi_Requisition_Change_InputElement().setNumber(wdContext.currentGetDetailDataElement().getPreq_No());
this work fine, it populate de input field "Number", because the Number is "Import" form bapi, is not a "table".
My problem, is when i need populate the table "Requisition_Items_Change" (Necessary to execute the Bapi), i put this:
wdContext.nodeZbapi_Requisition_Change_Input().nodeRequisition_Items_Change().currentRequisition_Items_ChangeElement().setPreq_Item(wdContext.currentGetDetailDataElement().getPreq_Item());
this have the same logical that anterior, but don't work, result a "JaVaNullPoint Exception"
why happens this??? to set a value in a table, I need another procedure???
Please help me, i need your knowledge...
regards...
Hi Antonio,
I feel, your code should look some thing similar to the below:
Assume that BAPI 'Zbapi_Requisition_Change' uses a table 'Requisition_Items_Change' of some type 'ZTAB' .
Zbapi_Requisition_Change_Input input = new Zbapi_Requisition_Change_Input () // create an instance of the Input class;
ZTAB table = new ZTAB();
//if you do not know table type of 'Requisition_Items_Change' , check the function input.addRequisition_Items_Change(<table type>)
table.set<property1>(<your-value>);
.
.
table.set<propertyn>(<your-value>););
input.addRequisition_Items_Change(table);
wdcontext.currentZbapi_Requisition_Change_InputElement.bind(input);
Now execute the BAPI using the following line
wdContext.currentZbapi_Requisition_Change_InputElement().modelObject().execute();
wdContext.nodeOutput.invalidate()
// clears the old value in the output node
Hope this helps,
Best Regards,
Nibu.
Message was edited by: Nibu Wilson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks by the help!
It´s Ok with the table
Thanks Nibu! and all ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, thanks for its answers.
Some Considerations:
I cannot do "model.setRequisition_Items_Change(new ());"
Because de Structure type for setRequisition_Items_Change is "Abstract", and it does not allow to assign it.
The other opcion, to create a table, perhaps can work, but i have a problem.
This sentence, I have to execute from "Custom Controller":
Zbapi_Requisition_Change_Input input = new Zbapi_Requisition_Change_Input();
ZTAB table = new ZTAB(); (ZTAB is ZBapiebanv)
table.set), is in the view...
then ¿How i cant invocate this value, which are storage in "view", from "Custom controller"???
another thinks.. the option
wdcontext.currentZbapi_Requisition_Change_InputElement.bind(input); does not appear
is the same that wdContext.nodeZbapi_Requisition_Change_Input().bind(input); ???
thanks a lot for your help
Message was edited by: Antonio Villagran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Antonio,
Do one thing.
Write following code before your code for setting Preq_Item()
ele = wdcontext.createRequisition_Items_ChangeElement();
wdcontext.nodeRequisition_Items_Change().addelement(ele);
Now, write following code.
wdContext.nodeZbapi_Requisition_Change_Input().nodeRequisition_Items_Change().currentRequisition_Items_ChangeElement().setPreq_Item(wdContext.currentGetDetailDataElement().getPreq_Item());
Regards,
Bhavik
helo Antonio,
i think here u want to send an internal table to the Bapi. for that u have to create Objects of table ie.
Requisition_Items_Change obj = new Requisition_Items_Change();
obj.set<attribute>(" ");
model.add(obj);
create n number of obj that u want to pass to Bapi.
hope this might help u.
Regards,
Piyush.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Antonio,
At the time of initialization of your model structure you also need to initialize your Requisition_Items_Change structure.
Like,
Zbapi_Requisition_Change_Input model = new Zbapi_Requisition_Change_Input();
model.setRequisition_Items_Change(new <structure type>());
wdcontext.nodeZbapi_Requisition_Change_Input().bind(model);
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Antonio,
I think the null pointer is because the node Requisition_Items_Change is not there. So when you are trying to set a value to the attribute its throwing the null pointer exception. Try creating a new element of the Requisition_Items_Change node and then set the value to the node.
Regards
Prakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.