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: 

About SMARTFORM printing order

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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?

5 REPLIES 5

Former Member
0 Kudos

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?

0 Kudos

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

0 Kudos

Hi,

Please check the sequence of values present in your select options.

0 Kudos

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..

0 Kudos

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