cancel
Showing results for 
Search instead for 
Did you mean: 

Error in smartform

Former Member
0 Kudos

Hi,

I have given some code like this in the form

LOOP AT ITEMKOND ASSIGNING <ITEMKOND>.

TAMOUNT = TAMOUNT + <ITEMKOND>-AMOUNT.

ENDLOOP.

When I try to activate the program,it is giving error as 'ITEMKOND is a table without a header line.Hence no component called AMOUNT.

When do we get this error?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

Follow like this,

Create a workarea WA_KOND for ITEMKOND IN GLOBAL DECLARATION.

And write the code as

LOOP AT ITEMKOND INTO WA_KOND.

AMOUNT = TAMOUNT + WA_KOND-AMOUNT.

ENDLOOP.

Reward if it is usefull,

Regards,

KP

Edited by: krishna prasad on Aug 4, 2008 12:48 PM

Former Member
0 Kudos

Hi,

In global definitions I have declared the internal table and workarea like this.

ITEMKOND TYPE TABLE OF ZGTI2C_PRICE_ITEMKOND.

ITEMKOND_WA LIKE ZGTI2C_PRICE_ITEMKOND.

I have used them in the following code.

LOOP AT ITEMKOND INTO ITEMKOND_WA.

TAMOUNT = TAMOUNT + ITEMKOND_WA-AMOUNT.

ENDLOOP.

But still it is giving the same error as 'ITEMKOND is a table without a header line.Hence no component called AMOUNT'.

Can anyone tell me some solution for this.

Former Member
0 Kudos

Try this...

ITEMKOND TYPE STANDARD TABLE OF ZGTI2C_PRICE_ITEMKOND.

ITEMKOND_WA LIKE ZGTI2C_PRICE_ITEMKOND.

since it is a amount field u have to declare(ALL of them) them in the currency/quantity tab of the global definition..

ITEMKOND_WA-AMOUNT like ITEMKOND_WA-AMOUNT

Edited by: Pratik Mallick on Aug 4, 2008 4:47 PM

Former Member
0 Kudos

Hi Pratik,

Already there is a loop node in the form.In that they have declared like this.

LOOP AT ITEMKOND ASSIGNING <ITEMKOND>.

Under this loop node I have declared one program lines node and gave the following code.

TAMOUNT = TAMOUNT + <ITEMKOND>-AMOUNT.

But it is giving error as '<ITEMKOND>-AMOUNT is unknown'

Could you please tell me how to resolve this.

Former Member
0 Kudos

Try this instead.....

FIELD-SYMBOLS:

<f_wa> TYPE ANY.

ASSIGN COMPONENT n OF STRUCTURE <ITEMKOND> TO <f_field>.

(where n is the position of the AMOUNT field in the structure <ITEMKOND>.)

v_amount = <f_field>.

TAMOUNT = TAMOUNT + v_amount .

Edited by: Pratik Mallick on Aug 4, 2008 5:25 PM

Former Member
0 Kudos

define amount parameter in global definitions

former_member188005
Contributor
0 Kudos

Create a workarea for ITEMKOND and then

Loop at ITEMKOND into workarea and then do the validation as per requirements.

Regards..