Application Development 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: 

please adivse

Former Member
0 Kudos

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?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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