cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting changes in address in a smartform to allow sorting into envelopes

Former Member
0 Kudos

Hello,

We have a sorting machine which can place hardcopy invoices into envelopes, placing several invoices into 1 envelope as long as the billing address is the same.

To achieve this, we need to print a mark on some invoices to indicate that the current invoice is the last for the current envelope and the next invoice (with a different address) will be placed into a new envelope.

Is it feasible to somehow find the address of the next document to be printed?

We have a simple setup:

RSNAST00 calls our own copy of RLB_INVOICE passing the current invoice in the NAST table. A smartform is then called to print out the invoice.

I am not sure if this is something that can be done via logic in the smartform or if it means an ABAP change. Any advice greatly appreciated!

Thanks,

Stuart.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

I think you need to set the information of last invoice of a envelope in a field of the invoice, in order to decide when it needs to be printed,

but if you need to calculate it at runtime, you need an abap modification in driver program

Max

Former Member
0 Kudos

Hi Max,

Thanks for the reply.

I did have one other thought. If we can configure our machine to choose a new envelope by looking at the 1st invoice of a particular address (instead of the last) maybe we could get the smartfrom to save each address and check it each time by using EXPORT TO MEMORY & IMPORT FROM MEMORY to see if the address has changed.

Maybe there is a completely different solution out there too... Or I just have to get my hands dirty and change the driver program like you suggest

Thanks,

Stuart.

Former Member
0 Kudos

Hi

You don't need to use IMPORT/EXPORT parameter:

If the many invoices are printed in the same session, all data of previous invoice are available for the next one:

A routine to clear all global data is placed at the beginning of the program in order to solve this "problem":

So you need to have a gloabal varianble where to check the previous address and check it with the current one.

This control should be done in the program, not in the smartform, and it works fine if the invoices to be printed are correctly sorted before printing them.

The problem could be this solution can see when a new envolope starts only, i.e. it can't understand when the last invoice cames

Max

Answers (0)