‎2005 Oct 22 11:54 AM
hi guys,
I have two issues in ABAP Dialog programming.
1. i created a list box with name txt6 and fnCode 'LST'.
now i have to insert values into list box as :
1 abc
2 syz
3 fst
these values need not be any ztable. how do you insert these values.
2. we know that in disable mode the SAVE icon on the top gets inactive. Now i want the same thing in my screen too.
i have set the SAVE icon on the top with fncode 'SAV'.
my disable mode works for other fields in the screen bcos i define the screen-group for them. for how define a screen group for a element in GUI Status.
Deepak
‎2005 Oct 22 12:37 PM
Hi Sri,
That was excellent reply.
the first one worked fine without any problem.
bust the second one is still having some hiccups.
for you convinence ill place the the two modules over here.
MODULE status_1200 OUTPUT.
SET PF-STATUS 'TEST1'.
SET TITLEBAR 'TIT'.
LOOP AT SCREEN.
IF screen-group1 = 'GRP'.
IF flag = ' '.
screen-input = '1'.
ELSEIF flag = 'X'.
screen-input = '0'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE. " STATUS_1200 OUTPUT
MODULE user_command_1200 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'EXT'.
LEAVE PROGRAM.
WHEN 'DIS'.
IF flag = ' '.
flag = 'X'.
APPEND 'SAV' TO t_fcode.
ENDIF.
SET PF-STATUS 'TEST1' EXCLUDING t_fcode.
WHEN 'CHA'.
IF flag = 'X'.
flag = ' '.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_1200 INPUT
if you see 'DIS' is fncode for disable button
now how can i deactivate my SAVE button in GUI status.
Could you pls suggest me where to exactly insert the statement.
ill surely mark your answers.
Deepak
‎2005 Oct 22 12:04 PM
Hi,
<b>
1. i created a list box with name txt6 and fnCode 'LST'.
now i have to insert values into list box as :
1 abc
2 syz
3 fst
these values need not be any ztable. how do you insert these values.</b>
First, declare this TYPE GROUP in your TOP Include.
TYPE-POOLS VRM.
And then create a MODULE VALUES_SET in your screen's Flow Logic, PROCESS ON VALUE-REQUEST event like,
PROCESS BEFORE OUTPUT.
....
PROCESS AFTER INPUT.
.....
PROCESS ON VALUE-REQUEST.
FIELD TXT6 MODULE values_set.
Next, double click on the module to create.
in the MODULE, write the following code,
DATA: t_values TYPE vrm_values WITH HEADER LINE.
t_values-key = '1'.
t_values-text = 'abc'.
APPEND t_values.
t_values-key = '2'.
t_values-text = 'syz'.
APPEND t_values.
t_values-key = '3'.
t_values-text = 'fst'.
APPEND t_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'TXT6'
values = t_values[]
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>
2. we know that in disable mode the SAVE icon on the top gets inactive. Now i want the same thing in my screen too.
i have set the SAVE icon on the top with fncode 'SAV'.
my disable mode works for other fields in the screen bcos i define the screen-group for them. for how define a screen group for a element in GUI Status.</b>
When you set your PF-STATUS, use the following,
<b>SET PF-STATUS <your GUI status> EXCLUDING 'SAV'.</b>
If you want to exclude more functions then declare an internal table,
<b>DATA: t_functions_to_exclude LIKE sy-ucomm OCCURS 0 WITH HEADER LINE.
APPEND 'SAV' TO t_functions_to_exclude.
SET PF-STATUS <your GUI status>
EXCLUDING t_functions_to_exclude.</b>
If you want to disable SAVE on a certain condition then
<b>DATA: t_functions_to_exclude LIKE sy-ucomm OCCURS 0 WITH HEADER LINE.
IF <your condition> EQ <true>.
APPEND 'SAV' TO t_functions_to_exclude.
ENDIF.
SET PF-STATUS <your GUI status>
EXCLUDING t_functions_to_exclude.</b>
Hope this helps..
Sri
Message was edited by: Srikanth Pinnamaneni
Message was edited by: Srikanth Pinnamaneni
‎2005 Oct 22 12:16 PM
Hi
You have to define a table to insert the code and description of your values:
type-pools vrm.
data: values type vrm_values,
wa type vrm_value.
1.
MODULE LIST_BOX.
REFRESH VALUES.
wa-key = 'ABC'.
wa-text = '.......'.
append wa to values.
call function 'VRM_SET_VALUES'
exporting
id = FIELD_OUTPUT_INPUT_NAME
values = values.
ENDMODULE.
2. There isn't a group for gui status, you have to manage by program:
DATA: T_EXCL LIKE SY-UCOMM OCCURS 0.
MODULE SET-PF-STATUS.
REFRESH T_EXCL.
IF FL_DISPLAY = 'X'.
T_EXCL = 'SAV'. APPEND T_EXCL.
ENDIF.
SET PF-STATUS 'MY_STATUS' EXCLUDING T_EXCL.
ENDMODULE.
Max
‎2005 Oct 22 12:37 PM
Hi Sri,
That was excellent reply.
the first one worked fine without any problem.
bust the second one is still having some hiccups.
for you convinence ill place the the two modules over here.
MODULE status_1200 OUTPUT.
SET PF-STATUS 'TEST1'.
SET TITLEBAR 'TIT'.
LOOP AT SCREEN.
IF screen-group1 = 'GRP'.
IF flag = ' '.
screen-input = '1'.
ELSEIF flag = 'X'.
screen-input = '0'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE. " STATUS_1200 OUTPUT
MODULE user_command_1200 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'EXT'.
LEAVE PROGRAM.
WHEN 'DIS'.
IF flag = ' '.
flag = 'X'.
APPEND 'SAV' TO t_fcode.
ENDIF.
SET PF-STATUS 'TEST1' EXCLUDING t_fcode.
WHEN 'CHA'.
IF flag = 'X'.
flag = ' '.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_1200 INPUT
if you see 'DIS' is fncode for disable button
now how can i deactivate my SAVE button in GUI status.
Could you pls suggest me where to exactly insert the statement.
ill surely mark your answers.
Deepak
‎2005 Oct 22 12:41 PM
Hi Deepak,
MODULE status_1200 OUTPUT.
Add this code here..
<b>REFRESH t_fcode.
IF flag EQ 'X'.
APPEND 'SAV' TO t_fcode.
ENDIF.</b>
<b>and change this
SET PF-STATUS 'TEST1'.
to
SET PF-STATUS 'TEST1' EXCLUDING t_fcode.</b>
SET TITLEBAR 'TIT'.
LOOP AT SCREEN.
IF screen-group1 = 'GRP'.
IF flag = ' '.
screen-input = '1'.
ELSEIF flag = 'X'.
screen-input = '0'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE. " STATUS_1200 OUTPUT
No need to do it in PAI..do it always in PBO in STATUS_1200 module..
MODULE user_command_1200 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'EXT'.
LEAVE PROGRAM.
WHEN 'DIS'.
IF flag = ' '.
flag = 'X'.
<b>Remove the following line from here..</b>
APPEND 'SAV' TO t_fcode.
ENDIF.
<b>Remove the following line from here..</b>
SET PF-STATUS 'TEST1' EXCLUDING t_fcode.
WHEN 'CHA'.
IF flag = 'X'.
flag = ' '.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_1200 INPUT
Sri
Message was edited by: Srikanth Pinnamaneni
Message was edited by: Srikanth Pinnamaneni
‎2005 Oct 22 12:56 PM
hey sri,
That was a great help.
issues are solved.
Thank you,
Deepak
‎2005 Oct 22 1:54 PM