2008 Jan 10 4:33 AM
hi
suppose i have a database table with field
Field1
Field2
Field3
Field4
Field5... till 20 field
In my program
if radio button 1 EQ X
--I am filling in field 1 , 2 , 10, 11, 12 , 19 20 which i put in a perform (F_both radio button)
--processing condition specific to radio button 1
--field 3 = xxx (other condition)
--field 4 = xxx (other condition)
--field 15 = xxx (other condition)
append internal table
endif.
if radio button 2 EQ x
--I am calling the perform F_both radio button (so as not to write the same code twice)
--processing condition specific to radio button 2
--field 3 = xxx (other condition)
--field 4 = xxx (other condition)
--field 15 = xxx (other condition)
append internal table
endif
NOte: user either choose to radio button 1 or 2
when i am filling in the field do i need to fill in the field in tha same order as my database table or can i do as code above like filling field 1, 2, 10 (found in F_both radio button)
then filling in field 3 4 15
does it cause performance issu or is ti ok what ever the order i fill in the table?
2008 Jan 10 4:40 AM
Hi
what you can do is fill your Internal Table once with Required fields before Your
conditioni
if radio button 1 EQ X
and then call perform I think it will help u
In case of any issue please revery back
Donot Forgot to reward points if helpful
Hitesh
2008 Jan 10 4:40 AM
Hi
what you can do is fill your Internal Table once with Required fields before Your
conditioni
if radio button 1 EQ X
and then call perform I think it will help u
In case of any issue please revery back
Donot Forgot to reward points if helpful
Hitesh
2008 Jan 10 5:00 AM
OLD piece of code --->
if radio button1 EQ X
loop at i_itab
field 1 = condition same for both radio button 1 & 2
field 2 = condition same for both radio button 1 & 2
field 3 = other conditon for radio button1
field 4 = other condition radio button1
field 10 = condition same for both radio button 1 & 2
field 11 = condition same for both radio button 1 & 2
field 12 = condition same for both radio button 1 & 2
field 13 = condition same for both radio button 1 & 2
endloop.
endif.
if radio button2 EQ X
loop at i_itab
field 1 = condition same for both radio button 1 & 2
field 2 = condition same for both radio button 1 & 2
field 3 = other conditon for radio button1
field 4 = other condition radio button1
field 10 = condition same for both radio button 1 & 2
field 11 = condition same for both radio button 1 & 2
field 12 = condition same for both radio button 1 & 2
field 13 = condition same for both radio button 1 & 2
endloop.
endif.
instead of writing same code twice . if it ok if i write re-structure it as below for readability . would it cause a performance issue is fild is not fill in in sequential order?
New code structure -->
if radio button1 EQ X
loop at i_itab
perform f_fill(filling field 1 2 10 11 12 13 from i_itab directly)
field 3 = other conditon for radio button1
field 4 = other condition radio button1
endloop.
endif.
if radio button2 EQ X
loop at i_itab
perform f_fill(filling field 1 2 10 11 12 13 from i_itab directly)
field 3 = other conditon radio button1
field 4 = other condition radio button1
endloop.
endif.
2008 Jan 10 5:06 AM
Yes u can do it.
But after assigning the fields u have to put an append statement. This append u shud not keep in ur perform statement.
awrd points if useful
Bhupal
2008 Jan 10 4:44 AM
Hi Newbie,
I will send a sample code 4 u.check it once..No problem on Perfomance issue.If we want u put below SELECT statements in perfom's ok..
data: begin of itab occurs 0,
field1,
upto
filed20,
end of itab.
if raidobutton1 = 'X'.
select field1
field2
field10
field12
field19
field20
from DB TABLE NAME
into corresponding fileds of table itab
where CONDITION
endif.
if radiobutton2 = 'X'.
select filed3
filed4
filed15
form DBTABLE NAME
into corresponding fileds of table itab
where CONDITION
endif.
Award points if helpful.
Kiran Kumar.G.A
Edited by: KIRAN KUMAR on Jan 10, 2008 5:47 AM
2008 Jan 10 4:53 AM
Hi Newbie,
Theres no matter in which order u asign the values to the fields. But u have to consider only whether u have assigned the values to right field or not.
Here u can check one thing. When u filled 1,2,10 ... and then if u have to fill 3, 4 ,15 if u have to modify the already filled records or to add new records.
If u use append a new record will be created. i.e. if u select radiobutton 1 or 2 values of the fields 3,4,15 will be created in a new record.
If u use modify statement with a condition, as u already have records with 1,2, 10 ... fields filled with data and 3,4,15 fields are empty, u can insert these values in already existing record.
awrd points if useful
Bhupal
2008 Jan 10 5:23 AM
hi,
From your question what i can understand is : You got 20 fields in your DB table.Based on your radio button selection you want the fields of internal table to be filled and then you fill internal table data to the DB.
See if i am right in understanding you then there should not be any performance issue.
Please reward points.
regards
Parth