SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Cancel Printing of individual document during EA29

rajesh_popat3
Active Participant
0 Kudos

Hi,

In our requirement, we are creating only one spool request for say about 1000 print documents. Now, based on some validation, I need to prevent one of the invoice (not validated) from updating in spool request. I tried using Macro MAC_PRINT_CANCEL and MAC_PRINT_CANCEL_REPEAT.

These macros are giving the error message in the application log for the failed record, but at the same time, it is getting updated in the spool request.

EG~: I have selected the print of 10 records. When I am running EA29 with the condition that all 10 records are in one single spool.

In this case, suppose print document no. 5 fails the validation, I am calling MAC_PRINT_CANCEL in the During LOOP of the DOC_HEADER node. In this case, after output, the application log has the message of 1 failed record, but at the same time, it is also present in the success log and is partially included for the Spool request.

The output spool has data for all 10 print documents, but it should have 9 as 1 has been cancelled.

The print date of the document is not updated.

Can you please suggest, if there is any way, I can cancel the print of one document from the particular set and have 9 in the output.

P.S> - We are using only one spool request per 1000 documents.

Any help would be appreciated.

Thanks,

Rajesh Popat

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Rajesh,

You can bypass the WRITE statement in you bill application form depending on the validation. You can set a flag if the validation occurs.

Before populating the variables in the spool check the value of this flag. If the flag is not set, then execute the write statement.

The standard print job EA29 will run successfully however no data will be populated in the spool request in this case for that particular invoice document where validation has been occured.

Hope it helps.

Thanks.

Nirmalya

Edited by: NirmalyaC on May 20, 2011 3:35 PM

Edited by: NirmalyaC on May 20, 2011 3:35 PM

View solution in original post

4 REPLIES 4

Former Member
0 Kudos

Hi Rajesh,

You can bypass the WRITE statement in you bill application form depending on the validation. You can set a flag if the validation occurs.

Before populating the variables in the spool check the value of this flag. If the flag is not set, then execute the write statement.

The standard print job EA29 will run successfully however no data will be populated in the spool request in this case for that particular invoice document where validation has been occured.

Hope it helps.

Thanks.

Nirmalya

Edited by: NirmalyaC on May 20, 2011 3:35 PM

Edited by: NirmalyaC on May 20, 2011 3:35 PM

rajesh_popat3
Active Participant
0 Kudos

Hi NimalyaC,

Thanks for your response.

But in this case as well, the standard WRITE process for spool would create the default header at the start of each record. In this case, I need to carry out all the validations before actual print of text elements begin.

In some cases, I have all the values available in the HEADER_NODE, but not all cases are handled. Some of the values for payment / other items comes later in the NODE. I need to explicitly duplicate the NODE to perform validations.

My requirement is to roll back all the text elements that are processed for this record if the validation of any data in the lower node fails.

MAC_PRINT_CANCEL does not delete the text that is printed till the point the cancel event is triggered causing partial entry of record in the spool.

So, if you could help if there is any way the spool data can be rolled back for the particular record it would be really helpful.

Thanks,

Rajesh Popat

Former Member
0 Kudos

Hi Rajesh,

Once you have executed the write statement, it will write the corresponding text in the spool. You might not be able to rollback it.

What you can do is you can store all the text elements with their values in an internal table. Only at the end of the application form you write all the contents of the internal table if all the valdations are passed.

Thanks.

Nirmalya

rajesh_popat3
Active Participant
0 Kudos

Hi,

I had already added the validations before processing of the first text elements.

Yes printing of the data at the end was the last option I had, thought there might be some macros to roll back the text element content for print cancellation. So, was expecting for some options to explore upon.

Closing the thread.

Thanks for your response.

Regards,

Rajesh Popat