‎2007 Jun 11 10:27 AM
‎2007 Jun 11 10:30 AM
Hi
Get Cursor is used to get the current position of the Cursor position....Get event will trigger when u read the first node of a Logical database and Get-Late will trigger when u read the last node of the Logical Database..
Reward All Helpfull Answers...........
‎2007 Jun 11 10:30 AM
Hi
Get Cursor is used to get the current position of the Cursor position....Get event will trigger when u read the first node of a Logical database and Get-Late will trigger when u read the last node of the Logical Database..
Reward All Helpfull Answers...........
‎2007 Jun 11 10:31 AM
Hello,
GET
Basic form 2 GET CURSOR. ...
Variants:
1. GET CURSOR FIELD f.
2. GET CURSOR LINE line.
Variant 1
GET CURSOR FIELD f.
Additions:
1. ... OFFSET off
2. ... LINE line
3. ... VALUE g
4. ... LENGTH len
5. ... AREA
Effect
Transfers the name of the field at the cursor position to the field f.
The return code is set as follows:
SY-SUBRC = 0:
Cursor was positioned on a field.
SY-SUBRC = 4:
Cursor was not positioned on a field.
Note
Unlike screen processing, list processing allows you to output literals, field symbols, parameters and local variables of subroutines. Literals, local variables and VALUE parameters of subroutines are treated like fields without names (field name SPACE, return value 0).
Otherwise, GET CURSOR FIELD returns only names of global fields, regardless of whether they are addressed directly (i.e. by "WRITE"), by field symbols or by reference parameters.
Example
DATA: CURSORFIELD(20),
GLOB_FIELD(20) VALUE 'global field',
REF_PARAMETER(30) VALUE 'parameter by reference',
VAL_PARAMETER(30) VALUE 'parameter by value',
FIELD_SYMBOL(20) VALUE 'field symbol'.
FIELD-SYMBOLS: <F> TYPE ANY.
PERFORM WRITE_LIST USING REF_PARAMETER VAL_PARAMETER.
ASSIGN GLOB_FIELD TO <F>.
AT LINE-SELECTION.
GET CURSOR FIELD CURSORFIELD.
WRITE: / CURSORFIELD, SY-SUBRC.
FORM WRITE_LIST USING RP VALUE(VP).
DATA: LOK_FIELD(20) VALUE 'local field'.
ASSIGN FIELD_SYMBOL TO <F>.
WRITE: / GLOB_FIELD, / LOC_FIELD,
/ RP, / VP,
/ 'literal', / FIELD_SYMBOL.
ENDFORM.
When you double-click the word " global field", CURSORFIELD contains the field name GLOB_FIELD, on "parameter by reference" the field name REF_PARAMETER, on " field symbol" the field name FIELD_SYMBOL, and on "local field", "parameter by value" and "literal" the value SPACE.
Addition 1
... OFFSET off
Effect
Copies the position of the cursor within the field to the field off (1st column = 0).
If the cursor is not somewhere within a field (SY-SUBRC = 4), the offset value is set to 0.
Addition 2
... LINE line
Effect
With step loops, lin contains the number of the loop line where the cursor stands. In list processing, this is the absolute line number (as stored in the system field SY-LILLI).
Addition 3
... VALUE g
Effect
g contains the value of the field where the cursor stands, always in output format (character display).
Addition 4
... LENGTH len
Effect
len contains the output length of the field where the cursor stands.
Addition 5
... AREA a
Effect
If the cursor is positioned on the field of a table view control, the name of the control is placed in the field a.
Variant 2
GET CURSOR LINE line.
Additions:
1. ... OFFSET off
2. ... VALUE g
3. ... LENGTH len
Effect
As for variant 1 with addition LINE, except that there are differences with the return code and the effect of the additions.
The return code is set as follows:
SY-SUBRC = 0:
The cursor is on one of the list lines (list processing) or on a loop line (step loop).
SY-SUBRC = 4:
The cursor is not on one of the list or loop lines.
Addition 1
... OFFSET off
Effect
Applies to list processing only. The field off contains the position of the cursor relative to the beginning of the list line (1st column = 0). With horizontally shifted lists, the offset value can thus be greater than 0, even if the cursor is positioned on the extreme left of the window.
Addition 2
... VALUE g
Effect
List processing only. The field g contains the list line where the cursor is positioned.
Addition 3
... LENGTH len
Effect
List processing only. len contains the length of the line (LINE-SIZE).
Related
SET CURSOR
Additional help
Setting the Cursor Position
Reading Lists at the Cursor Position
Regards,
Vasanth
‎2007 Jun 11 10:32 AM
Hi
GET cursor is used to get the Field on which the sursor was placed see the doc
GET CURSOR { { FIELD field [field_properties] }
| { LINE line } }.
If this statement is specified during PAI processing, depending on the specification for FIELD or LINE, it transfers either the name of the screen element or the number of the row of a table control or of the group of a step loop (on which the screen cursor is positioned after a user action) into the data objects field or line. For field, a character-type (before Release 6.10 flat) variable is expected. For line, a variable of the type i is expected. In field_properties, further properties of the screen element can be defined.
If the cursor is in the input field of the standard toolbar or on a pushbutton in the screen, the statement is ignored and the specified variables remain unchanged. If the cursor in the first variant is not in a screen element of the current screen but on a bar in the GUI status, the contents of field and the variables specified in field_properties are initialized. If the cursor in the second variant is not on a screen element that is part of a table control or a step loop, the variable line is initialized.
GET <table > LATE is used in Logical Databases
to fetch the data from a table which is heirarchially below the table
Reward points for useful Answers
Regards
Anji
‎2007 Jun 11 10:32 AM
Hi,
<b>
GET CURSOR</b>
get cursor is used to store the value of the field on which the cursor is placed
get cursor value f1----
>this stores the value in the field f1
which can b used later
first display the material number on the list from an internal table
loop at it_mara.
write : / it_mara-matnr.
endloop.
after list is diplayed place the cursor on the matnr and click it
that value is stored in field f1.
which can b later used to display on secondary list or any other purpose...
its just like hide statement..
<b>GET LATE</b>
This event is triggered when all of the data records for a node of the logical database have been read.
When you define the corresponding event block in the program, you can, as with GET, specify a field list if the logical database supports field selection for this node:
GET <table> LATE [FIELDS <f1> <f 2>...].
The following program is connected to the logical database F1S.
REPORT EVENT_DEMO.
NODES: SPFLI, SFLIGHT, SBOOK.
DATA WEIGHT TYPE I VALUE 0.
START-OF-SELECTION.
WRITE 'Test Program for GET <table> LATE'.
GET SPFLI.
SKIP.
WRITE: / 'Carrid:', SPFLI-CARRID,
'Connid:', SPFLI-CONNID,
/ 'From: ', SPFLI-CITYFROM,
'To: ', SPFLI-CITYTO.
ULINE.
GET SFLIGHT.
SKIP.
WRITE: / 'Date:', SFLIGHT-FLDATE.
GET SBOOK.
WEIGHT = WEIGHT + SBOOK-LUGGWEIGHT.
GET SFLIGHT LATE.
WRITE: / 'Total luggage weight =', WEIGHT.
ULINE.
WEIGHT = 0.
The total luggage weight is calculated for each flight in the event GET SBOOK, and then displayed in the list and reset in the event GET SFLIGHT LATE. Depending on the values you enter on the selection screen, the beginning of the list might look like this:
Regards,
Priyanka.
‎2007 Jun 11 10:33 AM
HI,
get cursor command will get give u the current position of the cursor in the screen.
see this link for help regarding get late
http://help.sap.com/saphelp_nw04/helpdata/en/d2/cb4538455611d189710000e8322d00/content.htm
rgds,
bharat.
‎2007 Jun 11 10:33 AM
Hi,
Get cursor has two functional significancies based on where they are used, in Dynpro's if used with PAI module returns the current element name where the cursor is placed. In list it will return the filed name or the list line number depending on the position of the cursor.
GET LATE is a event block generally used in Logical database programs, gets called when data of one node is read completly.
Regards,
Sesh
‎2007 Jun 11 10:35 AM
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
example program :
REPORT SAPMZTST NO STANDARD PAGE HEADING LINE-SIZE 40.
DATA: HOTSPOT(10) VALUE 'Click me!',
F(10), OFF TYPE I, LIN TYPE I, VAL(40), LEN TYPE I.
FIELD-SYMBOLS <FS>.
ASSIGN HOTSPOT TO <FS>.
WRITE 'Demonstration of GET CURSOR statement'.
SKIP TO LINE 4.
POSITION 20.
WRITE <FS> HOTSPOT COLOR 5 INVERSE ON.
AT LINE-SELECTION.
WINDOW STARTING AT 5 6 ENDING AT 45 20.
GET CURSOR FIELD F OFFSET OFF
LINE LIN VALUE VAL LENGTH LEN.
WRITE: 'Result of GET CURSOR FIELD: '.
ULINE AT /(28).
WRITE: / 'Field: ', F,
/ 'Offset:', OFF,
/ 'Line: ', LIN,
/ 'Value: ', (10) VAL,
/ 'Length:', LEN.
SKIP.
GET CURSOR LINE LIN OFFSET OFF VALUE VAL LENGTH LEN.
WRITE: 'Result of GET CURSOR LINE: '.
ULINE AT /(27).
WRITE: / 'Offset:', OFF,
/ 'Value: ', VAL,
/ 'Length:', LEN.
2 . GET LATE
When you link a logical database with an executable program, the GET statements determine the depth to which the logical database is read. When you call the function module LDB_PROCESS, you determine the depth by specifying a node name in the CALLBACK parameter. For each node for which you request data, a callback routine can be executed at two points. These correspond to the GET and GET LATE events in executable programs. In the table parameter CALLBACK, you specify the name of the callback routine and the required execution point for each node. A callback routine is a subroutine in the calling program or another program that is to be executed at the required point.
A flag (contents X or SPACE), to call the corresponding callback routine at the GET LATE event.
Example program :
REPORT demo_logical_database.
DATA wa_spfli TYPE spfli.
SELECT-OPTIONS s_carr FOR wa_spfli-carrid.
DATA: callback TYPE TABLE OF ldbcb,
callback_wa LIKE LINE OF callback.
DATA: seltab TYPE TABLE OF rsparams,
seltab_wa LIKE LINE OF seltab.
callback_wa-ldbnode = 'SPFLI'.
callback_wa-get = 'X'.
callback_wa-get_late = 'X'.
callback_wa-cb_prog = sy-repid.
callback_wa-cb_form = 'CALLBACK_SPFLI'.
APPEND callback_wa TO callback.
CLEAR callback_wa.
callback_wa-ldbnode = 'SFLIGHT'.
callback_wa-get = 'X'.
callback_wa-cb_prog = sy-repid.
callback_wa-cb_form = 'CALLBACK_SFLIGHT'.
APPEND callback_wa TO callback.
seltab_wa-kind = 'S'.
seltab_wa-selname = 'CARRID'.
LOOP AT s_carr.
MOVE-CORRESPONDING s_carr TO seltab_wa.
APPEND seltab_wa TO seltab.
ENDLOOP.
CALL FUNCTION 'LDB_PROCESS'
EXPORTING
ldbname = 'F1S'
variant = ' '
TABLES
callback = callback
selections = seltab
EXCEPTIONS
ldb_not_reentrant = 1
ldb_incorrect = 2
ldb_already_running = 3
ldb_error = 4
ldb_selections_error = 5
ldb_selections_not_accepted = 6
variant_not_existent = 7
variant_obsolete = 8
variant_error = 9
free_selections_error = 10
callback_no_event = 11
callback_node_duplicate = 12
OTHERS = 13.
IF sy-subrc <> 0.
WRITE: 'Exception with SY-SUBRC', sy-subrc.
ENDIF.
FORM callback_spfli USING name TYPE ldbn-ldbnode
wa TYPE spfli
evt TYPE c
check TYPE c.
CASE evt.
WHEN 'G'.
WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
ULINE.
WHEN 'L'.
ULINE.
ENDCASE.
ENDFORM.
FORM callback_sflight USING name TYPE ldbn-ldbnode
wa TYPE sflight
evt TYPE c
check TYPE c.
WRITE: / wa-fldate, wa-seatsocc, wa-seatsmax.
ENDFORM.
Reward points if it is usefull ..
Girish