Spool req in smartforms!
Dear SDNers,
I have a requirement for barcode in smartforms.My output sounds good in development server as well as in production server.My problem is it wont create spool request in production server instead it come back to selection-screen.so i cant take print out.
Urgently needed...
Reward sure.... if it is useful....
Thanks and regards,
Senthil kumar.
Hi Senthil,
After smartforms are generated, send it to spool. this will fix your issue..
Use the function module 'GET_PRINT_PARAMETERS'.
sample:
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_ID = C_CHAR_UNKNOWN
ARCHIVE_INFO = C_CHAR_UNKNOWN
ARCHIVE_MODE = C_CHAR_UNKNOWN
ARCHIVE_TEXT = C_CHAR_UNKNOWN
AR_OBJECT = C_CHAR_UNKNOWN
ARCHIVE_REPORT = C_CHAR_UNKNOWN
AUTHORITY = C_CHAR_UNKNOWN
copies = g_copies
COVER_PAGE = C_CHAR_UNKNOWN
DATA_SET = C_CHAR_UNKNOWN
department = ''
destination = g_destination
expiration = g_days
immediately = ' '
IN_ARCHIVE_PARAMETERS = ' '
IN_PARAMETERS = ' '
layout = 'X_65_200'
line_count = 65
line_size = 200
list_name = g_listname
list_text = g_listtext
MODE = ' '
new_list_id = 'X'
PROTECT_LIST = C_CHAR_UNKNOWN
no_dialog = 'X'
receiver = 'SAP*'
release = ' '
REPORT = C_CHAR_UNKNOWN
sap_cover_page = 'X'
HOST_COVER_PAGE = C_CHAR_UNKNOWN
PRIORITY = C_NUM1_UNKNOWN
SAP_OBJECT = C_CHAR_UNKNOWN
TYPE = C_CHAR_UNKNOWN
USER = SY-UNAME
USE_OLD_LAYOUT = ' '
UC_DISPLAY_MODE = C_CHAR_UNKNOWN
DRAFT = C_CHAR_UNKNOWN
ABAP_LIST = ' '
USE_ARCHIVENAME_DEF = ' '
DEFAULT_SPOOL_SIZE = C_CHAR_UNKNOWN
PO_FAX_STORE = ' '
NO_FRAMES = C_CHAR_UNKNOWN
IMPORTING
OUT_ARCHIVE_PARAMETERS =
out_parameters = g_params
valid = g_valid.
IF g_valid <> space.
NEW-PAGE PRINT ON PARAMETERS g_params NO DIALOG.
IF NOT tb_output3[] IS INITIAL.
LOOP AT tb_output3 INTO wa_output3.
PERFORM write_summary.
ENDLOOP.
ENDIF.
<b>Reward if useful...</b>
Similar Messages
-
Print number pages and formpages in a spool of multiple smartforms
Dear all,
I have created a program that create a spool using 4 smartforms. For each smartform the program can be create one o more pages. at the moment in my spool I have this situation:
document #1: smartforms#1 pag 1/1,
smartforms#2 pag 1/2, pag 2/2
smartforms#3 pag 1/1,
smartforms#4 pag 1/5, 2/5, 3/5, 4/5, 5/5.
document #2: smartforms#1 pag 1/1,
smartforms#2 pag 1/3, pag 2/3, pag 3/3
smartforms#3 pag 1/2, 2/2
smartforms#4 pag 1/4, 2/4, 3/4, 4/4.
How I can modify my program in order to have this result:
document #1: smartforms#1 pag 1/9,
smartforms#2 pag 2/9, pag 3/9
smartforms#3 pag 4/9,
smartforms#4 pag 5/9, 6/9, 7/9, 8/9, 9/9
document #2: smartforms#1 pag 1/10,
smartforms#2 pag 2/10, 3/10, 4/10,
smartforms#3 pag 5/10, 6/10,
smartforms#4 pag 7/10, 8/10, 9/10, 10/10.
Thanks in advance for any solutions.
Maurohi
may be this hepls u, i have senn this in another thread..
smartfom1.
ssfcompop-TDNEWID = 'X'.
ssfcompop-TDFINAL = ' '.
ssfcompop-TDIMMED = ' '.
smartfom2,3,4
ssfcompop-TDNEWID = ' '.
ssfcompop-TDFINAL = ' '.
ssfcompop-TDIMMED = ' '.
smartfom5,
ssfcompop-TDNEWID = ' '.
ssfcompop-TDFINAL = 'X'.
ssfcompop-TDIMMED = 'X'. -
Single spool for multiple smartforms
Hi,
I am using Function modules SSF_open and ssf_close for creating single spool for multiple smartforms but when i try to run the program in background then the job is getting cancelled...........and if i run the program in foreground then the program is running fine giving single spool for multiple forms........
so the problem is that job should run in background if i run it in background instead job is getting cancelled.
please tell me the solution how can i get the single spool for and multiple smartforms as well as the job should run if i am doing so.Moved to the correct forum
-
How to edit the contents of spools generated by smartforms
Hi All,
I am developing a print form using print work bench & smartforms.
There is a requirement to generate both preprinted forms (contains only datas) and Non-preprinted forms (contains u2026 data + layout + colors + picturesu2026etc) using a single smartform.In which the non-preprinted part should only get converted into pdf & preprinted should only be get printed.
For this I am making a replica of the first two pages of non-preprinted into preprinted format in the same smartform(total 4 pages).
Here I am able to extract & save the non-preprinted part from the spool into PDF.
After the above process, I want to edit the spool content, & then sent to printer.
But clueless about editing the spool content...
( for eg:- delete the first two pages of content in the spool & print the rest)
So my question is u2026.
-Is it possible to edit the contents of spool generated by smartforms u2026 ?
(Is it possible to copy the content of existing spool ,edit, save it into new spool and delete the old one. )
Any solutions / suggestions u2026 ?
Thank you for your attention.
With Regards,
santhHi Niki,
Thank you for your time & suggestions....
>
Niki wrote:
>
> try to control it in smartform itself.....(above idea will not work).
>
> try this ...
> from ur driver program pass a variable to identify o/p is preprinted forms or non-preprinted forms
Yes, I got your point... I even tried this option also.
First of all the user want both(preprinted-hardcopy & non-preprinted pdf) form in a single process, so that data integrity is maintained both in hardcopy & soft copy.
Even if I negotiate tha above requirement....
The problem is , I am using Print WorkBench , not an user-defined driver program.Inside printworkbench , the smartform is mentioned.
The process is as follows...
ea40/ea60(isu billing transaction) -> Printworkbench ->smartforms -> spool -> printer(preprint part) / pdf(non - preprint).
Hope u understand my limitations....
Still expecting a solution...
Regards,
santh -
HI experts,
how to create the spool request for smartform. can anyone help me. give me the complete procedure.
thanks in advance for ur responce.The user which send the smartform to the spool (probably wf-batch) needs an output device. You can maintain this in SU01.
Just look at sample code:
1.Send Smart Form output to spool using the FM <ws_formname> (FM name derived from the export parameters of SSF_FUNCTION_MODULE_NAME).
//Start of Code Sample
DATA : ws_formname TYPE rs38l_fnam.
TYPES: BEGIN OF ty_script,
trans_ref LIKE eanl-anlage,
cont_ref TYPE e_edmideservprovcontractid,
trans_code TYPE char05,
trans_reason TYPE char05,
market_sect LIKE eanl-zzmktscode,
efffrm_date LIKE sy-datum,
mprn LIKE iflot-zzmprn,
mlc TYPE char01,
subbuild_no(40) TYPE c,
build_no LIKE adrc-str_suppl1,
dep_fare LIKE adrc-str_suppl3,
post_town LIKE adrc-city1,
post_code LIKE adrc-post_code1,
asset_code LIKE egerh-kombinat,
paymnt_code(2) TYPE c,
model_code LIKE equi-typbz,
manuf_code LIKE equi-herst,
year_manuf LIKE equi-baujj,
serial_no LIKE equi-sernr,
meter_code TYPE char01,
meter_mech(2) TYPE c,
meas_cap TYPE zmeasur_cap,
role_code TYPE char03,
market_name LIKE eservice-serviceid,
status TYPE char01,
END OF ty_script.
DATA: i_scriptdata TYPE STANDARD TABLE OF ty_script
WITH HEADER LINE.
DATA: wa_output_options TYPE ssfcompop,
wa_control_params TYPE ssfctrlop,
wa_spoolnum TYPE rspoid,
wa_printdata TYPE efg_strn_printdata.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Your Form Name'
IMPORTING
fm_name = ws_formname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION ws_formname
EXPORTING
control_parameters = wa_control_params
c = wa_printdata
IMPORTING
job_output_info = wa_job_output_info
TABLES
i_scriptdata_input = i_scriptdata(Your Script Data)
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
MOVE wa_job_output_info-spoolids] TO wa_spoolids[.
READ TABLE wa_spoolids INTO wa_spoolnum INDEX 1.
IF sy-subrc = 0.
DATA :id LIKE tsp01-rqident.
MOVE wa_spoolnum TO id.
ENDIF. .
Comments-Id Contains the Spool Request for the given smart form
//End of Code Sample
Convert Smart Form Output to Raw
Format
2.Convert the Spool Output to OTF using the FM RSPO_RETURN_SPOOLJOB.
//Start of Code Sample
data i_soli LIKE soli occurs 0 with header line.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = id
desired_type = 'OTF'
TABLES
buffer = i_soli
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
Comments- i_soli contains the OTF data
//End of Code Sample
3.Convert the OTF using FM
SX_OBJECT_CONVERT_OTF_RAW.
DATA content_bin TYPE solix_tab.
DATA objhead TYPE soli_tab.
DATA i_soli_tab TYPE soli_tab.
DATA boolean TYPE sx_boolean.
DATA length TYPE so_obj_len.
LOOP AT i_soli.
APPEND i_soli TO i_soli_tab[].
ENDLOOP.
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_RAW'
EXPORTING
format_src = 'OTF'
format_dst = 'RAW'
CHANGING
transfer_bin = boolean
content_txt = i_soli_tab
content_bin = content_bin
objhead = objhead
len = length
Convert Smart Form Output to Raw
Format
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
REward points if useful. -
Multiple smartform in one spool req
Hello all,
i am calling same smartform multiple time (twice) from a program. i want to see the output in print priew as first page as first smartform data and second page as second smartforms data. will you please guid me how can i do this. please provide me step by step process.
The two smartforms are getting called when i checked two checkboxes.
thank you for your answers.
Sidds.Solved the problem
-
How to check if the spool req is open or close and close the req or open it
Hi All.
I have developed a program in which user can have option of print preview the outputs (all prints in one print request) , then save the outputs in one pdf, then send them through fax/email
But problem is that when I run each option, the spool requests get generated properly. But when I do print preview and then save as pdf is gives error message that
"No output request open. Document processing not possible. "
Diagnosis
You tried to process a new document by calling function module
SSFCOMP_PROCESS_DOCUMENT, but no output request is open.
System response
The system issues an error message.
Procedure
Check the sequence in which you call the function modules SSFCOMP_OPEN
and SSFCOMP_CLOSE. This is probably an internal error. Contact the SAP
hotline and report the problem.
in the code of print preview I have called the FM:
call function 'SSFCOMP_CLOSE'
exceptions
ERROR = 1
others = 2.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Please help.
Rgds,
MadhuriHi
1) Use below parameters of structure SSFCTRLOP
NO_OPEN, NO_CLOSE: These two flags prevent the print request from being closed after accepting the output of the Smart Form and allows you to include all other form output into this print request. The value should be like the following:
1st call:
NO_OPEN = SPACE.
NO_CLOSE = 'X'.
nth call:
NO_OPEN = 'X'.
NO_CLOSE = 'X'.
last call:
NO_OPEN = 'X'.
NO_CLOSE = SPACE
2.SSFCOMPOP: Structure for the output option.
TDNEWID: A flag indicating whether a new request is created.
4) Define one data wa_print_control referencing the structure SSFCTRLOP, and define another data variable wa_output_option referencing the structure SSFCOMPOP in the top include file of this report.
5) Clear the above two work areas before the print loop happens on the internal table that contains the selected invoice headers.
6) Initialize these two work areas with the values which would not change during the print loop as the following code fragment:
wa_print_control-no_dialog = ' '. u201DShow print setting dialog
wa_print_control-preview = 'X'. u201DEnable print preview
wa_output_option-TDNEWID = 'X'. u201CNew spool request.
7) In the loop at the internal table which holds the selected invoice headers, set blank value to of the field wa_print_control-NO_OPEN and set u2018Xu2019 to the field wa_print_control-NO_CLOSE for the first loop at the AT FIRST event because it will be the first call to the function module of the smartform. The code is bellow:
print_control-no_open = ' '.
print_control-no_close = 'X'.
8) Set blank value to the field wa_print_control-NO_CLOSE to close the spool request for the last loop at the AT LAST event.
wa_print_control-NO_CLOSE = u2018 u2018
9) Call the function module generated by the Form Design by passing the print control work area and output area. -
Long time for generating spool request for smartforms
Hi,
I'm have designed a smartforms for printing a Receipt form. It takes about 1 minute for generating spool request after pressing the PRINT button in PRODUCTION Server only.
The Code i used is below
CALL FUNCTION lv_fname
EXPORTING
p_belnr = p_belnr
p_bukrs = p_bukrs
p_gjahr = p_gjahr
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.
Please help me out to sort this issue.
Thanks,
Ramesh
Edited by: Rameshkumar Raamasamy on Mar 4, 2012 6:21 AMHi Rameshkumar,
you may look at the code sections of your smartform: If you have a lot more data in production than you have in development, it is especially important to use a fully specified primary key for any SELECTs.
You may also ask your basis people to check if any performance warnings have been recorded with database system. This happens quite frequently that growing database tables cause problems when table spaces are not properly assigned or table sizes are not maintained adequately.
Regards
Clemens -
How to create new spool request in smartforms??????
hi all,
i have to ctreate a new spool request for a smartform...
The driver program for this smartform is a standard program.
when i run the transaction, the spool for standard sap-script gets created but not for my smartform.
the code is something like this:-
wa_ssfcompop-TDDEST = 'LOCL'.
wa_ssfcompop-TDIMMED = space.
wa_ssfcompop-TDNEWID = 'X'.
wa_ssfcompop-TDFINAL = 'X'.
*wa_ssfcompop-XSF = 'X'.
wa_SSFCTRLOP-no_dialog = 'X'.
CALL FUNCTION v_fm_name
EXPORTING
CONTROL_PARAMETERS = wa_SSFCTRLOP
OUTPUT_OPTIONS = wa_ssfcompop
wa_rldri = xrldri
wa_rldrp = xrldrp
wa_rldru = xrldru
wa_t329p = xt329p
wa_resb = xresb
wa_rldrc = xrldrc
wa_vblkk = xvblkk
wa_vblkp = xvblkp
wa_rldrh = xrldrh
wa_rlvek = xrlvek
wa_reftab = xreftab
wa_lthu = xlthu
v_date = v_date
v_time = v_time
v_label = v_label
v_bzeit = v_bzeit
v_name1 = v_name1
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
it_rldri = xrldri
it_rldrh = xrldrh
it_rldrc = xrldrc
it_vblkk = it_vblkk
it_vblkp = it_vblkp
it_rldrp = it_rldrp
it_rldru = it_rldru
it_t329p = it_t329p
it_resb = it_resb
it_rlvek = it_rlvek
it_reftab = it_reftab
it_lthu = it_lthu
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Help would be greatly appreciated and definitely rewardedhi
good
Use the function module 'GET_PRINT_PARAMETERS'.
sample:
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_ID = C_CHAR_UNKNOWN
ARCHIVE_INFO = C_CHAR_UNKNOWN
ARCHIVE_MODE = C_CHAR_UNKNOWN
ARCHIVE_TEXT = C_CHAR_UNKNOWN
AR_OBJECT = C_CHAR_UNKNOWN
ARCHIVE_REPORT = C_CHAR_UNKNOWN
AUTHORITY = C_CHAR_UNKNOWN
copies = g_copies
COVER_PAGE = C_CHAR_UNKNOWN
DATA_SET = C_CHAR_UNKNOWN
department = ''
destination = g_destination
expiration = g_days
immediately = ' '
IN_ARCHIVE_PARAMETERS = ' '
IN_PARAMETERS = ' '
layout = 'X_65_200'
line_count = 65
line_size = 200
list_name = g_listname
list_text = g_listtext
MODE = ' '
new_list_id = 'X'
PROTECT_LIST = C_CHAR_UNKNOWN
no_dialog = 'X'
receiver = 'SAP*'
release = ' '
REPORT = C_CHAR_UNKNOWN
sap_cover_page = 'X'
HOST_COVER_PAGE = C_CHAR_UNKNOWN
PRIORITY = C_NUM1_UNKNOWN
SAP_OBJECT = C_CHAR_UNKNOWN
TYPE = C_CHAR_UNKNOWN
USER = SY-UNAME
USE_OLD_LAYOUT = ' '
UC_DISPLAY_MODE = C_CHAR_UNKNOWN
DRAFT = C_CHAR_UNKNOWN
ABAP_LIST = ' '
USE_ARCHIVENAME_DEF = ' '
DEFAULT_SPOOL_SIZE = C_CHAR_UNKNOWN
PO_FAX_STORE = ' '
NO_FRAMES = C_CHAR_UNKNOWN
IMPORTING
OUT_ARCHIVE_PARAMETERS =
out_parameters = g_params
valid = g_valid.
IF g_valid <> space.
NEW-PAGE PRINT ON PARAMETERS g_params NO DIALOG.
IF NOT tb_output3[] IS INITIAL.
LOOP AT tb_output3 INTO wa_output3.
PERFORM write_summary.
ENDLOOP.
ENDIF.
Reward if useful...
thanks
mrutyun^ -
Get Spool number for Smartform
Hi All,
I have created a smartform to print the POs created through ME21n. I have changed the config to use this smartform when a PO is changed/created. Everything is working fine. All I need is the spool number for each of the PO this is being printed. Can you please let me know how I can achieve this through the FM for smartform?
I AM USING 4.6C.
This is how I am using the function module
CALL FUNCTION FM_NAME
EXPORTING
CONTROL_PARAMETERS = CONTROL
OUTPUT_OPTIONS = OUTPUT
USER_SETTINGS = ' '
EKKO = L_DOC-XEKKO
PEKKO = L_DOC-XPEKKO
DRUVO = L_DRUVO
IMPORTING
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
TABLES
EKPO = L_DOC-XEKPO
PEKPO = L_DOC-XPEKPO
XAEND = IT_XAEND
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
All your inputs are greatly appreciated.
Thanks!
SandeepHi,
JOB_OUTPUT_OPTIONS is of type SSFCRESOP, which does not have a SPOOLIDS field/table.
I knwo that the function module SSF_CLOSE returns the spool id in a table. But, I am not sure how to use SSF_OPEN and SSF_CLOSE. Can you please throw some light on how I can use these to get the spool numbers?
This is what I have right now.
JOB_OUTPUT_OPTIONS-TDDEST = ITCPO-TDDEST.
JOB_OUTPUT_OPTIONS-TDNEWID = 'X'.
L_FORMNAME = TNAPR-FONAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = TNAPR-SFORM
FORMNAME = L_FORMNAME
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.
ENDIF.
CALL FUNCTION FM_NAME
EXPORTING
CONTROL_PARAMETERS = CONTROL
OUTPUT_OPTIONS = OUTPUT
USER_SETTINGS = ' '
EKKO = L_DOC-XEKKO
PEKKO = L_DOC-XPEKKO
DRUVO = L_DRUVO
IMPORTING
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
TABLES
EKPO = L_DOC-XEKPO
PEKPO = L_DOC-XPEKPO
XAEND = IT_XAEND
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.
ELSE.
SELECT RQIDENT RQOWNER RQCRETIME FROM TSP01 INTO TABLE IT_TSP01
WHERE RQOWNER = SY-UNAME.
IF SY-SUBRC = 0.
SORT IT_TSP01 BY RQCRETIME DESCENDING.
READ TABLE IT_TSP01 INDEX 1.
SPOOLID = IT_TSP01-RQIDENT.
PERFORM PROTOCOL_UPDATE USING '320' SPOOLID SPACE SPACE SPACE.
ENDIF.
ENDIF.
The SELECT part is wrong, I need to replace this code to get the correct spool numbers.
Thanks in advance.
Sandeep -
Hi all,
How to generate a spool number of a smartform.
Remember in the condition for that output type i have marked Print Immediately.
Regards,
Rajeswara Rao.JHi Rajeshwara,
Welcome to SDN.
Please check this link for sample code.
Re: PDF Output
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
Hope this will help.
Regards,
Ferry Lianto -
Single spool for different smartforms
Hi
Abapers ,
I need to print different layouts in single spool.
How can I do it.
Thanks in advance,
VaniThank you very much Mrutyun and Murugesh.
I have used SSF_OPEN and SSF_CLOSE function modules.
If the same smart form is called n times it outputting fine but depending upon the condition , corresponding smartforms should be called. In such case a case 'formatting_error' is the exception when calling the function module name.
Please suggest what might be wrong.
once again Thanks. -
Hi. I have the next problem. I have a program that shows 13 smartforms. I want to use the same spool order por each smartform. For example, I execute my program and it shows the first smartform, so I have to capture the spool order of that first call, and pass it to the next smartform. The problem is that I don't know is the spool order returned. Thanks.
You have to pass this in CONTROL_PARAMTER -
getotf = 'X'.
no_dialog = 'X'.
tdnoprev = 'X'. -
Creating spool requests using smartforms
hi folks,
I need help in this area...
I have an ABAP print program that I run to create monthly statements. There are two categories while running the monthly statements identified by the code '6' or '7' Now, i have to create separate spool requests so that while running the print program for these monthly customers.
How can I do this?
SanthoshOk, first lets say that ACCITAB has the records that are printed in the main window of the form. The number of pages for each customer depends on how many records are present in the ACCITAB for the customer.
For example.... ACCITAB.
<b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 <b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 $1.00
1234 08/26/2005 $1.00
1234 08/27/2005 $1.00
5678 08/21/2005 $1.00
5678 08/22/2005 $1.00
5678 08/23/2005 $1.00
5678 08/24/2005 $1.00
5678 08/25/2005 $1.00
5678 08/26/2005 $1.00
.00
1234 08/26/2005 <b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 $1.00
1234 08/26/2005 $1.00
1234 08/27/2005 $1.00
5678 08/21/2005 $1.00
5678 08/22/2005 $1.00
5678 08/23/2005 $1.00
5678 08/24/2005 $1.00
5678 08/25/2005 $1.00
5678 08/26/2005 $1.00
.00
1234 08/27/2005 <b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 $1.00
1234 08/26/2005 $1.00
1234 08/27/2005 $1.00
5678 08/21/2005 $1.00
5678 08/22/2005 $1.00
5678 08/23/2005 $1.00
5678 08/24/2005 $1.00
5678 08/25/2005 $1.00
5678 08/26/2005 $1.00
.00
5678 08/21/2005 <b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 $1.00
1234 08/26/2005 $1.00
1234 08/27/2005 $1.00
5678 08/21/2005 $1.00
5678 08/22/2005 $1.00
5678 08/23/2005 $1.00
5678 08/24/2005 $1.00
5678 08/25/2005 $1.00
5678 08/26/2005 $1.00
.00
5678 08/22/2005 <b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 $1.00
1234 08/26/2005 $1.00
1234 08/27/2005 $1.00
5678 08/21/2005 $1.00
5678 08/22/2005 $1.00
5678 08/23/2005 $1.00
5678 08/24/2005 $1.00
5678 08/25/2005 $1.00
5678 08/26/2005 $1.00
.00
5678 08/23/2005 <b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 $1.00
1234 08/26/2005 $1.00
1234 08/27/2005 $1.00
5678 08/21/2005 $1.00
5678 08/22/2005 $1.00
5678 08/23/2005 $1.00
5678 08/24/2005 $1.00
5678 08/25/2005 $1.00
5678 08/26/2005 $1.00
.00
5678 08/24/2005 <b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 $1.00
1234 08/26/2005 $1.00
1234 08/27/2005 $1.00
5678 08/21/2005 $1.00
5678 08/22/2005 $1.00
5678 08/23/2005 $1.00
5678 08/24/2005 $1.00
5678 08/25/2005 $1.00
5678 08/26/2005 $1.00
.00
5678 08/25/2005 <b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 $1.00
1234 08/26/2005 $1.00
1234 08/27/2005 $1.00
5678 08/21/2005 $1.00
5678 08/22/2005 $1.00
5678 08/23/2005 $1.00
5678 08/24/2005 $1.00
5678 08/25/2005 $1.00
5678 08/26/2005 $1.00
.00
5678 08/26/2005 <b>Customer Invoice Date Passed Due</b>
1234 08/25/2005 $1.00
1234 08/26/2005 $1.00
1234 08/27/2005 $1.00
5678 08/21/2005 $1.00
5678 08/22/2005 $1.00
5678 08/23/2005 $1.00
5678 08/24/2005 $1.00
5678 08/25/2005 $1.00
5678 08/26/2005 $1.00
.00
Lets say we have two customers in our table, customer 1234 has only two records associated with him, customer 5678 has like 75 lets say. Here you will need to loop at this table and count how many records are there for each customer and store it in another internal. Maybe you can have a separate internal table for each category.
Types: begin of titab,
kunnr type kna1-kunnr,
count type i,
end of titab.
Data: itab_1 type table of titab with header line.
Data: itab_2_5 type table of titab with header line.
Data: itab_6_M type table of titab with header line.
One for 1 pagers, one of 2-5 pagers, and one for 6 and more pages.
Now loop thru ACCITAB and at the end of a customer you need to write a record to one of these tables with the record count. Use the AT END statement. You will need to determine the maximum number of printed lines that your form handles in the MAIN window. Example, how many printed lines does it take to make the form go to the next page. You need to find what this number is.
When you have this number, now you can do some logic which will split the customers into there categorys.
Let's say that the max is 50 lines per page.
Data: counter type i.
LOOP AT ACCITAB.
counter = counter + 1.
at end of kunnr.
IF counter < '50'.
itab_1-kunnr = accitab-kunnr.
itab_1-count = counter.
append itab_1.
elseif counter => '51'
and counter =< '250'.
itab_2_5-kunnr = accitab-kunnr.
itab_2_5-count = counter.
append itab_2_5.
elseif counter => '251'.
itab_6_m-kunnr = accitab-kunnr.
itab_6_m-count = counter.
append itab_6_m.
ENdif.
clear counter.
endat.
ENDLOOP.
Now you have the customers split out into separate internal tables depending on how many pages for thier statement. Now you can start printing.
call fucntion 'OPEN_FORM'.
Loop at itab_1.
* Do the logic which prints your form.
endloop.
call fucntion 'CLOSE_FORM'.
call fucntion 'OPEN_FORM'.
Loop at itab_2_5.
* Do the logic which prints your form.
endloop.
call fucntion 'CLOSE_FORM'.
call fucntion 'OPEN_FORM'.
Loop at itab_6_m.
* Do the logic which prints your form.
endloop.
call fucntion 'CLOSE_FORM'.
Please remember to award points for helpful answers. Thanks.
Regards,
Rich Heilman -
Dear All
Can anybody send me smartform examples. I m new in smartform development.
Regards
sanjeev
I've already warned you once today. Repeated violations of the Rules of Engagement would invite deletion on your User Id.
Edited by: kishan P on Aug 25, 2010 1:58 PMHi,
Please do research before posting.
thanks,
Maybe you are looking for
-
I have never heard the fans in this 20-inch 2.4 GHz iMac and yesterday the temp was showing just over 140 degrees F while updating some software. Three questions: At what temp should the fans turn ON? At what temp will the iMac shut down? Anyway to m
-
Scanner problems using windows 8 and canon pixma mx432. printer is set up but wont scan
I have my printer installed on my computer already but the scanning function is not even coming up to be able to use it. I recently was given a new computer and it has windows 8 on it. it took a lot to get it to even be installed on the computer but
-
Replicate customer contact from R/3 to CRM
All, here is the scenario I have downloaded customers from R/3 to CRM. Now I'm trying to download the contacts in customer account to CRM. When I go to relationships in CRM, I should be able to view the same contacts in R/3 for this customer Settings
-
SMSY: Product version SAP R/3 ENTERPRISE 47X200 keeps returning
Hi, Last year we have upgraded our SAP R/3 ENTERPRISE 47X200 system to SAP ERP 6.0. For downloading enhancement packages we need the product version to be SAP ERP 6.0. In SMSY however, SAP R/3 ENTERPRISE 47X200 is still mentioned in the product versi
-
MX7 multiple instance jdbc data sources
The data sources on my single instance install of MX7 (Solaris9, Oracle9i), using jdbc, worked just fine. In a single instance install, the environment variables needed for jdbc (ORACLE_HOME, TNS_ADMIN, etc.) go in the start script $CF_DIR/bin/coldfu