Application Development and Automation 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: 
Read only

Capturing the highlighted line on a table control

VenuAnumayam
Participant
0 Likes
553

Hello Experts,

We already have some custom screens/code built into QM01. For Screen# 800, the code is like this:

PROCESS BEFORE OUTPUT.
  MODULE INIT_0800.

  LOOP AT t_comp_prt INTO qacomp_prt WITH CONTROL tc_qacomp_prt.
    xxxxxxxxxxx
    FIELD t_comp_prt-mark.
  ENDLOOP.

PROCESS AFTER INPUT.

  MODULE CANCEL_800 AT EXIT-COMMAND.

  LOOP AT t_qacomp_prt.
    FIELD t_qacomp_prt-mark.
    MODULE READ_TABLE_CONTROL_800.
  ENDLOOP.

  MODULE USER_COMMAND_0600.

t_qacomp_prt-mark is assigned to table control for attribute w/ selcolmn for highlighting the lines.

Now I have to create a new button "ADD" in " MODULE USER_COMMAND_0800".

MODULE USER_COMMAND_0800 INPUT.

 case ok_code.
    when 'ZZZ'.
      xxxxxxxxxxxxx.

     when 'ADD'.
        perform add_new.   -> Here I am writing code for new functionality.
    
    when others.
 endcase.

ENDMODULE.                 " USER_COMMAND_0800  INPUT

The requirement is when the users highlight a line on the Table Control and click on "ADD" button, I have to activate my new code. If they do not highlight any line on TC, it should not activate the new code.

I am trying to check the flag "T_QACOMP_PRT-MARK" is selected or not. But in "USER_COMMAND_0800 INPUT", its not working.

Could you please let me know what I have to write in

form add_new

.

Thanks a lot.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
517

Hi Ravi,

in PAI

loop at itab.
module modify_tc.
endloop.

in program.

module modify_tc.
modify itab index tc-current_line " just you select a line and press enter
" and mark should be tranferred to itab in program with avalue X
endmodule.

now 
read table itab with key mark = 'X'.
if sy-subrc is initial.
case ok_code.
when 'ADD'. " Now you can proceed further.
clear ok_code.
endcase.
endif

Cheerz

Ram

2 REPLIES 2
Read only

Former Member
0 Likes
517

Hi Ravi,

Please check out the this thread. Hopefully this would answer your question.

[]

Cheers,

Pritam

Read only

Former Member
0 Likes
518

Hi Ravi,

in PAI

loop at itab.
module modify_tc.
endloop.

in program.

module modify_tc.
modify itab index tc-current_line " just you select a line and press enter
" and mark should be tranferred to itab in program with avalue X
endmodule.

now 
read table itab with key mark = 'X'.
if sy-subrc is initial.
case ok_code.
when 'ADD'. " Now you can proceed further.
clear ok_code.
endcase.
endif

Cheerz

Ram