‎2014 Mar 03 7:13 AM
MODULE USER_COMMAND_9000 INPUT.
CASE SY-UCOMM.
WHEN 'SUBMIT'.
SELECT WERKS
FROM MARD
INTO TABLE IT_MARD
WHERE MATNR GE L_MATNR
AND MATNR LE H_MATNR.
IDX = 1.
LINE = 0.
LOOP AT it_mard INTO wa_x .
line = line + 1.
ENDLOOP.
CALL SCREEN 9001.
WHEN 'CLEAR'.
CLEAR: L_MATNR, H_MATNR.
when 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.
For screen 9001.
MODULE FILLDATA OUTPUT.
if idx > 0.
READ TABLE it_MARD INTO wa_MARD INDEX idx.
idx = idx + 1.
endif.
ENDMODULE.
MODULE RESET_IDX OUTPUT.
idx = idx - 5.
ENDMODULE.
MODULE USER_COMMAND_9001 INPUT.
DATA: i_tmp_line like line.
loop at screen. <------ This is where I need to know how to enable/disable the buttons. Rest of the code is working fine.
IF SCREEN-GROUP1 eq 'CHK'.
SCREEN-NAME = 'FAIL'.
screen-ACTIVE = '1'.
modify screen.
ENDIF.
endloop.
CASE Sy-ucomm.
WHEN 'PGDN'.
i_tmp_line = line - 5.
if idx > i_tmp_line.
else.
idx = idx + 5.
ENDIF.
WHEN 'PGUP'.
IF IDX <= 6.
IDX = 1.
else.
idx = idx - 5.
ENDIF.
when 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.
*************************************************************************************************************************************************************
Please help me with the code as to how to achieve the enable/disable functionality of the buttons based on my requirement.
Regards.
Manish.
‎2014 Mar 05 9:37 AM
‎2014 Mar 03 7:17 AM
Can you please tell your problem in detail what you want to achieve and what problem you are facing ,with screenshots?
‎2014 Mar 03 7:47 AM
It seems that my entire thread did not get posted properly due to some reason. I apologise.
In my first screen 9000, I am entering the material number:
In my second screen 9001, I get the following output in a step loop,.
Now there are 2 buttons: "Pass" and "Fail" which are invisible in the PBO of the screen. Below is the screen layout.
My requirement is that, when one or more than one field is checkboxed, the "Fail" button will be enabled, the "Pass" button remains disabled. If all the fields are checkboxed, then the "Pass" button is enabled and the "fail" button is disabled.
Regards.
Manish.
‎2014 Mar 05 9:54 AM
Hi,
Kindly find the below code.
tables: mara.
select-OPTIONS: s_matnr for mara-matnr.
types: begin of t_tab,
mark(1) type c,
flag(1) type c,
matnr type matnr,
end of t_tab.
data: i_mara type TABLE OF t_tab,
w_mara type t_tab,
w_mara1 type t_tab.
data: lv_flag type flag.
select matnr from mara
into CORRESPONDING FIELDS OF TABLE i_mara
where matnr in s_matnr.
loop at i_mara into w_mara.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = w_mara-matnr
IMPORTING
OUTPUT = w_mara1-matnr.
MODIFY i_mara from w_mara1 INDEX sy-tabix.
endloop.
call SCREEN 100.
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TC_ZTEST' ITSELF
CONTROLS: TC_ZTEST TYPE TABLEVIEW USING SCREEN 0100.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TC_ZTEST'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR
MODULE TC_ZTEST_CHANGE_TC_ATTR OUTPUT.
DESCRIBE TABLE I_MARA LINES TC_ZTEST-lines.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TC_ZTEST'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TC_ZTEST_MODIFY INPUT.
if sy-ucomm = 'CHK'.
* lv_tabix = TC_ZTEST-CURRENT_LINE.
clear: w_mara.
READ TABLE i_mara into w_mara index TC_ZTEST-CURRENT_LINE.
if w_mara-flag = ' '.
w_mara-flag = 'X'.
else.
w_mara-flag = ' '.
endif.
MODIFY I_MARA
FROM W_MARA
INDEX TC_ZTEST-CURRENT_LINE.
* endloop.
endif.
data: n type i.
if sy-ucomm = 'CHK'.
DESCRIBE TABLE i_mara LINES N.
loop at i_mara into w_mara.
if w_mara-flag = 'X' and sy-tabix <> n.
continue.
elseif sy-tabix = n.
CLEAR: lv_flag.
else.
lv_flag = 1.
exit.
endif.
endloop.
endif.
ENDMODULE.
*&SPWIZARD: INPUT MODUL FOR TC 'TC_ZTEST'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MARK TABLE
MODULE TC_ZTEST_MARK INPUT.
DATA: g_TC_ZTEST_wa2 like line of I_MARA.
if TC_ZTEST-line_sel_mode = 1
and W_MARA-MARK = 'X'.
loop at I_MARA into g_TC_ZTEST_wa2
where MARK = 'X'.
g_TC_ZTEST_wa2-MARK = ''.
modify I_MARA
from g_TC_ZTEST_wa2
transporting MARK.
endloop.
endif.
MODIFY I_MARA
FROM W_MARA
INDEX TC_ZTEST-CURRENT_LINE
TRANSPORTING MARK.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ABC'.
SET TITLEBAR 'ABC'.
case sy-ucomm.
when 'CHK'.
* loop at screen.
* if screen-name = 'PASS'.
* endif.
* endloop.
if lv_flag <> 1 .
loop at screen.
* screen-name = 'FAIL'.
if screen-name = 'FAIL'.
screen-active = 0.
MODIFY SCREEN.
endif.
endloop.
else.
loop at SCREEN.
* screen-name = 'PASS'.
if screen-name = 'PASS'.
screen-active = 0.
MODIFY SCREEN.
endif.
endloop.
endif.
ENDCASE.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
case sy-ucomm.
when 'BACK'.
leave to SCREEN 0.
when 'UP'.
exit..
endcase.
BR
Sumeet
ENDMODULE. " USER_COMMAND_0100 INPUT
‎2014 Mar 03 7:20 AM
‎2014 Mar 03 9:05 AM
Hi,
The thread you have referred is not of any relevance to my issue.
Regards.
Manish.
‎2014 Mar 03 7:24 AM
Hi Manish,
you need to heck screen field name as well.
if SCREEN-NAME = 'FAIL'.
‎2014 Mar 03 7:30 AM
I did that in my MODULE USER_COMMAND_9001 INPUT.
loop at screen.
IF SCREEN-GROUP1 eq 'CHK'.
SCREEN-NAME = 'FAIL'.
screen-ACTIVE = '1'.
modify screen.
ENDIF.
endloop.
In my first screen 9000, I am entering the material number:
In my second screen 9001, I get the following output in a step loop,.
Now there are 2 buttons: "Pass" and "Fail" which are invisible in the PBO of the screen. Below is the screen layout.
My requirement is that, when one or more than one field is checkboxed, the "Fail" button will be enabled, the "Pass" button remains disabled. If all the fields are checkboxed, then the "Pass" button is enabled and the "fail" button is disabled.
Regards.
Manish
‎2014 Mar 03 7:28 AM
Hi Manish,
Check like
IF SCREEN-GROUP1 eq 'CHK' and SCREEN-NAME = 'FAIL'..
screen-ACTIVE = '1'.
modify screen.
ENDIF.
endloop.
Arivazhagan S
‎2014 Mar 03 7:56 AM
Hi,
I tried your approach, however when I checkbox a few fields and scroll down for the next 5 records, the checkboxes disappear. Which means the records do not remain selected after the scroll option. Also, the "Fail" button doesnt not get enabled as per your logic.
‎2014 Mar 03 7:29 AM
HI Manish,
U can do below way.
Check your RadioBUtton First.
if Your radiobutton eq = 'X'.
Loop at screen.
SCREEN-NAME = Button Field Name.
screen-ACTIVE = '1'. " Acrtivate Button 0 = Disabled Button
modify screen.
ENDIF.
endloop.
endif.
Thanks
Tarak
‎2014 Mar 03 8:00 AM
I tried your approach, however when I checkbox a few fields and scroll down for the next 5 records, the checkboxes disappear. Which means the records do not remain selected after the scroll option. Also, the "Fail" button doesnt not get enabled as per your logic.
‎2014 Mar 05 9:21 AM
I have figured out how to enable the "Fail" button, however, my issue now is to make the checkbox work as a push button. The only way the "Fail" button is enabling is when a user-command is triggered. But as per my requirement, the checkbox will trigger the "fail" button. Adding a function code to the checkbox is not solving the issue as the checkbox is not getting ticked. Please advise.
‎2014 Mar 05 9:37 AM