Application Development 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: 

Deleting entries in Int.table where all the fields are empty

Former Member
0 Kudos

Hi,

I am displaying the report output in ALV.

if the customer contains all the numerical values as Zero those

records should be deleted from the internal table. Please suggest how can i do that.

Output internal table contains the following structure.

TYPES: BEGIN OF T_OUTPUT,

KUNNR LIKE BSID-KUNNR,

NAME1 LIKE KNA1-NAME1,

OPNBAL TYPE P DECIMALS 2, "Opening Bal

SALE LIKE KNC1-UM02S, "Sales

RECEIPT LIKE KNC1-UM02S, "Sales Receipt

RETRN LIKE KNC1-UM02S, "Sales Retn

CLETRAGODN LIKE KNC1-UM02S, "clearing from transporter godn

  • CLETRAGODN type p decimals 2, "clearing from transporter godn

CLOBAL TYPE P DECIMALS 2, "Sales Clobal

V_VARIANCE LIKE KNC1-UM02S, "Sales-Receipt

END OF T_OUTPUT.

data : IT_OUTPUT TYPE STANDARD TABLE OF T_OUTPUT.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Sort itab

delete itab where field1 = 0 and field2 = 0 etc.

Regards

Madhan

4 REPLIES 4

Former Member
0 Kudos

Hi

Sort itab

delete itab where field1 = 0 and field2 = 0 etc.

Regards

Madhan

Former Member
0 Kudos

Hi,

Loop at it_output.

if it_output-kunnr is initial and it_output-name1 is initial etc .

delete it_output.

endif.

endloop.

Regards,

Dhan

Former Member
0 Kudos

Former Member
0 Kudos

Hi venkat,

try this one.

delete it_output where
 OPNBAL is initial and
 SALE  is initial and
 RECEIPT is initial and
 RETRN is initial and
 CLETRAGODN is initial and
 CLOBAL is initial and
 V_VARIANCE  is initial .

Here first record in it_output table contains values, and when the second record is appeneded to it_output there is no values for remaining fields. So delete the record from it_output where these values are initial.

TYPES: BEGIN OF T_OUTPUT,
KUNNR LIKE BSID-KUNNR,
NAME1 LIKE KNA1-NAME1,
OPNBAL TYPE P DECIMALS 2, "Opening Bal
SALE LIKE KNC1-UM02S, "Sales
RECEIPT LIKE KNC1-UM02S, "Sales Receipt
RETRN LIKE KNC1-UM02S, "Sales Retn
CLETRAGODN LIKE KNC1-UM02S, "clearing from transporter godn

*CLETRAGODN type p decimals 2, "clearing from transporter godn
CLOBAL TYPE P DECIMALS 2, "Sales Clobal
V_VARIANCE LIKE KNC1-UM02S, "Sales-Receipt
END OF T_OUTPUT.

data : IT_OUTPUT TYPE STANDARD TABLE OF T_OUTPUT,
       fs_output type t_output.

fs_output-KUNNR = '123'.
fs_output-NAME1 = 'raj'.
fs_output-OPNBAL = '20000'.
fs_output-SALE  = '12'.
fs_output-RECEIPT ='123'.
fs_output-RETRN = '123'.
fs_output-CLETRAGODN = '1'.  "clearing from transporter godn

*CLETRAGODN type p decimals 2, "clearing from transporter godn
fs_output-CLOBAL = '2300'.
fs_output-V_VARIANCE ='34.7'.   "Sales-

append fs_output to it_output.

clear fs_output.
fs_output-KUNNR = '456'.
fs_output-NAME1 = 'SIRI'.


append fs_output to it_output.

delete it_output where
 OPNBAL is initial and
 SALE  is initial and
 RECEIPT is initial and
 RETRN is initial and
 CLETRAGODN is initial and

 CLOBAL is initial and
 V_VARIANCE  is initial .

Regards,

Rajitha.