on 03-01-2005 11:28 AM
Hi,
I have a Web Dynpro application which will call an R/3 RFC that returns a PDF file.
1) Is it possible to pass parameters dynamically (For eg userid of the person who has logged onto the portal) from webdynpro to a RFC? If yes, how?
Thanks in advance.
Jayesh
Hi Jayesh,
I saw you have made an RFC that returns a PDF file from back end R/3. Can you give me an exmaple as to how to do that in the RFC. I think once you are returning it from the BAPI I can bind it to a binary variable in WDP and use it. Please correct me if i am wrong
Regards
Jay Kapadia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jayesh,
you have to have the parameter in the BAPI signature. So when you create the model in Web Dynpro a corresponding model attribute will also get created in your model node structure. After that just create context mapping between this model attribute and the component context's attribute and then from component context to view contxt. So whenever you populate some data in the view context attribute it will be populated in the corresponding attribute of the model. And when you call the execute method of the model proxy this paramter value will be automatically passed to the RFC.
Regards,
Shubhadip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply, Shubhadip. The user id that I want to pass is not something that will be entered by the user.
My question is how do we get the userid of the person who has logged in (some method or code) and where do we write that code? If you could give me that it would be extremely helpful.
Thanks in advance.
Jayesh
Hi Jayesh,
for catching the current user you can use the following code block..
try{
IWDClientUser user = WDClientUser.getCurrentUser();
if(user.isAnonymousUser()){
//User is anonymous .. do something...
}else{
//user is authenticated..do something
}
}catch(WDUMException e){
//do something...
}
Hope it helps!!!
Shubhadip
Hi,
if you get the user details from this IWDClientUser object, then you can set the user details values (such as user name or something) in the view context attributes and can pass them to the RFC by context mapping as I said in the first message.
If you get your problems solved let us know in detail and dont forget to reward points )
regards,
Shubhadip
Hi Jayesh,
hope you are using NWDS. Please add the following import statements in your code
import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
import com.sap.tc.webdynpro.services.sal.um.api.WDUMException;
hope it solves your problem.
Regards,
Shubhadip
Hi Jayesh,
use the following tutorial to see how to pass parameter values to R/3 functions.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/creating a web dynpro application accessing abap functions.pdf
regards,
Shubhadip
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.