on 06-30-2009 5:31 PM
Hi Experts,
I am using following code to get data from backend. I am getting only 1 record from the back end. When I am executing the same BAPI using se37, I can see 28 records. Can you please let me know what is going wrong here? I have done proper context mapping etc. I am NOT new for Web Dynpro.
Regards,
Gary
public void executeData( )
{
//@@begin executeData()
BigDecimal a ;
a = BigDecimal.valueOf(0);
Bapi_Orgunitext_Data_Get_Input input = new Bapi_Orgunitext_Data_Get_Input();
wdContext.nodeBapi_Orgunitext_Data_Get_Input().bind(input);
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setScenario("MDT1");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setObjid("50050585");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setPlvar("01");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setKeydate(new java.sql.Date(System.currentTimeMillis()));
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setEvalpath("o-s-p");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setEvaldepth(a);
try {
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().modelObject().execute();
wdContext.nodeOutput_orgunit().invalidate();
}
catch (Exception e) {
wdComponentAPI.getMessageManager().reportException("error while getting orgunit from Bapi_Orgunitext_Data: " +e.getLocalizedMessage(), false);
}
Hi Gari,
Your code looks fine.
Are you sure about the test case gives 28 records in SE 37?
You are passing current date for "keydate" field!
Finally, I hope you bound the exact node which contains BAPI return data to the 'Table'. Can you post the output node structure?
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jaya,
I printed the size of model node immediately after execute BAPI. Its value is 1. The first record is being returned. I am not using supply function.
Hi Nikhil,
I am sure that using se37, I can see 28 records.Keydate is correct i.e. today's date
Hi Murali,
All records are unique record in backend. Also we are using SAP standard BAPI. So, the BAPI has been coded correctly.
Hi Lokesh,
The table data source is correct - Bapi_Orgunitext_Data_Get_Input.Output_orgunit.Actortab. Table data source property is the output node of BAPI.
Hi Santosh, Ponraj
The exact code is as below
BigDecimal a ;
a = BigDecimal.valueOf(0);
Bapi_Orgunitext_Data_Get_Input input = new Bapi_Orgunitext_Data_Get_Input();
wdContext.nodeBapi_Orgunitext_Data_Get_Input().bind(input);
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setScenario("MDT1");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setObjid("50050585");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setPlvar("01");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setKeydate(new java.sql.Date(System.currentTimeMillis()));
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setEvalpath("o-s-p");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setEvaldepth(a);
try {
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().modelObject().execute();
wdContext.nodeBapi_Orgunitext_Data_Get_Input().size();
wdComponentAPI.getMessageManager().reportSuccess("size "+wdContext.nodeBapi_Orgunitext_Data_Get_Input().size());
wdContext.nodeOutput_orgunit().invalidate();
}
catch (Exception e) {
wdComponentAPI.getMessageManager().reportException("error while getting orgunit from Bapi_Orgunitext_Data: " +e.getLocalizedMessage(), false);
}
Thanks every one. Kindly help me.
Regards,
Gary
Gary, You wrote that your table data source is Bapi_Orgunitext_Data_Get_Input.Output_orgunit.Actortab
so, can u print
wdContext.nodeActortab().size();
instead of printing
wdContext.nodeBapi_Orgunitext_Data_Get_Input().size();
Sure that would also be 1 as the main node size is also one.Still try.
Also Can you print the values by getElement(0, 1 etcs).
Is the cardinality of nodeActortab "o to n" in your view's context?
Try to create a local value node. After executing the FM, copy the values from Actortab to this local value node and see. Map your table's data source to this value node and change your table's "VisibleRowCount" property as "-1".
Before you try local value node, I suggest you check the "length" of these two input fields both in R3 and WebDynpro.
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setObjid("50050585");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setPlvar("01");
If the length of Plvar is 8 in the FM in R3, then instead of passing "01" as input in your code, please pass "00000001". Try this kind of correction for both of your numeric inputs.
Because, when you execute with same inputs in SE37, internally ABAP will append the necessary number of zeros and execute. Whereas in a remote call like portal, we have to manually append the zeros.
Edited by: Kavitha on Jul 1, 2009 2:55 PM
ok
Edited by: Preeti Kaur on Jul 1, 2009 4:15 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I guess there is some problem with the input you are passing from WebDynpro.
Check whether you are giving the same input while testing in R/3?
Regards,
Charan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thanks a lot. The issue got resolved. The input parameters are case sensitive.
Using the following code issue got resolved. Points awarded
Regards,
Gary
BigDecimal a ;
a = BigDecimal.valueOf(0);
Bapi_Orgunitext_Data_Get_Input input = new Bapi_Orgunitext_Data_Get_Input();
wdContext.nodeBapi_Orgunitext_Data_Get_Input().bind(input);
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setPlvar("01");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setOtype("O");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setObjid("50050585");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setKeydate(new java.sql.Date(System.currentTimeMillis()));
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setScenario("MDT1");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setEvalpath("O-S-P");
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setEvaldepth(a);
// wdContext.currentBapi_Orgunitext_Data_Get_InputElement().setOtype("0");
try {
wdContext.currentBapi_Orgunitext_Data_Get_InputElement().modelObject().execute();
wdComponentAPI.getMessageManager().reportSuccess("size "+wdContext.nodeStructuraldata().size());
wdContext.nodeOutput_orgunit().invalidate();
}
catch (Exception e) {
wdComponentAPI.getMessageManager().reportException("error while getting orgunit from Bapi_Orgunitext_Data: " +e.getLocalizedMessage(), false);
}
hi gary
to solve your problem and come out of the confusion , can you please provide the structure , node name and paramteres inthe so that every one understand .
can you provide the input and output node you are using ,
and have you debugged you webdynrpo application , have you put the external debugging and check whether the parameter you are passing are send to the RFC .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gary,
I hope you bind the model node to a table in the view to see the result.
Print the size of that particular node (model node) immediatley after executing the BAPI.
Are you using any supply function?
Also, which record is coming in your view out of 28 records? Is it the first record or last record or randomly it is coming?
Regards,
Jaya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
does the records in the backend table which are about 28 , are these unique or all the 28 records are same , i mean some times it happens that Abaper may create duplicate records
inthe table , but during populating the table you will see only one record , or
you can go for external debugging of your webdynpro application with the help of your abaper and check whether you are able to send the table to the RFC correctly if there is some thing
as such . if there are any inputs that need to be passes toRFC , you can test your RFC inthe backend with some test data and you can use the same data as hard cord values and test the
application in the backend.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How are you printing the output of the BAPI in webdynpro.
If you have written some code please post the same.
Try binding the output node which contains 28 records to the Data source of any table and see the output.
Let us know for any problems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check printing the output node size whether it is returning the same 28 records or not.
If you are using a atble to show the output and if you are facing the error.
Try the following it may help you.
Table data source property to the output node of ur BAPI.
Thanks & Regards,
Lokesh
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.