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

internal table work area

devrajsingh
Active Participant
0 Likes
895

hello frds i hav i doubt in internal table work area

TYPES: BEGIN OF tab,

retriving LIKE zdv_empgui-empid,

empname LIKE zdv_empgui-empname,

dept LIKE zdv_empgui-department_code,

sal LIKE zdv_empgui-salary,

sex LIKE zdv_empgui-sex,

END OF tab.

DATA: itab TYPE tab OCCURS 10,

ITAB_WA TYPE TAB.

*==============================================

SELECT empid empname department_code salary sex

FROM zdv_empgui

INTO ITAB_WA.

this is giving rit result.

*============================================

SELECT empid empname department_code salary sex

FROM zdv_empgui

INTO CORRESPONDING FIELDS OF ITAB_WA.

In this case value of dept is not retriving and sal is coming as value 0.

rest all value is ok.

is there any diff make by adding CORRESPONDING FIELDS OF ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
863

HI,

When using INTO CORRESPONDING FIELDS OF the field names of database table and internal table has to be same for correct results as said by Sudheer....

refer

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/select.htm

Regards,

Santosh

Message was edited by:

Santosh Kumar Patha

7 REPLIES 7
Read only

Former Member
0 Likes
863

Hi,

When you write the INTO CORRESPONDING FIELDS statment, the field name of the Database table and the Internal table shoulb be same.

Regards

Sudheer

Read only

Former Member
0 Likes
864

HI,

When using INTO CORRESPONDING FIELDS OF the field names of database table and internal table has to be same for correct results as said by Sudheer....

refer

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/select.htm

Regards,

Santosh

Message was edited by:

Santosh Kumar Patha

Read only

0 Likes
863

ya thanks a lot

i m getting rit result by both

but y dis is

is there any reason?

Read only

Former Member
0 Likes
863

Along with the above suggestions, also make the highlighted change:

SELECT empid empname department_code salary sex

FROM zdv_empgui

INTO CORRESPONDING FIELDS OF <b>TABLE</b> ITAB_WA.

( If the names are same in the itab and the dbtab)

Regards,

Ravi

Read only

ferry_lianto
Active Contributor
0 Likes
863

Hi,

Also please try this instead of using CORRESPONDING FIELDS OF .


SELECT empid empname department_code salary sex
FROM zdv_empgui
INTO TABLE ITAB_WA
WHERE <your condition>.

Regards,

Ferry Lianto

Read only

0 Likes
863

SELECT empid empname department_code salary sex

FROM zdv_empgui

INTO CORReSPONDING FIELDS OF ITAB_WA2

where salary = 123.

hi i tried the above exmple its working fine

y is there any <b>concept</b> of internal table?

Read only

Former Member
0 Likes
863

Hi,

SELECT empid empname department_code salary sex

FROM zdv_empgui

INTO (ITAB_WA-retriving,itab_wa-empname,itab_wa-dept,itab_wa-sal,itab_wa-sex).

Then u will get the answer. plz try it.

Rgds,

P.Suryanagi Reddy