05-23-2011 6:34 AM
Hello Experts,
I develop an ABAP program for user inputing several document number , and printing them through SMARTFORM.
Now I have a problem regarding the serial printing order ,
I would like the printing order to follow my input order of the document number ,
but it doesn't , it sort the order automatically from small to big (ps , at my ABAP code , I haven't sort the data)
Please , How to solve this problem?
Thanks you in advanced.
Best Regards,
Yacoa
05-23-2011 7:09 AM
Hi ,
Please drop your query in form printing forum.
As far as the solution is concerned,
1)How is the data present in teh final table you are passing to smartform? is it sorted?
2)How are you printing the form? directly through a program?
05-23-2011 7:09 AM
Hi ,
Please drop your query in form printing forum.
As far as the solution is concerned,
1)How is the data present in teh final table you are passing to smartform? is it sorted?
2)How are you printing the form? directly through a program?
05-23-2011 8:09 AM
Hi sap_wiz ,
My ABAP code is as follow,
-
SELECT-OPTIONS: S_BELNR FOR BKPF-BELNR.
PARAMETERS: S_BUKRS TYPE BKPF-BUKRS OBLIGATORY DEFAULT '1000'.
PARAMETERS: S_GJAHR TYPE BKPF-GJAHR OBLIGATORY.
SELECT * FROM BKPF INTO CORRESPONDING FIELDS OF TABLE T_BKPF
WHERE BUKRS = S_BUKRS AND GJAHR = S_GJAHR AND BELNR IN S_BELNR.
// transport table data to SMARTFORM
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZADOCUMENT'
IMPORTING
FM_NAME = FMNAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
CALL FUNCTION FMNAME
EXPORTING
BUKRS = S_BUKRS
GJAHR = S_GJAHR
TABLES
TBK = T_BKPF
TACC = ACCTABLE
T003T = T_T003T
DD07T = T_DD07T
-
for example , I key in the parameter value as follow
S_BELNR: 3700000111、3700000050、3700000073
S_BUKRS: 1000
S_GJAHR: 1000
and when I debug table T_BKPF of SELECT syntax ,
it presents row data order like 3700000050、3700000073、3700000111
how to make the row data present don't sort automatically?
Regards,
Yacoa
05-23-2011 8:21 AM
Hi,
Please check the sequence of values present in your select options.
05-23-2011 8:35 AM
Hi,
once you use the select query the internal table should be sort like based on the key fields in that BKPF table. Your using BKPF table.
So your Internal table get sort like (BUKRS,BELNR,GJAHR).
So we cant change based on the user giving input.
Regards,
Dhina..
05-23-2011 8:56 AM
Hi Yacoa Chen ,
For your issue, why it is printintg is because that table from where you are getting entries will have that sequesnce so that it is displaying in sorted order