cancel
Showing results for 
Search instead for 
Did you mean: 

how to prepare final internal table based on no. of records of individual t

Former Member
0 Kudos

Hi all,

I have to prepare final internal table based on the no. of records of individual table. i.e. I should append the data from the table which has large no of records first. Then I should modify the final table with other individual tables. I have reservation list table(RESB), purchase requisition table(EBAN), purchase order delivery schedules table(EKET) , GRs table (MESG) .I have prepared data for individual tables. We can't say particularly that this table'll have large no. of records always. So how can I append the first table into final internal table ? I have separate work areas for each table in my SMARTFORM.

Edited by: Jayasri P. on Aug 30, 2008 6:02 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1.Take a temporary internal table with two fields, first with type i and 2nd with type string,

2.Store all the value you get from line attribute of 5 tables and name in 2nd.

3.SORT the table in descending order w.r.to field 1.

Now,your first row in tem itab will give the line no and the table name of the table having max no of rows.

Regards,

Anirban

Former Member
0 Kudos

just now I got the same idea and doing the same.Thank u ,will catch u again if I find any problem.

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

DESCRIBE TABLE statement with LINE addition will give you the no of record in an internal table.

For further detail check,

http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm

you can stire the LINE value of each and comare them to get the table with max record.

Regards,

Anirban

Former Member
0 Kudos

I have 5 individual tables . So I have created 5 variables . How can we find the max. value of 5 variables? If we can find the max. value of those variables, how can we pass the data of that particular individual table to final table dynamically as the no. of records can't be maximum for a particular table every time.