‎2008 Jun 25 12:00 PM
Dear gurus,
I have developed interactive report for one secondary list.
It works fine.
wherever entered in the first screen it goes to next screen.
Issue is
i want to double click the particular field only. if i double click on any other field next screen should not be displayed.
how can i do.
Please provide the solution.
Regards
R.Rajendran
‎2008 Jun 25 1:12 PM
‎2008 Jun 25 12:04 PM
hi
pick the postion of the coloumn with sy-cucol and trigger the event only when sy-cucol is in specified range.
You will get the result.
Reward if useful.
Regards
Sumit Agarwal
‎2008 Jun 25 12:04 PM
‎2008 Jun 25 12:05 PM
Hi,
While using the double click event you can get the field name too, so use that field name when navigating to next screen.
for example:
fields: field1, field2, field3.
Please find the below pseudo code.
if para_values-field_name eq 'FIELD1'
--> Then navigate to next screen
--> Process your logic
endif.
Reward with points if helpful.
‎2008 Jun 25 12:09 PM
daat w_data(30) type c.
at line-selection.
get cursor field w_data.
if w_date eq 'Required field'.
process
endif.
‎2008 Jun 25 12:09 PM
hiii
you can do it as follows
AT LINE-SELECTION.
sy-lsind = sy-lsind + 1.
IF sy-lsind = 1.
PERFORM detail_list. " Call Subroutine
ELSE.
MESSAGE e572(zerror). " No Record Found
ENDIF. " IF sy-lsind = 0.
FORM detail_list .
SELECT
carrid " Carrier ID
connid " Connection ID
fldate " Flight Data
bookid " Booking ID
customid " Customer ID
INTO TABLE t_book
FROM sbook
WHERE fldate = w_date .
IF sy-subrc = 0.
PERFORM display_detail.
ELSE .
write:sy-lsind.
MESSAGE e571(zerror). " No Record Found
ENDIF. " IF sy-subrc = 0.
ENDFORM. " Detail listregards
twinkal
‎2008 Jun 25 12:12 PM
hi,
1. use sy-cucol field to specify the col positon from which event is triggered.
or
2. use GET CURSOR statement. the syntax is as follows
GET CURSOR FIELD <f> [OFFSET <off>] [LINE <lin>]
[VALUE <val>] [LENGTH <len>].
either one will defenitely help.
Reward if helpful
Anirban Bhattacharjee
‎2008 Jun 25 12:16 PM
Hi,
You can use GET CURSOR FIELD f, like give a condition
At line-selection.
if f = field1.
( display the secondary list)
else.
sy-lsind = 0.
message ....
endif.
or you can also do it by sy-cucol by giving the positions in if condition.
with luck,
Pritam.
‎2008 Jun 25 12:17 PM
hi,
1. use sy-cucol field to specify the col positon from which event is triggered.
or
2. use GET CURSOR statement. the syntax is as follows
GET CURSOR FIELD <f> [OFFSET <off>] [LINE <lin>]
[VALUE <val>] [LENGTH <len>].
either one will defenitely help.
Reward if helpful
Anirban Bhattacharjee
‎2008 Jun 25 1:11 PM
Hai,
Try to copy this code and directly execute in the abap editor and try to understand it. This This program is used to display Details from Tables VBAK & VBAP on Basic & Detail List . On the Detail list the details are displayed only when the user double clicks on Sales doc no.
*" Table declarations..................................................
TABLES :
vbak, " Sales Document Header Data
vbap. " Sales Document Item Data
*" Selection Screen Elements...........................................
SELECT-OPTIONS :
s_vbeln FOR vbak-vbeln. " Sales Document Number
*"Data declarations....................................................
"----
Work variables *
"----
DATA :
w_rowno LIKE sy-curow VALUE 3, " Row Number
w_curr LIKE vbak-waerk. " SD document currency
"----
Internal table to hold Sales Document Header data *
"----
DATA :
t_vbak LIKE
STANDARD TABLE
OF vbak.
"----
Internal table to hold Sales Document Item data *
"----
DATA :
t_vbap LIKE
STANDARD TABLE
OF vbap.
"----
TOP-OF-PAGE EVENT *
"----
TOP-OF-PAGE.
WRITE :/50 'SALES DOCUMENT HEADER INFORMATION'(001),
sy-uline.
FORMAT COLOR 3.
WRITE :/3 'Sales Doc.No'(002),
20 'Date'(003),
30 'Created By'(004),
45 'Doc.Category'(005),
62 'Doc.Type'(006),
73 'Del.Block'(007),
87 'Bill Block'(008),
102 'Net Value'(009),
115 'Sales Org.'(010),
130 'Sold to Party'(011).
"----
TOP-OF-PAGE DURING LINE-SELECTION EVENT *
"----
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE 😕 'SALES DOCUMENT ITEM DATA'(012),
sy-uline.
FORMAT COLOR 3.
WRITE :/5 'Sales Doc.No'(002),
22 'Sales Doc.Item'(013),
41 'Material Number'(014),
71 'Base Unit of Measure'(015).
"----
AT SELECTION-SCREEN EVENT *
"----
AT SELECTION-SCREEN.
SELECT vbeln " Sales Document
FROM vbak
INTO CORRESPONDING FIELDS OF
TABLE t_vbak
WHERE vbeln IN s_vbeln.
IF sy-subrc NE 0.
MESSAGE e184(bc_global) WITH text-017.
ENDIF. " IF SY-SUBRC NE 0.
"----
START-OF-SELECTION EVENT *
"----
START-OF-SELECTION.
PERFORM fetch_vbak_data.
"----
AT LINE-SELECTION EVENT *
"----
AT LINE-SELECTION.
IF sy-lsind = 1.
IF sy-cucol LT 14
AND sy-curow GT 3
AND sy-curow LE w_rowno.
PERFORM fetch_vbap_data.
ELSE.
MESSAGE e184(bc_global) WITH text-016.
ENDIF. " IF SY-CUCOL LT 14...
ENDIF. " IF SY-LSIND = 1.
&----
*& Form FETCH_VBAK_DATA *
&----
This Subroutine Fetches Data from the Database Table VBAK *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM fetch_vbak_data .
SELECT vbeln " Sales Document
erdat " Creation Date
ernam " Person who created the object
vbtyp " SD document category
auart " Document Type
lifsk " Delivery Block
faksk " Billing Block
netwr " Net value of the document
vkorg " Sales Organization
kunnr " Sold to Party
FROM vbak
INTO CORRESPONDING FIELDS OF
TABLE t_vbak
WHERE vbeln IN s_vbeln.
IF sy-subrc EQ 0.
PERFORM display_vbak_data.
ENDIF. " IF SY-SUBRC EQ 0
ENDFORM. " FORM FETCH_VBAK_DATA
&----
*& Form display_vbak_data *
&----
This Subroutine Displays Data from the Database Table VBAK *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM display_vbak_data .
SORT t_vbak BY vbeln ASCENDING.
LOOP AT t_vbak INTO vbak.
ADD 1 TO w_rowno.
FORMAT COLOR 1.
WRITE 😕 vbak-vbeln UNDER text-002.
FORMAT COLOR 2.
WRITE :17 vbak-erdat,
vbak-ernam UNDER text-004,
vbak-vbtyp UNDER text-005,
vbak-auart UNDER text-006,
vbak-lifsk UNDER text-007,
vbak-faksk UNDER text-008,
90 vbak-netwr CURRENCY w_curr,
vbak-vkorg UNDER text-010,
vbak-kunnr UNDER text-011.
HIDE : vbak-vbeln.
ENDLOOP. " LOOP AT T_VBAK...
ENDFORM. " FORM DISPLAY_VBAK_DATA
&----
*& Form FETCH_VBAP_DATA *
&----
This Subroutine Fetches Data from the Database Table VBAP *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM fetch_vbap_data .
SELECT vbeln " Sales Document Number
posnr " Sales Document Item
matnr " Material Number
meins " Base unit of measure
FROM vbap
INTO CORRESPONDING FIELDS OF
TABLE t_vbap
WHERE vbeln = vbak-vbeln.
IF sy-subrc EQ 0.
PERFORM display_vbap_data.
ENDIF. " IF SY-SUBRC EQ 0
ENDFORM. " FORM FETCH_VBAP_DATA
&----
*& Form DISPLAY_VBAP_DATA *
&----
This Subroutine Displays Data from the Database Table VBAP *
----
There are no interface parameters to be passed to this subroutine. *
----
FORM display_vbap_data .
LOOP AT t_vbap INTO vbap.
AT NEW vbeln.
FORMAT COLOR 2.
WRITE 😕 vbap-vbeln UNDER text-002.
ENDAT. " AT NEW VBELN
WRITE 😕 vbap-posnr UNDER text-013,
vbap-matnr UNDER text-014,
vbap-meins UNDER text-015,
90 space.
ENDLOOP. " LOOP AT T_VBAP INTO VBAP
ENDFORM. " FORM DISPLAY_VBAP_DATA
‎2008 Jun 25 1:12 PM