Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Smartforms

Former Member
0 Likes
681

Hi,

I have a question regarding smartforms.

My requirement is label printing with multiple line items.

there will be 2 delivery numbers printed in the same page so that customer can tear the page in middle.

condition is only 5 line items should be printed per delivery no.

If any delivery no. is having more than 5 line items it should go to below window.

for ex:

first half of page

delivery no.1 (if this delivery no has 15 line items)

header

details

table:

line item1

line item2

line item3

line item4

line item5

text1

text2

second half of page

delivery no.1

header

details

table:

line item6

line item7

line item8

line item9

line item10

text1

text2

then it should go to next page for printing on second page.

I am trying to do this by having a secondary window and a main window.

in secondary window i am printing first 5 line items and then deleting those  5 line items

and looping the same table in main window again for next 5 line items.

But in the output i am able to see the first 5 line items but no data is being printed in main window except for text1 and text2.

Any suggestions on this will be appreciated.

Thanks in advance.

Best Regards,

VN.

4 REPLIES 4
Read only

Former Member
0 Likes
633

hi Veena,

Before i provide any suggestions on this, can you please confirm that you are deleting correctly only first 5 records. Can you please check in debuging mode that data is present in the Main Window and still its not printing?

Regards,

DN.

Read only

0 Likes
633

Hi Deepak,

I am using below logic :

data : g_mod type i.

DESCRIBE TABLE it_item LINES i.

g_f_count = g_f_count + 1. "count for every line item.

if g_f_count > 5.

   g_mod = g_f_count / 5.

if g_mod > 0.

   delete it_item from 1 to 5.

   else.

     delete it_final2 index 1.

   endif.

   endif.

it_item is item table and it_final2 is header table.

And I am placing this code in first window table main area program lines.

In debug mode I am able to see data ,with above code first 5 lines are getting deleted. but that data is not flowing into main window table.

The problem is to exit secondary window after 5 lines and move to main window for next 5 lines.

That is not happening.

Regards,

VN.

Read only

0 Likes
633

Hi Veena,

I really doubt that you will be able to achieve your req that easily. In your case there can be multiple deliveries with multiple line items and as per my understanding if first delivery had 13 line items and second as 8. you would be actually printing 5+5 on one page, 3+5 on second and remaining 3 on third page.

Below is my suggsetion to it( not full proof but will work after some fine tuning):

Create two loops in static window instead of using MAIN WINDOW and set them in layout as per your requirement. u can use two tables also.

before the first loop, in program lines, move the first five records from main table to temporary table. Check if these are for same delivery, if yes then delete five records from main table, if not then delete the records for second delivery from temporary table and delete only records of first delivery from main table. (i knw sounds confusing, but this means that 3 records of first dely are captured and next loop will process from first line item of second delivery)

repeat the same logic in program lines before the second loop.

Loop at the temporary table, since we moved only 5 records it will print max of 5 records at a time. After each loop, we check for next 5 entries as per our logic and keep on repeating for even different deliveries.

Please revert if still in doubt.

Regards,

DN.

Read only

Former Member
0 Likes
633

Use the codes to check if you are treating an index which is a multiple of 5.

If yes, set a flag, else clear it.

Then use the command for next page with a condition (flag = x).

put the command after the after the item row

important: You should be in the main winfow for this to be possible !!!!!!

Hpoe it helps