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

Clear from internal table

Former Member
0 Likes
503

I have one ITAB having following values:

GRN IR Date Price

11249432 6075620 31.07.2007 1082104

11249433 6075620 31.07.2007 1082104

11249436 6075620 31.07.2007 1082104

But i wish to write in this manner tht amt come only once.

GRN IR Date Price

11249432 6075620 31.07.2007 1082104

11249433 6075620 31.07.2007

11249436 6075620 31.07.2007

Please guide

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
486

Hi,

1.Take two structures as str1 and str2.

2.First compare as If str1 eq str2.First time it fails,then move the values into the str2.

3.From second time onwards clear the value .

Regards,

Shiva.

3 REPLIES 3
Read only

Former Member
0 Likes
486

Hi Abhut,

Refer the Below Example Program :

REPORT  YH1072_TEST.

DATA: wa_maktx LIKE makt-maktx,
      wa_menge TYPE c.

DATA: BEGIN OF t_mara OCCURS 0,
         matnr LIKE mara-matnr,
         werks LIKE marc-werks,
         maktx LIKE makt-maktx,
         menge TYPE c,
      END OF t_mara.

t_mara-matnr = 'A1' .
t_mara-werks = 602.
t_mara-maktx = 'Milk'.
t_mara-menge = '1'.
APPEND t_mara.

t_mara-matnr = 'A1' .
t_mara-werks = 602.
t_mara-maktx = 'Milk'.
t_mara-menge = '1'.
APPEND t_mara.

t_mara-matnr = 'A1' .
t_mara-werks = 602.
t_mara-maktx = 'Milk'.
t_mara-menge = '1'.
APPEND t_mara.

LOOP AT t_mara.
  IF t_mara-maktx = wa_maktx AND
     t_mara-menge = wa_menge.
         WRITE:/ t_mara-matnr,
           t_mara-werks .

  ELSE.
    WRITE:/ t_mara-matnr,
           t_mara-werks ,
           t_mara-maktx,
            t_mara-menge.

  ENDIF.
  MOVE: t_mara-maktx TO wa_maktx,
        t_mara-menge TO wa_menge.
ENDLOOP.

Regards,

Sunil

Read only

Former Member
0 Likes
486

HI,

loop at itab.

write: / GRN IR Date.

at new ir.

write: price.

endat.

endloop.

regards

Nicole

Read only

Former Member
0 Likes
487

Hi,

1.Take two structures as str1 and str2.

2.First compare as If str1 eq str2.First time it fails,then move the values into the str2.

3.From second time onwards clear the value .

Regards,

Shiva.