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 FILL

Former Member
0 Likes
821

hi,

i am posting the select part of my code and would like to ask someone to look trough it and to check why my internal table isn't filling up???

thanx so much in advance!!!

code:

SELECT vbeln fkart fktyp vbtyp waerk vkorg vtweg knumv

fkdat gjahr poper zterm netwr kunrg mwsbk

zuonr kunag

INTO CORRESPONDING FIELDS OF TABLE it_hd

FROM vbrk

WHERE vbeln IN so_vbeln AND

erdat IN so_erdat.

IF vbrk-vbtyp = 'H' OR

vbrk-vbtyp = 'K' OR

vbrk-vbtyp = 'N' OR

vbrk-vbtyp = 'O' OR

vbrk-vbtyp = 'T' OR

vbrk-vbtyp = '6'.

wa_hd-bsart = 'CRME'.

ELSE.

wa_hd-bsart = 'INVO'.

IF sy-subrc <> 0.

WRITE: / 'Wrong IF statement'.

ENDIF.

ENDIF.

Maja

hi,

i am posting the select part of my code and would like to ask someone to look trough it and to check why my internal table isn't filling up???

thanx so much in advance!!!

code:

SELECT vbeln fkart fktyp vbtyp waerk vkorg vtweg knumv

fkdat gjahr poper zterm netwr kunrg mwsbk

zuonr kunag

INTO CORRESPONDING FIELDS OF TABLE it_hd

FROM vbrk

WHERE vbeln IN so_vbeln AND

erdat IN so_erdat.

IF vbrk-vbtyp = 'H' OR

vbrk-vbtyp = 'K' OR

vbrk-vbtyp = 'N' OR

vbrk-vbtyp = 'O' OR

vbrk-vbtyp = 'T' OR

vbrk-vbtyp = '6'.

wa_hd-bsart = 'CRME'.

ELSE.

wa_hd-bsart = 'INVO'.

IF sy-subrc <> 0.

WRITE: / 'Wrong IF statement'.

ENDIF.

ENDIF.

Maja

7 REPLIES 7
Read only

former_member189629
Active Contributor
0 Likes
777

append the table and clear the header

Read only

ibrahim_u
Active Participant
0 Likes
777

Hi

Because of


INTO CORRESPONDING FIELDS OF TABLE it_hd

you must use


loop at it_hd.
IF vbrk-vbtyp = 'H' OR
it_hd-vbtyp = 'K' OR
it_hd-vbtyp = 'N' OR
it_hd-vbtyp = 'O' OR
it_hd-vbtyp = 'T' OR
it_hd-vbtyp = '6'.
wa_dhd-bsart = 'CRME'.
ELSE.
wa_hd-bsart = 'INVO'.
IF sy-subrc <> 0.
WRITE: / 'Wrong IF statement'.
ENDIF.
ENDIF.
endloop.

ibrahim

Message was edited by: Ibrahim UGUR

Message was edited by: Ibrahim UGUR

Read only

Former Member
0 Likes
777

paste the declaration part of ur internal table.

Regards

Read only

0 Likes
777

here it is:

DATA: BEGIN OF wa_hd,

vbeln TYPE vbrk-vbeln,

gjahr TYPE vbrk-gjahr,

poper TYPE vbrk-poper,

fkart TYPE vbrk-fkart,

fktyp TYPE vbrk-fktyp,

vbtyp TYPE vbrk-vbtyp,

kunrg TYPE vbrk-kunrg,

fkdat TYPE vbrk-fkdat,

zterm TYPE vbrk-zterm,

invdue_date TYPE sy-datum,

vkorg TYPE vbrk-vkorg,

vtweg TYPE vbrk-vtweg,

waerk TYPE vbrk-waerk,

netwr TYPE vbrk-netwr,

mwsbk TYPE vbrk-mwsbk,

knumv TYPE vbrk-knumv,

zuonr TYPE ordnr_v,

kunag TYPE kunag,

bsart TYPE bsart ,

END OF wa_hd,

it_hd LIKE TABLE OF wa_hd.

Read only

0 Likes
777

It should work.

1.Check the names of fields of internal table and database table are same.

2.Check wether data exists for that particular conditio.

If still problem exists,

try checking by selecting all the records in that table without any conditions at the end.

Please check and let me know.

Regards

Read only

Former Member
0 Likes
777

Hi maja,

1. Ideally it should fill the data.

2. Just make sure of the following things :

a) it_hd has got the SAME FIELD Names

b) so_vbeln , so_erdat are select options

regards,

amit m.

Read only

Former Member
0 Likes
777

<b>WHERE vbeln IN so_vbeln AND

erdat IN so_erdat.</b>??

check with the values present in these 2 select-options in SE16 VBRK table.

i hope those 2 are SELECT-OPTIONS.

for testing purpose,dont give any values to those fields & test the SELECT return code in DEBUG ?

Regards

srikanth