on 11-08-2006 1:02 PM
Hi,
I am working on a form which is launched in VF03. Having known that a billing might have many deliveries, the requirement is to produce a new page with header, item and footer for every deliveries.
The program is almost finished. However, when I'm testing it, I found a bug.
In the first delivery, the output is OK. It has the header, items and footer. But for the next deliveries (new page), the footer part which is placed in MAIN window element FOOTER, always appear. It must only appear when all the items are displayed.
Can you please give me a solution for this?
Below is the code for passing data in sapscript:
DO nast_anzal TIMES.
PERFORM
f_open_form USING xscreen
t001-land1.
CHECK retcode EQ 0.
PERFORM
f_start_form.
CHECK retcode EQ 0.
LOOP AT i_vbfa_j INTO wa_vbfa.
ON CHANGE OF wa_vbfa-vbelv.
IF sy-tabix NE 1.
PERFORM f_control_form USING 'NEW-PAGE'.
ENDIF.
PERFORM:
f_fill_title_window,
f_fill_header1a_window,
f_fill_header1b_window,
f_fill_header2_window,
f_fill_item_header_window,
f_fill_page_window.
ENDON.
f_fill_item_window. (MAIN)
AT END OF vbelv.
PERFORM
f_fill_footer_window.
FOOTER is placed in MAIN window
IF v_pending_flag EQ c_mark.
PERFORM f_control_form USING 'NEW-PAGE'.
ENDIF.
ENDAT.
CLEAR:
wa_vbfa.
ENDLOOP.
PERFORM
f_close_form.
CHECK retcode EQ 0.
ENDDO.
Thanks,
Druzz
Hi Dru,
why don't you keep a separate window for FOOTER and keep it in all pages in script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hullo,
if the requirement is to have the footer window displayed at the end of the internal table, maybe you might want to try "AT LAST" instead of "AT END OF".
AT last.
PERFORM f_fill_footer_window.
* FOOTER is placed in MAIN window
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you sorted i_vbfa_j by vbelv? What is the structure of table i_vbfa_j?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tomasz,
Yes I sorted it. The creation of new page per delivery is working. The footer is the only. It always appear on the succeeding pages. For example, the first delivery has only 1 page. Thus, it will show the footer. After this, a new page will be created for the next delivery. But the data of this delivery is not enough for one page. In its first page, the footer still appears which should not. It must only appear when all the items of the delivery are printed.
Thanks,
Dru
Hi Tomasz,
I am testing two ways:
PERFORM f_write_form_check USING 'FOOTER'
'MAIN'
'BOTTOM'
CHANGING v_pending_flag.
PERFORM f_write_form USING 'FOOTER'
'FOOTER'.
FORM f_write_form USING p_element
p_window.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = p_element
window = p_window
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
OTHERS = 9.
IF sy-subrc NE 0.
retcode = sy-subrc.
PERFORM protocol_update.
ENDIF.
FORM f_write_form_check USING p_element
p_window
p_type
CHANGING p_pending_flag.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = p_element
type = p_type
window = p_window
IMPORTING
pending_lines = p_pending_flag
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
OTHERS = 9.
IF sy-subrc NE 0.
retcode = sy-subrc.
PERFORM protocol_update.
ENDIF.
Thanks!
Hi Tomasz,
By doing that, the footer will not be placed in the bottom of the page. I used the bottom so that it will be always placed at the bottom of the MAIN window and that is the requirement.
I read something and it tells that it will indeed always appear in the MAIN window. I think I shouldn't use this WRITE command with type.
I don't if it will work if I remove the footer window in the NEXT page which I assigned as "Next Page" for page, FIRST.
Thanks,
Dru
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.