Problem in Calling a smartform in a driver program(SE38)
Hi,
I created a report in SE38 and i have a 5 CHECK Boxes. i called a smartformsin that program.
My problem is if i check the 5 check boxes the layout should show 5 copies.
if i check 3 check boxes the layout should show 3 copies. e.t.c.
Edited by: vijay krishna on Jul 12, 2008 9:47 AM
Hi amit,
thanks for this code.
But i am using this code. i have 3 check boxes as vendor , gatepass , office copies
if i select this 3 check box i want the three copies of there repective copy heading like in first page Vendor copy , in 2nd copy gatepass copy e.t.c.
w_formname = 'Z_MM_REP_GATEPASS'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = w_formname
IMPORTING
fm_name = w_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
call function w_fm_name
exporting
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = tdcopies
USER_SETTINGS = 'X'
s_bukrs = v_bukrs
s_mblnr = p_mblnr
s_mjahr = p_mjahr
s_data = p_data
s_lifnr = v_lifnr
s_nrgp = r_nrgp
s_rgp = r_rgp
s_gp = r_gp
s_gpcc = r_gpcc
s_chal = r_chal
s_truck = p_truck
s_date = p_date
s_freight = p_freigh
coun = var
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
tables
s_itab = ITAB[]
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.
Edited by: vijay krishna on Jul 12, 2008 1:17 PM
Edited by: vijay krishna on Jul 12, 2008 2:37 PM
Similar Messages
-
Calling a Smartform through a driver program.
Hi ALL,
I had created a smart-form and executed it without any errors.
Since its create a FM, which can be called by driver Program,when i called the smart-form FM from the driver program I get a Pop-up asking for the OUTPUT DEVICE. When we enter a device name its executed properly and can see the print preview of the form.
My concern is to avoid that pop up, by giving the device value in the program itself. To do so it provided a options though which i can send the device type.
these are the values which i have passed.
outop-TDTITLE = 'testing for title'.
outop-xdfoutdev = 'LP01'. "output device type
cparam-getotf = 'X'.
cparam-no_dialog = 'X'.
cparam-preview = ' '.
CALL FUNCTION fm_name "FM for smart-form.
EXPORTING
control_parameters = cparam
output_options = outop
* user_settings = 'X'
*** IMPORTING
** job_output_info = tab_otf_data
* EXCEPTIONS
* formatting_error = 1
* internal_error = 2
* send_error = 3
* user_canceled = 4
* OTHERS = 5.
Can you tell where am I going wrong, so that can avoid that window.
Thanks,
Lalitkumar.Hi shivendran,
I tried the mentioned code by mentioned by you. but still the issue exists that is the popup for output device.
DATA:fm_name TYPE rs38l_fnam.
DATA: ls_control_pars TYPE ssfctrlop,
ls_output_opt TYPE ssfcompop.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'z_smartform_test'
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.
ls_output_opt-tddest = 'LP01'.
ls_output_opt-tdimmed = 'X'.
ls_control_pars-no_dialog = 'X' .
CALL FUNCTION fm_name
EXPORTING
control_parameters = ls_control_pars
output_options = ls_output_opt
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.
this is code which i tried to call my amartform from driver program.
I tried assigning the default output device by
open a session:
Clickon the system menu->user profile -> own data
then goto the defaults tab. in the spool control section maintain output device (your printer name where you want to print)
but still the problem exists.
Please help to resolve this issue.
Thanks,
Lalitkumar. -
Calling a Smartform from different driver programs
Hi everyone,
I have two driver programs and from both these programs i'm calling the same Smartform.
I have a field in smartform. and i want it to be printed for one program but not printed when the
smartform is called from the second program.
Pls. can anyone help me out about how this can be achieved.
Thanks in advance.
Regards
TanuCreate an import parameter (flag) in your smartform interface and when you call your smartform from one of these drivers pass assume 'X' value to this flag. And add a condition for the field you want to hide. like below.
if flag = 'X'
show or don't show.
endif.
Edited by: Gungor Ozcelebi on Jul 3, 2009 5:08 PM -
Can we call multiple Smartforms from single Driver Prog?
Hi all,
Can we call multiple smartforms from single Driver Program. Here Driver program is custom Program.
I want to give Print Parameter only once and output should get printed one after the another smartform in same order of smarforms were called.
If yes, then how?
Thanks in advance.Yes, you can do this in your Smartform driver program.
Each time you call you Smartform function module you will need to change the values in structure OUTPUT_OPTIONS slightly.
On the first call set TDNEWID to X.
After this, set it to space
On the last form set TDFINAL to X.
This will put all of the output into one spool request, in the order they are called in the program.
Regards,
Nick -
Calling two smartforms in one Abap program
Hi ABAPers,
Can anybody know how to call 2 smartforms in 1 abap program?actually i used the FM SSF_FUNCTION_MODULE_NAME...and two smart forms are called...but my main problem is...the first smartforms is called and the print dialog box appeared...once i click the button back ...the second smartforms is called and print dialog box appeared again..
I want to correct this...i want this to be happen once i click the print button...the two smart forms will be combined in a one printing...meaning the first page is the first smartforms and the next page will be the second smart forms...no matter how many pages will be the first smartforms...the second smartforms will concatenate or will append to the last page of the first smartforms..how can i do this?
Please help...this is my sample code..kindly correct the error.
Will reward points...
suppressing the dialog box****************************
outop-tddest = 'LP01'.
cparam-no_dialog = 'X'.
cparam-preview = space.
cparam-getotf = 'X'.
Call the First Smartforms *******************
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSF_CHEQUE'
IMPORTING
fm_name = ly_formname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION ly_formname
EXPORTING
prepared_by = p_prepb
approved_by = p_apprb
TABLES
it_cheque = it_final
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Call the Second Smartforms *******************
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSF_TSHEET'
IMPORTING
fm_name = ly_formname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION ly_formname
EXPORTING
prepared_by = p_prepb
approved_by = p_apprb
TABLES
it_cheque = it_final
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Thanks in advance
aVaDuDzhi,
i never used these function but i've found this link.
[http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/62ae7fcd-0b01-0010-3e9d-a54f26944450]
[http://help.sap.com/saphelp_nw2004s/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/content.htm]
[http://help.sap.com/saphelp_nw04/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/frameset.htm]
[SMartform printing;
hope that is useful.
bye
Marco
Edited by: nicolai marco on Jan 14, 2008 12:36 AM -
Reg : SMARTFORM name and DRIVER PROGRAM
Dear Gurus,
Can anybody help me out in providing standard SMARTFORM name and also driver Program for
'ANNUAL MAINTENANCE CONTRACT CONFIRMATION' in CS(Customer Service) module.
Cheers,
Loverboy KHi,
there is on a standard system no smartform for you. So you have to do your thing with the standard sapscript.
However there have been some BestPractices projects at SAP. There they have a lot of standard smartforms. Maybe you can download them from SAP somewhere the name will something
with MMCON or MMDLS in it.
you have to find out yourself because i do not have it here to send it to you.
Gr., Frank -
Table that list sapscripts/smartforms and their driver program
hi gurus
can ne one help me with the table name which holds the sapsciprt/smartform with their driver programsHi,
You can find all entries related to scripts and smartforms in the table TNAPR.
Transaction code is NACE-choose the application for example EFOutput types button -- output type choose from the list and click procedures.
Here also you will get same lsit as you can see by TNAPR table.
you provide output type like BA00 for sales order ..etc
while displaying entries.
Regds
Sivaparvathi
Please reward points if helpful.. -
Dump in smartform driver program for purchase order
i created one smartform with driver program for purchase order.
in smartfrom i gave
form interface: p_ebeln as import,
tables as it_ekpo like ekpo.
global definitions are
wa_ekko type ekko for printing the ekko data in one window,
wa_ekpo type ekpo .
in main window i took the one table and loop the ekpo table for printing the item details.
no errors is there.but ; when i call this generated function module to my driver program it goes to dump.
in driver program i declare structures,internal tables,work areas, and parameter as p_ebeln .
and also select statements for my table all are good.but its not work.
in function module i pass the details as export p_ebeln = p_ebeln and table it_ekpo = it_ekpo.
and also i done debugging in this data come to the internal table and work areas.
but it goes to dump.
if u dont mind plz solve my problem.
Thanks
Navya.
Moderator message: empty lines removed, subject corrected, please use meaningful subject lines when posting!
Edited by: Thomas Zloch on Mar 24, 2011 10:10 AMHi Navya,
Your smartform is correct. But, as per my understanding, the dump comes when you call the smartform from the driver program. If that is the case, please check the input parameters and all th parameters in the program should be same as used in samrtform. Any deviation would lead to a dump.
Analyse and resolve!!!
Regards
Atul Sachdeva -
Purchase Order Driver Program Not loading SMARTFORM
Hi,
I have developed Z smartform by copying from standard form and tried to call from standard program only but here I am not able to call my Z smartform and I am able to call only Z SAPSCRIPT from this standard program.
I have done all the necessary changes in NACE transaction but then also only when I keep the script name its working fine but when I replace this by smartform name the driver program is not calling smartform .!! why?
Please do let me know why is it like this?
Thanks
SudharshanHi,
PO driver program is written to support only SAPSCRIPT. So if you want to assign smartform in NACE, you should take a Zcopy of the driver program SAPFM06P with its include FM06PE02 as ZFM06PE02. And give the zprogram against the driver program field in NACE.
Then you need to replace the entry_nue subroutine in ZFM06PE02 with the below code.
form entry_neu using ent_retco ent_screen.
data: l_druvo like t166k-druvo,
l_nast like nast,
l_from_memory,
l_doc type meein_purchase_doc_print.
* Data Declaration for PO smartform Modification
DATA: fname TYPE rs38l_fnam,
xkomk TYPE TABLE OF komk,
gs_output TYPE ssfcompop,
gs_dialog TYPE ssfctrlop.
clear ent_retco.
if nast-aende eq space.
l_druvo = '1'.
else.
l_druvo = '2'.
endif.
call function 'ME_READ_PO_FOR_PRINTING'
exporting
ix_nast = nast
ix_screen = ent_screen
importing
ex_retco = ent_retco
ex_nast = l_nast
doc = l_doc
changing
cx_druvo = l_druvo
cx_from_memory = l_from_memory.
check ent_retco eq 0.
IF tnapr-sform NE ' '.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = tnapr-sform
IMPORTING
fm_name = fname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc EQ 0.
gs_dialog-no_dialog = 'X'.
gs_dialog-preview = 'X'.
gs_output-tddest = 'LP01'.
gs_output-tdnoprev = ' '.
gs_output-tdnoprint = ' '.
gs_output-tdimmed = 'X'.
gs_output-tdnewid = 'X'.
CALL FUNCTION fname " modify the interface as per your needs
EXPORTING
control_parameters = gs_dialog
output_options = gs_output
user_settings = ' '
zxekko = l_doc-xekko
zxpekko = l_doc-xpekko
TABLES
l_xekpo = l_doc-xekpo
l_xekpa = l_doc-xekpa
l_xpekpo = l_doc-xpekpo
l_xeket = l_doc-xeket
l_xtkomv = l_doc-xtkomv
l_xekkn = l_doc-xekkn
l_xekek = l_doc-xekek
l_xkomk = xkomk
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
ELSE.
CALL FUNCTION 'ME_PRINT_PO'
EXPORTING
ix_nast = l_nast
ix_druvo = l_druvo
doc = l_doc
ix_screen = ent_screen
ix_from_memory = l_from_memory
ix_toa_dara = toa_dara
ix_arc_params = arc_params
ix_fonam = tnapr-fonam "HW 214570
IMPORTING
ex_retco = ent_retco.
ENDIF.
ELSE.
CALL FUNCTION 'ME_PRINT_PO'
EXPORTING
ix_nast = l_nast
ix_druvo = l_druvo
doc = l_doc
ix_screen = ent_screen
ix_from_memory = l_from_memory
ix_toa_dara = toa_dara
ix_arc_params = arc_params
ix_fonam = tnapr-fonam "HW 214570
IMPORTING
ex_retco = ent_retco.
ENDIF.
endform.
While calling the smartform modify the fm interface to your needs.
This will solve your problem.
Regards
Karthik D -
Smartforms driver program output query
Hello friends,
I created sales invoice smartforms. For that i created one driver program in se38. But while i am executing driver program i am just getting program output. Both my smartforms design and driver program is activated. Someone please give me guidance to solve this problem.
Thanx & Regards,
Rahul TaleleHave you written this function module to specify the smartform name and execute the Smartform Function Module..
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZPP_PACKMATL_REQ' " smartform name
IMPORTING
FM_NAME = W_FORM_FUNCTION.
CALL FUNCTION W_FORM_FUNCTION
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
ITAB_DATA = ITAB_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.
ENDIF.
ENDFORM. " display_form -
How to Call Total Amount field from t.code - PC00_M40_ANN in driver program
Hi,
There is a standard Transaction for Payroll Annual display - PC00_M40_ANN. From this transaction we can see the Pension Amount month wise and in Totals as well as.
In my report, we want to call Total Amount (from T.Code PC00_M40_ANN).
For Ref., I have design a Smartform with its driver program. In driver program i required this Value...
Plz guide..Hi,
Please check the below code ....
Declare variables , structures .....
call function 'CU_READ_RGDIR'
exporting
persnr = pernr-pernr <--- pass the pernr
importing
molga = w_molga
tables
in_rgdir = itrgdir
exceptions
no_record_found = 1
others = 2.
if not w_molga is initial.
call function 'CD_READ_LAST'
exporting
begin_date = pn-begda
end_date = pn-endda
importing
out_seqnr = w_seqnr
tables
rgdir = itrgdir
exceptions
no_record_found = 1
others = 2.
endif.
if itrgdir is initial.
continue.
else.
select single relid from t500l into w_relid where molga = w_molga.
call function 'PYXX_READ_PAYROLL_RESULT'
exporting
clusterid = w_relid
employeenumber = pernr-pernr
sequencenumber = w_seqnr
read_only_international = 'X'
changing
payroll_result = itresult
exceptions
illegal_isocode_or_clusterid = 1
error_generating_import = 2
import_mismatch_error = 3
subpool_dir_full = 4
no_read_authority = 5
no_record_found = 6
versions_do_not_match = 7
error_reading_archive = 8
error_reading_relid = 9
others = 10.
get all the earnings and deductions
loop at itresult-inter-rt into wa_rt.
case wa_rt-lgart.
to get the net pay
when '/560'.
wa_pernr-npay = wa_rt-betrg.
v_npay = wa_rt-betrg.
endcase.
endloop. -
Calling Smart Form using Driver Program
Hi, I'm a new ABAP developer. I've recently been studied about Smart Forms and I didn't understand what are the benefits to call a smart form using driver program.
Could anyone help me, please?Bruno, it works like this.
Lets says you attach a Z output to a sales order which sends the details of the SO to the customer in a PDF format. For this purpose you have developer the o/p using smartforms or scripts. Now there are few configs that you will perform in order to send the PDF to the customer AUTOMATICALLY once the SO is saved. This is done thru the transaction NACE where you will attach the smartform, the o/p, partner function and driver program.
This driver program will get kicked in when the order is saved and will perform the logic and then call the smartform.
Hope this give a little bit better picture.
Vikram.M -
How to call a smartform in a bsp application
Hi,
I would like to have an example or code for calling a Smartform in a BSP program.Can anyone suggest me in this ?
Thanks in Advance,
shwethaHi,
Also chek the BSP application sf_webform_01 and page form.htm in it.
Go through the event OnInitialization of the events of form.htm too.
Hope this will be useful.
Rgds,
Vijayalakshmi -
How to find the standard smartform,sap scripts and theur driver programs
Hi friends,
can any one tell me how to find the standard smartforms and their driver programs and same for scripts also.
bye
sasiHi sasidhar,
1. Either standard or Y sapscript layouts,
we can check their standard programs
in this manner also.
2. goto se71
open the layout in DISPLAY mode.
3. FORM------> CHECK -
> TEXTS
4. a small window will come.
click ok (tick button)
5. Again a new window will come
which will list out all the DRIVER programs,
which use this layout.
regards,
amit m. -
Calling smartform in a background program
Hi Experts,
I want to call one smartform in a background program, i am very new to smartform .Can anybody help me to do this?
I want to suppress the dialog box appearing while directly executing the smartform?
Also please tell me how i can give the smartform data to spool?
Regards,
RatheeshHi Ratheesh,
First you create Form . in print program you have to read the data from data bace table table "nast". and Based on the NAST-OBJKY retrive your data.
DATA : RETURN_CODE TYPE SY-SUBRC,
US_SCREEN TYPE C,
P_ORDER LIKE NAST-OBJKY.
DATA: RETCODE LIKE SY-SUBRC. "Returncode
DATA: XSCREEN(1) TYPE C. "Output on printer or screen
DATA: REPEAT(1) TYPE C.
DATA : LT_TEXT LIKE TLINE-TDLINE.
CLEAR RETCODE.
XSCREEN = US_SCREEN.
SELECT SINGLE *
FROM NAST INTO NAST WHERE OBJKY = NAST-OBJKY. "P_VBELN.
PERFORM GET_DATA.
CASE RETCODE.
WHEN 0.
RETURN_CODE = 0.
WHEN 3.
RETURN_CODE = 3.
WHEN OTHERS.
RETURN_CODE = 1.
ENDCASE.
FORM GET_DATA .
P_ORDER = NAST-OBJKY.
SELECT VBELN
AUDAT
WAERK
KUNNR
VDATU
FROM VBAK
INTO TABLE TB_VBAK
WHERE VBELN = P_ORDER.
IF NOT TB_VBAK[] IS INITIAL.
SELECT VBELN
POSNR
MATNR
KWMENG
NETPR
NETWR
BRGEW
GEWEI
VOLUM
VOLEH
CHARG
WERKS
POSEX
KDMAT
FROM VBAP
INTO TABLE TB_VBAP
FOR ALL ENTRIES IN TB_VBAK
WHERE VBELN = TB_VBAK-VBELN.
ENDIF.
endform.
After complete this go through NACE transaction in that select required out put type and give you form name and Program name.
then go through the transaction in display mode and select the print preview. you will get your lay oput.
here You must give output type in proper.
Maybe you are looking for
-
Will apple TV effectively make my TV a wireless external monitor
Would I be able to use the Apple TV to to display anything my iMac screen shows? ie could I use it to show an Excel spreadsheet or a Keynote presentation? Ta
-
Hello, I am hoping that there may be some tech savvy people here who can advise me. My PowerMac G5 2.5 duo processors recently started acting up. There were times that the power button would not function. Could not shut it down and sometimes couldn't
-
Hello Experts, I was reading about credit control area which is basically - organizational unit that represents an area responsible for granting and monitoring credit. One control area can corresponds to many company code (though vice versa is not tr
-
I need help with a personal site that would be my Safari start page. I would like to have layers of HTML snippets that when clicked, would change the layer of the page to make that HTML snippet the top layer, so like dynamic tabs that would not chang
-
Can this be done with LR4 and Drobo FS?
When I import pictures on my MacBook Pro running Lion OS at home into LR4, I set it up to backup onto my Drobo FS which is a NAS device wirelessly via my home network. Not being computer saavy at all, can I set up both my Drobo and configure LR4 on