cancel
Showing results for 
Search instead for 
Did you mean: 

Print the Item details twice in a Check using SAPScript

Former Member
0 Kudos

Hi Experts,

I have already done a lot of searching on this issue, but not able to find a working answer.

I have to print a pre numbered check. The form should have a check part on the top, and 2 stubs after that. Here stub means the sections having the individual line item details for the check. Both the stub has to have the same item details. In short the 2nd stub would be a identical copy of the first one.

I have copied the standard SAPScript 'F110_PRENUM_CHCK' into a Z form and using it. All the configurations needed are in place and I am able to print my line items onto the first stub, which is in the MAIN window and it's using the Element 525.

For the other stub, I declared a window 'MAIN2' of type 'VAR' and in the print driver program added the calls to the FM 'WRITE_FORM' for this window 'MAIN2'. This solution was actually proposed in another thread.

The Issue is, in the window 'MAIN2', only the last line item is being printed multiple times. Other items are not coming.

I have also tried to use two MAIN windows. But found out that that won't work as the only way you can refer to the new main window is by using the command 'NEW-WINDOW', which transfers the control to the Next MAIN window permanently.We can't have identical lines printed in the two.

Now I am out of Ideas.

Any pointers to a solution would be highly appreciated.

Regards

Barada.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi All,

I am a bit late for the reply. But I wanted to make sure I try everything and not miss out any possible solution.

The answer to the above is that, it's not possible in SAP scripts. And though it's technically possible to do the same in Smartforms (I had actually created a smartform for this); it can't be integrated with the existing SAP print program and the way cheques are printed.

So, finally we convinced the client that it's not possible and there would be only one stub in the payment advice section. To address the issue of having a copy for office use(one of the stubs would have been kept just for reference), we are sending a duplicate cheque to the person responsible by email, mentioning that it's a office copy.

Regards

Barada

Former Member
0 Kudos

Hi Swain,

The requirement that you have for check printing is eaxctly the same one i have to design.

tried to get the item data repeated using 2 main windows ,

tried with one main and one variable window for item data repetation.

tried with looping in the print program for a variable window.

Iam out of ideas now.. can u pls help me out as how exactly did you achieve this ,is it even possible?

Former Member
0 Kudos

hi,

i have same question with you. That is the page has two windows which have same content. If one page is not enough for the printing data, it will be printed in next page.

here is my solution. hope it helps.

The page has only one MAIN Window which print internal table through a LOOP.

The other Window prints same data through a LOOP too. But you must create a internal table which contains same data with MAIN Window.

If the MAIN Window is full, the system will print data in next page. This is done automatically.

But in the other Window, you must configure the range of internal table which will be printed. That is, you set the Start Line and End Line of the internal table.

After the Loop finishes in the second window, you can delete the printed data from internal table.

In one word, you must control the loop in the second window.

ok.

hope it helps.

Former Member
0 Kudos

Hi,

Could you plz more specific to ur req..

How exactly u wanted to print?

If you want to print same line items 1 after another, then U write a DO loop for 2 times to Element '525'.

Eg:

LOOP AT itab.

DO 2 times.

call function 'WRITE_FORM'

exporting

element = '525'

window = 'MAIN'.

ENDDO.

ENDLOOP.

By writing DO 2 times it will print each line item 2 times one after another...

Hope its clear!!

Regards,

Pavan

Former Member
0 Kudos

Hi Swain,

Box1 ! box2

paragraph formats as below

1,10,20,30,40,50,60,70,80.

suppose split the main window at 45 split the . please try in this way

thanks,

Suma.

Former Member
0 Kudos

Hi Suma,

I guess I have missed some important information in the question.

1. The stubs(windows having the line item details) are to place one above the other occupying the full width of the page.

2. There are some header information like Date, Vendor Name etc which are also to be placed in both the windows. And also there should be a line for the totals for 3 amount fields I am using.

I couldn't follow the solution you proposed completely. But I don't think it would solve the purpose.

Thanks & Regards

Barada

Former Member
0 Kudos

Hi, if u dont mind can u provide some details.

u have two stub means

Ref no. Bill No. Bill Amount TDS Amount Total

.

.

.

.

-


total

-


Ref no. Bill No. Bill Amount TDS Amount Total

.

.

.

.

-


total

-


like this on the same page or u want to print the smae on 2nd page?

Former Member
0 Kudos

Hi Monika,

Thanks for the reply.

You are correct. I want it the format you have given. Each page should have two sections (which I refered as stubs) which should have the same details (line item details and some headers and Totals line).

Now if the line items are more in number than, that can be fitted on one page, the deatils should continue to the next page.

Hope I am clear with this explaination. In other words you can say that I want to print the MAIN window twice in all the pages. Page numbers would vary depending on the number of line items.

Regards

Barada

Former Member
0 Kudos

hi do one thing.

in sapscript , make a new element 526

and copy the line which are required to print table and paste it in element 526.

then goto ur zprogram .

and then press the find button on menubar (n not just ctrl + F) .

then put 525 and enter.

u will get all 525 present in the program . add same code for 526 at evry place .wherever 525 is present .

hope it will works

Former Member
0 Kudos

Hi,

If your 2 stubs are adjacent means then your problem will be easy

draw the 2 boxes in the main window as below

-


:

: : :

: : :

: : :

: : :

: : :

: : :

: : :

: : :

-


:

in the first box put stud1 and 2nd one put stud2 details. here no need to declare another window

create paragraph format with positions for x fields(stud1) and y(stud2) fields in the same paragraph format.

When ever displaying the items call the above paragraph format and replicate the item details as below

field1,,field2,,field3,,field4,,field1,,field2,,field3,,field4,,

Thanks,

Suma.