on 01-25-2010 9:00 AM
Hi All,
I have to display smartforms in WDA. For that I'm using following link.
[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785?quicklink=index&overridelayout=true]
Now, in my case --
Form Name - 'ZFORM'
Importing Field - 'VBELN'
But, my problem is I'm unable to understand some of the fields, used in Tutorial in the link above, which are --
element_zinput
pernr = stru_input1-zpernr
reinr = stru_input1-zreinr
pdvrs = stru_input1-zpdvrs
I can understand that these must be user-defined. But, it has not defined in tutorial and hence, I'm confused.
Can anyone tell me what are these fields and from where are these coming?
Thakns.
Kumar Saurav.
zreinr must be the Trip Number.
zpernr = personell number
zpdvrs -> Trip Version number
But the question is, what would that be of any concern to you and your particular smartform? Fact is, that in the example a smart form was created which, as input parameter uses these three fields. These fields are most likely retrieved from the WDA itself (selection screen parameters for example).
I guess you have created a smartform of your own which you want to display. And how this smartform exactly looks like, shouldn't really matter, the only thing is, you want it to be displayed in your WD application. So, just create a simple smart form without these (import) parameters and proceed with the example (it's all about the principles).
Hope you get the point.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Micky,
Thanks for giving me the lead.
Now, I have made the changes as per my Smartforms. But, when I test that Webdyn Application, an error is coming up. This is as follows --
Error code: ICF-IE-http -c: 400 -u: G_SIMARLEEN -l: E -s: DEV -i: unidev_DEV_00 -w: 0 -d: 20100126 -t: 123406 -v: RABAX_STATE -e: CALL_FUNCTION_PARM_MISSING
Would you please suggest what's wrong in my case.
Actually, I've defined as follows --
DATA: LV_TEXT TYPE CHAR3,
LV_SYUCOMM TYPE CHAR1,
LS_PDF TYPE XSTRING,
LV_FM_NAME TYPE RS38L_FNAM,
LV_CONTROL_PARAMETERS TYPE SSFCTRLOP,
LV_OUTPUT_OPTIONS TYPE SSFCOMPOP,
LV_SSF_OUTPUT TYPE SSFCRESCL,
LT_OTFDATA TYPE TABLE OF ITCOO.
Then, calling that as below --
CALL FUNCTION LV_FM_NAME
EXPORTING
* ARCHIVE_INDEX * ARCHIVE_INDEX_TAB *
*ARCHIVE_PARAMETERS control_parameters = lv_control_parameters
* MAIL_APPL_OBJ * MAIL_RECIPIENT * MAIL_SENDER
OUTPUT_OPTIONS = LV_OUTPUT_OPTIONS
CONTROL_PARAMETERS = LV_CONTROL_PARAMETERS "Saurav
USER_SETTINGS = SPACE
IMPORTING
DOCUMENT_OUTPUT_INFO = LV_SSF_OUTPUT
I_VBRK = LS_VBRKTAB_2-VBELN
* JOB_OUTPUT_OPTIONS
TABLES
I_VBRP = VBRP
I_THEAD = THEAD
I_TLINE = TLINE
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.
REFRESH LT_OTFDATA.
LT_OTFDATA[] = LV_SSF_OUTPUT-OTFDATA[].
Before this call, I've made a call to
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZFACTORY_INVOICE1'
IMPORTING
FM_NAME = LV_FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* Error MESSAGE
ENDIF.
I am stuck as it is suggesting that The following error text was processed in the system DEV : Incorrect parameter with CALL FUNCTION.
What should I do.
Please guide me.
Thanks.
Kumar Saurav.
Hi Abhimanyu,
I've done that.
LV_CONTROL_PARAMETERS-NO_DIALOG = L_X. "No print dialog
Now, while testing my application, diff error comes, as below.
The following error text was processed in the system DEV : Please maintain an output device in your user master data.
Although I've defined output option as below --
* Set relevant control parameters
LV_CONTROL_PARAMETERS-GETOTF = L_X. "OTF output
LV_CONTROL_PARAMETERS-NO_DIALOG = L_X. "No print dialog
LV_CONTROL_PARAMETERS-PREVIEW = ' '. "SPACE. "No preview
* Set relevant output options
LV_OUTPUT_OPTIONS-TDNEWID = L_X. "Print parameters,
LV_OUTPUT_OPTIONS-TDDELETE = ' '. "SPACE. "Print parameters,
Please suggest where am I wrong.
Thanks.
Kumar Saurav.
Hi,
When I checked for the reason in SM21 - because The termination type was: ABORT_MESSAGE_STATE -
Breakpoint reached
>in program /1BCWDY/B_7B6BPXV7SQ55HBEF769I , line 0800, event SUPPLY_VIEW_SWITCH*
Breakpoint reached
>in program /1BCWDY/B_7B6BPXV7OW1IOPPCV1A5 , line 1003, event ONACTIONON_CONTINU*
Breakpoint reached
> in program /1BCWDY/B_7B6BPXV7RZITPZUT4QV9 , line 0477, event WDDOINIT
Transaction Canceled SSFCOMPOSER 010 ( )
Although, I am calling the function as
REFRESH LT_OTFDATA.
LT_OTFDATA[] = LV_SSF_OUTPUT-OTFDATA[].
CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
EXPORTING
I_OTF = LT_OTFDATA
EXCEPTIONS
CONVERT_OTF_TO_PDF_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
I am posting this in the hope that this may give you the lead.
Thanks.
Kumar Saurav.
Edited by: Kumar Saurav on Jan 27, 2010 6:49 AM
The following error text was processed in the system DEV : Please maintain an output device in your user master data.
Although I've defined output option as below --
Set relevant control parameters
LV_CONTROL_PARAMETERS-GETOTF = L_X. "OTF output
LV_CONTROL_PARAMETERS-NO_DIALOG = L_X. "No print dialog
LV_CONTROL_PARAMETERS-PREVIEW = ' '. "SPACE. "No preview
Set relevant output options
LV_OUTPUT_OPTIONS-TDNEWID = L_X. "Print parameters,
LV_OUTPUT_OPTIONS-TDDELETE = ' '. "SPACE. "Print parameters,
--- You haven't supplied a printer device itself. Even if you are just converting a form, it needs a reference printer to perform the formatting. If none is supplied it tries to use the default printer ID from your user master. It appears that you have no default printer in your user master. You will need to supply some printer device ID for the conversion to occur.
Hi Thomas,
Thanks for your valued guideline.
I added the code as below --
LV_CONTROL_PARAMETERS-DEVICE = 'PRINTER'.
Still, same error is coming up.
It seems, your second point is applicable here. May be User Master Data has not been updated with any Printer.
I've asked to update accordingly to concerned people.
I'll post it as and when done.
Till then, if there be any other coding error....?
Thanks.
Kumar Saurav.
(Answer: 1 of 2)
Hi Kumar,
Please compare your code with my code:
" Data Declaration
DATA: node_pdf_data TYPE REF TO if_wd_context_node,
fm_name TYPE rs38l_fnam,
outop TYPE ssfcompop,
cparam TYPE ssfctrlop,
tab_otf_data TYPE ssfcrescl,
tab_otf_final TYPE TABLE OF itcoo,
bin_filesize TYPE i,
bin_file TYPE xstring,
pdf_tab TYPE TABLE OF tline.
" Get function module name for smart form
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZHR_PF_MSS_CCREF'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
" Get Report Format With Data From Smart Form
outop-tdprinter = 'PDF1'.
cparam-no_dialog = 'X' .
cparam-preview = 'X'.
cparam-getotf = 'X'.
CALL FUNCTION fm_name
EXPORTING
control_parameters = cparam
output_options = outop
user_settings = space
lho_REF_NO = LV_CC_REF_NO
IMPORTING
job_output_info = tab_otf_data
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.
EXIT.
ENDIF.
" Get all data of Smartform
tab_otf_final[] = tab_otf_data-otfdata[].
Then convert the OTF data to PDF data.
See Below......
(Answer: 2 of 2)
" Convert OTF data into PDF data
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = bin_filesize
bin_file = bin_file
TABLES
otf = tab_otf_final
lines = pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 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.
EXIT.
ENDIF.
" Set PDF Data to context attribute
node_pdf_data = wd_context->get_child_node( name = 'PDF_DATA' ).
CALL METHOD node_pdf_data->set_attribute
EXPORTING
value = bin_file
name = 'SOURCE'.
Here I have saved the value of bin_file parameter of CONVERT_OTF function to the SOURCE, which is a XString type of attribute of context PDF_DATA. The SOURCE attribute is bind to source property of Interactive Form.
Regards,
Vikrant
Hi Vikrant,
Thanks for giving me so detailed code.
My problem has been resolved. My Code is same as of yours.
The problem was of authorization of user and not in code itself. When relevant changes were made in SU01 for that user-id, display came up.
But, still, you have provided the complete code, thank you very much.
Kumar Saurav.
Hi Ranjani,
First of all, you should have open a new thread. Because its an old thread & not being followed at all. Thanks to SAP Networkmail, else this type of posting could have gone unnoticed.
Anyways, for the answer of your query, you need to maintain Printer in SU01 while creating an User. Please refer to Thomas Jung's answer in this same thread.
--- You haven't supplied a printer device itself. Even if you are just converting a form, it needs a reference printer to perform the formatting. If none is supplied it tries to use the default printer ID from your user master. It appears that you have no default printer in your user master. You will need to supply some printer device ID for the conversion to occur.
For maintaining Printer, please follow the steps as below -
SU01 -> Input User ID -> Click on Change Icon -> Go to "DEFAULTS" Tab -> Set "OutputDevice" from F4 -> Select Checkbox "Output Immediately" -> Save.
Just for your clarification, if Printer is not set in User Profile, (s)he is not allowed to access that device and hence error comes up. However, keep in mind that you need to use Control Parameters to set the printer through code as given in Thomas Jung's answer.
Hope this may resolve your problem.
Thanks.
Kumar Saurav.
Hi Ranjani,
It seems you are using GUI statements inside WDA. Simply, you can not use GUI statements inside WDA.
You may refer Thomas Jung's answer in thread -
You can not have connections to the SAPGUI Control Framework within any processing that runs from Web Dynpro. BAPIs and Enterprise Services by their very definition will avoid such processing and be safe for usage within Web Dynpro.
However, please share the source-code or the requirement, so that we can think of other way out.
Thanks.
Kumar Saurav.
Hi Ashok,
Actually, this workaround solution for smartforms sends the output to the spool and then converts the spool to PDF.
But, can you elaborate if your concern is related to printing the smartforms using Local Printer from WDA? If so, there are few solutions that you may get by searching on the SDN.
http://scn.sap.com/thread/1407526
Thanks.
Kumar Saurav.
hi:Thomas
I have a requirement which smartform convert to pdf in web dynpro for abap ,But garbled for the Chinese.why is this?
my code:
method ONACTIONPDF2 .
DATA FM_NAME TYPE RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST_WDA'
IMPORTING
FM_NAME = FM_NAME
.
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: JOB_OUPUT TYPE SSFCRESCL,
LT_OTFDATA TYPE TABLE OF ITCOO.
DATA: LA_CTRL_FORM TYPE SSFCTRLOP,
LA_OUTPUT_OPT TYPE SSFCOMPOP.
** Spool Parameters
*LA_OUTPUT_OPT-TDIMMED = 'X'.
*LA_OUTPUT_OPT-TDDELETE = 'X'.
*LA_OUTPUT_OPT-TDLIFETIME = 'X'.
*LA_OUTPUT_OPT-TDDEST = 'LOCL'.
* ****************************************************************************
* Parameters passes to get the output in PDF format
****************************************************************************
LA_CTRL_FORM-NO_DIALOG = 'X'.
*LA_CTRL_FORM-PREVIEW = 'X'.
LA_CTRL_FORM-GETOTF = 'X'.
LA_CTRL_FORM-LANGU = '1'.
*LA_CTRL_FORM-DEVICE = 'PRINTER'.
LA_OUTPUT_OPT-tdprinter = 'PDF1'.
CALL FUNCTION FM_NAME
EXPORTING
CONTROL_PARAMETERS = LA_CTRL_FORM
OUTPUT_OPTIONS = LA_OUTPUT_OPT
IMPORTING
JOB_OUTPUT_INFO = JOB_OUPUT
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.
REFRESH LT_OTFDATA.
LT_OTFDATA[] = JOB_OUPUT-OTFDATA[].
CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
EXPORTING
I_OTF = LT_OTFDATA
EXCEPTIONS
CONVERT_OTF_TO_PDF_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
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: L_DUMMY TYPE STANDARD TABLE OF TLINE,
PDF_DATA TYPE XSTRING,
PDF_SIZE TYPE I.
CLEAR: PDF_DATA, PDF_SIZE.
* convert otf to pdf
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 255
IMPORTING
BIN_FILESIZE = PDF_SIZE
BIN_FILE = PDF_DATA
TABLES
OTF = LT_OTFDATA[]
LINES = L_DUMMY
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(
* *path to the word file
I_FILENAME = 'WDA_SMARTFORMS.pdf'
* String Variable
I_CONTENT = PDF_DATA
* File Type
I_MIME_TYPE = 'PDF' ).
endmethod.
image1 for smartforms
image2 for pdf
hi:Thomas
I have a requirement which smartform convert to pdf in web dynpro for abap ,But garbled for the Chinese.why is this?
my code:
method ONACTIONPDF2 .
DATA FM_NAME TYPE RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST_WDA'
IMPORTING
FM_NAME = FM_NAME
.
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: JOB_OUPUT TYPE SSFCRESCL,
LT_OTFDATA TYPE TABLE OF ITCOO.
DATA: LA_CTRL_FORM TYPE SSFCTRLOP,
LA_OUTPUT_OPT TYPE SSFCOMPOP.
** Spool Parameters
*LA_OUTPUT_OPT-TDIMMED = 'X'.
*LA_OUTPUT_OPT-TDDELETE = 'X'.
*LA_OUTPUT_OPT-TDLIFETIME = 'X'.
*LA_OUTPUT_OPT-TDDEST = 'LOCL'.
* ****************************************************************************
* Parameters passes to get the output in PDF format
****************************************************************************
LA_CTRL_FORM-NO_DIALOG = 'X'.
*LA_CTRL_FORM-PREVIEW = 'X'.
LA_CTRL_FORM-GETOTF = 'X'.
LA_CTRL_FORM-LANGU = '1'.
*LA_CTRL_FORM-DEVICE = 'PRINTER'.
LA_OUTPUT_OPT-tdprinter = 'PDF1'.
CALL FUNCTION FM_NAME
EXPORTING
CONTROL_PARAMETERS = LA_CTRL_FORM
OUTPUT_OPTIONS = LA_OUTPUT_OPT
IMPORTING
JOB_OUTPUT_INFO = JOB_OUPUT
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.
REFRESH LT_OTFDATA.
LT_OTFDATA[] = JOB_OUPUT-OTFDATA[].
CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
EXPORTING
I_OTF = LT_OTFDATA
EXCEPTIONS
CONVERT_OTF_TO_PDF_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
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: L_DUMMY TYPE STANDARD TABLE OF TLINE,
PDF_DATA TYPE XSTRING,
PDF_SIZE TYPE I.
CLEAR: PDF_DATA, PDF_SIZE.
* convert otf to pdf
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 255
IMPORTING
BIN_FILESIZE = PDF_SIZE
BIN_FILE = PDF_DATA
TABLES
OTF = LT_OTFDATA[]
LINES = L_DUMMY
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(
* *path to the word file
I_FILENAME = 'WDA_SMARTFORMS.pdf'
* String Variable
I_CONTENT = PDF_DATA
* File Type
I_MIME_TYPE = 'PDF' ).
endmethod.
image1 for smartforms
image2 for pdf
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.