2013 Oct 28 4:30 AM
Hiii Experts,
I print the smartforms using driver program, for printing the multiple invoices, for that I am printing the multiple copies of smartform i.e. '
Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy'.......for that all logic is ok with using the copies window.........
Now problem is that the copies of the smartforms not coming in sequence i.e. when I enter the multiple invoice for that invoices the print preview shows first all 'Original Copy' of all invoices and then shows all 'Duplicate copy' of all invoice and so on for other copies but we want
for first invoice ' Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy' ..... for second invoice ' Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy'...... for third invoice ' Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy'
within in copy window I use code as below...
if sfsy-copycount = '001'.
text1 = 'Original Copy'.
elseif sfsy-copycount = '002'.
text1 = 'Duplicate Copy'.
elseif sfsy-copycount = '003'.
text1 = 'Triplicate Copy'.
elseif sfsy-copycount = '004'.
text1 = 'Extra Copy I'.
elseif sfsy-copycount = '005'.
text1 = 'Extra Copy II'.
endif.
Plz help me .......
Thanks......
2013 Oct 29 7:37 AM
Dear All,
Finally got the solution by myself ,
I just tick the checkbox Group.........
Thanks to all of u for useful helps....
Thanks once again
2013 Oct 28 4:50 AM
Hi,
Try the below code..
instead of using sfsy-copycount in smart form , write the logic in your driver program.
inside you final loop where you append values to internal table (this internal table will be used in sf) try the below code...
loop at itab into wa_tab.
your logic..
do n times.
if n = 3. """"""""Here 3 will execute the smart form 3 times..
flag = flag + 1.
endif.
if flag = 1.
v_desc = 'ORIGINAL-BUYERS COPY' . """""""""""v_desc will be your text.
elseif flag = 2.
v_desc = 'DUPLICATE-TRANSPORTERS COPY'.
elseif flag = 3.
v_desc = 'TRIPLICATE-SELLERS COPY' .
endif.
wa_final-zdesc = v_desc.
wa_final-zdesc1 = v_desc1.
append wa_final to it_final. """"""""" it_final will be appended to smartform.
enddo.
endloop.
Hope this will solve your problem..
Regards,
Madhumahesh.
2013 Oct 28 5:16 AM
Hi,
In u r form
First Create one Separate Window for Text of type 'Copies Window'.
In program lines write the below code
IF SFSY-COPYCOUNT = '001'.
v_TEXT = 'Original'.
ENDIF.
IF SFSY-COPYCOUNT = '002'.
v_TEXT = 'Duplicate'.
ENDIF.
IF SFSY-COPYCOUNT = '003'.
v_TEXT = 'Triplicate'.
ENDIF.
IF SFSY-COPYCOUNT = '004'.
v_TEXT = 'Quadruplicate'.
ENDIF.
IF SFSY-COPYCOUNT = '005'.
v_TEXT = 'Extra Copy'.
ENDIF.
Then Print 'V_TEXT' in Text Element
pls check this link
2013 Oct 28 8:56 AM
Dear Kiran,
As per ur suggestion I already done the code but my question is that when I print preview or print the Form for multiple invoices then it prints all original copies then duplicate copies and so on but we want sequence as first invoice Original copy, Duplicate Copy ,triplicate copy and then for second invoice Original copy, Duplicate Copy ,triplicate copy and so on .......sequence should no be change
2013 Oct 28 9:08 AM
Hi,
Did you try what i mentioned earlier?
Regards,
Madhumahesh.
2013 Oct 28 10:56 AM
Hi,
That means in your case, when control enters into the smartforms.. it should loop for 4 times and then for second invoice.. it should again loop for 4 times..right..
I have implemented this scenario for our client.. please do following..
wa_heading-name = 'Original Copy'.
APPEND wa_heading TO it_heading.
CLEAR: wa_heading.
wa_heading-name = 'Duplicate Copy'.
APPEND wa_heading TO it_heading.
CLEAR: wa_heading.
wa_heading-name = 'Triplicate copy'.
APPEND wa_heading TO it_heading.
CLEAR: wa_heading.
wa_heading-name = 'Extra copy'.
APPEND wa_heading TO it_heading.
CLEAR: wa_heading.
And then loop your Main window or the nodes which are common for all copies.
and for each copy give command line as i shown below..
Regards
Tejas
2013 Oct 28 11:27 AM
2013 Oct 28 11:29 AM
Can you post your source code, where you are appending data into final internal table?
Regards,
Madhumahesh.
2013 Oct 28 9:18 AM
Hi Mahadeo,
How did you and where did you enter multiple invoices? Are you calling Smartform in the loop of internal table with multiple invoices or what??
Thanks & Regards,
-Vijay
2013 Oct 28 9:19 AM
hi Mahadeo,
i think your design of the smartforms have problem.
loop invoices.
loop copies where num = invoices-num. (of couse, the itab of copies already sort by your sequence )
logic of templete or table.
hope will help you.
Regards,
Archer
2013 Oct 28 10:06 AM
Hi,
You can write logic in the driver program, after writing the SSF_OPEN,
after writing loop for multiple invoices, just write the code
| DO 3 TIMES. | |
| N = N + 1. | |
| IF N = 1. | |
| COPY = 'ORIGINAL FOR BUYER'. | |
| ELSEIF N = 2. | |
| COPY = 'Duplicate for Transporter'.. | |
| ELSEIF N = 3. | |
| COPY = 'Triplicate for Assessee'.. | |
ENDIF. then you just call the function module generated for the form and write ENDDO after it. Regards Kusuma |
2013 Oct 28 10:34 AM
Hi Dear,
You may have used "Main Window".
Please use "Copies Window".
With Thanks & Regards,
Tushar Trivedi.
2013 Oct 29 4:21 AM
Hiii Experts,
Here is the source Code,
Selection Screen:
Source Code:
loop at h_inv1 into winv1.
loop at i_inv1 into winv2 where exnum = winv1-exnum.
append winv2 to i_inv.
endloop.
append winv1 to h_inv.
CLEAR LS_CONPARA.
DESCRIBE TABLE h_inv1 lines cnt.
if cnt > 1.
AT FIRST.
LS_CONPARA-NO_OPEN = SPACE.
LS_CONPARA-NO_CLOSE = 'X'.
ENDAT.
IF FLAG = SPACE.
LS_CONPARA-NO_OPEN = 'X'.
LS_CONPARA-NO_CLOSE = 'X'.
ENDIF.
AT LAST.
LS_CONPARA-NO_OPEN = 'X'.
LS_CONPARA-NO_CLOSE = SPACE..
ENDAT.
call function lv_smartform
EXPORTING
CONTROL_PARAMETERS = LS_CONPARA
tables
h_inv = h_inv
i_inv = i_inv
exceptions
others = 0.
CLEAR: FLAG.
clear: h_inv[], i_inv[].
else.
call function lv_smartform
EXPORTING
CONTROL_PARAMETERS = LS_CONPARA
tables
h_inv = h_inv
i_inv = i_inv
exceptions
others = 0.
endif.
endloop.
"we want"
for first invoice 0100000101: ' Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy' then
for second invoice 0100000102 ' Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy' then
for third invoice 0100000103 ' Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy'
But it comes like that ,
for first invoice 0100000101: ' Original Copy', '
for second invoice 0100000102 ' Original Copy',copy'
for third invoice 0100000103 ' Original Copy',
for first invoice 0100000101: ' Duplicate Copy'
for second invoice 0100000102 ' Duplicate Copy'
for third invoice 0100000103 ' Duplicate Copy'
for first invoice 0100000101: 'Triplicate copy'
for second invoice 0100000102 'Triplicate copy'
for third invoice 0100000103 'Triplicate copy'
I use Copies window
in copies window code is like that.........
if sfsy-copycount = '001'.
text1 = 'Original Copy'.
elseif sfsy-copycount = '002'.
text1 = 'Duplicate Copy'.
elseif sfsy-copycount = '003'.
text1 = 'Triplicate Copy'.
elseif sfsy-copycount = '004'.
text1 = 'Extra Copy I'.
elseif sfsy-copycount = '005'.
text1 = 'Extra Copy II'.
endif.
2013 Oct 29 4:41 AM
Dear Mahadeo,
Please try this one
data: SSFCOMPOP TYPE SSFCOMPOP.
SSFCOMPOP-TDCOPIES = 3. " Number of copy you want
CALL FUNCTION fm_name
EXPORTING
OUTPUT_OPTIONS = SSFCOMPOP
* USER_SETTINGS = 'X'
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
ITAB = ITAB
ITAB3 = ITAB3
ITAB2 = ITAB2
* 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.
Regards,
Yogesh Chaudhari
2013 Oct 29 5:00 AM
This is a very long time Query for which I am seeking answer for , when we Implement multi print option using
http://help.sap.com/saphelp_nw04s/helpdata/en/71/9ccd9c8e0e11d4b608006094192fe3/content.htm
Hope I will get answer from your query
2013 Oct 29 5:52 AM
Dear all,
My problem is only with sequence of printing the copies.........
"we want"
for first invoice 0100000101: ' Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy' then
for second invoice 0100000102 ' Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy' then
for third invoice 0100000103 ' Original Copy', ' Duplicate Copy','Triplicate copy','Extra copy'
But it comes like that ,
for first invoice 0100000101: ' Original Copy', '
for second invoice 0100000102 ' Original Copy',copy'
for third invoice 0100000103 ' Original Copy',
for first invoice 0100000101: ' Duplicate Copy'
for second invoice 0100000102 ' Duplicate Copy'
for third invoice 0100000103 ' Duplicate Copy'
for first invoice 0100000101: 'Triplicate copy'
for second invoice 0100000102 'Triplicate copy'
for third invoice 0100000103 'Triplicate copy'
I use Copies window
in copies window code is like that.........
if sfsy-copycount = '001'.
text1 = 'Original Copy'.
elseif sfsy-copycount = '002'.
text1 = 'Duplicate Copy'.
elseif sfsy-copycount = '003'.
text1 = 'Triplicate Copy'.
elseif sfsy-copycount = '004'.
text1 = 'Extra Copy I'.
elseif sfsy-copycount = '005'.
text1 = 'Extra Copy II'.
endif.
Thanks........
2013 Oct 29 5:56 AM
Hi
What i would suggest is in case you want to control this print order. Then in your internal table append as many entries as you need to print for copies etc and each time while calling smartform pass a flag to signify whether which copy it is.
It will then print in order.
Nabheet
2013 Oct 29 7:37 AM
Dear All,
Finally got the solution by myself ,
I just tick the checkbox Group.........
Thanks to all of u for useful helps....
Thanks once again
2013 Oct 29 7:52 AM
2013 Oct 29 7:54 AM
2013 Oct 29 8:20 AM
2013 Oct 29 9:47 AM
Dear Sijin Sij,
Yes U r correct.......
use SSFCOMPOP-TDGROUP = 'X'.
then it will check automatic checkbox of group...
if u want to come number of copies and group check box tick automatically 'then we can do enhancement also and achieve it......
Actually I did the enhancement for default Number of copies based on selection screens radio buttons i.e. five copies ,three copies so on
when user select radio button five copies then number of copies 5 automatically come and also the group check box is active.
Thanks......
2013 Oct 29 12:12 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |