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 can i pass calculated value to internal table

Former Member
0 Kudos

Hi

i have to pass calculated value into internal table

below field are coming from database view and i' m passing view data into iznew1

fields of iznew1

LIFNR LIKE EKKO-LIFNR,

EBELN LIKE EKKO-EBELN,

VGABE LIKE EKBE-VGABE,

EBELP LIKE EKBE-EBELP,

BELNR LIKE EKBE-BELNR,

MATNR LIKE EKPO-MATNR,

TXZ01 LIKE EKPO-TXZ01,

PS_PSP_PNR LIKE EKKN-PS_PSP_PNR,

KOSTL LIKE EKKN-KOSTL,

NAME1 LIKE LFA1-NAME1,

NAME2 LIKE LFA1-NAME2,

WERKS LIKE EKPO-WERKS,

NETWR LIKE EKPO-NETWR,

KNUMV LIKE EKKO-KNUMV,

GJAHR LIKE EKBE-GJAHR,

and now i want to pass

one field ED1 which i has calculated separatly and i want to pass this value into iznew1

but error is coming that iznew1 is a table with out header line has no component like ED1.

so how can i pass calculated value to internal table iznew1,

9 REPLIES 9

Former Member
0 Kudos

Add one more field ED1 to the internal table iznew1.Use 'move-corresponding' for populating the data from the view and for ED1 into this internal table

0 Kudos

Mr. Mukesh as ED1 is for calculating part so it was asking for type declaration but as per your words if i declare ED1 in internal table in iznew1 then i have to declare it as ED1 LIKE IZNEW1 so it was showing an error related to declaration

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

data wanew like line of iznew1.

wanew-field = value.

append wanew to iznew1.

Former Member
0 Kudos

declare a workarea like itab.

data : watab like itab.

loop at itab into watab.

watab-fname = ed1.

modify itab from watab .

endloop.

regards

shiba dutta

0 Kudos

i got an error as

"WATAB" cannot be converted to the line type of "IZNEW1"

IZNEW1 is an internal table which i had declared as vector type

and the values in iznew1 are transfered from database view znew1

Former Member
0 Kudos

Hi.

declare internal table including that ED1 field.

fetch data from view in following way.

select * from zview into corresponding fields of izview where (condition).

(and do the calculations)

izview-ED1 = (calculated value).

append izview.

clear izview.

endselect.

Thanks,

srinivas

0 Kudos

Mr. Srinivas as ED1 is for calculating part so it was asking for type declaration but as per your words if i had declared ED1 in internal table in iznew1 then i had declare it as ED1 LIKE IZNEW1 so it was showing an error related to arithmetical operations

0 Kudos

plz any one help me answer will be rewarded points

0 Kudos

When you declare your internal table , make an addtion occurs 0

eg . data : begin of iznew occurs 0 ,

fields ...

        • add the field here ed1.

end of iznew.

now when you are calculating the value of ed1,

you can pass the corresponding value of ed1 and modify table iznew.

eg

loop at iznew.

iznew-ed1 = ed1.

modify iznew.

endloop.