‎2010 Apr 01 9:57 AM
I have 2 queries
1) On a table control how can I move cursor to second row when I press enter
2) I hav to use 1 screen for two prgrams to I need to chance the title of screen (SET-TITLE) for both accordingly and I have to chance the heading (text label) above table control in that screen for those two programs , can I use anything else instead of text labels as i dont think that can be changed dynamically.
‎2010 Apr 01 10:05 AM
Hi
1) You can use the SET CURSOR statement to move the cursor wherever you want, for details just click F1 on set cursor statement in program editor.
2) Set TITTLEBAR, with your text dynamically.
SET TITLEBAR 'TIT' with text-001 Hope it will solve your issue.
Thanks
Praveen
‎2010 Apr 01 10:13 AM
But how can I get the ENTER value in screen ok_code on presing enter it does not take it
how will i set title based on which program it was called from i know the syntax but how to change it dynamically
‎2010 Apr 01 10:21 AM
Once you click on the enter, automatically PAI will trigger, no need to assign any ok_code for it.
Keep a condition in the PBO module, based on the condition you populate the text.
Ex:
data title(60).
if sy-repid eq 'ZTEST1'.
title = 'Test Program for Title testing:1'
SET TITLEBAR 'TIT' with title.
else.
title = 'Test Program for Title testing:2'
SET TITLEBAR 'TIT' with title.
endif.
‎2010 Apr 01 10:28 AM
Hi Karan,
This is to set the title dynamically based on the calling program.
1) Define the title bar with & symbol. For example, let us consider the titles should be "Program A" if called by first program and title should be "Program B" if called by second program. Define the title bar with text "Program &" (pls note quotes are not required).
2) In the PBO of the screen, check whether called from first program or second program and accordingly, populate the variable LV_PRG.
3) The command in PBO should be SET TITLEBAR 'TT1' WITH lv_prg.
4) When executed, the variable lv_prg will be populated with value A or B based on the calling program. This variable value will be substituted in place of & symbol.
Thanks,
Sakthi.
‎2010 Apr 01 10:36 AM
To set the cursor in the next row of table control when you press enter key please follow the below steps.
1. when you press enter key PAI should be triggered, and to trigger PAI please enter a FCODE for the ENTER key in the PF-STATUS.
2. Get the current position of the cursor in the table control by using the statement
GET CURSORE ....LINE <line no in TC>.
NEXT LINE = <line no in TC> + 1
3. To set to the next line of the table control(TC) use the statement
SET CURSOR........... LINE <NEXT LINE>
Please note the <NEXT LINE> value should be less tahn or equal to the table control-Lines.
Regards,
Amarjit
Edited by: Amarjit Singh on Apr 1, 2010 3:07 PM
‎2010 Apr 01 11:32 AM
1.) I have also a label above table control which has fixed text how can that be chaged when screen is caled from diffrent programs
2.) I have give ENTER FCODE in the pf status but when i press it from key board the ok_code does not get that value
‎2010 Apr 01 11:59 AM
‎2010 Apr 01 12:51 PM
there is nothing much in the program plz help
1) I have also a label above table control which has fixed text how can that be chaged when screen is caled from diffrent programs
2) I have give ENTER FCODE in the pf status but when i press it from key board the ok_code does not get that value
3) how can i set displayed values rows from intenal table in display mode and rest in edit mode in table control
‎2010 Apr 01 1:31 PM
1. For the text label create a text field with only output properties selected, this will behave like text field except you can chage the text of such dynamically.
2. set FCODE for the enter sysmbol inthe PF-Status, please check if sy-ucomm has the FCODE value.
3. LOOP AT <ITAB> WITH CONTROL <TC>
LOOP AT SCREEN.
READ TABLE <TC>-COLS... with SCREEN-NAME = 'SCREEN-NAME'
......
......
......
ENDLOOP.
ENDLOOP.
‎2010 Apr 01 1:18 PM