cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a 'At New' like statement in smartforms...

aris_hidalgo
Contributor
0 Kudos

Hello Experts,

IN my smartform, I created a table in my main window that displays

records in spfli namely countryfr, cityfrom, countryto and cityto. Now,

I sorted it by countryfr in ascending order. What I want is that when a

new country is detected it will create a horizontal line(seperator) before

the new countryfr is printed. Any help would be greatly appreciated and rewarded.

Thank you guys and take care!

Example:

Country From:

America

America

America

-


<--draw underline for seperator

Bahrain

Bahrain

Accepted Solutions (0)

Answers (2)

Answers (2)

sachin_chauhan3
Participant
0 Kudos

Hello Aris,

if you have solved your query can you plz tell me the solution of it...

its very urgent..

in my query..i have to sort the material on there division and give the heading of the division.

for example.

abc division

31000023

31000024

xyz division

31000025

31000026

and so on...

Former Member
0 Kudos

Hi Sachin,

In order to get such result.

1. Sort your internal table in the program by field which you will use in control break statement.

2. In smart form-> table control you have option for sort... select that option and insert the field name. you will see 2 fields automatically added to your tree on left hand side.

3. those 2 fields are control break statement for u.

Former Member
0 Kudos

hi

for u r info...

in the table

DATA tab u will find sort criteria..

SAP Smart Forms: General flag

Use

Within a loop for data retrieval, the entries of an internal table can be sorted either in ascending or in descending order.

In addition, you can determine particular events for control group processing by marking the relevant checkboxes. Control groups within an internal table indicate that adjacent table lines can be divided into groups according to the contents of certain fields. The division into groups in an internal table statically depends on the sequence of the fields in the table control. The first field determines the top control group in the hierarchy, and so on. At a control break an event for form printing is triggered.

Smart Forms knows two different events at a control break: at the beginning of a sort term (AT NEW) and at the end of a sort term (AT END). As soon as you mark a sort term, the system dynamically creates an event node in the tree structure of the form; if you unmark it, the event node is deleted. The event nodes "at sort begin" and "at sort end" of a table field appear in pairs in the tree. You can add subnodes to the event nodes, for example, text nodes to display headings or subtotals at a control break.

Dependencies

The control break in Smart Forms, which is executed using events, does not correspond to the control break processing in ABAP, which uses special control structures (see also: AT command: Control break at internal tables).

See also: The Data Tab