on 07-31-2008 5:48 AM
Hi ,
I am passing data from webdynpro to function module.
I put the below code in action and I am passing flags also.
Please check the code
wdContext.currentZfxx_abc_clas_Validations_InputElement().setP_V_Header(null);
wdContext.currentZfxx_abc_clas_Validations_InputElement().setP_V_Details(null);
String acctDocNumber = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_AcctDocNumber();
Date docDate = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_DocDate();
String docType = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_DocType();
String fisclaYear = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_FiscalYear();
boolean postInPrev = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_PostInPrev();
String refDocNumber = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_RefDocNumber();
String companyCode = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_CompanyCode();
String docHeaderText = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_DocHeaderText();
String reason = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_Reason();
String currencyKey = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_currencyKey();
String fiscalPeriod = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_FiscalPeriod();
Date postingDate = wdContext.currentCtx_vn_HeaderDetailsElement().getCtx_va_PostingDate();
IPrivateHeaderInfoView.ICtx_vn_HeaderDetailsNode headerDetails = wdContext.nodeCtx_vn_HeaderDetails();
validationInput = new Zfxx_abc_Hd();
wdComponentAPI.getMessageManager().reportSuccess("-- 1 ");
validationInput.setBelnr(acctDocNumber);
validationInput.setBktxt(docHeaderText);
validationInput.setBldat(docDate);
validationInput.setBlart(docType);
validationInput.setGjahr(""+fisclaYear);
validationInput.setBudat(postingDate);
validationInput.setMonat(""+fiscalPeriod);
validationInput.setPost_Prev_Per(postInPrev);
validationInput.setXblnr(refDocNumber);
validationInput.setBukrs(companyCode);
validationInput.setReason(reason);
validationInput.setWaers(currencyKey);
wdThis.wdGetHeaderInfoCompController().executeZfxx_abc_Validations();
wdComponentAPI.getMessageManager().reportSuccess("Data Successfully Copied");
In the //begin and //end
I write the code
Zfxx_abc_Validations_Input input = new Zfxx_abc_Validations_Input();
Zfxx_abc_Hd validationInput;
the functionmodule is executed but values are not passing.
Please helpme out.
Thanks
Risha
Hi,
add this statement before calling rfc
input.set<Node Name which contains the attributes>(validationInput);
the sample code to pass information is like below
Zfxx_abc_Validations_Input input = new Zfxx_abc_Validations_Input();
wdContext.nodeZfxx_abc_Validations_Input().bind(input);
Zfxx_abc_Hd validationInput;
validationInput = new Zfxx_abc_Hd();
validationInput.setBelnr(acctDocNumber);
validationInput.setBktxt(docHeaderText);
validationInput.setBldat(docDate);
..........
input.set<Node Name which contains the attributes>(validationInput);
wdThis.wdGetHeaderInfoCompController().executeZfxx_abc_Validations();
Regards,
ramesh
Edited by: Ramesh Babu V on Jul 31, 2008 10:32 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I am not geting any errors. But values are not passed. After executing function module I am getting success message. I am giving invalid data for that also getting success message.
In Return table im checking errors after executing function module if errors are in table the it will print the error messages in webdynpro.
But errors are not displaying.
Please help me out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
after instantiating validationInput = new Zfxx_abc_Hd();
where are you binding validationInput?
I think you are missing here.
after setting values try adding that to node
wdContext.nodeZfxx_abc_Hd().bind(validationInput);
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check whether your FM is taking "X" as a flag in the r/3. what are the correct values you need to pass for this flag?
also write this code for setting flags after binding the input
i.e. write after
Zfxx_abc_Validations_Input input = new Zfxx_abc_Validations_Input();
wdContext.nodeZfxx_abc_Validations_Input().bind(input);
PradeeP
Hi,
You have to bind the funtion module input node... see the below code for flight list bapi, given by sap
public void wdDoInit()
{
//@@begin wdDoInit()
// Create a new element in the Bapi_Flight_Getlist_Input node
Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();
wdContext.nodeBapi_Flight_Getlist_Input().bind(input);
// Create new elements in the Destination_From and Destination_To nodes
input.setDestination_From(new Bapisfldst());
input.setDestination_To(new Bapisfldst());
}
after this you can set , get the values.
and also in your code i could see that, you are getting the values before executing the bapi. and also invalidate() the node after executing the bapi.
context. node<your node>.invalidate();
first you have to bind, then set the values to bapi, then execute the bapi and then get the values from bapi (output).
PradeeP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
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.