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 population

Former Member
0 Likes
723

Here in this code the internal table it_mseg and it_mbew

are not being populated in the following code.Can anybody please tell me what the reason.

Thanks and regards

jyoti

SELECT mblnr

bwart

matnr

INTO TABLE it_mseg

FROM mseg.

IF it_mseg IS NOT INITIAL .

SELECT mblnr

bldat

INTO TABLE it_mkpf

FROM mkpf

FOR ALL ENTRIES IN it_mseg

WHERE mblnr = it_mseg-mblnr.

ENDIF.

IF it_mseg IS NOT INITIAL.

SELECT matnr

bwkey

bwtar

lbkum

INTO TABLE it_mbew

FROM mbew

FOR ALL ENTRIES IN it_mseg

WHERE matnr = it_mseg-matnr.

ENDIF.

7 REPLIES 7
Read only

SantoshKallem
Active Contributor
0 Likes
688

check at the bold one

SELECT mblnr

bwart

matnr

INTO TABLE it_mseg

FROM mseg.

IF it_mseg<b>[ ]</b> IS NOT INITIAL .

SELECT mblnr

bldat

INTO TABLE it_mkpf

FROM mkpf

FOR ALL ENTRIES IN it_mseg

WHERE mblnr = it_mseg-mblnr.

ENDIF.

IF it_mseg<b>[ ]</b> IS NOT INITIAL.

SELECT matnr

bwkey

bwtar

lbkum

INTO TABLE it_mbew

FROM mbew

FOR ALL ENTRIES IN it_mseg

WHERE matnr = it_mseg-matnr.

ENDIF.

<b></b><b></b>

Read only

Former Member
0 Likes
688

hi

try these..

1. use INTO CORRESPONDING FIELDS OF TABLE

2. use IF it_mseg[] IS NOT INITIAL

thx

pavan

Read only

Former Member
0 Likes
688

Hi Jothi,

Can you check whether there exist data on the database through se16.

Regards,

Satya.

Read only

Former Member
0 Likes
688

Please check if there exists some data in your table.

santhosh

Read only

Former Member
0 Likes
688

Hi Jyoti,

Can you also mention the internal table definitions for it_mseg and it_mkpf and it_mbew...

Regards,

Biju

Read only

Former Member
0 Likes
688

Use "F it_mseg[]S NOT INITIAL" in place of "IF it_mseg IS NOT INITIAL".

If u declared the itabs with all fields....include "into corresponding fields of table it_mkpf" in place of "INTO TABLE it_mkpf".

repeat the same for all select statements and if statements.

Cheers.

Read only

Former Member
0 Likes
688

Hi,

Syntax of IF it_mseg IS NOT INITIAL is wrong

Please check this code.

DATA:it_mseg LIKE MSEG OCCURS 0 WITH HEADER LINE,

it_mkpf LIKE MKPF OCCURS 0 WITH HEADER LINE,

it_mbew LIKE MBEW OCCURS 0 WITH HEADER LINE.

SELECT mblnr bwart matnr

INTO CORRESPONDING FIELDS OF TABLE it_mseg

FROM mseg.

<b>IF NOT it_mseg[] IS INITIAL .</b>

SELECT mblnr

bldat

INTO CORRESPONDING FIELDS OF TABLE it_mkpf

FROM mkpf

FOR ALL ENTRIES IN it_mseg

WHERE mblnr = it_mseg-mblnr.

ENDIF.

IF not it_mseg IS INITIAL.

SELECT matnr

bwkey

bwtar

lbkum

INTO CORRESPONDING FIELDS OF TABLE it_mbew

FROM mbew

FOR ALL ENTRIES IN it_mseg

WHERE matnr = it_mseg-matnr.

ENDIF.