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: 

can't get the internal table values

Former Member
0 Kudos

hi all,

i have created a report in which i have DISPLAY EKPO-BANFN and EKKO-EBLEN.For this reason i have created an internal table gi_final,in which my values of both table are coming through.Following are the codes and structure of internal table:

BEGIN OF gi_final OCCURS 0,
       matnr  LIKE  ekpo-matnr,
       ematn  LIKE  ekpo-ematn, "Material Number
       txz01  LIKE  ekpo-txz01, "Mareial Description
       ktmng  LIKE  ekpo-ktmng, "Quantity
       netpr  LIKE  ekpo-netpr, "Rate
       anfnr  LIKE  ekpo-anfnr, "RFQ No.
       banfn  LIKE  ekpo-banfn, "Purchase Requisition Number
       ebeln  LIKE  ekko-ebeln, "Purcahse Order
       ekorg  LIKE  ekko-ekorg,
       bstyp  LIKE  ekko-bstyp, "Purchasing Document Category
       submi  LIKE  ekko-submi, "Collective Number
       lifnr  LIKE  ekko-lifnr, "Vendor Number
       bedat  LIKE  ekko-bedat, "Purchase Order Date
    END OF gi_final.

  select ekko~ebeln ematn txz01 ktmng banfn 
  from
    ekpo
    inner join ekko on
    ekpo~ebeln eq ekko~ebeln
  into
    corresponding fields of table gi_final
  where
    ekko~ekorg  in s_ekorg  and
    ekko~ebeln  in s_ebeln  and
    ekko~submi  in s_submi  and
    ekko~lifnr  in s_lifnr.

    READ TABLE gi_final WITH KEY  ebeln = gi_final-ebeln.
    MOVE gi_final-banfn to gi_detail-banfn.
    MOVE lv_netpr     to gi_detail-netpr.
    MOVE gi_final-ematn TO gi_detail-ematn.
    MOVE gi_final-txz01 TO gi_detail-txz01.
    MOVE gi_final-ktmng TO gi_detail-ktmng.

Probelm is that when i execute it with Debugger my internal table can't get the values of EBELN and BANFN.

Thanks & Regards,

sapabappk

Edited by: sapabappk on Sep 26, 2010 10:32 AM

1 ACCEPTED SOLUTION

deepak_dhamat
Active Contributor
0 Kudos

HI ,

BEGIN OF gi_final OCCURS 0,

matnr LIKE ekpo-matnr,

ematn LIKE ekpo-ematn, "Material Number

txz01 LIKE ekpo-txz01, "Mareial Description

ktmng LIKE ekpo-ktmng, "Quantity

netpr LIKE ekpo-netpr, "Rate

anfnr LIKE ekpo-anfnr, "RFQ No.

banfn LIKE ekpo-banfn, "Purchase Requisition Number

ebeln LIKE ekko-ebeln, "Purcahse Order

ekorg LIKE ekko-ekorg,

bstyp LIKE ekko-bstyp, "Purchasing Document Category

submi LIKE ekko-submi, "Collective Number

lifnr LIKE ekko-lifnr, "Vendor Number

bedat LIKE ekko-bedat, "Purchase Order Date

END OF gi_final.

select ekko~ebeln ematn txz01 ktmng banfn

from

ekpo

inner join ekko on

ekpoebeln eq ekkoebeln

into

corresponding fields of table gi_final

where

ekko~ekorg in s_ekorg and

ekko~ebeln in s_ebeln and

ekko~submi in s_submi and

ekko~lifnr in s_lifnr.

READ TABLE gi_final WITH KEY ebeln = gi_final-ebeln.

MOVE gi_final-banfn to gi_detail-banfn.

MOVE lv_netpr to gi_detail-netpr.

MOVE gi_final-ematn TO gi_detail-ematn.

MOVE gi_final-txz01 TO gi_detail-txz01.

MOVE gi_final-ktmng TO gi_detail-ktmng.

Why you are reading gi_final table and comparing same table field gi_final-ebeln ?

how is gi_detail table declared ?

just do like this

loop at gi_final .

MOVE gi_final-banfn to gi_detail-banfn.

MOVE gi_final-ematn TO gi_detail-ematn.

MOVE gi_final-txz01 TO gi_detail-txz01.

MOVE gi_final-ktmng TO gi_detail-ktmng.

append gi_detail .

clear gi_detail

endloop.

and From where you are getting value of lv_netpr

MOVE lv_netpr     to gi_detail-netpr.

then you will get data in gi_detail

Regards

Deepak.

7 REPLIES 7

deepak_dhamat
Active Contributor
0 Kudos

HI ,

BEGIN OF gi_final OCCURS 0,

matnr LIKE ekpo-matnr,

ematn LIKE ekpo-ematn, "Material Number

txz01 LIKE ekpo-txz01, "Mareial Description

ktmng LIKE ekpo-ktmng, "Quantity

netpr LIKE ekpo-netpr, "Rate

anfnr LIKE ekpo-anfnr, "RFQ No.

banfn LIKE ekpo-banfn, "Purchase Requisition Number

ebeln LIKE ekko-ebeln, "Purcahse Order

ekorg LIKE ekko-ekorg,

bstyp LIKE ekko-bstyp, "Purchasing Document Category

submi LIKE ekko-submi, "Collective Number

lifnr LIKE ekko-lifnr, "Vendor Number

bedat LIKE ekko-bedat, "Purchase Order Date

END OF gi_final.

select ekko~ebeln ematn txz01 ktmng banfn

from

ekpo

inner join ekko on

ekpoebeln eq ekkoebeln

into

corresponding fields of table gi_final

where

ekko~ekorg in s_ekorg and

ekko~ebeln in s_ebeln and

ekko~submi in s_submi and

ekko~lifnr in s_lifnr.

READ TABLE gi_final WITH KEY ebeln = gi_final-ebeln.

MOVE gi_final-banfn to gi_detail-banfn.

MOVE lv_netpr to gi_detail-netpr.

MOVE gi_final-ematn TO gi_detail-ematn.

MOVE gi_final-txz01 TO gi_detail-txz01.

MOVE gi_final-ktmng TO gi_detail-ktmng.

Why you are reading gi_final table and comparing same table field gi_final-ebeln ?

how is gi_detail table declared ?

just do like this

loop at gi_final .

MOVE gi_final-banfn to gi_detail-banfn.

MOVE gi_final-ematn TO gi_detail-ematn.

MOVE gi_final-txz01 TO gi_detail-txz01.

MOVE gi_final-ktmng TO gi_detail-ktmng.

append gi_detail .

clear gi_detail

endloop.

and From where you are getting value of lv_netpr

MOVE lv_netpr     to gi_detail-netpr.

then you will get data in gi_detail

Regards

Deepak.

0 Kudos

hi Deepak Dhamat,

Thanks for your reply.I have to ask you two things after putting your code, i'm still not get the data in the field BANFN and gi_detail is giving me blank fields, so kindly tell me what should i do now..?

Thanks,

sapabappk

Edited by: sapabappk on Sep 26, 2010 11:16 AM

0 Kudos

Try to check with the same select options the tables EKKO y EKPO using the transactions SE16 y SE16N, and then you can view if the field 'BANFN' is really empty or not.

You can use the view EKBI too nd do a simple select to test results.

You should create an itab for gi_detail too and if the tables have fields in common, you can try with the command

MOVE-CORRESPONDING itab1 TO itab2.

Regards.

JMV.

0 Kudos

Hi ,

Please check in table ekpo whether data is present for BANfn

or data which you are passing in select option that data should be there in EKKO and EKPO

if data is there in both table then there should be no problem .

Regards

Deepak.

0 Kudos

hi Deepak Dhamat,

Yes i have check it field BANFN and EBELN is coming in GI_FINAL but only BANFN is displaying in GI_DETAIL.

Thanks & Regards,

sapabappk.

0 Kudos

hi ,

types : BEGIN OF w_final ,

matnr LIKE ekpo-matnr,

ematn LIKE ekpo-ematn, "Material Number

txz01 LIKE ekpo-txz01, "Mareial Description

ktmng LIKE ekpo-ktmng, "Quantity

netpr LIKE ekpo-netpr, "Rate

anfnr LIKE ekpo-anfnr, "RFQ No.

banfn LIKE ekpo-banfn, "Purchase Requisition Number

ebeln LIKE ekko-ebeln, "Purcahse Order

ebelp like ekpo-ebelp ,

ekorg LIKE ekko-ekorg,

bstyp LIKE ekko-bstyp, "Purchasing Document Category

submi LIKE ekko-submi, "Collective Number

lifnr LIKE ekko-lifnr, "Vendor Number

bedat LIKE ekko-bedat, "Purchase Order Date

END OF w_final.

data : it_final type standard table of w_final with header line .

data : it_detail type standard table of w_final with header line .

select b~ebeln

a~ebelp

ematn

txz01

ktmng

banfn

from

ekpo as a

inner join ekko as b on

aebeln eq bebeln

into

corresponding fields of table it_final

where b~ekorg in s_ekorg

and b~ebeln in s_ebeln

and b~submi in s_submi

and b~lifnr in s_lifnr.

There is no need to read table to move data in another table you can do that using loop endloop .

Regards

Deepak.

0 Kudos

hi ,

For ebeln you have to move that field to gi_detail table

loop at gi_final .

MOVE gi_final-banfn to gi_detail-banfn.

MOVE gi_final-ematn TO gi_detail-ematn.

MOVE gi_final-txz01 TO gi_detail-txz01.

MOVE gi_final-ktmng TO gi_detail-ktmng.

move gi_final-ebeln to gi_detail-ebeln .

append gi_detail .

clear gi_detail

endloop.

Regards

Deepak.

Edited by: Deepak Dhamat on Sep 26, 2010 12:24 PM

Edited by: Deepak Dhamat on Sep 26, 2010 12:25 PM