‎2009 Aug 07 10:45 AM
Hai experts,
i have following issues in module pool program . They are
1. I have 3 push buttons in my screen 1 . They are " Create , Display , Change ", the issue is , when i am clicking Create button remaining two buttons should be inactive . How can I do it ?
2. I have created two transactions ( Create , Display ) , whenever I use transaction either Create or Dispaly , the name of the transaction should be dispalyed in the top of the screen .
example: Purchase Order ZPOCREATE.
Thanks and regards,
Mani.
‎2009 Aug 07 12:18 PM
Hi,
Go through the following code
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUSMAIN'.
if sy-tcode eq 'ZPURCR_G13'.
set titlebar 'CREATETITLE'.
elseif sy-tcode eq 'ZPURCHG_G13'.
set titlebar 'CHANGETITLE'.
elseif sy-tcode eq 'ZPURDIS_G13'.
set titlebar 'DISPLAYTITLE'.
endif.
if sy-tcode eq 'ZPURCR_G13'.
loop at screen.
if screen-name eq 'CHANGE'.
screen-input = '0'.
modify screen.
elseif screen-name eq 'DISPLAY'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
if sy-tcode eq 'ZPURCHG_G13'.
loop at screen.
if screen-name eq 'CREATE'.
screen-input = '0'.
modify screen.
elseif screen-name eq 'DISPLAY'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
if sy-tcode eq 'ZPURDIS_G13'.
loop at screen.
if screen-name eq 'CREATE'.
screen-input = '0'.
modify screen.
elseif screen-name eq 'CHANGE'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
ENDMODULE. " STATUS_0100 OUTPUT
‎2009 Aug 07 10:54 AM
Hi,
To display the transaction name set it in the titlebar using SET TITLEBAR in the PBO of teh screen.
To disable a buttuon; loop on the screen table and put screen-input = 0.
loop at screen.
case screen-name .
when 'TEST1' . "button name
screen-input = '0'.
modify screen.
endcase.
endloop.Regards,
Ankur Parab
Edited by: Ankur Parab on Aug 7, 2009 3:31 PM
‎2009 Aug 07 11:09 AM
Where do you have your buttons, in application toolbar? If so then use this logic
DATA fcode TYPE TABLE OF sy-ucomm.
"PAI module
case sy-ucomm.
when 'FC_CREATE'. "if create button was selected (function code for create button)
"then hide all the others
append 'FC_CHANGE' to fcode.
append 'FC_DISPLAY' to fcode.
when 'FC_DISPLAY.
"then hide CHANGE and CREATE
when 'FC_CHANGE' .
"same here.
endcase.
"PBO module
set pf-status 'YOUR_STATUS' excluding fcode. "hide all buttons which are in FCODE table
For Title you can use
"in PBO module
SET TITLEBAR title.
Regards
Marcin
‎2009 Aug 07 11:27 AM
Hi,
Add the the below code in the PBO of the First screen, this should be the first module after status & title bar.
In Main screen PBO
PROCESS BEFORE OUTPUT.
MODULE status_2000.
*&---------------------------------------------------------------------*
*& Module status_2000 OUTPUT
*&---------------------------------------------------------------------*
* " Triggering Transactions here.
*----------------------------------------------------------------------*
MODULE status_2000 OUTPUT.
CCASE sy-tcode.
WHEN 'ZCREATE'.
PERFORM f_title_bar. " ----- Set Title
LOOP AT SCREEN.
CASE screen-name.
WHEN 'CREATE'.
screen-input = 1.
MODIFY SCREEN.
WHEN 'CHANGE'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'DISPLAY'.
screen-input = 0.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
WHEN 'ZCHANGE'.
PERFORM f_title_bar. " ----- Set Title
LOOP AT SCREEN.
CASE screen-name.
WHEN 'CREATE'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'CHANGE'.
screen-input = 1.
MODIFY SCREEN.
WHEN 'DISPLAY'.
screen-input = 0.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
WHEN 'ZDISPLAY'.
PERFORM f_title_bar. " ----- Set Title
LOOP AT SCREEN.
CASE screen-name.
WHEN 'CREATE'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'CHANGE'.
screen-input = 0.
MODIFY SCREEN.
WHEN 'DISPLAY'.
screen-input = 1.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
ENDCASE.
ENDMODULE. " status_2000 OUTPUTRegards
Bala Krishna
‎2009 Aug 07 12:18 PM
Hi,
Go through the following code
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUSMAIN'.
if sy-tcode eq 'ZPURCR_G13'.
set titlebar 'CREATETITLE'.
elseif sy-tcode eq 'ZPURCHG_G13'.
set titlebar 'CHANGETITLE'.
elseif sy-tcode eq 'ZPURDIS_G13'.
set titlebar 'DISPLAYTITLE'.
endif.
if sy-tcode eq 'ZPURCR_G13'.
loop at screen.
if screen-name eq 'CHANGE'.
screen-input = '0'.
modify screen.
elseif screen-name eq 'DISPLAY'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
if sy-tcode eq 'ZPURCHG_G13'.
loop at screen.
if screen-name eq 'CREATE'.
screen-input = '0'.
modify screen.
elseif screen-name eq 'DISPLAY'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
if sy-tcode eq 'ZPURDIS_G13'.
loop at screen.
if screen-name eq 'CREATE'.
screen-input = '0'.
modify screen.
elseif screen-name eq 'CHANGE'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
ENDMODULE. " STATUS_0100 OUTPUT
‎2009 Aug 07 1:46 PM
‎2009 Aug 17 2:27 PM
loop at screen.
case sy-tcode.
when 'ZGP2_1'.
set titlebar 'T001' with 'Create'.
set pf-status 'PF_1'.
if screen-group1 = 'CH' or screen-group1 = 'DI'.
screen-input = 0.
endif.
when 'ZGP2_2'.
set titlebar 'T001' with 'Change'.
set pf-status 'PF_1'.
if screen-group1 = 'CR' or screen-group1 = 'DI'.
screen-input = 0.
endif.
when 'ZGP2_3'.
set titlebar 'T001' with 'DISPLAY'.
set pf-status 'PF_1' excluding it_excl.
if screen-group1 = 'CH' or screen-group1 = 'CR'.
screen-input = 0.
endif.
endcase.
modify screen.
endloop.
hope it will help you.
regards,
Shweta.