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

hi sapscript pl help

Former Member
0 Likes
348

hi all

my code is given below::

data:

zlv_netpr type netpr,

zlv_netwr type netwr,

zlv_diff type netpr,

Loop at TABLE in_tab.

case in_tab-name.

when 'ITAB-NETPR'.

MOVE in_tab-value TO zlv_netpr. " HERE I AM GETTING ERROR.'

*( in_tab-value is an amount field in sapscript.)

when 'ITAB-NETWR'.

MOVE in_tab-value TO zlv_netwr.

endcase.

endloop.

zlv_diff = zlv_netpr - zlv_netwr.

READ TABLE out_tab with key name = 'ITAB-DIFF' .

out_tab-value = zlv_diff.

MODIFY out_tab INDEX sy-tabix.

the above code is in the calling program of PERFORM.

I AM GETTING ERROR and error is 'in_tab-value' cannot be interprete as number.

i am passing amout field from SAPSCRIP FORM to calling program i.e. 'PERFORM AND FORM' INSIDE FORM.

I HAVE TO CALCULATE IN SIDE 'FORM' OF CALLING PROG, BUT IT IS GIVING ERROR- CANNOT CONSIDER AS NUMBER.

IF I CHANGE THE DATA TYPE OF PASSING FIELDS TO CHAR THEN I AM NOT ABLE TO DO CALCULATION .

PL CORRECT THE ABOVE CODE SO THAT I CAN DO CALCULATIONS.

PL HELP AS THIS HAS BEEN PENDING FOR LONG.

THANX

ROCKY

2 REPLIES 2
Read only

Former Member
0 Likes
327

Hi rocky..

try this out...

data:

zlv_netpr type c,

zlv_netwr type c,

zlv_diff type c.

Loop at in_tab.

case in_tab-name.

when 'ITAB-NETPR'.

MOVE in_tab-value TO zlv_netpr. " HERE I AM GETTING ERROR.'

*( in_tab-value is an amount field in sapscript.)

when 'ITAB-NETWR'.

MOVE in_tab-value TO zlv_netwr.

endcase.

endloop.

the fields of in_tab and out_tab are always character types...

try to move into zlv_netpr of type c of sufficient length.

let me know if it helps u..

sai ramesh

Read only

Former Member
0 Likes
327

DATA: lf_arbid TYPE afvgd-arbid,

lf_arbpl TYPE crhd-arbpl.

Thats how i do it:

READ TABLE in_tab WITH KEY 'AFVGD-ARBID'.

CHECK sy-subrc = 0.

lf_arbid = in_tab-value.

never ran into problems with that.

Message was edited by:

Florian Kemmer