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

Select query

Former Member
0 Likes
733

Hello All,

SELECT fieldname FROM edsappl

INTO TABLE l_t_appl

WHERE segtyp = 'E1MAKTM'.

In the above selection, the internal table is populated as :

MAKTX

MSGFN

SPRAS

SPRAS_ISO

whereas, in SE16 it is in the below order :

MSGFN

SPRAS

MAKTX

SPRAS_ISO

Is it possible to populate the internal table, as shown in SE16 itself.

Thanks,

Bharadwaj

7 REPLIES 7
Read only

Former Member
0 Likes
714

Hi br,

1. order by pos

u can use order by.

2.

SELECT fieldname FROM edsappl

INTO TABLE l_t_appl

WHERE segtyp = 'E1MAKTM'

order by pos.

regards,

amit m.

Read only

0 Likes
714

Hi,

To use "ORDER BY pos" , i need to add the pos field also to the internal table(l_t_appl). Is there any possibility avoiding this!

Read only

0 Likes
714

hi again,

1. i need to add the pos field also to the internal table(l_t_appl

NOT REQUIRED.

No need to add any field in your internal table.

It will work fine.

regards,

amit m.

Read only

Former Member
0 Likes
714

Hello BR,

i have used the following code and I get the same result as in SE16.

<b>tables: edsappl.

data: begin of i_edsappl occurs 0.

data: fieldname like edsappl-fieldname.

data: end of i_edsappl.

clear i_edsappl.

refresh i_edsappl.</b>

select fieldname from edsappl

into table i_edsappl

where segtyp = 'E1MAKTM'.

I am using ur code only.

Read only

Former Member
0 Likes
714

hi

After the select statement sort the internal table in the order of primery key as in se11 table. this will solve ur problem

Read only

former_member186741
Active Contributor
0 Likes
714

you could do:

SELECT pos fieldname FROM edsappl

INTO corresponding fields of TABLE l_t_appl

WHERE segtyp = 'E1MAKTM'

order by pos.

....

Hopefully pos will be used for the order by but isn't in the output table.

Read only

Former Member
0 Likes
714

Hi B R,

Define ur internal table by this way:

data : begin of L_T_APPL occurs 0,

MSGFN like <table Name>-MSGFN,

SPRAS like <table Name>-SPRAS,

MAKTX like <table Name>-MAKTX,

SPRAS_ISO like <table Name>-SPRAS_ISO,

end of L_T_APPL.

Regards,

Digesh Panchal