‎2006 Mar 31 4:40 AM
Hello experts,
Please take a look at my code below. In the code, I want to print the footer only if the condition is satisified but it the footer window prints on every page. Here is my code guys:
IF v_flag = 1.
PERFORM print_footer.
CLEAR v_flag.
CLEAR v_print.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-PAGE'.
ENDIF.
v_flag is 1, then a new page is called meaning a new customer is found but before creating a new page, I want to print the footer at last page of the current customer.
Thank you very much guys!
‎2006 Mar 31 5:42 AM
Hi viraylab,
1. how is your footer window defined ?
2. is it a constant window, variable window,
or main window ?
regards,
amit m.
‎2006 Mar 31 5:29 AM
should the endif come after the clear stmts..?
IF v_flag = 1.
PERFORM print_footer.
CLEAR v_flag.
CLEAR v_print.
ENDIF.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-PAGE'.
‎2006 Mar 31 5:35 AM
show us is the logic which sets v_flag and the form print_footer.
‎2006 Mar 31 5:42 AM
Hi viraylab,
1. how is your footer window defined ?
2. is it a constant window, variable window,
or main window ?
regards,
amit m.
‎2006 Mar 31 6:18 AM
Hello guys!
Below is the code for the print footer:
FORM print_footer.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'LLCOR'
window = 'LLCOR'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'LRCOR'
window = 'LRCOR'.
ENDFORM.
‎2006 Mar 31 6:30 AM
‎2006 Mar 31 6:33 AM
Hi again,
1. try with CONST window.
2. <b>In that,
give one ELEMENT (/E)</b>
<b>and print that element
on the requried conditoion,
using WRITE_FORM function module.</b>
3. <b>Don't write anything in the layout,
outside this element (in this footer window)</b>
regards,
amit m.
‎2006 Mar 31 6:43 AM
Hi Amit,
Thanks for your replies. I am kinda new to ABAP so sorry for so many questions.What do you mean in your suggestion no. 3?
Thanks you very much!
‎2006 Mar 31 6:48 AM
Hi again,
1. in layout, u must have created
a new window (variable window u are saying)
2. Now, go this window,
3. u must have put some text
in it for printing purpose.
4. what i m saying is put text like this.
/E MYELEMENT
ASDFASD JASDLFKJ;FLDJ;ASD
ASDFA 234 KLSDAFJASD923 KLASDF
ANY DATA...
5. This will make sure
that this data isprinted
<b>ONLY WHEN THE ELEMENT (MYELEMENT)
IS PRINTED
USING THE WRITE_FORM FUNCTION MODULE.
(in write form we have to pass
the VARIABLE WINDOW NAME
and also the ELEMENT NAME (myelement in this case))</b>
regards,
amit m.
‎2006 Mar 31 6:57 AM
Hi Amit,
I tried doing what u said but unfortunately it still prints in every page.
‎2006 Mar 31 7:16 AM
Hello Viraylab,
As u say it is getting printed on each page meaning that the flag is set to 1 irrespective of customer!! Or the call to the footer window is also happening from some other place Or debug and c from where this footer is getting called.