on 06-05-2006 8:03 PM
I am creating webdynpro JAVA application to create RFQ, for which ABAP guy written a Custom BAPI called Z_BAPI_INQUIRY_CREATE. I tested this BAPI in SAPGUI it is working fine. From my webdynpro application when I passes header and item parameter, my header getting inserted but my item data is not. It is giving me error like "Table input parameter not found". I am passing table to this bapi. When I tried my code to standard BAPI's (NOT CUSTOM), I am able to insert both HEADER and ITEM data.
In above scenario I have few questions,
1. Is there anything extra we have to do with custom BAPI's? (my BAPIs are in BOR).
2. What is the datatype in webdynpro parallal to table parameter?
3. is there any tutorial available for table parameter? (except FLIGHT examle).
Thanks and regards,
Nitin
Hi,
There is nothing extra needed for the custom bapi.
Only thing is u should declare it as a RFC.
Here are the steps.
Steps:
1. First create an instance for bapi and bind the instance to the bapi node.
Z<bapi name> zb=new Z<bapi name>();
wdContext.nodeZ<bapi name>. bind(zb);
2. Then if u have the import parameter u have to set them by using
The instance of the above bapi.
Zb.set<import parameters>;
3. If the bapi has a table parameters then the structure for the table parameters will also be imported
In the model class.
4. Set the table parameters by creating the instance for that structure and using this instance set it.
Z<Struct>itm tab=new Z<Struct>();
Tab.set<table parameters>
5. Then add the structure instance to the bapi instance.
Zb.add(Tab);
6. Then Execute the bapi after setting the import parameters.
7. If there is any export parameters, then get the values after execution.
Best Regards,
Vijayakhanna Raman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijayakhanna Raman,
Thanks much for your reply.
Yes I did the same as you mentioned, but still I am getting an error "Table parameter not avaliable is empty".
I am not getting were is the bug. And this is happening only with ZBapi's not with Standard Bapi's.
I am really stucted becouse of this, answer will really get all 10 points.
Here is my code,
1. First create an instance for bapi and bind the instance to the bapi node.
Z_Bapi_Inquiry_Change_Input input = new Z_Bapi_Inquiry_Change_Input();
Zbapirfqitem item =new Zbapirfqitem();
wdContext.nodeBapi_RFQ_OnHold_Update_Input().bind(input);
2. Then if u have the import parameter u have to set them by using
input.setRfq_Number("6");
input.setCreated_By("NLNS0000");
//wdContext.currentBapi_RFQ_OnHold_Update_InputElement().modelObject().setRfq_Number("6");
//wdContext.currentBapi_RFQ_OnHold_Update_InputElement().modelObject().setCreated_By("NLNS0000");
3. If the bapi has a table parameters then the structure for the table parameters will also be imported In the model class.
DONE!
4. Set the table parameters by creating the instance for that structure and using this instance set it.
item.setUpdateflag("I");
item.setItm_Number("000030");
item.setMaterial("MAT-NITIN");
item.setMatl_Desc("Inserted by Nitin");
item.setQuantity(new BigDecimal(4));
item.setBase_Uom("PCE");
item.setReq_Qty(new BigDecimal(4));
item.setBase_Uom1("PCE");
item.setList_Price(new BigDecimal(3));
item.setList_Curr("");
item.setReq_Price(new BigDecimal(4));
item.setCurrency("EUR");
item.setIndirect_Price(new BigDecimal(4));
item.setCurrency_2("EUR");
item.setFinal_Price(new BigDecimal(4));
item.setCurrency_3("EUR");
item.setText_Line("");
item.setReq_Date_H(new Date(12-05-06));
item.setDirect_Dis(new BigDecimal(4));
item.setIndirect_Dis(new BigDecimal(4));
item.setFinal_Dis(new BigDecimal(4));
item.setProfit_Margin1(new BigDecimal(4));
item.setProfit_Margin2(new BigDecimal(4));
item.setBrand1("");
item.setModel1("");
item.setVal_Loccurr1(new BigDecimal(4));
item.setCurrency1("");
item.setBrand2("");
item.setModel2("");
item.setVal_Loccurr2(new BigDecimal(4));
item.setCurrency2("");
5. Then add the structure instance to the bapi instance.
input.addItem(item);
6. Then Execute the bapi after setting the import parameters.
//wdThis.wdGetContext().currentBapi_RFQ_OnHold_Update_InputElement().modelObject().execute();
input.execute();
Message was edited by: Nitin Kamble
Hi,
Check that u have created the instance for Z_Bapi_Inquiry_Change_Input but binded to
Bapi_RFQ_OnHold_Update_Input() and executed it.
if Bapi_RFQ_OnHold_Update_Input()is the bapi create instance for it and bind to that itself.
else Z_Bapi_Inquiry_Change_Input is the bapi create instance for it and bind to that itself and execute it.
Regards,
Vijay
Hi,
Check that u have created the instance for Z_Bapi_Inquiry_Change_Input but binded to
Bapi_RFQ_OnHold_Update_Input() and executed it.
if Bapi_RFQ_OnHold_Update_Input()is the bapi create instance for it and bind to that itself.
else Z_Bapi_Inquiry_Change_Input is the bapi create instance for it and bind to that itself and execute it.
Regards,
Vijay
Hi,
Check that u have created the instance for Z_Bapi_Inquiry_Change_Input but binded to
Bapi_RFQ_OnHold_Update_Input() and executed it.
if Bapi_RFQ_OnHold_Update_Input()is the bapi create instance for it and bind to that itself.
else Z_Bapi_Inquiry_Change_Input is the bapi create instance for it and bind to that itself and execute it.
Regards,
Vijay
Hi Ritesh,
I am facing the same problem.
I'm getting zero records, but it should be 20 records.
How did you solve it?
The following is my code.
I'm passing a table as input with values like tablename, fieldname to populate values in dropdownbyindex.
Z_Field_Value_Request_Input input = new Z_Field_Value_Request_Input();
wdComponentAPI.getMessageManager().reportSuccess("1");
wdContext.nodeZ_Field_Value_Request_Input().bind(input);
//To retrieve Requestor info
Zf4_Help objRequestor = new Zf4_Help();
objRequestor.setKey_Fld("bname");
objRequestor.setVal_Fld("bname");
objRequestor.setTabname("USR01");
objRequestor.setOrdertxt("bname");
input.addInput_Tab(objRequestor);
wdThis.wdGetWorkOrderCustomControllerController().executeZ_Field_Value_Request_Input();
int size1 = wdContext.nodeReturn_Tab().size();
wdComponentAPI.getMessageManager().reportSuccess(String.valueOf(size1));
Thanks
Sundar
hi,
i need create a table at runtime mode in webdynpro.
i have one model node and need create a any instances for this model node to create my table and consequently send to rfc.
Please, help-me in my question...
regards
Douglas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nitin,
How did the problem resolved. What was the reason for your error..?.
Thank you and regards
Maruti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have you asked you ABAP guy to check that the FM is really released via transaction SE37? Also, ask your ABAP guy to check SWO1 and ensure that the interface parameters are defined correctly.
Cheers,
Rich
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check that u have created the instance for Z_Bapi_Inquiry_Change_Input but binded to
Bapi_RFQ_OnHold_Update_Input() and executed it.
if Bapi_RFQ_OnHold_Update_Input()is the bapi create instance for it and bind to that itself.
else Z_Bapi_Inquiry_Change_Input is the bapi create instance for it and bind to that itself and execute it.
Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijay,
I did the same as you said, but still getting same error.
Here is my change,
1. Binding.
wdContext.nodeZ_Bapi_Inquiry_Change_Input().bind(new Z_Bapi_Inquiry_Change_Input());
2. Setting input param
wdContext.currentZ_Bapi_Inquiry_Change_InputElement().modelObject().setRfq_Number("6");
wdContext.currentZ_Bapi_Inquiry_Change_InputElement().modelObject().setCreated_By("NLNS0000");
3. Setting table
Zbapirfqitem item =new Zbapirfqitem();
item.setUpdateflag("I");
item.setItm_Number("000030");
item.setMaterial("MAT-NITIN");
item.setMatl_Desc("Inserted by Nitin");
item.setQuantity(new BigDecimal(4));
item.setBase_Uom("PCE");
item.setReq_Qty(new BigDecimal(4));
item.setBase_Uom1("PCE");
item.setList_Price(new BigDecimal(3));
item.setList_Curr("");
item.setReq_Price(new BigDecimal(4));
item.setCurrency("EUR");
item.setIndirect_Price(new BigDecimal(4));
item.setCurrency_2("EUR");
item.setFinal_Price(new BigDecimal(4));
item.setCurrency_3("EUR");
item.setText_Line("");
Date mydate=null;
item.setReq_Date_H(mydate);
item.setDirect_Dis(new BigDecimal(4));
item.setIndirect_Dis(new BigDecimal(4));
item.setFinal_Dis(new BigDecimal(4));
item.setProfit_Margin1(new BigDecimal(4));
item.setProfit_Margin2(new BigDecimal(4));
item.setBrand1("");
item.setModel1("");
item.setVal_Loccurr1(new BigDecimal(4));
item.setCurrency1("");
item.setBrand2("");
item.setModel2("");
item.setVal_Loccurr2(new BigDecimal(4));
item.setCurrency2("");
4. Adding table
wdContext.currentZ_Bapi_Inquiry_Change_InputElement().modelObject().addItem(item);
5. Exec
wdContext.currentZ_Bapi_Inquiry_Change_InputElement().modelObject().execute();
Thanks much,
Nitin
Message was edited by: Nitin Kamble
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.