02-10-2006 5:14 PM
Hi,
During aparticular code the internal table is_bil_invoice-IT_PRICE[]
gets populated during VF02.
Now I insetad of doing aselect on VBRP I am planning to use this already populating values
in my code.
Now if I try to look during debug for a particular value as follows:
Data: v_count type N.
v_vount = v_count + 1.
lOop...
:
:
:
x = is_bil_invoice-IT_PRICE[v_count]-kzwi1
:
:
:
endloop...
I get following error "unable to interpret v_count as number." but if I go and put 1 or some numeric value I get the data properly.
How do I solve the above problem ?
02-10-2006 5:18 PM
02-10-2006 5:21 PM
02-10-2006 5:19 PM
02-10-2006 5:19 PM
HI Tushar,
Define V_COUNT as below..
DATA: V_COUNT.
dont use type N.
Or use type I.
DATA: V_COUNT TYPE I.
Message was edited by: Phani Kiran Nudurupati
02-10-2006 5:20 PM
Hi Tushar Shah
you should use
Data: v_count type I.
in fact type N is a character type containing only digits 0...9
Type I is integer type and should work in your case.
Regards, Manuel
PS: you wrote
v_vount = v_count + 1.
did you mean
v_Count = v_count + 1.
?
Message was edited by: Manuel Bassani
02-10-2006 5:23 PM
declare as type i , type N is alpha-numeric , so it is displaying the error
Type I should not give u any error
02-10-2006 5:38 PM
Hi Tusahar,
I think you want to use this in Invoice smartform.
Define V_counter as I . --as suggested by others.
Then you can write program lines with in the loop.
In program lines : V-vounter = V_counter + 1.
Then at your text elements Please check the V_counter at Conditions. (Example : V_counter = 1 ...)
Lanka
02-10-2006 5:38 PM
Hi
Declare v_count like the following way
v_count like sy-tabix. sy-tabix is of type int4.
if you declare as type i , if data exceeds the integer storage limit , you will get another error : overflow.
Laxman
02-10-2006 5:46 PM
The following code is inside the smartform program node. The code is defined as one of the flow logic inside a table.
The code runs for each item of table and accumulates the fireght in variable gv_freight_total and list price in gv_listprice.
Now one of the programmer is using following inside the flow logic for table:
select single * into gs_vbrp from VBRP
where vbeln = is_bil_invoice-hd_ref-BIL_NUMBER
and posnr = gs_it_gen-itm_number.
gv_freight_total = gv_freight_total + gs_vbrp-kzwi3.
gv_listprice = gs_vbrp-kzwi1.
But it seems that there is no need to do the database select on VBRP.
We can use the deep structure is_bil_invoice to get the kzwi3 and kzwi1 value.
This deep structure gets populated as per follows if there is one item we will have
is_bil_invoice-IT_PRICE[1]-KZWI1
If the number of items are two then deep structure will have,
is_bil_invoice-IT_PRICE[1]-KZWI1.
is_bil_invoice-IT_PRICE[2]-KZWI1.
02-10-2006 5:52 PM
Hi Tusahr,
Please note that there is no need to do another select from VBRP. Your Samrtform structure is_bil_invoice will provide you all the freight and other pricing conditions.
Have you copied your invoice from standard smartform LB_INVOICE? Then you can include your own logic at program lines :
READ_KOND_DATA_SUM Under Table Item.
GS_HD_KOND this table is papulated in program lines "READ_KOND_DATA_SUM"
Lanka
Message was edited by: Lanka Murthy