‎2007 Apr 19 12:15 PM
Hi
plz tell me the Difference between hide and get cursor
thanks & regards
Fazil
fazil_md@yahoo.com
‎2007 Apr 19 12:19 PM
Hi,
HIDE
The HIDE statement is one of the fundamental statements for interactive reporting. You use the HIDE technique when creating a basic list. It defines the information that can be passed to subsequent detail lists.
Hide is statement which staroe the information you specified in list to a Hide internal table and by that we can use the field swe stored.
GET CURSOR
Use the statements GET CURSOR FIELD and GET CURSOR LINE to pass the output field or output line on which the cursor was positioned during the interactive event to the ABAP program.
But by using GET CURSOR we can select the fields after list has been processed.
with regards,
Jay.
‎2007 Apr 19 12:20 PM
Hi,
GET CURSOR
Gets the cursor position on a screen or in an interactive list event.
Syntax
GET CURSOR FIELD <f> [OFFSET <off>] [LINE <lin>]
[VALUE <val>] [LENGTH <len>].
GET CURSOR LINE <lin> [OFFSET <off>] [VALUE <val>] [LENGTH <len>].
At a user action on a list or screen, the statement writes the position, value, and displayed length of a field or line into the corresponding variables.
HIDE
Stores information about list lines.
Syntax
HIDE <f>.
While the list is being created, this statement stores the contents of the field <f> and the current line number in the internal HIDE area When the cursor is positioned on a line in an interactive list event, the stored value is returned to the field <f>.
Do reward if this solves ur query
Rgds,
Preeti
‎2007 Apr 19 12:28 PM
Hi
Both the statements are used in interactive reports only but the difference is in hide statement based on which field you want to go to next list that field name you have to mention in the hide statement. Where as in get cursor you can give the field name dynamically.
Regards
Haritha.
‎2007 Apr 19 12:30 PM
HI Fazil
check the program <b>DEMO_LIST_HIDE</b> for hide technique.
<b>DEMO_LIST_GET_CURSOR </b>for get cursor technique.
HIDE: hide statement buffers the record temporarily that is selected by the user in the previous list,which is then compared at the next level for corresponding details to be displayed.
GET CURSOR: stores the value in the variable we declare in our code.
Check this for HIDE.
http://www.sap-img.com/abap/a-sample-hide-get-cursor-in-interactive-programming.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbabf135c111d1829f0000e829fbfe/content.htm
and have look on this also
*&---------------------------------------------------------------------*
*& Report SAPMZMMPO
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT SAPMZMMPO no standard page heading.
tables: ekko.
DATA: f(40) TYPE c, off TYPE i, lin TYPE i, val(10) TYPE c, len TYPE i.
data: begin of iekko occurs 0,
bukrs like ekko-bukrs,
bsart like ekko-bsart,
ekorg like ekko-ekorg,
ekgrp like ekko-ekgrp,
ebeln like ekko-ebeln,
lifnr like ekko-lifnr,
bedat like ekko-bedat,
end of iekko.
data: begin of iekpo occurs 0,
ebeln like ekko-ebeln,
ebelp like ekpo-ebelp,
matnr like ekpo-matnr,
menge like ekpo-menge,
meins like ekpo-meins,
netpr like ekpo-netpr,
matkl like ekpo-matkl,
werks like ekpo-werks,
lgort like ekpo-lgort,
eeind like rm06e-eeind,
end of iekpo.
data: begin of ilfa1 occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
stras like lfa1-stras,
ort01 like lfa1-ort01,
end of ilfa1.
*parameters: p_ebeln like ekko-ebeln default '4500006130'.
select-options: s_ebeln for ekko-ebeln DEFAULT '4500006130' TO '4500006135'
OPTION bt SIGN i.
*start-of-selection.
start-of-selection.
select bukrs bsart ekorg ekgrp ebeln lifnr bedat
from ekko into corresponding fields of table iekko
where ebeln in s_ebeln.
loop at iekko.
write:/ iekko-ebeln HOTSPOT COLOR 5 INVERSE ON,
iekko-lifnr HOTSPOT COLOR 3 INVERSE ON ,
iekko-bukrs,iekko-bsart,iekko-ekorg,iekko-ekgrp.
hide: iekko-ebeln,iekko-lifnr.
endloop.
* iekko-lifnr,iekko-ebeln.
at line-selection.
GET CURSOR FIELD f VALUE val .
* WRITE: / 'Field: ', f,
* / 'Offset:', off,
* / 'Line: ', lin,
* / 'Value: ', (10) val,
* / 'Length:', len.
case sy-lsind.
when 1.
*if val = iekko-ebeln.
if f = 'IEKKO-EBELN'.
select ebeln ebelp menge meins lgort werks
matnr matkl netpr from ekpo
into corresponding fields of table iekpo
where ebeln = iekko-ebeln.
* for all entries in iekko where ebeln = iekko-ebeln.
loop at iekpo.
write:/ iekpo-ebelp,iekpo-matnr,iekpo-menge,iekpo-meins,
iekpo-werks,iekpo-lgort,iekpo-matkl,iekpo-netpr.
endloop.
endif.
*if val = iekko-lifnr.
if f = 'IEKKO-LIFNR'.
select lifnr name1 stras ort01 from lfa1
into corresponding fields of table ilfa1
where lifnr = iekko-lifnr.
loop at ilfa1.
write:/ ilfa1-lifnr,ilfa1-name1,ilfa1-stras,ilfa1-ort01.
endloop.
endif.
when others.
leave screen.
endcase.Regards
Rk
Message was edited by:
Rk Pasupuleti
‎2007 Apr 19 12:37 PM
Hi fazil,
try this short example.
TABLES: MARA.
DATA: CURSORFIELD(20).
*
START-OF-SELECTION.
SELECT * FROM MARA UP TO 20 ROWS.
WRITE: / MARA-MATNR, MARA-MTART, MARA-MATKL.
HIDE: MARA-MATNR.
ENDSELECT.
END-OF-SELECTION.
AT LINE-SELECTION.
*
GET CURSOR FIELD CURSORFIELD.
WRITE: / CURSORFIELD, MARA-MATNR, MARA-MTART, MARA-MATKL.
with hide you get the actuel value of the picked field.
You that MTART and MATKL will never changed, but MATNR has the picked value.
Hope it helps.
Regards, Dieter