cancel
Showing results for 
Search instead for 
Did you mean: 

Looping and grouping

IanStubbings
Active Participant
0 Kudos

Hi

I wish to print data out in a loop but do not want to repeat the first column as it is the same all the way through.

Therefore, how do I print the first column only when it appears for the first time?

Cheers

Ian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can sort that table and delete duplicates and use that table.

Pranav

Answers (3)

Answers (3)

Former Member
0 Kudos

Before the loop write progmme line.

store loop counter in a variale.

After that u have to create alter.

Give counter condition = 1.

and Store first column value in variable.

and in second condition

reset variable value to ' '.

Former Member
0 Kudos

Before the loop write progmme line.

store loop counter in a variale.

After that u have to create alternative Node.

Alternative will have 2 nodes.

Select Condition .

type that variable name in Field name .

Alternative Node have two sub nodes .

1 . is Ture

2. is false

1. Right Click True node and create programme line.

in programme line u have to store field value.

2. After that u have to click on False node

and create programm lines.

store space in that variable value .

After this u have to create text element.

In text element u can give that variable name.

I am sure this will solve your provlem.

Reward point if answer is satisfactory.

Bye ...

Best of luck ...

Pradeep

+9910705704

Edited by: PRADEEP SHARMA on Mar 8, 2008 11:12 AM

Former Member
0 Kudos

Hi Ian,

Try the following code.

Loop at Itab.

At new Column1.

Write /: Itab-column2,

Itab-column3,

Itab-column4.

End at.

Endloop.

IanStubbings
Active Participant
0 Kudos

Just to clarify, I am outputting data in a smartform, not in list processing.

Ian

Former Member
0 Kudos

HI Ian.

If you are saying column here,I think you have 3-4 columns and are using table to print the output.You can either create a Program Lines under flow logic and input your column field into another variable and print.Use at new here.I am not sure if you can solve your problem but this is just a work around method.As there is no other way to use at new here unless you do that in the driver program.

Reward if helpful.

Thanks,

Dishant

Former Member
0 Kudos

Ian,

you cannot use AT New in smartforms. Either you can use in print program or use sort command and delete duplicates.

Pranav

Former Member
0 Kudos

You can use AT NEW...

Rob

IanStubbings
Active Participant
0 Kudos

Hi guys

Thanks for the replies but rather new (2 days) to smartforms although used SAPScript a lot. Where would I put the AT NEW?

Ian