Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

at new and modify

Guruz,

my code:

SORT gt_output BY storeno.

LOOP AT gt_output.

AT NEW storeno.

***store branch number

PERFORM get_kna1 USING gt_output-storeno

CHANGING gv_adrnr.

ENDAT.

**storeno

gt_output-storeno = gv_sort2.

MODIFY gt_output.

CLEAR gt_output.

ENDLOOP.

..here im having same branch number in gt_output as iam modifying it within the loop its hitting at new again for the same branch..how can i overcome this?

pla advise..

thanks

Tags:
replied

Instead of at new use following logic.

clear gw_output. "work area for gt_output.

LOOP AT gt_output.

IF gw_output-storeno NE gt_output-storeno.

***store branch number

PERFORM get_kna1 USING gt_output-storeno

CHANGING gv_adrnr.

ENDIF.

clear gw_output.

READ gt_output into gw_output index sy-tabix.

gt_output-storeno = gv_sort2.

MODIFY gt_output.

CLEAR gt_output.

ENDLOOP.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question