Skip to Content

NEW PAGE DOUBT

Im printing a 'MAIN' Part in a sap script..

The data will be of many rows..

Actually the main body fits only for 7 rows..

After 7 rows the data must get printed on the next page ( ie..the next 7 rows and so on)

How to do this ???

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 01:02 PM

    when count = 7

    execute this in the driver program

    call function 'CONTROL_FORM'

    EXPORTING

    command = NEW-PAGE

    EXCEPTIONS

    unopened = 1

    unstarted = 2

    others = 3.

    Edited by: Nehal Fonseca on Apr 10, 2008 3:02 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 02:38 PM

    Hi,

    While looping on main, set a counter and flag. When counter becomes 7, set the flag to 'X'. Check for the flag in script, If it is 'X' then write command /: NEW-PAGE.

    Hope it will solve your problem.

    Thanks,

    Parul.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 03:17 PM

    Hi keshu,

    I have added code of your similar requirement.

    CODE:

    describe table iafvgd lines v_c_lin.

    LOOP AT iafvgd.

    • Increment the Operations Count

    v_co = v_co + 1.

    • Increment the counter

    v_ctr = v_ctr + 1.

    • Using Write_Form for values Visibility in SAP Scripts.

    PERFORM write_form USING 'OPER'

    'MAIN'.

    • If NO.of Operation Details is 4, Trigger New Page.

    IF v_co = 4.

    CALL FUNCTION 'CONTROL_FORM'

    EXPORTING

    command = 'NEW-PAGE'

    EXCEPTIONS

    unopened = 1

    unstarted = 2

    OTHERS = 3.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    CLEAR v_co.

    ENDIF.

    ENDLOOP.

    In my requirement i need to print only four items in a page. So when the counter(V_CO) becomes 4, New page will be triggered.

    Here you will face one problem. When there is only four items or multiple of four to be displayed, all items will be displayed and a new empty page will be displayed. Suppose consider only 4 items should be printed, in that case all four items get printed and condition is checked and new page is triggered.

    So add another condition like v_c_lin NE v_co just like ,

    IF v_co = 4 AND v_c_lin NE v_ctr.

    Please Reward points if useful.

    Thanks,

    karthik

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.