on 02-12-2009 4:38 AM
Hi,
Where can I find sample program to display smartform as PDF in web dynpro java.
Thanks.
Regards,
Henry
1. Create a smart form in the R/3 side
2. Now create a function module with the corresponding export parameter:
3. Make sure that the function module is marked remote enabled.
4. In NWDS create an Adaptive RFC model which points to the FM created in R/3 under the webdynpro application
5. Now create an application and view inside it to display the PDF and Insert a frame inside the view
6. Create a value node and an attribute say url of type string inside that node and bind it to the source
7. In the doInit() method place the following code
> ZTest_Pdf_1_Input input = new ZTest_Pdf_Input();
> wdContext.nodeZTest_Pdf_Input().bind(input);
> try {
> wdContext.currentZTest_Pdf_InputElement().modelObject().execute();
> }
> catch (Exception e) {
> e.printStackTrace();
> }
> wdContext.currentInternalElement().setUrl(convert(wdContext.currentOutputElement().getBin_File()));
Inside that view create a method to convert the string to url so that it can be passed as a string to the setUrl method of the currentContextElement() , say convet(byte[] doc_content) which return a string.
Inside that methos write the following code,
> String url = "";
> WDWebResourceType webResType = WDWebResourceType.PDF;
> IWDWebResource webResource = WDWebResource.getWebResource(doc_content, webResType);
> try {
> url = webResource.getURL();
> }
> catch (Exception e) {
> e.printStackTrace();
> }
> return url;
Hope It will be helpful
Regards,
Sam Charles J.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use this wiki
https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdjava/tutorialWebDynproJavadisplayingasmartforminWDJ+applications&focusedCommentId=77005362
check www.saptechnical.com. with this name "
Displaying a Smart form as PDF in Enterprise portal using WebDynpro for Java" you will get complete blog...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
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.