‎2006 Feb 01 2:27 PM
Hi All,
I have a requirement as below. Please suggest me a suitable solution.
1. The SAP Standard Program calls the Form. The Standard Form is modified to accommodate the client specific changes and added in Customization.
2. If the numbers of pages to be printed is with in one page, Form1 to be used to print the same using Printer A for printing this Form1.
2. If the numbers of pages to be printed are more than one page, Form2 to be used to print the same using Printer B for printing Form2.
3. Form1 and Form2 have different page windows. That is, both First page and Next page are of different Format for both the Forms.
Please write to me,
1. Is it possible to accommodate the above requirement in SAPScript?
1. Is it possible to accommodate the above requirement in SmartForm?
Thanks in Advance,
Kannan
‎2006 Feb 01 2:29 PM
HI Kannan,
We can do either way.But you have to change the program for that.
Regarding doing it in sap script.You have to used FM START_FORM & END_FORM.
‎2006 Feb 01 2:43 PM
Hi Phani,
Thanks for your reply immediately. I am not supposed to change the SAP Standard Program. I need to provide a solution for the requirement only through the Form.
In SAP Script, i can call Form1 and check the total number of pages, if the total page is one, then use Form1 (Linked with Program in Customization) or if the page is more than one, then i have to call Form 2 to print the documents of more than one page in a different printer from Form 1.
But i suppose, i can not have tow Forms Open (Form 1 and Form2) at the same time.
Please let me know if my understanding is correct or not?
Please suggest me a suitable solution in SmartForm without modifying the Standard Calling Program.
Thanks,
Kannan.
‎2006 Feb 01 2:47 PM
Hi Kannan,
I guess there is no way to do that,without changing the program.
there is no way that you can call form1 & check total no. of pages & then call form 2 with out changing the program.
‎2006 Feb 01 2:50 PM
Hi Kannan,
I don't think this is possible because at the begining of the script *Means OPEN_FORM" program can't trace no. of pages.
Why don't you create twp different O/P types and based on O/P you can control the no.of pages.
Exanple :
/: IF &NAST-KSCHL& EQ 'ZKQ1'.
/: NEW-PAGE
/: ENDIF.
Lanka
‎2006 Feb 01 2:58 PM
Hi lanka,
Please correct me if i am wrong.
1. I can use output type Ztype1 to call Form1.
2. I can use output type Ztype2 to call Form2.
Since th ecalling program is the same, SAP Standard program for both Forms,
1. Where will i check the total number of pages?
2. In Program, i can not check the total no ofpages.
3. Do i have to check in the Form1.
4. Unless the program control comes to Form1, no of pages can not be counted, i think. Because, it depends on th epage formats.
Please correct me if i am wrong.
Thanks,
Kannan.
‎2006 Feb 01 3:05 PM
Hi Kannan,
1. I can use output type Ztype1 to call Form1.
2. I can use output type Ztype2 to call Form2.
Yes .
calling program is the same ---yes.
Where will i check the total number of pages--
&SAPSCRIPT-FORMPAGES&
Lanka
‎2006 Feb 01 3:08 PM
Hi Lanka,
I check &SAPSCRIPT-FORMPAGES& in Form1, if it is one, then Execute Form1. If it more than one, then call Form2 from From1.
is my understanding correct?
Thanks,
Kannan.
‎2006 Feb 01 3:16 PM
Hi Kannan,
1. I can use output type Ztype1 to call Form1.
2. I can use output type Ztype2 to call Form2.
calling program is the same ---yes.
Where will i check the total number of pages--
&SAPSCRIPT-FORMPAGES&
Lanka
Hello Lanka but it's not possible to know
at program running how many pages
are to be printed you see it on the output
that's true but if you try to check it within a Sapscript
it has always the current page number...
With greetings Bogusia
‎2006 Feb 01 3:19 PM
Hi lanka,
Please correct me if i am wrong.
1. I can use output type Ztype1 to call Form1.
2. I can use output type Ztype2 to call Form2.
Since th ecalling program is the same, SAP Standard program for both Forms,
1. Where will i check the total number of pages?
2. In Program, i can not check the total no ofpages.
3. Do i have to check in the Form1.
4. Unless the program control comes to Form1, no of pages can not be counted, i think. Because, it depends on th epage formats.
Please correct me if i am wrong.
Hello Kannan
you have to find out the other way of checking the number of pages the worst but the only solution is to check
the number of positions e.g that fits at one page...
(it not nice but if you alwasy print it on the same printer and nothing changes... so you can use this method)
Bogusia
‎2006 Feb 01 3:23 PM
Hi Kannan,
My system is very slow.
What you have to do is Set a Command in MAIN Window :
/: If NAST-KSCHL = ZOUT1 --You need second page
/: NEW-PAGE = 'NEXT'.
/: ENDIF.
Please make sure at page attribute you have not assigned the next page.
Try this.
Lanka
‎2006 Feb 01 3:12 PM
Hello
Do you want to know the idea how find out which form should be called depending of number of pages?
But the question is:
How do you count number of pages ? Usually it's not possible to know that at program running.
Do you count the number of positions? it is not save but it could be use... in the worst case...
What would I do I would use surely ONLY smartform
if I do not want to change Standard program.
You can use in Smartform - COMMAND placed within MAIN Window of First page and with it control the flow of pages withouth any small change done in a Sap Standard Program.
With Command included in MAIN Window you can jump to the diffrent pages.
I think it is complicated but possible to manage...
I have a lot of experience in creating strange
Smartform Flows...
Try to create:
4 Pages
FIRST1 (Next page parked as Next1)
NEXT1 (Next page marked as Next1)
FIRST2 (Next page parked as Next2)
NEXT2 (Next page marked as Next2)
(All of them has the same MAIN window
and in that MAIN window depending on condition use
COMMAND at the beggining and jumb to the
requested PAGE accoring to condition
either FIRST1 or FIRST2)
You must try it and I cannot 100% assure you that it works
Create a simple Smartform and try to test it.
But I have no IDEA how to force printing it on diffrent printers... on diffrent trays it is possible but printers I have no idea...
Greetings
Bogusia abapka@op.pl
‎2006 Feb 01 4:22 PM
Hi Bogusia,
Thanks for your input, I will impliment your suggestion and let you know my feedback. Please do let me know if you come across any more ideas related to this topic.
Hi Lanka,
Thanks for all your inputs / ideas. I will update you the result.Please do let me know if you come across any more ideas related to this topic.
Thanks,
Kannan.
‎2006 Feb 01 7:31 PM
>Thanks for your input, I will impliment your suggestion >and let you know my feedback. Please do let me know if >you come across any more ideas related to this topic.
I think that at the moment this is the one idea... I will try to look something about a printer...
and inform you of course about it
With greetings Bogusia
‎2006 Feb 15 3:45 PM
Hi Bogusia / Lanka,
Thanks for all your inputs / ideas. Actually this requirement is for AR Customer Account Statement and SAP does not allow/ support at the moment to replace the existing SAPScript by a Smart Form in the customization. So i am left with no other option but to go for Z- Program. I have decided to copy the print program and make necessary modification to accommodate two forms with two printers. The Z program and Z Forms will be linked with the Tcode F.27 in Customization.
Thanks,
Kannan.
‎2006 Feb 15 3:52 PM
Great Kannan,
So you are able to get what you want..or do you need any help??