How to display smartform as PDF in web dynpro java
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.
Similar Messages
-
How to display an error Message in Web Dynpro
Hello,
I want to display an error message in Web Dynpro. I'm using this,
IWDMessageManager message = wdComponentAPI.getMessageManager();
message.reportSuccess("<some relevant debug message>");
However, the message is always shown at the bottom of the screen. It is possible to select the location in the screen for showing this object? Or what is the best way for doing this? I've tried to use a Label but I can't set the type (warning, error, info) it's only a message.
Thanks
Regards
SUHi,
If you include the UI, it will display at the top of the screen..
Please see below how to create a message in the message editor.
http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
and this is how you access the error message in the application ti display it to the end user
http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
Regards,
Ganesh N -
Reading and displaying Ms.Word document with web dynpro java
Hi,
I'm using NetWever developer studio 7..0.21.
I'm developing web dynpro java application.I'm in difficulty to read and display word document with its original format in web dynpro view. Is it possible?
If possible , is there a blog etc.?
Thanks.Hello,
You have to use the Office Integration Library. Please, follow the documentation below:
http://help.sap.com/saphelp_nw04/helpdata/en/c3/32853febec3c17e10000000a114084/frameset.htm
I hope this helps you.
Regards,
Blanca -
Smartform as PDF in Web Dynpro for ABAP
Hello Experts,
I have developed one Web Dynpro application in which i am trying to show PDF converting from smart from on button click.
I am seeing blank screen when i try to display PDF? But when i check i debugging data passed successfully to context element.
PDF source property mapped to review context element.
I used below code to show PDF in view method:
call function 'SSF_FUNCTION_MODULE_NAME'
call function lv_fm_name
call function 'SSFCOMP_PDF_PREVIEW'
call function 'CONVERT_OTF'
elem_pdf->set_attribute(
exporting
name = `SOURCE`
value = data ).
Thanks
Rajesh YadlaLooks quite alright, but since you only have provided a few function modules, there is 'no' way of telling what is going wrong. I can however give you a link and compare your coding with the one from the tutorial:
[How to display a smartform as PDF in WD4A|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785] -
How to display Popup message in ABAP Web Dynpro
Hi All,
Is it possible to display popup messages like SAP to collect information from the user? is it possible to display information messages like SAP? If possible, Please let me know how to handle in Web Dynpro.
Thanks & Regards,
IA Kumar.Agree with the two firend on my head :).
you can find a demo from: SWDP_TEST(package)--> WDR_TEST_POPUPS also.
I have a lazy idea, two step:
1. create a popup function module;
2.call the function module;
function module:--Begin--
FUNCTION ZFUNM_CONFIRM .
""Local interface:
*" IMPORTING
*" REFERENCE(P_API) TYPE REF TO IF_WD_VIEW_CONTROLLER
*" REFERENCE(P_CMP_API) TYPE REF TO IF_WD_COMPONENT
DATA:
L_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER,
L_CMP_API TYPE REF TO IF_WD_COMPONENT,
L_API_MAIN TYPE REF TO IF_WD_VIEW_CONTROLLER,
L_POPUP TYPE REF TO IF_WD_WINDOW,
L_TEXT TYPE STRING_TABLE.
wd_this type ref to IF_MAIN,
wd_comp_controller TYPE REF TO IG_COMPONENTCONTROLLER.
l_api_main = wd_this->wd_get_api( ).
l_cmp_api = wd_comp_controller->wd_get_api( ).
L_WINDOW_MANAGER = P_CMP_API->GET_WINDOW_MANAGER( ).
APPEND 'POPUP text' TO L_TEXT.
L_POPUP = L_WINDOW_MANAGER->CREATE_POPUP_TO_CONFIRM(
TEXT = L_TEXT
BUTTON_KIND = 4
MESSAGE_TYPE = 1
CLOSE_BUTTON = ''
WINDOW_TITLE = 'messagebox Title'
WINDOW_LEFT_POSITION = L_CONF_CONTEXT-WINDOW_LEFT_POSITION
WINDOW_TOP_POSITION = L_CONF_CONTEXT-WINDOW_TOP_POSITION
WINDOW_POSITION = L_CONF_CONTEXT-WINDOW_POSITION
WINDOW_WIDTH = L_CONF_CONTEXT-WINDOW_WIDTH
WINDOW_HEIGHT = L_CONF_CONTEXT-WINDOW_HEIGHT
L_POPUP->SUBSCRIBE_TO_BUTTON_EVENT(
BUTTON = IF_WD_WINDOW=>CO_BUTTON_YES
ACTION_NAME = 'YES'
ACTION_VIEW = P_API
IS_DEFAULT_BUTTON = ABAP_TRUE ).
L_POPUP->SUBSCRIBE_TO_BUTTON_EVENT(
BUTTON = IF_WD_WINDOW=>CO_BUTTON_NO
ACTION_NAME = 'NO'
ACTION_VIEW = P_API
IS_DEFAULT_BUTTON = ABAP_FALSE ).
L_POPUP->OPEN( ).
ENDFUNCTION.
function module:--End--
call the function module Begin----
METHOD ONACTIONDELETE .
DATA:
L_API TYPE REF TO IF_WD_VIEW_CONTROLLER,
L_CMP_API TYPE REF TO IF_WD_COMPONENT,
NODE_ZTAB_PROJ TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_ZTAB_PROJ TYPE REF TO IF_WD_CONTEXT_ELEMENT,
STRU_ZTAB_PROJ TYPE IF_ZV_PROJ_DISPLAY=>ELEMENT_ZTAB_PROJ,
SELECTED_ELEM TYPE WDR_CONTEXT_ELEMENT_SET .
navigate from <CONTEXT> to <ZTAB_PROJ> via lead selection
L_API = WD_THIS->WD_GET_API( ).
L_CMP_API = WD_COMP_CONTROLLER->WD_GET_API( ).
CALL FUNCTION 'ZFUNM_CONFIRM'
EXPORTING
P_API = L_API
P_CMP_API = L_CMP_API.
IF WD_THIS->A_DEL = ''.
EXIT.
ENDIF.
NODE_ZTAB_PROJ = WD_CONTEXT->GET_CHILD_NODE( NAME = IF_ZV_PROJ_DISPLAY=>WDCTX_ZTAB_PROJ ).
IF ( NODE_ZTAB_PROJ IS INITIAL ).
EXIT.
ENDIF.
ELEM_ZTAB_PROJ = NODE_ZTAB_PROJ->GET_LEAD_SELECTION( ).
ELEM_ZTAB_PROJ->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = STRU_ZTAB_PROJ ).
DELETE FROM ZTAB_PROJ
WHERE COMCODE = STRU_ZTAB_PROJ-COMCODE
AND PROJID = STRU_ZTAB_PROJ-PROJID.
WD_THIS->ONACTIONSELECT(
WDEVENT = WDEVENT " Ref to cl_Wd_Custom_Event
LOOP AT selected_elem .
ENDLOOP.
ELEM_ZTAB_PROJ
@TODO handle not set lead selection
alternative access via index
Elem_Ztab_Proj = Node_Ztab_Proj->get_Element( Index = 1 ).
@TODO handle non existant child
if ( Elem_Ztab_Proj is initial ).
endif.
get all declared attributes
ELEM_ZTAB_PROJ->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = STRU_ZTAB_PROJ ).
ENDMETHOD.
call the function module End---- -
How to display work flow log in web dynpro
Hi
I generated a list of users work flow in web dynpro abap now i wanted to display log as it appears in standard report using method cl_swf_rdg_dispatcher=>execute_dialog_request but when i run it it give me below mention error
"Screen output without connection to user. "
code is as follows
DATA: ls_por TYPE sibflpor.
ls_por-INSTID = lv_wi_id. "8177
ls_por-CATID = 'BC'.
CALL METHOD cl_swf_rdg_dispatcher=>execute_dialog_request
EXPORTING
im_por = ls_por
im_function = 'DISP'
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.>
Ammad Zaman wrote:
> is there any container available to display ABAP screen ? as it is available for ALV
No. There is no container for displaying SAPGUI inside of Web Dynpro. The closest you could get to this would be the SAPGUI for HTML running inside an iFrame, but that is completely different than what you are talking about (and also not recommended). Dynpro/SAPGUI output is a very different technology thatn Web Dynpro and the two can't be mixed directly. You need to find a way to extract the data you need without any calls to visualize it. -
Generate Adobe Interactiveform pdf using Web Dynpro Java API.
I created pdf form by using standard "InteractiveFormElement" and it is displaying correctly in browser.
Now there is a requirement to provide url link to the same pdf that is displayed with InteractiveFormElement. To generate pdf, I was doing something the below.
//Copied XDP file from the srcconfigurationcomponents<package><file>.xdp
//to srcmimiescomponents<package><file>.xdp
try {
templateUrl = WDURLGenerator.getWebResourceURL(
wdComponentAPI.getDeployableObjectPart(),
"CompView_InteractiveForm.xdp");
} catch (WDURLException e) {
IWDPDFDocumentCreationContext pdfContext =
WDPDFDocumentFactory.getDocumentHandler().getDocumentCreationContext();
pdfContext.setData(
WDInteractiveFormHelper.getContextDataAsStream(wdContext.nodeDataNode()));
pdfContext.setTemplate(templateUrl);
IWDPDFDocument pdf = null;
try {
pdf = pdfContext.execute();
} catch (WDPDFDocumentRenderException e) {
wdComponentAPI.getMessageManager().reportException(
"pdfContext.execute() " + e.getLocalizedMessage(), false);
IWDPDFDocument.execute() is raising exeception "Template used in PDF render
operation is invalid or cannot be found". template url is indeed correct. I checked by
assigning to that url to linkToUrl Element and opening the xdp file.
Please help me to identify the issue. Thank you.Hi Ajay,
Use getResourcePath instead of getWebResourceURL
templateUrl = WDURLGenerator.getResourcePath(
wdComponentAPI.getDeployableObjectPart(),
"CompView_InteractiveForm.xdp");
Thanks
Ram -
How to disable calculator value help in Web Dynpro Java
Hello ,
Does anyone know if it's possible in CE 7.2 to disable the automatic help calculator when using input fields of the type integer or decimal?
I ve done SAP Note 1406153 in server. But it doesnt work.. value help is still appear..
Best Regards,
Rasim1. 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. -
How to use the date picker in Web dynpro java
Hi,
I want to add date picker to enter a date while developing webdynpro application.
How can i do that.
Regards,
H.V.SwathiHi,
its very simple...
take a input field and map it to the attribute which data type is of "date". thats it at runtime you will see a input filed with date picker.
i.e. Add an inputField and bind the context attribute of Type Date to it
this will show the date picker on screen.
PradeeP -
Problem in displaying smartform as pdf in portal
Hi all,
We created a smartform and we are displaying as a pdf in portal.Everything is fine and pdf is coming.But there is arabic data in the form .
Some of the arabic data is coming perfectly.
But some data is coming in Japanese or chinese and some data is coming like
F,D'! 9(/'D1-EF (F 5'D- 'D3JA 叉â
Department 'D%/'1) 'D9'E) DDEH'1/ 'D(41J).
Please let me know what could be the problem.
Thanks and Regards,
Rajeshhi Rajesh.....
Could you explain me how 2 display SMARTFORM as PDF in portal..... please.....
I have the requirement as follows.....
By pressing a button the smartform must be generated.....
SO what must be the RFC o/p from ABAP.... I am ABAPER basically
and what the portal guys must do.....
pleaseeee -
Adobe interactive forms in web Dynpro java
Hi Everyone,
I am new to webDynpro development and as I am working on Interactive forms, I need pdf's and related materials for the same.
I mean pdf's for how to create Adobe interactive forms in web Dynpro java.
Thanks in advance.Go Through the following document.
It will give you good overview.
Interactive Forms-->Functionality
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0401535-f81c-2a10-0192-ffd41e8e8d59
Cheers
Satya -
Programming Key Functions in Web Dynpro Java
Hi, "Amigous"
How can I Programming Key Functions in Web Dynpro Java, like F1, F2, F3...??
Thanks in advance.
P:D. I don´t have Swine Flu.Hi,
Please see the below link.
[http://www.octavia.de/fileadmin/octavia_files/content_bilder/Hauptnavigation/SAP_NetWeaver/WebDynpro/Web_Dynpro_Part_I.pdf]
Regards
Krishna -
Kill the RFC connection as soon as the call is completed in Web Dynpro JAVA
Hi Experts,
Please guide us how to kill the RFC Connection from web dynpro java as soon as the execution is completed.The FM connection (Adaptive RFC) isnt getting closed in IS-U side. Please guide us how to close them explicitly.
We are getting the following error
(102) RFC_ERROR_COMMUNICATION max number of cpic clients exceeded (300)hi suvankar ,
wdContext.current<Modelname>_InputElement().modelObject().modelInstance().disconnectIfAlive();
use this option after executing your rfc, it will remove the connection to the r/3.
adn this
(102) RFC_ERROR_COMMUNICATION max number of cpic clients exceeded (300) -- is occuring because the pool size defined the jco destination is not sufficient, ask your basis team to increase the pool size.
Regards
Govardan -
In R/3 display smartform as pdf in a custom container
Hello,
I want to display smartform as pdf in a custom contianer . I was able to find all the right code from sdn.
but my problem is that when executed my sap gui is closed without any error.
I am unable to understand what is going wrong.
CALL METHOD G_HTML_CONTROL->SHOW_URL( URL = LV_URL
IN_PLACE = 'X' ). does not show the pdf.
Can any one help me to find out if we need to do some setting for MIME type application/pdf. Because I tried to display a bar chart in the custom container of MIME type text/html , and this is working fine.
Is any setting missing in our R/3 because of which the code is not getting executed.
below code is the exact copy from a post in sdn:
report ztest_pdf.
DATA: LT_PDF TYPE TABLE OF TLINE,
LS_PDF LIKE LINE OF LT_PDF,
LV_URL TYPE CHAR255,
PDF_FSIZE TYPE I,
LV_CONTENT TYPE XSTRING,
LT_DATA TYPE STANDARD TABLE OF X255.
DATA : L_JOB_OUTPUT_INFO TYPE SSFCRESCL.
DATA : LS_CONTROL_PARAM TYPE SSFCTRLOP.
DATA : G_HTML_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
G_HTML_CONTROL TYPE REF TO CL_GUI_HTML_VIEWER.
* pdf_control type ref to cl_gui_pdfviewer.
DATA : P_VBELN TYPE VBELN_VL.
DATA : i_html TYPE w3htmltabtype.
", g_url TYPE w3url
FIELD-SYMBOLS <FS_X> TYPE X.
INITIALIZATION.
LS_CONTROL_PARAM-GETOTF = 'X'.
LS_CONTROL_PARAM-NO_DIALOG = 'X'.
START-OF-SELECTION.
CALL FUNCTION '/1BCDWB/SF00000298'
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = LS_CONTROL_PARAM
* P_VBELN = P_VBELN
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
IMPORTING
* DOCUMENT_OUTPUT_INFO = L_DOCUMENT_OUTPUT_INFO
JOB_OUTPUT_INFO = L_JOB_OUTPUT_INFO
* JOB_OUTPUT_OPTIONS = L_JOB_ OUTPUT_OPTIONS
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
data pdfxstring type xstring.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = PDF_FSIZE
bin_file = pdfxstring
TABLES
OTF = L_JOB_OUTPUT_INFO-OTFDATA
LINES = LT_PDF
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
CALL SCREEN 100.
module STATUS_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
CREATE OBJECT G_HTML_CONTAINER
EXPORTING
CONTAINER_NAME = 'PDF'.
CREATE OBJECT G_HTML_CONTROL
EXPORTING
PARENT = G_HTML_CONTAINER.
* Convert xstring to binary table to pass to the LOAD_DATA method
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
BUFFER = pdfxstring"LV_CONTENT
TABLES
BINARY_TAB = LT_DATA.
* PERFORM bar_chart .
* Load the HTML
CALL METHOD G_HTML_CONTROL->LOAD_DATA(
EXPORTING
TYPE = 'application' "'text' " 'application'
SUBTYPE = 'pdf' "'html' "'pdf'
IMPORTING
ASSIGNED_URL = lv_URL
CHANGING
DATA_TABLE = LT_DATA "i_html "LT_DATA
EXCEPTIONS
DP_INVALID_PARAMETER = 1
DP_ERROR_GENERAL = 2
CNTL_ERROR = 3
OTHERS = 4 ).
* Show it
CALL METHOD G_HTML_CONTROL->SHOW_URL( URL = LV_URL
IN_PLACE = 'X' ).
Thanks,
Jaya.
Edited by: kishan P on Jun 9, 2011 1:40 PMHello Sandra,
Thanks for your reply, but eventhen it fails to load the pdf. Is ADS required to be installed for this?
Can I just pass the pdf_fsize imported from CONVERT_OTF which is of type i.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = PDF_FSIZE
bin_file = pdfxstring
TABLES
OTF = L_JOB_OUTPUT_INFO-OTFDATA
LINES = LT_PDF
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
CALL METHOD G_HTML_CONTROL->LOAD_DATA(
EXPORTING
TYPE = 'application' "'text' " 'application'
SUBTYPE = 'pdf' "'html' "'pdf'
size = PDF_FSIZE
IMPORTING
ASSIGNED_URL = lv_URL
CHANGING
DATA_TABLE = LT_DATA "i_html "LT_DATA
EXCEPTIONS
DP_INVALID_PARAMETER = 1
DP_ERROR_GENERAL = 2
CNTL_ERROR = 3
OTHERS = 4 ).
Thanks,
Jaya. -
How to send smartforms as pdf attachments with e mail
hi experts,
how to send smartforms as pdf attachments with e mail???
nitinHi
In the FORM Interface put proper parameter. Hope this helps.
Maybe you are looking for
-
SAP Integration kit for BO XIR2 with Crystal XI for BI 7.0 Front end
Hello Team, We are in a little fix. We have BOE XIR2, Crystal XI and working with old version of BI front-end 3.5. We are upgrading to BI 7.0 frontend, but I am not able to trace out the SAP Integration kit for combination of BOE XIR2, Crystal XI and
-
How to do forward multiple mail
Hi all, I want to write the forward multiple mail script,if we select multiple mails from apple mail and click forward button ,messages will come in to the same window as forward . the same scenario i want to do using apple script.If any one have ide
-
Posting slideshow on iweb from iphoto
okay, i'm new to mac and website design. i would like to know how i can add a slideshow that i made in iphoto and place it on iweb? i'm using the 60 day trial. is this feature not available to me? in iphoto >share > send to iweb> the options aren't h
-
Precalculation of Web Templates
Hi everyone, I have a process chain which uses the precalculation for web templates with a reporting agent. Today is the first time is have failed. It failed with 'uncaught exception'. I checkec ST22 for the dump analysis and it gives nothing hel
-
10.5.7 Macbook sleeps once, freezes second time
After installing 10.5.7 from combo update, I can now only sleep my mac once. Second time it does not sleep, instead it freezes. It does this consistently. I found another user with the same issue: +Peter Hull+ +After applying the 10.5.7 Combo update,