‎2013 Apr 16 1:57 AM
I have brought the output of a field in the alv output which is Konv_kbetr for condition type (kschl) of ZCH, whose value appears as 250 instead 25. Konv table value also shows this as 250. I want to do 250/10.
For bring the value of 250 in the output, i have used select statement, created internal table , Loop statement created and modified the internal table etc. I am now struck to proceed further for doing this calculation 250/10.
please guide as i am very new to this abap.
‎2013 Apr 16 5:14 AM
You want to display 250 or 25 in output?
Can you post ur code here, so that we can check where you facing issue.
‎2013 Apr 16 4:06 AM
Hi Pooja,
10 is fixed or you are calculating unit price? If latter, you should use konv-kbetr/konv-kpein before appending the value to internal table.
Chloe
‎2013 Apr 16 5:14 AM
You want to display 250 or 25 in output?
Can you post ur code here, so that we can check where you facing issue.
‎2013 Apr 16 5:26 AM
wanted 25 in the output. My code as follows :
SELECT
KONV~KNUMV
konv~kposn
konv~kschl
konv~kbetr as kbetr2
into CORRESPONDING FIELDS OF TABLE it_display3 from konv
for ALL ENTRIES IN it_display where
konv~knumv = it_display-knumv AND
konv~kschl = 'ZCAS'.
LOOP AT it_display.
READ TABLE it_display3 WITH KEY knumv = it_display-knumv .
IF sy-subrc = 0.
it_display-kbetr2 = it_display3-kbetr2.
MODIFY it_display.
ENDIF.
ENDLOOP.
‎2013 Apr 16 5:42 AM
hi,
SELECT
KONV~KNUMV
konv~kposn
konv~kschl
konv~kbetr as kbetr2
into CORRESPONDING FIELDS OF TABLE it_display3 from konv
for ALL ENTRIES IN it_display where
konv~knumv = it_display-knumv AND
konv~kschl = 'ZCAS'.
LOOP AT it_display.
READ TABLE it_display3 WITH KEY knumv = it_display-knumv . ( You also need to match the KPOSN )
IF sy-subrc = 0.
it_display-kbetr2 = ( it_display3-kbetr2 / 10 ).
MODIFY it_display.
ENDIF.
ENDLOOP.
Regards,
Rahul Singh
‎2013 Apr 16 5:44 AM
Hi Pooja,
In the loop you can have :
it_display-kbetr2 = it_display3-kbetr2 / 10.
So your code becomes:
SELECT
KONV~KNUMV
konv~kposn
konv~kschl
konv~kbetr as kbetr2
into CORRESPONDING FIELDS OF TABLE it_display3 from konv
for ALL ENTRIES IN it_display where
konv~knumv = it_display-knumv AND
konv~kschl = 'ZCAS'.
LOOP AT it_display.
READ TABLE it_display3 WITH KEY knumv = it_display-knumv .
IF sy-subrc = 0.
it_display-kbetr2 = it_display3-kbetr2 / 10.
MODIFY it_display.
ENDIF.
ENDLOOP.
Regards,
Sonal