11-16-2007 1:11 AM
Hi experts,
I have a requirement like this...
In my report output showing list of 10 company codes.
If i click 6th company code in the list, it should display all related plants....
how can i do using at line selection?
can any one give me simple code for this...
thanks
11-16-2007 1:13 AM
when you write your company codes .. HIDE the company code.
LIke:
data: W_BUKRS LIKE T001-BUKRS.
LOOP AT ITAB.
W_BUKRS = ITAB-BUKRS.
WRITE: / ITAB-BUKRS.
HIDE W_BUKRS.
ENDLOOP.
AT LINE-SELECTION.
* you can access W_BUKRS ...
Regards,
Naimesh Patel
11-16-2007 1:13 AM
when you write your company codes .. HIDE the company code.
LIke:
data: W_BUKRS LIKE T001-BUKRS.
LOOP AT ITAB.
W_BUKRS = ITAB-BUKRS.
WRITE: / ITAB-BUKRS.
HIDE W_BUKRS.
ENDLOOP.
AT LINE-SELECTION.
* you can access W_BUKRS ...
Regards,
Naimesh Patel
11-16-2007 1:14 AM
check below sample code. You can create your own based on the same
http://www.howforge.com/abap-4-example-code-hide-and-at-line-selection
Regards,
Atish
11-16-2007 1:14 AM
Hi Kaki,
Example Code is here
DATA TEXT(20).
START-OF-SELECTION.
PERFORM WRITE_AND_HIDE USING SPACE SPACE.
AT LINE-SELECTION.
CASE TEXT.
WHEN 'List index'.
PERFORM WRITE_AND_HIDE USING 'X' SPACE.
WHEN 'User command'.
PERFORM WRITE_AND_HIDE USING SPACE 'X'.
WHEN OTHERS.
SUBTRACT 2 FROM SY-LSIND.
PERFORM WRITE_AND_HIDE USING SPACE SPACE.
ENDCASE.
CLEAR TEXT.
FORM WRITE_AND_HIDE USING P_FLAG_LSIND P_FLAG_UCOMM.
WRITE / 'SY-LSIND:'.
PERFORM WRITE_WITH_COLOR USING SY-LSIND P_FLAG_LSIND.
TEXT = 'List index'.
HIDE TEXT.
WRITE / 'SY-UCOMM:'.
PERFORM WRITE_WITH_COLOR USING SY-UCOMM P_FLAG_UCOMM.
TEXT = 'User command'.
HIDE TEXT.
IF SY-LSIND > 0.
WRITE / 'PICK here to go back one list level'.
ENDIF.
ENDFORM.
FORM WRITE_WITH_COLOR USING P_VALUE
P_FLAG_POSITIVE.
IF P_FLAG_POSITIVE = SPACE.
WRITE P_VALUE COLOR COL_NORMAL.
ELSE.
WRITE P_VALUE COLOR COL_POSITIVE.
ENDIF.
ENDFORM.
<b>Reward Points if it helps,</b>
Satish
11-16-2007 2:11 AM
Hi Kaki,
You may want to use hotspots event.
Please check this sample code.
data: itstc type table of tstc with header line.
select-options : s_tcode for itstc-tcode.
at line-selection.
check sy-ucomm = 'PICK'.
call transaction itstc-tcode.
start-of-selection.
select * into corresponding fields of table itstc
from tstc
where tcode in s_tcode.
loop at itstc.
format hotspot on.
write:/ itstc-tcode.
hide itstc-tcode.
format hotspot off.
endloop.
Regards,
Ferry Lianto
11-16-2007 3:52 AM
Hi Kaki,
Naimesh solved ur problem, plz award points and close the thread.
Regards,
Manish