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

Not getting data in Internal Table

Former Member
0 Likes
1,309

Hello experts,

I m not getting data in my internal table

if i_mseg[] is not initial.

select zzlcno zzlcdt

into i_ekpo from ekpo

  • where ebeln = '0020002943'.

for all entries in i_mseg

where ebeln = i_mseg-ebeln and

ebelp = i_mseg-ebelp.

append i_ekpo.

endselect.

endif.

Plz suggest where I wrong.

Ravi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,259

Hello Ravi,

Please confirm if there is data in ekpo table.

Thanks,

Amit

10 REPLIES 10
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,259

Hello

Since we do not see the definitions of your itab's it is difficult (but not impossible) to answer.

Are the fields zzlcno zzlcdt appended to EKPO? What is the line type of I_EKPO.

Assuming that the two z-fields are appended to EKPO and I_EKPO has line type EKPO you may succeed with::


select zzlcno zzlcdt
into CORRESPONDING FIELDS OF i_ekpo from ekpo
* where ebeln = '0020002943'.
for all entries in i_mseg
where ebeln = i_mseg-ebeln and
ebelp = i_mseg-ebelp.
append i_ekpo.
endselect.
endif.

Regards

Uwe

Read only

0 Likes
1,259

Hello experts,

My table declaration part and i_mseg has data in it.

data: begin of i_ekpo occurs 0,

zzlcno like ekpo-zzlcno,

zzlcdt like ekpo-zzlcdt,

end of i_ekpo.

Ravi

Read only

0 Likes
1,259

Hi,

Firstly in the debugging mode check if you are getting entries in i_mseg table... whether it goes to that select queries or not....

Then from SE11 check in the ekpo table if there are any values for the fields you have mentioned in the select query...

Regards,

Siddarth

Read only

Former Member
0 Likes
1,259

Hi,

Just try with the code given below... hope that helps you out....

also write a break-point statement just before the if statement and check in the debugging mode if it i_mseg table has some values or not...

if i_mseg[] is not initial.

select zzlcno zzlcdt
into i_ekpo from ekpo
for all entries in i_mseg
where ebeln = i_mseg-ebeln.

    append i_ekpo.
endselect.

endif.

OR

if i_mseg[] is not initial.

select zzlcno zzlcdt
into corresponding fields of  i_ekpo from ekpo
for all entries in i_mseg
where ebeln = i_mseg-ebeln.

    append i_ekpo.
endselect.

endif.

Regards,

Siddarth

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,259

HI Ravi...Avoid Endselect and use Into table...

Paste your itab declaration part ...

Read only

Former Member
0 Likes
1,259

1. avoid select endselect.

use..

select x y z from tt into TABLE i_ekpo where...

2. check the structure declarations

3. keep a break point on the select statement and when execute. when debugger starts check values in i_mseg.

4.if values are there in i_mseg. take those values, goto se16->ekpo table. pass those i_mseg entries in to it and check data is available or not.

Read only

Former Member
0 Likes
1,260

Hello Ravi,

Please confirm if there is data in ekpo table.

Thanks,

Amit

Read only

pradiptakumar_mishra
Participant
0 Likes
1,259

Hi,

1. Directly populate the itab using 'INTO TABLE' addition.

2. Check whether you have data in I_MSEG[].

3. Avoid using 'SELECT...ENDSELECT'.

4. Also pls check whether you have data in EKPO corresponding to I_MSEG condition.

Thanks and Regards

Pradipta K Mishra

Read only

rainer_hbenthal
Active Contributor
0 Likes
1,259

Always check sy-subrc after a select. In case of update and delete, check sy-dbcnt, too. If you ask in SDn, post all necessary information.

Read only

Former Member
0 Likes
1,259

hi try this

if i_mseg[] is not initial.

select zzlcno zzlcdt

into table i_ekpo from ekpo

  • where ebeln = '0020002943'.

for all entries in i_mseg

where ebeln = i_mseg-ebeln and

ebelp = i_mseg-ebelp.

endif.