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

reading value from internal table

Former Member
0 Likes
624

hi,

please let me know how can i find the max of customer no found in a row and it should be restricted to 6 9 i.e there can be a min of 1 customer no and max of 6 customer no

my internal table is like this

y name customerno customerno cusno cusno ... ...

kindly reply..

Thanks

padma

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
588

hi,

here you go.

data : lv_count type i.

loop at itab.

if itab-cust1 is not initial.

lv_count = lv_count + 1.

endif.

if itab-cust2 is not initial.

lv_count = lv_count + 1.

endif.

...

...

...

...

...

if lv_count gt 6.

delete itab index sy-tabix.

endif.

endloop.

Thanks

Mahesh

4 REPLIES 4
Read only

Former Member
0 Likes
589

hi,

here you go.

data : lv_count type i.

loop at itab.

if itab-cust1 is not initial.

lv_count = lv_count + 1.

endif.

if itab-cust2 is not initial.

lv_count = lv_count + 1.

endif.

...

...

...

...

...

if lv_count gt 6.

delete itab index sy-tabix.

endif.

endloop.

Thanks

Mahesh

Read only

Former Member
0 Likes
588

hi,

Do you have data of this kind

1000,cust1,cust2,cust3,cust4,cust5,cust6,cust7.

do this way.

data : begin of jtab occurs 0,

line(10),

end of jtab.

data : begin of itab occurs 0,

line(10),

end of itab.

let us say you have data in itab.

loop at itab.

split itab-line at ',' into table jtab.

describe table jtab lines lv_lines.

if lines > 7.

this indicates that the this particular record has more that 6 customers.

endif.

refresh jtab.

endloop.

Thanks,

Mahesh

Read only

Former Member
0 Likes
588

Hi Magesh,

My internal table is like this

Y Name Cust1 cust2 Cust3 Cust4

values like

Y abcdef 123234234 13123424 1312343534 4242453455 563654654

how can i find out that the column from 3 till 9 should only have values and other than that it cannot have any values

Thanks

Padma

Read only

0 Likes
588

HI,

Check my frist reply.

Thanks

Mahesh