Application Development 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: 

Problem in displaying reciept no: in Script

Former Member
0 Kudos

Hi Experts,

I have developed a script for cash receipt based on the document number.

In this script I have a column for Receipt No (which is same as serial no:)

This script / form is based on document number and I have to display

the reciept no: in such a way that each document no: should contain only one reciept no: .

For eg:

For the first time in my scrip if the user genertes a reciept for document no: 11111

its should generate a reciept no: 001 and for the next doc no as 002 and so on...!!

Note: when ever the user generates reciept for a document which was already

generated I want to display the same reciept no: which was generated at first time,

( means avoid duplication ).

Please advice

Sharmila

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try this.

apply this logicin your print program where you are procesing the data.

Sort your itab by document number.

data: receit_no type...

data: doc_number type ...

clear :receit_no

doc_number

loop at itab.

if itab-doc_number = doc_number.

receit_no = receit_no.

else.

receit_no = receit_no + 1.

endif.

at first.

itab-doc_number = doc_number

endloop.

Edited by: Bhargava TC on Jun 26, 2009 11:34 AM

2 REPLIES 2

Former Member
0 Kudos

Hi,

Try this.

apply this logicin your print program where you are procesing the data.

Sort your itab by document number.

data: receit_no type...

data: doc_number type ...

clear :receit_no

doc_number

loop at itab.

if itab-doc_number = doc_number.

receit_no = receit_no.

else.

receit_no = receit_no + 1.

endif.

at first.

itab-doc_number = doc_number

endloop.

Edited by: Bhargava TC on Jun 26, 2009 11:34 AM

Former Member
0 Kudos

Hi Sharmila,

I had a similar requirement in my present project.

I had used a Ztable to store the document no and receipt no and a flag.

When my print is successful i store the document no, receipt no and set the flag as 'X' which indicates my first print.

Next time when i take a print i check against my ztable wheteher a print has been issued by checking

for document no and flag = X.

If sy-subrc = 0.

Pick up that receipt number and print.

endif.

Hope this will solve ur problem.

Best Regards,

Navin Fernandes.