Driver Program of Smartform
Hi Folks,
Can any body post the sample driver program of smart form? I need the same to call a smartform which created.
thanks
Siddarth
Hi,
Check this....
*& Report ZSEND_PDF_EMAIL
REPORT zsend_pdf_email.
DATA: itcpo LIKE itcpo,
tab_lines LIKE sy-tabix.
Variables for EMAIL functionality
DATA: maildata LIKE sodocchgi1.
DATA: mailpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: mailbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailrec LIKE somlrec90 OCCURS 0 WITH HEADER LINE.
DATA: solisti1 LIKE solisti1 OCCURS 0 WITH HEADER LINE.
PERFORM send_form_via_email.
FORM SEND_FORM_VIA_EMAIL *
FORM send_form_via_email.
CLEAR: maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
REFRESH: mailtxt, mailbin, mailpack, mailhead, mailrec.
Creation of the document to be sent File Name
maildata-obj_name = 'TEST'.
Mail Subject
maildata-obj_descr = 'Subject'.
Mail Contents
mailtxt-line = 'Here is your file'.
APPEND mailtxt.
Prepare Packing List
PERFORM prepare_packing_list.
Set recipient - email address here!!!
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
APPEND mailrec.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = maildata
put_in_outbox = 'X'
TABLES
packing_list = mailpack
object_header = mailhead
contents_bin = mailbin
contents_txt = mailtxt
receivers = mailrec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
commit work.
ENDFORM. "SEND_FORM_VIA_EMAIL
Form PREPARE_PACKING_LIST
FORM prepare_packing_list.
CLEAR: mailpack, mailbin, mailhead.
REFRESH: mailpack, mailbin, mailhead.
DESCRIBE TABLE mailtxt LINES tab_lines.
READ TABLE mailtxt INDEX tab_lines.
maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
Creation of the entry for the compressed document
CLEAR mailpack-transf_bin.
mailpack-head_start = 1.
mailpack-head_num = 0.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'RAW'.
APPEND mailpack.
Creation of the document attachment
This form gets the OTF code from the SAPscript form.
If you already have your OTF code, I believe that you may
be able to skip this form. just do the following code, looping thru
your SOLISTI1 and updating MAILBIN.
PERFORM get_otf_code.
LOOP AT solisti1.
MOVE-CORRESPONDING solisti1 TO mailbin.
APPEND mailbin.
ENDLOOP.
DESCRIBE TABLE mailbin LINES tab_lines.
mailhead = 'TEST.OTF'.
APPEND mailhead.
Creation of the entry for the compressed attachment
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'OTF'.
mailpack-obj_name = 'TEST'.
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
APPEND mailpack.
ENDFORM. "PREPARE_PACKING_LIST
Form GET_OTF_CODE
FORM get_otf_code.
DATA: BEGIN OF otf OCCURS 0.
INCLUDE STRUCTURE itcoo .
DATA: END OF otf.
DATA: itcpo LIKE itcpo.
DATA: itcpp LIKE itcpp.
data control type SSFCTRLOP.
data output type SSFCOMPOP.
data otfdata type SSFCRESCL.
control-getotf = 'X'.
OUTPUT-TDDEST = 'Lp01'.
control-DEVICE = 'LOCL'.
control-NO_DIALOG = 'X'.
CLEAR itcpo.
itcpo-tdgetotf = 'X'.
CALL FUNCTION '/1BCDWB/SF00000279'
EXPORTING
CONTROL_PARAMETERS = control
OUTPUT_OPTIONS = output
USER_SETTINGS = ' '
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = otfdata
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
Move OTF code to structure SOLI form email
CLEAR solisti1. REFRESH solisti1.
LOOP AT otfdata-otfdata into otf.
solisti1-line = otf.
APPEND solisti1.
ENDLOOP.
ENDFORM. "GET_OTF_CODE
Regards,
Sankar
Similar Messages
-
Regarding Passing two internal Tables from Driver Program to Smartform
hi all,
I am Passing Two Internal Tables from Driver Program to Smartform it is going to dump and message is showing like this " one of the parameters eded according to the interface description was not specified ".
When i am passing one Internal Table Output is coming Perfectly. Is there any restriction for passing of internal tables.
Regards
RamiHI,
Check the names specified in the smartfrom and FM whcih you are calling in the driver program. Both might be different.... -
Table from driver program to smartform
Hi All,
I am passing the table from driver program to smartform as below
CALL FUNCTION w_fname
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
output_options = ls_composer_param
user_settings = space
TABLES
t_prod_ords = i_prod_ords
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
now my problem is that i want to access the data into smartform i have already define similar structure under types tab in global setting and then create a table in global data tab but when i go to smartform the table comes up BLANK.
i dont want to create Z structure and dont want to define table in import parameter.
any other way out ?
Thanks ,
Ruchi TiwariHi Ruchi,
The data you wanted to pass from driver program to Smartform should be defined under Global settings in Form Interface not in Global data.
If you want to pass tables data from driver program to smartform, define a table with same structure in Form Interface of Global settings and if you wanted to export/import some values just do the same in Import/export parameters under Form Interface.
The data you declare under Global data can be used globally in the smartform.
eg : GT_VBAK LIKE VBAK.
Hope this helps
Rgds,
Sripal -
i want the name of the driver program & form name in smartform for Invoice .
kindly help.tksHi,
Go to transaction NACE, select application V3 - Billing then click on output types.
click on medium type.
For ex: NEU for print output, then on left hand side select processing routines, then you can see smart form/ script & driver programs associated with that.
Reward if it is useful
Praneeth -
How to write driver programming in smartforms
hi Floks
<i>how to write driver programmig and how many types of driver programs available to trigger smartforms what are they . how to call the url in smartforms ?
help me out .thanking you ,</i>
with regards,
sureshHi
Try to get the Function module name from the smart form
how to find Driver program for a smartform
and now goto SE38 and create a progarm for calling the smartform
smartform driver program
Regards
Kathirve -
Error, while calling driver program for Smartforms
Hi All,
I am getting a error while running DRIVER PROGRAM of smart form.
both driver program and smart form running successfully without any error while executing separately. But
while calling Smart Form from driver program. it is giving error as :-
*Events are already defined.*
Description :- You tried to define events for a section, but a section with
events is already active. You are not allowed to nest events.
Regards,
Pavan.MThis is nothing to do with coding, this coz of error is from smartforms....
Regards,
Pavan.M -
Error whille excuting the driver programe of smartform
HI SAP gurus
i am getting error message while executing driver program
and error is
No table line started. Output to cell not
kindly help me out
thanks in advanceHi,
In smartforms..You have to create a Line type which needs to be added for field. For the first field select new line and mention the line type.
for the next fields select new cell without giving line type.
Regards,
Omkaram. -
About driver program for smartforms
Hello Experts,
I want driver program sample examples for SD, MM & HR module if anyone having such examples plz send me on following mail id...
"[email protected]"
Thanx & Regards,
Rahul TaleleHi Rahul ..
smart form name for Purchase Order is /SMB40/MMPO_L. The driver program name is sapfm06p.
For Goods Recipt --> Driver Progaram is SAPM07P_SMART
You can look at the NAST table to find the program names and the Layout names
Regards
Sudheer -
Error in smartform driver program.
Hi,
I want to know the functionality of form interface and Global definitions.when i am executing driver program i got following error.
Field "INTO" is unknown. It is neither in one of the specified tables
nor defined by a "DATA" statement.
could anyone give the solution for this error ?Hi Raja,
The form interface will contain what all things U export from Driver program. ie Tables , Workarea etc.
The Global defenitions will contain what all global varibales that U use inside SMARTFORM.
Suppose U are exporting a work area from Driver program which is of structure Z_TEST then declare that work area in FORM INTERFACE as
w_test type z_test.
U have a table that U pass from Driver program into smartform let it be t_final of structure z_final then declare that table in TABLES tab of form interface as t_final LIKE Z_final.
Declare all the varibles that U use in Global defenitions w_str type string etc.
U might have used "INTO" as some variables or declaration might be wrong.
Please see the declaration in Global definitions and Interface.
Click on that Error and see where its coming.
Reward points if Useful
Regards
Avi... -
About smartforms driver program
Hello Experts,
Is there any function module to fetch data from sd module to get data in SMARTFORMS ?
mail me solution on "[email protected]"
Thanx in advance,
Rahul TaleleHi Rahul,
Call function 'SSF_FUNCTION_MODULE_NAME' that will give u smartform function name by passing smartform name. then call that FM to transfer data from driver program to smartform.
Refer this code :
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = P_FORM
IMPORTING
FM_NAME = P_FUNCTION
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION P_FUNCTION
TABLES
D_VBRK = IT_VBRK
D_VBRP = IT_VBRP
D_LIKP = IT_LIKP
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Reward points if helpful.
regards,
Hemant -
Driver program Configurations for CO03/CO02
Hi All,
Requirement:
We are configure script and driver program in OPK8 With list type LP01.
Issue:
This driver program is not triggered CO03/CO02 transaction level For this we need configure any other transaction.
Can you suggest me how to resolve this issue.
Thanks in Advance,
Rajeshbabuv.Hi,
Check whether you have maintained an entry of the smartform in NACE, and removed any sapscript assigned under FORM in NACE.
Place a break point in Program RSNAST00 at line number 799, and check the values of TNAPR workarea, see what the Driver program and smartform name
TNAPR-PGNAM = ?
TNAPR-SFORM = ?
Regards
Bala Krishna
Edited by: Bala Krishna on Aug 6, 2010 3:12 PM -
Can we call a report program in smartforms
hai
I need my report progrm output should be called in smartforms.
i.e my report output is displayed in a table in smartforms
pls give suggestionHi,
You cannot call report program in smartform.
But,you can call the smartform in your report program.
Refer these links:
how to write driver programming in smartforms
what is the basic purpose of driver program
Regards,
Sravanthi -
Printing Purchase Order from ME9F using custom program and smartform
I was able to use my custom program which calls a smartform to print purchase orders from transaction ME9F. I did this using transaction NACE.
However, when I call "Output Message" from ME9F, the output always fails (shown by an 'X' icon after the checkbox). When I try to put back the standard program in NACE, it does not show an 'X' but a check which indicates that the printing was successful.
Do you know why this happens? What did I miss?
Here's my call to my smartform from my custom driver program:
" Change Smartform ZP_MMSF_P01_PURCHASE_ORDER
" to internal Function module name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZP_MMSF_P01_PURCHASE_ORDER'
IMPORTING
FM_NAME = fmname
wa_cparam-no_dialog = 'X'.
wa_output-tddest = 'LOCL'. "or 'LP01'. "Spool: Output device
CALL FUNCTION fmname
EXPORTING
control_parameters = wa_cparam
output_options = wa_output
i_data = i_data
wa_lookup = wa_data_lookup
goods_amt = goods_amt
discount_amt = discount_amt
vat = vat
total_amt = total_amt
total_amt_inwords = total_amt_inwordsVijaya,
I have this problem though,
Whenever I try to provide values for CONTROL_PARAMETERS and OUTPUT_OPTIONS to the sapscript call in your code, the PO printing (even the preview) does not proceed. I do this because I wanted to suppress the printer dialog.
here is a fragment of the code:
" code I added
LS_COMPOSER_PARAM-tddest = 'LOCL'. "or 'LP01'. "Spool: Output device
LS_COMPOSER_PARAM-bcs_langu = sy-langu.
LS_CONTROL_PARAM-preview = 'X'.
LS_CONTROL_PARAM-no_open = 'X'.
LS_CONTROL_PARAM-no_close = 'X'.
LS_CONTROL_PARAM-device = 'PRINTER'.
LS_CONTROL_PARAM-no_dialog = 'X'.
DO NAST_ANZAL TIMES.
*--In case of repetition only one time archiving
* if sy-index > 1 and nast-tdarmod = 3.
* nast_tdarmod = nast-tdarmod.
* nast-tdarmod = 1.
* ls_composer_param-tdarmod = 1.
* endif.
IF SY-INDEX NE 1 AND REPEAT IS INITIAL.
REPEAT = 'X'.
ENDIF.
CALL FUNCTION LF_FM_NAME
EXPORTING
ARCHIVE_INDEX = TOA_DARA
ARCHIVE_PARAMETERS = ARC_PARAMS
CONTROL_PARAMETERS = LS_CONTROL_PARAM
MAIL_RECIPIENT = LS_RECIPIENT
MAIL_SENDER = LS_SENDER
OUTPUT_OPTIONS = LS_COMPOSER_PARAM
USER_SETTINGS = SPACE
IS_NAST = NAST
IS_REPEAT = REPEAT
I tried to trace it to the function module generated by smartform. The error propagates this way: From the function module, there is a call to function SSFCOMP_PROCESS_DOCUMENT. Then inside that function, there is a perform operation to tr_ssfcomp_process_doc
perform tr_ssfcomp_process_doc using startpage docstruc
header.
Inside that form, it calls the macro tr_active which checks the value of ssfcstat-trlevel (tracelevel) against c_trlevel_document. In the macro, if ssfcstat-trlevel is less than c_trlevel_document, the smartform will fail. c_trlevel_document is 15 and ssfcstat-trlevel is 0, and so the smartform fails.
(you can see the macro tr_active in include LSTXBCMAC and the form tr_ssfcomp_process_doc is in the include LSTXBCFTR)
When I do not put values in CONTROL_PARAMETERS and OUTPUT_OPTIONS, everything is ok.
Do you know why this happens?
Thanks in advance!
Edit: I have found out about transaction SFTRACE, but this is disabled.
Kyle -
Smart form driver program for VF23
hi any one can tell me is there a standard driver program for a smartform to run transaction VF23. There is a Standard SAP script program named RVADIL01 . Is there a similar driver program for Smartform for the same Invoice List Transaction .
Hi swathi,
Yes based on conditions you can print the smartform in the driver program.
SELECTION-SCREEN BEGIN OF BLOCK block WITH FRAME.
PARAMETERS:
p_vintag RADIOBUTTON GROUP rad1,
p_contag RADIOBUTTON GROUP rad1,
p_rmctag RADIOBUTTON GROUP rad1,
p_rfrtag RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK block.
IF sy-subrc EQ 0.
*"For Vintag smartform................................................
IF p_vintag EQ 'X'.
w_form = 'Y_HFA_VINTAG'.
*"For Containertag smartform..........................................
ELSEIF p_contag EQ 'X'.
w_form = 'Y_HFA_CONTTAG'.
*"For Remanufacturedtag smartform.....................................
ELSEIF p_rmctag EQ 'X'.
w_form = 'YH_HFA_REMAC'.
*"For Reefertag smartform.............................................
ELSEIF p_rfrtag EQ 'X'.
w_form = 'YH_HFA_REEFER'.
Regards,
Sravanthi -
How to Debug the Driver Pgm and Smartform while Invoice Creation(VF01)
Hello All,
I've configured the Driver Pgm and Smart Form in NACE for the output type RD00. I would like to debug the Driver Pgm and Smartform while creation of invoice using VF01. I've set the break points in the Driver Pgm and Smart form, but its not taking me to there while creating an Invoice using VF01.
Once the Invoice created, If I go thru the VF02/VF03 to see the output, I'm able to debug.
Please help me to debug the Driver Program and Smartform during the Invoice Creation.
I've configured the following objects in NACE:
Program ZDRIVER_PGM_INVOICE_SMARTFORM
Form Routine ENTRY
PDF/Smartform Form ZINVOICE(Smartform)
Thanks in Advance!
Anil S.Moderator message - Welcome to SCN.
But please read Please read "The Forum Rules of Engagement" before posting! HOT NEWS!! and How to post code in SCN, and some things NOT to do... before posting. In particular, asking the same question multiple times is not allowed.
Thread locked
Rob
Maybe you are looking for
-
Can you have multiple ipods and multiple libraries running on the same computer. I have an Ipod classic, I just purchased an Ipod nano for my wife. Our music aren't completely similar. I would like to have to totally separate libraries on the same co
-
When I click on my bookmarks they no longer open in a new tab, what do I do to fix it?
I just uploaded to the newest version of Firefox. Now, when I click on a bookmark the link opens in the same tab - they won't open in a new tab. However, when I click on a link in an existing page that link opens in a new tab. I miss having my bookma
-
Where do you buy a lightning AV adapter and a HDMI to Micro-HDMI cable?
I need to connect my iphone 5s to the micovision projector. I have read that I need a Lightning AV adapter and a HDMI to Micro-HDMI cable. Where can this be purchased?
-
Converting from Panther to Tiger
I have been using Panther since I bought my new iMac 1 year ago. I have no serious complaints except maybe that **** spinning ball that occasionally pops up (usually at the worst times). I've looked at some of the features of Tiger which are, admitte
-
Show ringing status on FXO card.
Hi all, This might sound a bit nit pickey, but you know that when you typically dial out on a T1 or other digital line, it show on the phone the it is ringing. That is basically what I want to do with my FXO card. I would like the CM or Gateway to he