Application Development and Automation 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: 
Read only

SAPScript

Former Member
0 Likes
653

hello,

I wish ot display my internal tabel in such a way that say i have n no of fields in my internal table material number,material description,quantity,unit....

now the material number and description is same for several records n i wish to display them only once... dat is display should b like

mat1 desc1 qunt1 unit1

qunt2 unit2

mat2 desc2 qunt3 unit3

(dat is mat1 n des1 is same for both qunt1,unit1 and qunt2,unit2)

is possible wid sapscript? how can achive this ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
607

HI,

It is posible, but the internal table should have the like what you plant to display.

Lets say you have a Internal table which is having MATNo, Des, Qunatitu,

Take another internal table, and use the AT NEW command and move the Values to the New Internal table, so in this Internal table the data will be stored like what you explained.

then use this Internal table to Print in the Layout

Regards

Sudheer

5 REPLIES 5
Read only

Former Member
0 Likes
608

HI,

It is posible, but the internal table should have the like what you plant to display.

Lets say you have a Internal table which is having MATNo, Des, Qunatitu,

Take another internal table, and use the AT NEW command and move the Values to the New Internal table, so in this Internal table the data will be stored like what you explained.

then use this Internal table to Print in the Layout

Regards

Sudheer

Read only

0 Likes
607

thnx for quik reply...i had da same plan jst wanned to knw ders ny other way to do so................

Read only

Former Member
0 Likes
607

Use sort criteria event on sort begin or event on sort end for the internal table node in smartform

Read only

Former Member
0 Likes
607

Hi

In the program you have to keep the fields in the internal table in that order and sort by MATNR MAKTX and use AT NEW command.

sort ITAB by MATNR

loop at ITAB..

at new MATNR.

perform WRITE_FORM using 'WINDOW' 'ELEMENT'.

< in the script create this element and write only 2 fields MATNR and MAKTX)

endat.

perform WRITE_FORM using 'WINDOW' 'ELEMENT1'.

< here again create another element and in that write the remaining fields of the

itab which has to come below same material>

endloop.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
607

Hi,

You can do it in other method also.

store material no. in some variable.

and in LOOP code like this

IF V_MAT = MATNR.

&QUAN& ,, &.UNIT&.

ELSE.

...

..

Regards,

Naveen