‎2009 Feb 25 12:28 PM
Hi Experts,
Please advice,
I am having three fields in output 1 is directly fetched from table and other two are variables.
ITAB-MENGE = fetched data.
ITAB-UCOMM = input on ( user command )
when the user press ENTER
ITAB-SUM = ITAB-MENGE + ITAB-UCOMM.
For eq:
Suppose if ITAB-MENGE which is fetched from table = 100
and if the user enters the value in ITAB-UCOMM = 200
and when the user press enter the sum should display on the other field ITAB-SUM
Note: I am using normal write statement ( not ALV ) & there is no need of saving option.
Thanks
R.Karthik
‎2009 Feb 25 12:51 PM
" ist enter the value in first field and do not press enter.
" Then place cursor on second input and write value. then press enter
" u can change code according to ur desire
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001 .
SELECTION-SCREEN COMMENT 1(35) text1.
PARAMETERS: pmenge type i.
SELECTION-SCREEN COMMENT 50(1) text2 .
PARAMETERS: pucomm TYPE i MODIF ID dpt.
PARAMETERS: psum TYPE i MODIF ID dpt.
SELECTION-SCREEN END OF BLOCK a.
INITIALIZATION.
text1 = 'Please Enter the values'.
AT SELECTION-SCREEN OUTPUT.
IF pmenge IS INITIAL.
pmenge = ''.
pucomm = ''.
psum = ''.
ELSE.
pmenge = pmenge.
pucomm = pucomm.
psum = pucomm + pmenge.
ENDIF.
‎2009 Feb 25 1:03 PM
Hi karthik,
Your query is ambiguous. Still I am answering as per my understanding.
Let say you are selecting MENGE from database table.
And you have UCOMM as parameter in selection screen.
So if ITAB has following values,
100
200
300
400
and UCOMM = 20
then
data : begin of itab occurs 0,
menge type menge,
tot(10) type c ,
end of itab.
***already you selcetd data in ITAB
loop at itab.
itab-tot = itab-menge + p_ucomm.
modify itab transporting tot.
endloop.
Hope this helps you.
Regards,
Anil