04-19-2006 3:11 PM
Hi,
In BASIC list I placed 2 push buttons. When I clicked any 1 button, another list is displayed(SY-LSIND = 1).
Here when I go BACK to BASIC list I want to DISABLE 1 push button.
Could any one give me the hints or sample code for the above scenario.
Thanks in advance.
Message was edited by: KDeepak
04-19-2006 3:22 PM
Hi
After clicking the button you should re-set the GUI status excluding that button.
Max
04-19-2006 3:26 PM
hi,
you can do it wwith the help of excluding opttion.
set pf-status 'STATUS' excluding 'FCODE'. "fcode of button.
if you have so many then have a itab of type sy-ucomm and append all okcodes to it and then use
set pf-status 'STATUS' excluding P_EXTAB.
Regards
vijay
04-19-2006 3:34 PM
Hi,
Ya I know that EXCLUDING.... but here when I click 'BACK'
it not going to that command to reset the PF-STATUS.
AT USER-COMMAND.
CASE ucom.
WHEN 'DOC_POST'.
............
............
WHEN 'BACK'.
..........
..........
ENDCASE.
Here it is not going to BACK.<<<<-------
Thanks.
04-19-2006 3:44 PM
hi,
when you say BACK it will go at user-command of second list (sy-lisind), in that set the PF-status and say leave to screen 0.
can you show your code
Regards
vijay
04-19-2006 3:49 PM
Hi Vijay,
Have a look....
----
AT USER-COMMAND.
----
CASE sy-ucomm.
WHEN 'ACT_DETAIL'.
PERFORM display_act_details.
WHEN 'DOC_POSTIN'.
IF oset_act = 'X'.
PERFORM posting_offset.
ELSE.
PERFORM transfer_doc.
ENDIF.
PERFORM display_postings.
WHEN 'BACK'.
REFRESH basic_it.
CLEAR basic_it.
basic_it-fcode = 'DOC_POSTIN'.
APPEND basic_it.
SET pf-status 'PO_DETAIL' EXCLUDING basic_it.
WHEN others.
EXIT.
ENDCASE.
This above code which I coded in my prog..
Thanks.
04-19-2006 4:09 PM
Hi,
you need to take help of sy-lisind , with the help of sy-lsind you need to code.
but in your user command you are not considering sy-lsind. since secondary list you want Button and Basic list you don't want. it can be done only with sy-lsind.
and are you not going to basic list. why i am asking is you have no leave to screen 0 in your BACK code.
Regards
vijay
04-19-2006 4:19 PM
Hi,
Vijay could you please provide me the sample code how to handle the s-lsind.
Next in my secondary list I dont have any buttons. Both the buttons are in basic list itself.
From secondary list when I click 'BACK' now it is going to basic list which is correct, but in this I dont want 1 push button(it should be disabled).
I think now it is clear for you.
Thanks.
04-19-2006 5:03 PM
Hi,
check this code...
set the pf-status , i added three buttons. and i enable BACK , CANC, EXIT. i gave BACK1 , CANC1,EXIT1 their okcodes. and concentrate on bold code.
REPORT z_test_interactive NO STANDARD PAGE HEADING.
DATA: BEGIN OF it_one OCCURS 0,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
END OF it_one.
DATA: BEGIN OF it_two OCCURS 0,
vbeln LIKE vbak-vbeln,
posnr LIKE vbap-posnr,
END OF it_two.
DATA: BEGIN OF it_code OCCURS 0,
okcode LIKE sy-ucomm,
END OF it_code.
DATA: fld(20), val(10).
START-OF-SELECTION.
<b> SET PF-STATUS 'STATUS'.</b>
SELECT vbeln
erdat
FROM vbak
UP TO 100 ROWS
INTO TABLE it_one.
IF sy-subrc = 0.
SORT it_one BY vbeln.
SELECT vbeln
posnr
FROM vbap
INTO TABLE it_two
FOR ALL ENTRIES IN it_one
WHERE vbeln = it_one-vbeln.
ENDIF.
LOOP AT it_one.
WRITE:/(10) it_one-vbeln,
(10) it_one-erdat.
ENDLOOP.
AT LINE-SELECTION.
<b>IF sy-lsind = 1.
it_code-okcode = 'FCODE1'.
APPEND it_code.
CLEAR it_code.
it_code-okcode = 'FCODE2'.
APPEND it_code.
CLEAR it_code.
SET PF-STATUS 'STATUS' EXCLUDING IT_CODE.</b> GET CURSOR FIELD fld VALUE val.
IF fld = 'IT_ONE-VBELN'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = val
IMPORTING
output = val.
LOOP AT it_two WHERE vbeln = val.
WRITE:/ it_two-vbeln,
it_two-posnr.
ENDLOOP.
ENDIF.
ENDIF.
AT USER-COMMAND.
<b> CASE sy-ucomm.
WHEN 'BACK1' OR 'CANC1' OR 'EXIT1'.
IF sy-lsind = 2.
SET PF-STATUS 'STATUS' .
SET USER-COMMAND 'BACK'. "this is the trick to go back to first list
ENDIF.
IF sy-lsind = 1.
LEAVE TO SCREEN 0.
ENDIF.</b>
ENDCASE.
Regards
vijay
04-19-2006 5:04 PM
hi,
Do you want to disable the button or completely make it invisibile?
If you want to make invisible, just populate fcode of the button in itab.
case sy-ucomm.
when 'BACK'.
clear : itab[], itab.
itab-fcode = 'BTN1'.
append itab. clear itab.
set pf-status 'ABC' excluding itab.
endcase.
if you want to disable buttons ( gray out the buttons), then you have to make a setting.
double click on 'ABC' ->goto->attributes->push button assignment -> display all -> ok -> activate.
Regards,
Sailaja.
Message was edited by: Sailaja N.L.