Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

at line selection capturing values

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

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

5 REPLIES 5

naimesh_patel
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

ferry_lianto
Active Contributor
0 Kudos

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

former_member194623
Participant
0 Kudos

Hi Kaki,

Naimesh solved ur problem, plz award points and close the thread.

Regards,

Manish