Application Development 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: 

How to use "TRANSPORTING FIELDS.." in READ itab?

Former Member
0 Kudos

Hi. I have an internal table. I want to read a particular field in the internal table and transport it to an work area. I tried the following codes but encounterd an error.

Why is that so? Thanks.

Error: No component exists with the name into.

***********************************************************

READ TABLE ITAB_REF0011 WITH KEY

LN_DAT8 = ITAB_TRA-DT_DAT8 LN_TIM6 = ITAB_TRA-DT_TIM6

BINARY SEARCH TRANSPORTING LN_DAT6 INTO ITAB_REF0011A.

5 REPLIES 5

former_member404244
Active Contributor
0 Kudos

Hi,

try like this

READ TABLE ITAB_REF0011 WITH KEY

LN_DAT8 = ITAB_TRA-DT_DAT8 LN_TIM6 = ITAB_TRA-DT_TIM6

BINARY SEARCH .

if sy-subrc eq 0.

move : ITAB_REF0011-LN_DAT6 TO ITAB_REF0011A.

endif.

Regards,

nagaraj

Former Member

Former Member
0 Kudos

Hi Kian,

example.

Loop at i_mara.

read table i_makt where matnr = i_mara-matnr.

if sy-subrc = 0.

i_mara-maktx = i_makt-maktx.

endif.

modify i_mara transporting maktx.

endloop.

If it is helpfull pls reward .

Regards

srimanta

former_member667836
Active Participant
0 Kudos

Hi Kian,

is the internal table ITAB_REF0011 is with header line or not?syntax for read statement is

INTO wa [transport_options] }

| { ASSIGNING <fs> }

| { REFERENCE INTO dref }

| { TRANSPORTING NO FIELDS }.

You can see that the result set assigned to work area .if you want to transport only one field mention the field explicitly in the INTO clause

eg: transporting field1 into wa_test-field1.

reward for helpful answer

message edited

shibu

Former Member
0 Kudos

try this,

READ TABLE ITAB_REF0011 WITH KEY

LN_DAT8 = ITAB_TRA-DT_DAT8 LN_TIM6 = ITAB_TRA-DT_TIM6

BINARY SEARCH.

*******incase ITAB_REF0011A has only one field of type itab_REF0011-lndat6 .

if sy-subrc = 0.

move itab_REF0011-lndat6 to ITAB_REF0011A.

append ITAB_REF0011A.

endif.

********otherwise use move to pass data into corresponding field of ITAB_REF0011A. and then append.