‎2007 Jun 05 10:13 AM
Hi all,
I have created smartform for Delivery Challan....
Now i want that user can give range of Delivery number .
means i have 4 windows in smartforms and i gave ranges of delivery in which 3 delivery challans are there?
so is that possible that first for first delivery it prints all window then for second delivery and then for third.....
So is that possible in samrtform to give loop?
Thanks in advance...
‎2007 Jun 05 10:19 AM
hi,
yes, i think you can have it in loop.
since you have a <b>function module</b> generated when you activate the smart form, you can loop this function in a program and get your work done.
pls. reward if useful...
‎2007 Jun 05 10:23 AM
Hi Dhwani,
This is possible only when you have control of thecomplete print program.
Using function modules SSFCOMP_OPEN & SSFCOMP_CLOSE, you can print or display any number of samrtforms continuously after SSFCOMP_OPEN & before SSFCOMP_CLOSE. You can also have a control to send all pages to a single spool request (check print control parameters in SSF_CREATE_COMPOSER_INPUT.
But here, I guess the main program is standard one (where you can select multiple deliveries using checkbox) & you might have copied only the print program & made modifications. So, as for each delivery the print preogram is called separately, this may not work.
If this is not your case & if you have your own (Z) transaction for this, its always possible.
‎2007 Jun 05 10:26 AM
Thanks for ur help.
Ya i have created my Zprogram.
So i can do that but can u please explain me in detail?
Should i have to use loop?
Thanks for ur help.
‎2007 Jun 05 10:43 AM
CALL FUNCTION 'SSFCOMP_OPEN'
EXPORTING
INPUT = input
IMPORTING
RESULT = RESULT
EXCEPTIONS
ERROR = 1
OTHERS = 2.
*************************************************************************
*THIS FM GIVES A POPUP FOR PRINT PARAMETERS
*************************************************************************
ls_control_param-no_open = 'X'.
ls_control_param-no_close = 'X'.
************************************************************************
*pass these two parameters & other parameters got from
'SSFCOMP_OPEN' to the FM (smartform)
************************************************************************
*************************************************************************
*NOW WITHIN LOOP PERFORM YOUR PRINT OPERATIONS HERE
*FOR EACH DELIVERIES
*************************************************************************
CALL FUNCTION 'SSFCOMP_CLOSE'
IMPORTING
RESULT =
EXCEPTIONS
ERROR = 1
OTHERS = 2
.
‎2007 Jun 05 12:39 PM
Thanks a lot
but i cant understand what to write and where....
‎2007 Jun 05 12:41 PM
and when i write these two functions its giving error that previous request not finished.....
‎2007 Jun 05 12:47 PM
Hi dhwani
U have called ur smartform through report now it was showing some error is it right???
then say me what are the function modules u have declared to call smartforms
this is the sample code to call smartforms plz check it out
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
* <a href="http://sapr3.tripod.com" TARGET="test_blank">http://sapr3.tripod.com</a>
*
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.
Reward if helpfull
Regards
Pavan
‎2007 Jun 05 1:10 PM
Thanks but my question is different i want loop on smartform..
Is that possible and how?
Just see my first question
‎2007 Jun 05 1:16 PM
Hi
Ok if so the problem then try to put loop in the smartform itself. In the coding part output options u can see the option by right click on the text window or coding part from where u have to put loop then goto
Create> Flow logic> Loop
Reward if helpfull
Regards
Pavan
‎2007 Jun 05 1:24 PM
No its not like that
Actully i am creating smart form for delivery challan and while running i want to give range of delivery number and according to that output should come.
means first in page 1 first delivery challan then when it completes next page should have second delivery challan data and moreover i am using four windows in one page in smartforms so for first delivery all four windows should print than for second and than so on......
‎2007 Jun 05 1:29 PM
Hi dhwani
then its better to call this smartform in a report and then use select options there u can get it
Regards
Pavan