‎2009 Oct 04 8:01 PM
IF NOT p_htkl IS INITIAL.
r_htkl-sign='I'.
r_htkl-option='EQ'.
r_htkl-low=p_htkl.
APPEND r_htkl.
It is written after SELECTION-SCREEN block. I got the SELECTION-SCREEN part but I couldn't get this code. Please help me to understand.
‎2009 Oct 04 8:18 PM
r_htkl must be a range table. check the declaration part of it.
p_htkl is a parameter on selection screen i hope.
so, there are four fields on a range table.(range table are similar to your select options)
1. SIGN ( I or E - Inclusive or Exculsive)
2. OPTION(options like EQ = euqal, BT = Between, CP = contains pattern etc)
3. LOW (value)
4. HIGH (value)
so..
IF NOT p_htkl IS INITIAL. " checks if some thing is being passed to the parameter
r_htkl-sign='I'. " give the sign a value I i.e it make inclusive sign
r_htkl-option='EQ'. " EQ to option means you value will be checked for a equal to condition
r_htkl-low=p_htkl. " the low field in now assigned the same value of the parameter p_hktl
APPEND r_htkl. " the range table is appended.
endif.so this range table can be used in select statements as :
select * from abcd into gt where xyz in r_hktl. ==> this will check for a EQ condition with value in r_hktl-low in database or
in if statements like : if abc in r_hktl. ==> this will check the EQ condition of abc with the r_hktl-low.
Had it been
r_htkl-sign='E'.
then the condition is same but with a NOT.. that means NOT EQ or NOT BT etc.
as exclusive of the option.
etc.
hope this is clear.
AND PLEASE CLOSE THE OTHER THREAD (duplicate)
‎2009 Oct 04 8:18 PM
r_htkl must be a range table. check the declaration part of it.
p_htkl is a parameter on selection screen i hope.
so, there are four fields on a range table.(range table are similar to your select options)
1. SIGN ( I or E - Inclusive or Exculsive)
2. OPTION(options like EQ = euqal, BT = Between, CP = contains pattern etc)
3. LOW (value)
4. HIGH (value)
so..
IF NOT p_htkl IS INITIAL. " checks if some thing is being passed to the parameter
r_htkl-sign='I'. " give the sign a value I i.e it make inclusive sign
r_htkl-option='EQ'. " EQ to option means you value will be checked for a equal to condition
r_htkl-low=p_htkl. " the low field in now assigned the same value of the parameter p_hktl
APPEND r_htkl. " the range table is appended.
endif.so this range table can be used in select statements as :
select * from abcd into gt where xyz in r_hktl. ==> this will check for a EQ condition with value in r_hktl-low in database or
in if statements like : if abc in r_hktl. ==> this will check the EQ condition of abc with the r_hktl-low.
Had it been
r_htkl-sign='E'.
then the condition is same but with a NOT.. that means NOT EQ or NOT BT etc.
as exclusive of the option.
etc.
hope this is clear.
AND PLEASE CLOSE THE OTHER THREAD (duplicate)
‎2009 Oct 04 8:28 PM
So here, Are we getting data from data base or adding data to the table?
‎2009 Oct 04 8:31 PM
No...
Append just adds one row to the range table r_hktl. its an internal table like a temp storage in ABAP memory.. it has nothing to do with database.
and append is not used for database tables, nor the assigning can fecth data from database.
only statements like SELECT fetch data from database.
‎2009 Oct 04 8:36 PM
Then why SELECTION-SCREEN is used before the code that I wrote first? As I know, SELECTION-SCREEN formats the selection screen. If we don't get data from the screen, why do we used it?
‎2009 Oct 04 8:41 PM
do you have it in
AT SELECTION-SCREEN.
this event is triggered as the last event in selection screen and before start-of-selection. so your code is filling value before any other part starts.
show me the code for
selection screen and the code you are asking about as they are written.
‎2009 Oct 04 8:46 PM
‎2009 Oct 04 8:49 PM