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

simple QA

Former Member
0 Likes
1,036

data: begin of itab occurs 0,

zlblni like essr-lblni,

zebeln like essr-ebeln,

zebelp like essr-ebelp,

zbanfn like essr-banfn,

zbnfpo like essr-bnfpo,

zpackno like essr-packno,

zko_ebeln like ekko-ebeln,

zko_lifnr like ekko-lifnr,

zbelnr like rseg-belnr,

end of....

select single lblni ebeln ebelp banfn bnfpo packno

from essr

into corresponding fields of itab.

why its not work???

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
996

The names of the internal table fields should be matching with those in the table.

This would work:

<b>data: begin of itab occurs 0,

lblni like essr-lblni,

ebeln like essr-ebeln,

ebelp like essr-ebelp,

banfn like essr-banfn,

bnfpo like essr-bnfpo,

packno like essr-packno,

zko_ebeln like ekko-ebeln,

zko_lifnr like ekko-lifnr,

zbelnr like rseg-belnr,

end of....</b>

Regards,

Ravi

11 REPLIES 11
Read only

Former Member
0 Likes
996

Hi,

give the itabi field names same as database field names or else exclusively specify the fields of the itab in the select statement.

Read only

Former Member
0 Likes
997

The names of the internal table fields should be matching with those in the table.

This would work:

<b>data: begin of itab occurs 0,

lblni like essr-lblni,

ebeln like essr-ebeln,

ebelp like essr-ebelp,

banfn like essr-banfn,

bnfpo like essr-bnfpo,

packno like essr-packno,

zko_ebeln like ekko-ebeln,

zko_lifnr like ekko-lifnr,

zbelnr like rseg-belnr,

end of....</b>

Regards,

Ravi

Read only

0 Likes
996

like other said.. 'CORRESPONDING' will work for only an exact match of field names..

Regards,

Suresh Datti

Read only

Former Member
0 Likes
996

Hi liat,

1. BCOS the FIELD NAMES ARE DIFFERENT

2. THE FIELD NAMES SHOULD BE SAME.

3. Remove Z

from the field names in itab.

regards,

amit m.

Read only

Peter_Inotai
Active Contributor
0 Likes
996

Because in ESSR you have field like EBELN and not ZEBELN, so move-correcponding won't move it as they have different names.

Either remove the z from your fields name or remove the move-corresponding and * from your select.

Peter

Read only

Former Member
0 Likes
996

<b>select single lblni ebeln ebelp banfn bnfpo packno

from essr

into (itab-zlblni,itab-zebeln,itab-zebelp,itab-zbanfn,

itab-zbnfpo,itab-zpackno).</b>

Read only

Former Member
0 Likes
996

<b>into corresponding fields</b> compares the field names & moves the fields accordingly so declaring itab fields with the same names as the table names is always recommended.

Read only

Former Member
0 Likes
996

Hi Liat,

Remove Z and declare this way

data: begin of itab occurs 0,

<b>lblni like essr-lblni,

ebeln like essr-ebeln,

ebelp like essr-ebelp,

banfn like essr-banfn,

bnfpo like essr-bnfpo,

packno like essr-packno,

ko_ebeln like ekko-ebeln,

ko_lifnr like ekko-lifnr,

belnr like rseg-belnr,</b>end of....

Read only

Former Member
0 Likes
996

HOPE THIS HELPS YOU..

Syntatically your select will be correct. If you want to select multiple items use select as

select lblni ebeln ebelp banfn bnfpo packno
from essr into corresponding fields of table itab.
break-point.

Cheers,

Thomas.

Read only

Former Member
0 Likes
996

hi liat,

when u r using into <b>corresponding fields of itab</b>

the fieldnames should be the same.

like this..

data: begin of itab occurs 0,

lblni like essr-lblni,

ebeln like essr-ebeln,

ebelp like essr-ebelp,

banfn like essr-banfn,

bnfpo like essr-bnfpo,

packno like essr-packno,

zko_ebeln like ekko-ebeln,

zko_lifnr like ekko-lifnr,

zbelnr like rseg-belnr,

end of....

hope this helps,

priya.

Read only

LucianoBentiveg
Active Contributor
0 Likes
996

yo can try too with:

select single lblni ebeln ebelp banfn bnfpo packno

from essr

into itab.