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
hi Max,
Here is my latest code...
DATA:SSFCTRLOP TYPE SSFCTRLOP,
SSFCTRLOP_OPEN TYPE SSFCTRLOP,
SSFCRESOP TYPE SSFCRESOP,
E_SSFCOMPOP TYPE SSFCOMPOP,
SORT LIKE FINAL_ACCITAB-ZSORTGROUP,
FL_OPEN,
T_CUSTOMER LIKE STANDARD TABLE OF FINAL_ACCITAB.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = p_form
variant = ' '
direct_call = ' '
importing fm_name = fm_name
exceptions no_form = 1
no_function_module = 2
others = 3.
LOOP AT FINAL_ACCITAB.
IF FINAL_ACCITAB-ZSORTGROUP <> SORT.
SORT = FINAL_ACCITAB-ZSORTGROUP.
IF NOT E_SSFCOMPOP IS INITIAL.
After first time dialog doesn't open
SSFCTRLOP_OPEN-NO_DIALOG = 'X'.
ENDIF.
IF FL_OPEN = 'X'.
CALL FUNCTION 'SSF_CLOSE'.
ENDIF.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
USER_SETTINGS = SPACE
OUTPUT_OPTIONS = E_SSFCOMPOP
CONTROL_PARAMETERS = SSFCTRLOP_OPEN
IMPORTING
JOB_OUTPUT_OPTIONS = SSFCRESOP
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC = 0.
FL_OPEN = 'X'.
Get print parameter choosen in the first print and
transfer them for next call of fm SSF_OPEN
MOVE-CORRESPONDING SSFCRESOP TO E_SSFCOMPOP.
ENDIF.
ENDIF.
Block open and close of smartform in FM
SSFCTRLOP-NO_OPEN = 'X'.
SSFCTRLOP-NO_CLOSE = 'X'.
if zzadvertiser ne final_accitab-zadvertiser and zzadvertiser ne ' '. (instead of AT NEW zadvertiser)
aging
.
.
.
ZCURRENT = agingdataitab1-RAST1.
ZOVER30 = agingdataitab1-RAST2.
ZOVER60 = agingdataitab1-RAST3.
ZOVER90 = agingdataitab1-RAST4.
ZTOTALAMOUNT = ZCURRENT + ZOVER30 + ZOVER60 + ZOVER90 +
zappliedcredits1.
payment terms
.
.
.
address , adname, adnumber
.
.
.
scan number
.
.
.
IF NOT T_CUSTOMER[] IS INITIAL.
now call the generated function module
CALL FUNCTION '/1BCDWB/SF00000013'
EXPORTING
archive_index =
archive_parameters =
control_parameters = SSFCTRLOP
mail_appl_obj =
mail_recipient =
mail_sender =
output_options = E_SSFCOMPOP
user_settings = 'X'
ZTOTAL = ZTOTALAMOUNT
ZSCAN_CODE = SCAN_NUMBER
zpartner = bpartner
Z_BDATE = E_DATE
ZADNUMBER = ADNUMBER
ZADNUMBER1 = ZZADNUMBER
ZAGENCYNUMBER = AGENCYNUMBER
Z_PAYMENT_TERMS = V_PAYMENT_TERMS
ZADNAME = ADNAME
ZZADNAME = ADNAME1
ZAGENCYNAME = AGENCYNAME
ZPHONE = BPHONE
ZCREDITGROUP = ZCREDITTEXT
Z_BPERIOD = MONTHN
ZTOTALCREDITS = ZAPPLIEDCREDITS1
ZTOTALBALANCE = ZCURRENTTOTAL1
ZZEXTZIP = ZZEXTENSIONZIP
TABLES
STRIBUNECUSTOMER = CUSTOMER
ACCOUNTDATA = T_CUSTOMER
ZCDATAR = ZCDATA
ZAGING = AGINGDATAITAB1
ZADDRESS = I_ADDRESS_NUMBER
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
REFRESH T_CUSTOMER.
ENDIF.
ENDAT.
zzadvertiser = final_accitab-zadvertiser.
zzbusinesspartner = final_accitab-zagency.
refresh T_CUSTOMER.
endif.
INSERT FINAL_ACCITAB INTO TABLE T_CUSTOMER.
append final_accitab.
zzadvertiser = final_accitab-zadvertiser.
zzbusinesspartner = final_accitab-zagency.
ENDLOOP.
For the last customer.....
How to get the data for payment terms, adnumber, adname, for the last customer while using
the below..
IF FL_OPEN = 'X'.
CALL FUNCTION FM_NAME
EXPORTING
CONTROL_PARAMETERS = SSFCTRLOP
ZTOTAL = ZTOTALAMOUNT
ZSCAN_CODE = SCAN_NUMBER
Z_BDATE = E_DATE
ZADNUMBER = ADNUMBER
ZADNUMBER1 = ZZADNUMBER
ZAGENCYNUMBER = AGENCYNUMBER
Z_PAYMENT_TERMS = V_PAYMENT_TERMS
ZADNAME = ADNAME
ZZADNAME = ADNAME1
ZAGENCYNAME = AGENCYNAME
ZPHONE = BPHONE
ZCREDITGROUP = ZCREDITTEXT
Z_BPERIOD = MONTHN
ZTOTALCREDITS = ZAPPLIEDCREDITS1
ZTOTALBALANCE = ZCURRENTTOTAL
ZZEXTZIP = ZZEXTENSIONZIP
TABLES
STRIBUNECUSTOMER = CUSTOMER
ACCOUNTDATA = T_CUSTOMER
ZCDATAR = ZCDATA
ZAGING = AGINGDATAITAB1
ZADDRESS = I_ADDRESS_NUMBER
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
REFRESH T_CUSTOMER.
CALL FUNCTION 'SSF_CLOSE'.
ENDIF.
Question 2:
I have the data in 'final_accitab' as follows:
zadvertiser zagency ....................zsortgroup
100000065 100000065 1
100000065 100000065 1
.
.
100000070 100000070 1
100000071 100000071 2 and so on
I am able to pull in the relevant line items for each customer UNABLE TO GENERATE SEPARATE SPOOL REQUESTS BASED ON THE SORT GROUP
I AM GETTING A SINGLE SPOOL REQUEST CONTAIN STATEMENTS FOR VARIOUS SORT TYPES hOW TO CHANGE THAT?
IW OUDL REALLY APPRECIATE IF YOU COULD TAKE ALOOK INTO MY CODE AND HELP ME OUT HERE..
THANKS IN ADVANCE
VINU
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 |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |