0
Former Member
Jan 30, 2009 at 06:22 AM

# Threding problem

17 Views

Hi ABAP Gurus,

Now i'm facying the problem of kunnr repitition and according to KUNNR other fields also goes to repet.Pls help me.

Thanks & Regards

Atul

TABLES : kna1.

DATA : BEGIN OF project,

ort01 TYPE kna1-ort01, "customer city

kunnr TYPE kna1-kunnr, "customer code

name1 TYPE kna1-name1, "customer name

stras TYPE kna1-stras, "customer street

pstlz TYPE kna1-pstlz, "city zip-code

END OF project.

DATA itab LIKE project OCCURS 0 WITH HEADER LINE.

SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE t1.

SELECT-OPTIONS : customer FOR kna1-kunnr.

SELECTION-SCREEN : END OF BLOCK blk1.

INITIALIZATION.

t1 = 'Customer List'.

customer-low = '1410'.

customer-high = '2410'.

APPEND customer.

START-OF-SELECTION.

SELECT kunnr name1 stras ort01 pstlz INTO CORRESPONDING FIELDS OF TABLE itab FROM kna1

WHERE kunnr IN customer.

END-OF-SELECTION.

SORT itab BY ort01.

LOOP AT itab.

AT NEW ort01.

WRITE : /1 sy-vline, 'city:-', 8 itab-ort01,

35 sy-vline,

90 sy-vline,

100 sy-vline.

WRITE : /1(100) sy-uline.

ENDAT.

LOOP AT itab WHERE ort01 = itab-ort01.

WRITE : /1 sy-vline, 21 itab-kunnr,

35 sy-vline, 36 itab-name1,

90 sy-vline, 91 itab-pstlz,

100 sy-vline.

WRITE : / sy-vline, 35 sy-vline, 50 itab-stras, 90 sy-vline, 100 sy-vline.

ENDLOOP.

ENDLOOP.