Application Development and Automation 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: 
Read only

Refresh

Former Member
0 Likes
945

Hi

I have few performs in my program and every perform iam using same i_tab ... and also w_matnr etc

and iam declaring those in global declarations.

My question is incase if dont clear in ever form..endform...does its going to append?

Exam iam using i_matnr and getting data...

and again next perform iam using same select into i_matnr..

so in every perform iam clearing variables and refreshing i_matnr table..

is is ok??bcz i dont why my data is missing ...

Please tell me and thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
875

Is i_matnr with header line or without header line,

If it is without header line then do not use CLEAR I_MATNR anywhere in your program , it will clear the whole internal table

One more suggestion is before every select statement use CLEAR ITAB and REFRESH ITAB if ur itab is with header line, that should be fine

8 REPLIES 8
Read only

Former Member
0 Likes
875

Hi..,

that depends on ur select statement..

In each perform if u are using the select as..

<b>select matnr

from Mara

into table itab.</b>

<u>then each time the table will get refreshed and contains onli that particular select statement's data..</u>

if ur select statement is..

<b>select matnr

from Mara

appending table itab.</b>

<u>

then it contains the records of all the performs..</u>

Suppose consider a variable not internal table..

if u have declared it globally and adding 1 to it in each perform.. then its value will get increased each time and it contains the increased value even outside the form also..

regards,

sai ramesh

Read only

0 Likes
875

i didnt get you...can you please eloborate

Thanks

Read only

Former Member
0 Likes
875

If you do a SELECT * from Some_TABLE INTO TABLE YOUR_INT_TAB, the old data will be lost and the int table will ONLY hold the new data.

If you do a SELECT * from Some_TABLE APPENDING TABLE YOUR_INT_TAB, the old data will be kept and the new data will be added to the existing data that is already in the int table.

Read only

0 Likes
875

In addition to my APPENDING statement... you MUST remove the REFRESH statement to continue APPENDING to the int table.

If you do not remove it, your data will be lost prior to each SELECT... APPENDING TABLE.

Read only

ferry_lianto
Active Contributor
0 Likes
875

Hi,

Refreshing i_matnr table means you delete all entries in i_matnr table.

Perhaps you may want to clear the work area/variable ONLY in every perform.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
876

Is i_matnr with header line or without header line,

If it is without header line then do not use CLEAR I_MATNR anywhere in your program , it will clear the whole internal table

One more suggestion is before every select statement use CLEAR ITAB and REFRESH ITAB if ur itab is with header line, that should be fine

Read only

Former Member
0 Likes
875

Hi

My requirement is

I want to fetch data from select and pass to i_tab..

then pass to BAPI fm..

in another perform iam using same bapi...

for that i need to fetch data from same table...but iam using i_tab only..

but every form iam refreshing it and clearing variables...

and also iam using select single matnr mtart from mara into w_matnr w_mtart...

and passing w_matnr to fm..

now another perform same thing

in every form iam clearing thease variables and refreshing if it is itab.

is it correct?

Thanks in advance

Read only

0 Likes
875

Simple thing is....What happend is you got one select and get some data....But on the second select you don't find anything....The data will be kept on the internal table....And that's no good because you didn't find any data....

It's better to always refresh your internal tables....

You can do this to get work faster


DEFINE CLEAN.
CLEAR &1.
REFRESH &1.
END-OF-DEFINITION.

You can use it like this...


CLEAN MY_INTERNAL_TABLE.

Greetings,

Blag.