cancel
Showing results for 
Search instead for 
Did you mean: 

maintianing multiple line items in main window in scripts

former_member1006740
Participant
0 Kudos

Hi folks,

i want to print multiple line items in main window of script for eg 50 line items then my main window should continue in second page also. how to maintain this.

can u provide me sample code for this..

Thx in advance,

Neelima.N

Accepted Solutions (0)

Answers (8)

Answers (8)

former_member1006740
Participant
0 Kudos

answered..

Former Member
0 Kudos

hi,

In SE 71 the page that u want to continue , for that page give the next page as the same page .

eg: if Page1 is ur page then for that page in the window option give the Next Page as Page1. It will adjust automatically to the data .

This will help u.

Please let me know if I am wrong

Thanks and Regards

Suraj

Former Member
0 Kudos

Hi

To get the data into the next page . Declare the next page as same as first page in the form.

you can get the continous data in the next page.

Regards,

Rajani

Former Member
0 Kudos

Hi,

If u have only one main page than do..

Goto>Pages>set next page of your MAIN page to FIRST .

or if u printing the line items From Second Page than give next page of Main Page as SECOND AND Next Page of Second Page as SECOND.

ie

pages->MAIN->(next page)-> SECOND ->SECOND(next page).

In LINE Editor use:

/:ENDPROTECT

/E <text_element>

&LINE_ITEMS

/:PROTECT

thanks

Ravi

Former Member
0 Kudos

Hi,

try giving protect..endprotect.

In text editor.

/E HEADER

/: ENDPROTECT.

  • Header details.

/E LINE

/: PROTECT

  • Item details.

This works fine.

Former Member
0 Kudos

Hi,

SE71 -> SHORT DESCRIPTION.

WINDOWS tab -> double click on MAIN .Click Editor icon .

give all the fields .

for ex ,

FOR SFLIGHT with two fields.

&fs_flight-carrid&,,&fs_flight-connid&

In the driver program u have to pass the fields for carrid and connid.

&& is compulsory for the fields in scripts. ,, is for space.U no need to handle for the number of records bcoz main page will trigger the next page if it has some records.In pages window for First page give the next page in which the main window is included.

Thanks,

Nithya.

Former Member
0 Kudos

Hi!

It's quite simple: if you have only 1 page layout (called FIRST for example), then you have to set itself as the next page also

I hope you understand it...

So in SE71, give your SAPScript's name, choose the page radiobutton and click modify.

Here you'll see the field called page: FIRST.

Fill the next page field also with FIRST.

The SAPScript will handle automatically the pages.

Regards

Tamá

former_member1006740
Participant
0 Kudos

Hi,

im having 50 line items so my data is exceeding from 1st page to second page so how to handle this in sap

scripts.

Thanks,

Neelima.N

Former Member
0 Kudos

You have an internal table with 50 lines, is it correct?

Let's say, there's a MATNR field in your internal table.

First do, what I wrote in my previous comment.

The create an element in yout main window, like this:

/E LINE_ITEMS

/ &GS_MAIN-MATNR&

In your printer program you have to code the following:

LOOP AT gt_main INTO gs_main.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

WINDOW = 'MAIN'

ELEMENT = 'LINE_ITEMS'.

ENDLOOP.

This code will loop all 50 of your table entries.

In the MAIN window will fit 30 entries.

When the LOOP is reaching the 30th entry, SAP will automatically create a new page (because of the NEXT PAGE statement you set in the page settings in the SAPScript) and will continue the printing.

Regards

Tamá

viquar_iqbal
Active Contributor
0 Kudos

Hi

In the main window right click and create ->flow logic->loop

in the loop check mark internal table and loop the internal table that you have

Then in the loop ->create command under field name create a variable (ex serail) eq 6.

then loop->create->program lines->declare the serail in input and output

and write code like this in it .

if serial = 6.
serial = 1.
next_page = next_page + 1.
endif.               " if serial = 6.

This should do a page break .

Thanks

Viquar Iqbal

former_member1006740
Participant
0 Kudos

HI,

im asking in scripts not in smartforms.please help me out..

Thx in advance,

Neelima.N

Former Member
0 Kudos

Hi,

Use:

a counter in the main program:

loop at itab..

add 1 to counter.

if counter = 50.

counter = 0.

endif.

write_form --FM

endloop.

Text editor of script:

/:If &Counter& > 50

/:new-page

/:endif

Also set the Next page properties in the Page window to the first page.

Hope this resolves the issue

regards,

Gurpreet

former_member1006740
Participant
0 Kudos

Hi,

I am not sure how many line items will fit into my main window, for example i am telling 50 line items so first 20 will come in 1st page and remaining 30 continously should come in second page main window.please help me out how to solve this.

Thanks,

Neelima.N

Former Member
0 Kudos

Hi,

Script have an automatic feature the nex page will be generate automatically if the next page attribute is set.Once the Line items do not fit into the main window a new page is triggered.

Goto>Pages>set next page to first .

And also in the text Editer use:

/:EndProtect

/e <textelement>

  • line-items to display

/:protect

This will definitly resolve the issue..

Regards,

Gurpreet

Former Member
0 Kudos

HI,

Print the Internal table data into main window. If the data exceed the more that what page can handle then the remaining date will contuinely printed in next page.

The property of the Main Window is if data excceds the page then new page will be created for the remainind data.

former_member1006740
Participant
0 Kudos

Hi,

i printed the internal table data in the main window and created one driver program also.in se71 the form is showing.but when iam executing the driver program the form is not showing.and also driver program is not showing any error .y it is so..

i kept write form in loop.maintained element for main window.

please help me out.

Thanks in advance,

Neelima.N

Former Member
0 Kudos

Hi neelima,

Check in the debugging mode whether the form is getting triggered or not.

Regards,

Sravanthi

former_member1006740
Participant
0 Kudos

Hi,

How to check in whether the form is triggering or not.

i know how to activate debugger.after activating debugger,executing driver program and then next what should i do .

please do need helpful

Thx,

Neelima.N

Former Member
0 Kudos

Hi Neelima,

call function 'OPEN_FORM'.
exporting
  form  = 'Z_SCRIPTS'---> Include the script.
endform..

loop at t_tab into fs_tab.
 call function 'WRITE_FORM'
  exporting
    element = ' '
    window = 'MAIN'
 endloop.
 endform.

Regards,

Sravanthi