2005 Sep 04 9:13 PM
hi folks,
Now I have added the group field to 'accitab' and as mentioned I have another itable (same as 'accitab') called 'final_accitab where I have the recrods for all the customers and their corresponding group types too.
something like this..
customernumber ........ sortgroup
1000001 1
1000001 1
1000001 1
1000012 1
1000012 1
1000112 1
.
.
.
.
10000002 2
10000002 2
10000002 2
.
.
.
.
10000003 3 and so on
Now I have to print the customers based on the sorting therefore I should be passing the records of all the customers that come under a common sort type into one spool request,( I think that way!!) and how to do that ?
ii)how to print separate statements for each customer
for the same sort within the same spool request.
Thanks in advance
Vinu
you have to open your sapscript or your smartform every time you have to create a new spool.
So, if I remember well you use a smartform, you shoUld use the function to open and close smartform to part from smartforms:
DATA: E_SSFCOMPIN TYPE SSFCOMPIN,
SORT LIKE FINAL_ACCITAB-SORTGROUP,
FL_OPEN,
T_CUSTOMER LIKE STANDARD TABLE OF FINAL_ACCITAB.
LOOP AT FINAL_ACCITAB.
Create a new spool while sortgroup is changing
IF FINAL_ACCITAB-SORTGROUP <> SORT.
SORT = FINAL_ACCITAB-SORTGROUP.
Before you close previous print (smartform and spool)
IF FL_OPEN = 'X'.
CALL FUNCTION 'SSF_CLOSE'.
ENDIF.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
INPUT = E_SSFCOMPIN
EXCEPTIONS
ERROR = 1
OTHERS = 2.
IF SY-SUBRC = 0. FL_OPEN = 'X'. ENDIF.
ENDIF.
Print data while customer is changing
AT NEW CUSTOMER.
IF NOT T_CUSTOMER[] IS INITIAL.
CALL FUNCTION FM_NAME_OF_SMART
.......
TABLES
CUSTOMER = T_CUSTOMER.
After printing data, clear the customer table
REFRESH T_CUSTOMER.
ENDIF.
ENDAT.
Append records of the same customer
INSERT FINAL_ACCITAB INTO TABLE T_CUSTOMER.
ENDLOOP.
IF SY-SUBRC = 0.
Print data of last customer
IF NOT T_CUSTOMER[] IS INITIAL.
CALL FUNCTION FM_NAME_OF_SMART
.......
TABLES
CUSTOMER = T_CUSTOMER.
CALL FUNCTION 'SSF_CLOSE'.
After printing data, clear the customer table
REFRESH T_CUSTOMER.
ENDIF.
ENDIF.
2005 Sep 13 8:35 PM
Printer names are case sensitive. Have you checked that?
Srinivas
Message was edited by: Srinivas Adavi
Also, I see that you marked this as answered, but I don't see any points given to Max, who has helped you a lot on this issue. Please reward him for his efforts.
2005 Sep 13 8:46 PM
2005 Sep 13 9:43 PM
Hi Vinu
I agree with Srinivas: check the name of device, are you sure it's Xerox1?
You can try to transfer the name of that printer by dialog (FM SSF_OPEN) and then check the name in debug.
Max
2005 Sep 13 10:00 PM
Hi Vinu,
I saw that you rewarded Max for his effort. I apologize for missing it.
Regards,
Srinivas
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |