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: 

How to remove records in itab where its HKONT does not end in '0'...

aris_hidalgo
Contributor
0 Kudos

Hello Experts,

I am getting records from BSIS and BSAS and I want to remove those records with

their HKONT(GL account) does not end in '0'(zero). I do now want to do it via a loop.

I tried using DELETE FROM ITAB statement but it seems it does not work.

Here is what I did:

IF NOT gt_bsis_bsas[] IS INITIAL.

DELETE gt_bsis_bsas WHERE hkont+10(0) <> '0'.

ENDIF.

Hope you can help me guys. Thank you and take care!

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

Sorry it should be CP instead of NP

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

ranges r_hkont for <type for hkont>.

r_hkont-sign = 'I'.

r_hkont-option = 'NP'.

r_hkont-low = '+++++++++0'. "Assuming HKONT is 10 chracters

append r_hkont.

delete itab where hkont not in r_hkont.

REgards,

Ravi

former_member181962
Active Contributor
0 Kudos

Sorry it should be CP instead of NP

0 Kudos

Hi Ravi,

So am I what do you mean by '+++++++++0'?

Thanks again!

0 Kudos

Hi,

It is nothing but the single wild character. As you have * for anything, you have + for a single character.

Regards,

Atish

0 Kudos

Hi Viray,

'+' is a wildcard char which is used to represent one char

where as '*' represents any number of char's.

In this case +++++++++0

<b>means that the length of the field is 10 chars and first 9 can be anything</b>

he didn't use '*0' since it could mean that the length of the data entered can be anything .

Hope this clarifies

Regards

Nishant

aris_hidalgo
Contributor
0 Kudos

Thank you guys!problem solved:)