‎2009 May 19 6:25 AM
Hi Experts,
In my table control, I have a column of push buttons, each per row.
As the FCODE of all the push buttons are same, so same set of actions are getting triggered on
click of any of these buttons.
I mean, if data is present only in the first row, then the push button of the first row should work, but
right now even if I click the 5th row's button same thing is happening.
So Can we change the function code of these push buttons every time the table control loop is
processed ??
Thanks
Chandan
‎2009 May 19 6:39 AM
yeah fcode remains same , but when u look st sy-ucomm , u will get to know from which line it was triggered.
sample code looks like
l_lin = ytc_10-top_line + sy-ucomm+2(2) - 1.
regards
Prabhu
‎2009 May 19 6:59 AM
Hey Prabhu can you please elaborate it more as in what should I do ?
‎2009 May 19 7:07 AM
check values of sy-ucomm in debug mode.
in PAI
at user-command.
ok_code = sy-ucomm.
l_lin = ytc_10-top_line + sy-ucomm+2(2) - 1.---> current line.
read itab index l_lin.-->this will give current line details.
regards
Prabhu
‎2009 May 19 7:30 AM
Prabhu,
sy-ucomm is 'BUT', the fcode that I have assigned to the button.
Its not a number.
‎2009 May 19 7:38 AM
sorry , forgot to tell IMP thing when u are using Button on ROW,
fcode should be like thi BU%%
regards
Prabhu
‎2009 May 19 7:55 AM
That means, if I change the FCODE from BUT to BU%% it will work ???
‎2009 May 19 8:32 AM
Prabhu,
Where is your sample code, can u please show me ?
Thanks
Chandan
Edited by: chandan sinha on May 19, 2009 9:32 AM
‎2009 May 19 8:36 AM
Hi,
Disable the rows which doesn't have any values. In PBO, use describe statement to find the no. of lines in internal table. Then for table control, use the lines count to enable/ disable a particular row. For that use screen-input inside loop..endloop.
‎2009 May 19 8:16 AM
same solution......... without try u never know what i'm saying...how it works...
yupe it should work...
%% or %%%( which can holds record no ) will contain current row details, so in PAI u need to have code just like my sample code ....
in PAI
at user-command.
ok_code = sy-ucomm.
l_lin = ytc_10-top_line + sy-ucomm+2(2) - 1.---> current line.
read itab index l_lin.-->this will give current line details.
regards
Prabhu
Edited by: Prabhu Peram on May 19, 2009 3:21 PM
Edited by: Prabhu Peram on May 19, 2009 4:07 PM
‎2009 May 19 10:08 AM
Prabhu,
BU%% is giving BU01, BU02 like wise for each time the button is clicked and not depending on the row.
This change in sy-ucomm should be row dependent and not button click dependent.
I mean, when row = 1, only then sy-ucomm = BU01( Not depending on the click made on the button)
row = 2, only then sy-ucomm = BU02 ( Not depending on the click made on the button)
Can you please suggest on this ?
Thanks
Chandan
‎2009 May 19 10:32 AM
dude .....
i dont how is ur TC design ..... but it should give selected row no itself...
see where is ur cursor postion.
regards
Prabhu
‎2009 May 19 11:43 AM
Hey Prabhu,
Fine I agree, that from your formula, I will get the selected row, but then what should I write in the below
blank :
CASE OK_CODE.
WHEN '_____'.
CALL SCREEN 110.
ENDCASE.Based on that row, I need to trigger the corresponding button, which will then open a pop-up input screen, where I need to enter data. When I will press the same button next time it should show the values which I had entered. Like this it should work for all the rows.
what should I write in the above condition ?
seems I am close, please reply to the earliest.
Thanks
Chandan
‎2009 May 20 3:53 AM
*screen 100
data: l_function like sy-ucomm,
l_lin type sy-stepl.
clear: ok_code,l_function,error.
ok_code = sy-ucomm.
l_function = ok_code.
if l_function(2) = 'BU'.
clear l_lin.
l_lin = gt_cat09-top_line + l_function+2(2) - 1.
read itab into ls_itab index l_line.--->current line. basedon conditions u can call popup message.
perform get_relations.
if gt_cat06[] is initial.
perform display_popup.--->pop up select options.
else.
saved = 'X'.
endif.
if error ne 'X'.
call screen '0101'.-->i'm calling another screen.
endif.
endif.
case ok_code.
when 'SAVE'.
when 'DELE'.
when others.
endcase.
dude..... i dont do copy & paste my code... ...... u should try .....anyhow i hope u got the logic....so try to do it on ur own ...
regards
Prabhu
‎2009 May 20 6:47 AM
Hey Prabhu, that BU%% is working yaar, cool
Thanks a lot,
Now can you tell me is this possible: To get the row number of a table control where the cursor is currently
placed and the processing should start from that row ??
Prabhu, See the above message.
Thanks
Chandan
Edited by: chandan sinha on May 20, 2009 7:55 AM
‎2009 May 20 10:56 AM
To get the row number of a table control where the cursor is currently
placed and the processing should start from that row ??
what processing ?
-
>see my sample code , that will give u current row only. based on the l_lin u can read ur internal table.
‎2009 May 20 11:31 AM
Ok Fine....let me tell you my scenario then, please do help me
Scenario:
1) I have a table control with 2 radio buttons, 7 columns and 1 column of push buttons.
2) On click of radio button 2, the push button gets enabled and on click of the push button, a pop-up
screen comes up.
3) After entering data on the pop-up screen, control should come back to the main screen and whatever
data the user has entered should get displayed.
4) Now say user has entered 7 rows of data by repeating the above process. Suddenly, the user wants to
see what he entered in the first row's pop-up, then the user has to press the first row's push button in order
to see what he had entered in the pop-up.
My Problem is with the 4th Point, how can I achieve this.
Challenges I am facing: Even though I am clicking the 5th row's push button, it is showing me the 1st row's
data.
The Pop-up screen's values should change row wise depending on the data.
Please help me out, this issue is eating me up.
Thanks
Chandan
‎2009 May 19 9:43 AM
Hi,
The PAI code to handle the click event of a pushbutton should be done inside the LOOP ENDLOOP of the coulmn of pushbuttons. So that when the appropriate column is clicked the apt code (which you need to do for the particular column cell) shall be executed.
Shankar
‎2009 May 21 8:05 AM