Calling a smart form or script
hi guys,
can we call 2 smartforms from the same driver program and call 2 sap scripts from same driver program if so can any one help me by giving some code for both smartform and scripts.
thanks
pavan.
Not sure about SmartForms, but yes to SAPscript. You can do it in configuration.
For example-
Use txn NACE.
Select V1 for SALES and pick OUTPUT TYPES.
Select BA00 for the Order Confirmation and choose PROCESSING ROUTINES.
Select 1 for PRINTOUT and hit the details icon (magnifying glass).
You can list up to 5 programs and SAPscript layout sets. They will all get processed in sequence.
Similar Messages
-
hi,,
will u tell what is the difference between smart forms and scripts.hI
Sapscripts are client dependend and smartforms are client independet.
SAPscript are CLient Dependent, SmartForms are Client Independent. The reason why SmartForms are client independent is because when you activate a SMartForm, SAP actually generates a Function Module (which as you know is client independent). The Print Program (or as SAP likes to refer to them these days - Application Program) calls your generated FM.
In the "smartforms" transaction, when you are viewing a smartform, you can go to the Environment->Function Module Name menu path to see the FM name.
Look at the "Application Program" for the Invoice SmartForm (RLB_INVOICE):
determine smartform function module for invoice
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING formname = lf_formname
variant = ' '
direct_call = ' '
IMPORTING fm_name = lf_fm_name
EXCEPTIONS no_form = 1
no_function_module = 2
OTHERS = 3.
call smartform invoice
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_appl_obj =
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = space
is_bil_invoice = ls_bil_invoice
is_nast = nast
is_repeat = repeat
importing document_output_info =
job_output_info =
job_output_options =
EXCEPTIONS formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
<b>Difference with SMARTFORMS vs. SapScript (SE71)</b>
The Following are the differences :-
a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
b) It is possible to have a smartform without a main window .
c) Labels cannot be created in smartforms.
d) Routines can be written in smartforms tool.
e) Smartforms generates a function module when activated.
Contributed by : SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips
f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
i) The main difference is that SAP script is client-dependant, while smartform is independent. Also there are some advanced and intreractive features available in smartforms.
You can use an External subroutine-call in sapscript editor like:
/: perform <form_name> in program <program_name>
/: using <var1>
/: using <var2>
/: changing <return1>
/: changing <return2>
/:endperform -
Purchase order smart forms and scripts
i need to create a smart form and script in simple purchase order there is no requirements has given to me, can any one tell me in detail how i need to do and what are the procedures i need to follow, example code will be usefull and steps to build it.
Hi,
Go through the links mentioned below.
http://www.****************/Tutorials/Smartforms/SFMain.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
http://www.sapmaterial.com/smartform_example.html
Re: Hands on SAP Smart Forms
smartforms
A Simple Smartform Tutorial
SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output).
According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
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.
Additional Fonts for your SMARTFORMS
You can create additional fonts and style with transaction SMARTSTYLES
This can then be define in the paragraph and character formats, which you can then be assign to texts and fields in the Smart Form.
The character formats includes effects such as superscript, subscript, barcode and font attributes.
Also, you can refer to the below link for the explanation:
http://help.sap.com/saphelp_46c/helpdata/en/4b/83fb42df8f11d3969700a0c930660b/frameset.htm
Reward if helpful.
Regards,
Harini.S -
Calling a Smart Form on Click of a Table Row..
Hi All,
I have one requirement.
I have developed one applicaiton, in which from R3, the values are coming in form of a table. Now, on Click of a Table row, it should call a smart form developed in R3 for that selected row attribute. Also the smart form should open in a new window, so that user can take a print of it.
How to add this new view and how to get the selected Row value ?
Please help me.Hi,
To open the new window, I have added blow code:
IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("InfoPopup");
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
window.open();
but, getting error message as : IWDWindowInfo cannot be resolved
what should be the import parameter? Also please tell me how to search for the Import parameters for the respected attribute/code?
Please help. -
Regarding Smart form and Script
Hi.
Can anybody send Full screen short of Smart Form And Script.
Thanks And Regards
Gulo.Hi Golu singh,
Pleasae check this link
Tutorials on SAP Script/Smart Forms
http://www.****************/Tutorials/Smartforms/SFMain.htm
SAP SmartForms explained step by step including Table display .
http://sap.niraj.tripod.com/id67.html
SMARTFORMS
[Step br Step Tutorial to create Smartform|http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html]
Best regards,
raam -
What is the difference between smart forms and scripts.?
what is the difference between smart forms and scripts.?
Differences between Smartforms and SAPscript
a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
b) It is possible to have a smartform without a main window .
c) Routines can be written in smartforms tool.
d) Smartforms generates a function module when activated.
e) Smartforms can create web enable forms like XML
f) smartforms itself contine subroutine pools need not to main separetly like in case of scripts
Request you to refer the following links
www.sap-img.com/smartforms/smartform-sapscripts.htm
www.erpgenie.com/abap/smartforms_sapscript.htm
Sapscript vs Smartforms
Difference with SMARTFORMS vs. SapScript(SE71)
The Following are the differences :-
a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
b) It is possible to have a smartform without a main window .
c) Labels cannot be created in smartforms.
d) Routines can be written in smartforms tool.
e) Smartforms generates a function module when activated
Scripts are client dependent whereas smartforms aren't.
Upto 99 main windows are possible in scripts and only one in smarforms.
To create multiple main windows in scripts, you just have to give the window type as MAIN whnever you create a window.
Scripts still exists but smartforms are in use from 4.6c version, now the lastest version of these two is adobe forms
SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
configure forms with data from an SAP System for the relevant business processes.
Advantages of SAP Smart Forms
SAP Smart Forms have the following advantages:
1. The adaptation of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
2. Displaying table structures (dynamic framing of texts)
3. Output of background graphics, for form design in particular the use of templates which were scanned.
4. Colored output of texts
5. User-friendly and integrated Form Painter for the graphical design of forms
6. Graphical Table Painter for drawing tables
7. Reusing Font and paragraph formats in forms (Smart Styles)
8. Data interface in XML format (XML for Smart Forms, in short XSF)
9. Form translation is supported by standard translation tools
10. Flexible reuse of text modules
11. HTML output of forms (Basis release 6.10)
12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
Reward Points if useful. -
Hi Friends.
How r u?
This is Ravinder.
what r the problems does I get when we generating the layout for checks using smart forms and scripts(also)? There is standard programs r there plz tell me? Plz give an exampleHi Friends.
How r u?
This is Ravinder.
what r the problems does I get when we generating the layout for checks using smart forms and scripts(also)? There is standard programs r there plz tell me? Plz give an example -
experts
can any body tell me the difference between smart form and scritps
regards
Raemsh<b></b>Hi Ramesh,
The Following are the differences :-
a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
b) It is possible to have a smartform without a main window .
c) Labels cannot be created in smartforms.
d) Routines can be written in smartforms tool.
e) Smartforms generates a function module when activated.
f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
We can use both. but practically smartforms is easier to develop. For more information on the difference between SAPscript & smarform, kindly check the following links:
http://www.sap-img.com/smartforms/smartform-sapscripts.htm
Re: what is difference between SAPscript and smartforms?
Re: Diff betwen Scripts & smartforms
Difference?
Hope this resolves your query.
Reward all the helpful answers.
Regards -
How to limit the number of rows in a smart form , sap script.
Can anyone tell me how to limit the number of rows in the output of a sap script/smart form. I have tried "protect/endprotect" in sap script but have no idea of how to do in smart form. In sap script the only way it has happened is by reducing the size of the main window.
Hi,
In Smartform also, why dont you try reducing the size of the window if you want to limit the rows in it. Also if you are printing Line Items in a LOOP, you can write
LOOP AT T_ITAB FROM 1 TO N in the LOOP Node if you know how many records exactly you want to display in 1 Page processing.
regards,
Mahesh -
Error in calling/converting smart form from ECC to pdf in portal.
Hi,
We have a requirement in our project where we have to show IT form in portal exactly in the way payslip are shown in ESS
Screen, that is in the pdf form in ess portal screen.
For this my HR abap consultant has made one customize smart form which is being called from a RFC FM.
After the FM lf_fm_name gets executed , the OTF data is being captured and then converted in to PDF.
After that the PDF is then converted into XSTRING format which is then supplied to the portal side through export parameter
of the RFC.
Now when we debugged the RFC, the conversion is taking place perfectly fine in to XSTRING.This is wat we assume.
Portal Side: I have used Iframe ui ELEMENT in my webdynpro java and its property source I have binded with a value attribute
of type string and I am executing above customize RFC given to me by my HR abap consultant and after executing that RFC with
userID and payroll year as its import parameter I am taking export parameter of that RFC with name pdf_string of type XSTRING
of that RFC into my webdynpro java value attribute which i binded to source property of Iframe.
Now when we see the output in portal , first of all pdf is not getting generated and its showing the error message:
file does not begin with '%pdf-' and secondly errored Adobe form getting opened outside Iframe window its not coming within
Iframe window like what payslip comes inside Iframe UI element.
I want to know what mistake we are doing in our ABAP coding or portal coding.
Please help.Hi Satyam,
You can use the existing SAP GRT framework for developing the app.
Its easy and provides more features.
See this wiki:
http://wiki.sdn.sap.com/wiki/display/WDJava/HowtodevelopcustomWebDynproESSapplicationsusingGenericReportingTool%28GRT%29
Regards
Yugandhar Reddy -
Calling a smart form on click of a button in web dynpro abap
Hi experts,
I have a requirement like if I click a button in a view i need ti generate a PDF through smart form.
Is this possible. If so please tell me the way..
Thanks & RegardsHi Sharma,
Create Interactive form in your view, create one node say PDF_SOURCE under this one attribute PDF_SOURCE of type XSTRING.
Bind this to IF form Datasource and pdfsource.
in your button action write code to call your smartform
using SSF_FUNCTION_MODULE_NAME
using FM CONVERT_OTF and attach_file_to_response
*convert to pdf
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lv_bytecount
TABLES
otf = ls_job_output_info-otfdata
lines = lt_lines
EXCEPTIONS
err_conv_not_possible = 1
err_bad_otf = 2.
loop at lt_lines into ls_line.
lv_string = ls_line.
export mydata = lv_string to data buffer lv_buffer.
import mydata to l_xline from data buffer lv_buffer in char-to-hex
mode.
concatenate l_pdfstring l_xline into l_pdfstring in byte mode.
endloop.
call method cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = 'ZWTY_PACKINGSLIP'
i_content = l_pdfstring
i_mime_type = 'BIN'
i_in_new_window = abap_false
i_inplace = abap_false.
also check this..
http://abapcodexperiments.wordpress.com/2011/03/20/smartform-pdf-webdynpro-abap/
Call smartform in web dynpro abap
Cheers,
Kris. -
MULTIPLE COMMAND NODE CALL IN SMART FORMS
Hi all
Hi All,
I am designing a Smart form. i have 5 page . In my page2 (main window ) i call a command node to call page 3 with some condition it's working fine and now i going to call another page in my page2 (main window ) just behind the first command node to call the page3 but the problem is my first command take the cursor in the page3 but not come on page2 (main window ) and gives error .
Regards,
Kuldeep Singhhi,
when the first command get executed, then the control moves into the new page....
but ur second command is in old page, i mean from where u called ur first command... then the control is in one page, and the command is in another page...then how can u get that executed...?
here do one thing, using first command u r calling one page, in that page place this secod command, then after executing that page, u can get the required one using the second command...
hope its clear.
if any doubts, plz revert back. -
Find the translation of smart form and script
Hi, I am new in this forum. 30.04.2009
1.) I have to translate a smart form from German to english and to hungry. I use SE63 translate the text. The elements get a new name with the language in the name. I activate it.
In the formula at the form attributes -> translate -> in all languages
I put it in a transport, but where they are??? I can see it there are with the name in the Formula.
I can not find the translation.
2.) I must change the formula, I must translate it again? I use SE63. I don't find the
translation of the formula. The same like oben.
I hope you can help me.
With best regards
HeinzHi Heinz,
1) You do not see the translation of the SmartForm in the TP request. The idea is that it will get transported with all the associated texts from SE63.
2) You cannot translate texts that only have variables (&abc& elements) in them. The idea is that they will remain the same in whichever language you will use.So, changing the formula in the original language means it will be changed in all the languages.
But, if you have a row something like: Material &matnr& produced in &country&, this row will appear in SE63 and you will have to translate it because it contains texts outside of variables.
Regards,
George -
WANT THE TCODE FOR SMART FORMS AND SCRIPTS IN FI MODULE?
HI SHAREHOLDERS OF SAP,
I WANT TO KNOW THE TRANSACTION CODES FOR SCRIPTS AND SMARTFORMS RELATED TO FI MODULE.
WE ARE GOING THROUGH UP GRADATION PROJECT.SO I NEED THE TCODE FOR OBSOLETED TCODE FOR SCRIPTS TO SMARTFORMS IN FI.Hi Arun Kumar,
Generally we do changes in SE71 itself for any forms
but the forms of FI module, we assign in SPRO.
Goto SPRO there click on Display SAP Reference IMG push button or (F5) .
Now search for FORMS. Give the Search term as FORMS and press enter.
Here u get the hit list for FORMS related to all the functional modules. select the FI related forms and double click on it. Then u get the dropdown where the forms are located.
Foe Example here is a path for Assign payment forms for payment method in company code
In SPRO --->Display IMG
Financial Accounting---> Accounts Receivable and Accounts Payable ---> Business Transactions ---> Outgoing payments ---> Automatic outgoing payments ---> Payment media -> Make Setting for Classic Payment Medium Programs-> Assign payment forms for payment method in company codes
EXECUTE Assign payment forms for payment method in company codes
Here u can see all the formS related to the Payment Advice.
Hope this helps...
Best regards,
raam -
Call text element and command in smart forms
Hi, I have create a smart form that have one text element and one command. The command is for do a page break.
I have seen that you can call the smart form from a program doing:
1.-'SSF_FUNCTION_MODULE_NAME'
2.-call function fm_name
That is not ok for me because I want to call to the smart forms manually as befores it done with sap-script, open form, write , close form...
What function Have I to use to call to the text element?
What function Have I to use to call to the command?
Someone have and example calling a smart form from an abap.
Thanks in advance.
MANUELHi Vinod, I do not understand very good that you propose.
I explain more details of I have to do:
I have a abap program that read and write some data, I want to pass every line of the report to smart form, and in some lines comes a break page that I have to force also in the smart form, the idea
LOOP AT ITAB.
IF ITAB-LINE EQ '<BREAK>'.
BREAK PAGE IN SMART FORM
ELSE.
PASS ITAB-LINE TO SMART FORM
ENDIF.
ENDLOOP.
In order to do that I have created in the smart forms one text element X_LINE that represents every line and a command NEWPAGE that force page break.
Is possible to do that I want by the way that you propose?
Thanks in advance.
MANUEL
Maybe you are looking for
-
I'm trying to connect to mac or Ipad or even Iphone and it's searching without any result.
-
IPhoto Library no longer accessible from Photoshop
Till now I used a Power Book G4, I life 05 and Photoshop CS2. No problem opening iPhoto Library pictures in Photoshop for working on them. I built different iPhoto Libraries for getting them lighter... Now I got an iMac Intel Core 2 Duo, 3.06 Ghz wit
-
I have music on my Ipod touch, how can I get it on to my new macbook?
Hello! My old macbook died, I want to get my music from my ipod touch to my new macbook. I know this requires a third party program, are there any recommendations? Thanks
-
How to create a custom listview with a specific listview item style?
Hi everybody, I am trying to implement a custom image gallery. It has a very distinct design though, It supports drag and drop reordering. Each item has a button on the left and a thumbnail. The drag and drop should happen only when we drag the thumb
-
Can't download 11.1 upgrade for xp - says I need msi file
I can't download the itunes 11.1 upgrade for my windows xp desktop - message says I need "msi file". Now I can't sync my I phone 5s running ios7 with the older version of itunes on my desktop.