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

Problem with Describing internal table.

Former Member
0 Likes
377

Hi,

Presently i am working in travel module,

my internal table have: application numbers, type of visa, country, i am able to get total number of applications by describing table,

But my need is to get the total number applcaitions based on individual coutnry wise and visa type.

How to get total total numebr of application coutry wise and by visa type.An individual country may have different visa type.

Pelase give the logic it is quite urgent.

Thanks in Advance

Regards,

Irfan Hussain

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
360

Hi Irfan

Define another internal table and use collect statement .

<b>DATA BEGIN of itab occurs 0.

APPL ...

VISATYP ...

COUNTRY ...

END of ITAB.

DATA begin of itab1 occurs 0,

visatyp ...

country ...

count type i,

end of itab1 .

  • Assuming your itab has all the data.

Loop at itab .

move itab-visatyp to itab1-visatyp.

move itab-country to itab1-country.

itab1-count = 1.

collect itab1.

endloop.</b>

( Now in itab1 you will have unique combination of country + visatype , with the number of applications in count field.)

Cheers.

( dont forget to reward if answers were helpful )

2 REPLIES 2
Read only

Former Member
0 Likes
360

Hi,

One way of doing this will be create 2 itabs with same fields but in 1st itab keep country as 1st field and in 2nd Visa type as 1st field.With this u can get total apps by country and by visa type as seperate figures.

If you need it by country and visa type,in an itab create a key field by concatenating country and visa type.This key field will be the 1st field in the itab.

In the loop use at end of to sum.

Please reply if this works.

<b>Regards

<u>Abhijit Moholkar</u></b>

Read only

Former Member
0 Likes
361

Hi Irfan

Define another internal table and use collect statement .

<b>DATA BEGIN of itab occurs 0.

APPL ...

VISATYP ...

COUNTRY ...

END of ITAB.

DATA begin of itab1 occurs 0,

visatyp ...

country ...

count type i,

end of itab1 .

  • Assuming your itab has all the data.

Loop at itab .

move itab-visatyp to itab1-visatyp.

move itab-country to itab1-country.

itab1-count = 1.

collect itab1.

endloop.</b>

( Now in itab1 you will have unique combination of country + visatype , with the number of applications in count field.)

Cheers.

( dont forget to reward if answers were helpful )