cancel
Showing results for 
Search instead for 
Did you mean: 

How to put footer in the Delivery note sap script form.

Former Member
0 Kudos

Hi All,

i am new to SAP SCRIPT , can any one guide us how to Create a footer in the Delivery note sap script.

I need to put some message if the stock of the material is "0"(zero).

can anyone tell me the process to do this.

Thanks

-


Channappa Sajjanar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

U create a window in script (Footer), and in the Driver program call this window at last..

eg:

create a window in script and call it at the end in the layout..

/E FOOTER

P1 'Write Required text what u want to display;.

now in print program, after printing all the line items in ur internal table call the FM write_form to print the footer...

LOOP AT itab.

call function 'WRITE_FORM'

exporting

window = 'MAIN'

exceptions

others = 1.

endloop.

now call, FM write_form to print the footer

IF stock EQ 0.

call function 'WRITE_FORM'

exporting

window = 'FOOTER'

element = 'FOOTER'

exceptions

others = 1.

endif.

Hope it helps!!

Rgds,

Pavan

Former Member
0 Kudos

Hi vishnu ,

thanks a lot for your reply, i tried it but it is displays only at the last page, but i need the fotter on every page.

Regards

-


Channappa Sajjanar

Former Member
0 Kudos

Hi,

First place Windows on page like this :

Main Window

Footer

Then go to Print program :

CALL FUNCTION 'OPEN_FORM'

EXPORTING

FORM = 'ZTEST'.

CALL FUNCTION 'START_FORM'

EXPORTING

FORM = 'ZTEST'

STARTPAGE = 'FIRST'.

LOOP AT IT.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'HEADER'

WINDOW = 'MAIN'.

ENDLOOP .

CALL FUNCTION 'WRITE_FORM'

EXPORTING

WINDOW = 'FOOTER'.

CALL FUNCTION 'END_FORM'.

CALL FUNCTION 'CLOSE_FORM'.

I am not sure ..try like this.......

Former Member
0 Kudos

could you tell on what stock eq 0 it should print? is that at item level?

Former Member
0 Kudos

Hi ,

yes it is item level if any one of item in list has sotck zero then the footer should come on every page.

Regards

-


Channappa Sajjanar

Former Member
0 Kudos

Hi,

be sure your footer window iis declared on every page in the sapscript.

In the print program: determine you variable which you use to print (or not print) the footer before printing the main window.

explanation: if you first print the main window and then determine that variable your are already on the last page. And the foorter will only be printed there.

Gr., Frank

Former Member
0 Kudos

Hi Frank,

thanks a lot for your reply, your explanation solved my issue, actually i putted the FOOTER window after the mail window which result's every time printing at last page.

below is the steps i have done .

1:Defined a CONST window names 'Footer". and added this window in both pages 1st and 2nd at the bottom.

2:In the window defied a text element "foot_mesg' and below it hard coded the text which i need to note.

3:in the print program i checked stock for 0(zero) stock .if the stock is zero then mark a variable = 'X'.

4:before printing the fotter window check Variable = 'X' if yes then print the footer window other wise not.

*let me know is this solution is correct or not .

Regards

-


channappa Sajjanar

Former Member
0 Kudos

THe print is going correct so i think your change will also be correct.

I have only 1 note. You must check the 0 stock in the print program BEFORE you start to print MAIN-window items. That's the only way to be sure that your footer always will be printed on al pages if necessary.

Gr.,Frank

Former Member
0 Kudos

Hi Frank,

I have done that thing.thanks for your update.

Thanks and Regards

-


Channappa Sajjanar

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Create a window at the required position in Bottom part of page.

Put a condition like :

/: If &Stock_of_mat& EQ '0'.

p1 Place the text here

/: Endif.

Edited by: MR Venkat on Sep 8, 2009 11:45 AM