2013 Nov 28 7:26 AM
Hi Experts,
I have read certain discussions on the same but it is not getting disabled. Please check the following screenshots:
The requirement is when the user clicks on create button, it should get disable so that duplicate record should not be created.
I have written the following code after all the data in the screen fields gets updated in the database in the PAI 'WHEN CREATE'.
why it does not work? Where I am lacking?
Regards
Mani
2013 Nov 28 7:41 AM
Screen settings made in PAI will not be reflected on screen.
You need to code it in PBO.
You can set a variable in PAI, when a record is created.
PAI.
eg,
if sy-surbc = 0.
messag...
created = 'X'
endif.
In PBO.
if created = 'X'.
loop at screen.
* Screen setting to disable push button.
endloop.
endif.
2013 Nov 28 7:31 AM
2013 Nov 28 7:36 AM
Hi Bhushan,
Please write the loop at screen code in PBO also, it will work just fine.
Regards,
Bhushan
2013 Nov 28 7:41 AM
Screen settings made in PAI will not be reflected on screen.
You need to code it in PBO.
You can set a variable in PAI, when a record is created.
PAI.
eg,
if sy-surbc = 0.
messag...
created = 'X'
endif.
In PBO.
if created = 'X'.
loop at screen.
* Screen setting to disable push button.
endloop.
endif.
2013 Nov 28 8:13 AM
Hi mani,
For making any changes in screen layout you have to code in PBO. (Process Before Output).
you could declare a flag of type char01.
in pai if the button is clicked set the flag to X. also in pbo write as,
IF flag EQ 'X'.
loop at screen.
if screen-name EQ 'CREATE'.
screen-input = 0.
modify screen.
endloop.
ENDIF.
Regards,
sivaganesh
2013 Nov 28 8:36 AM
Hi mani bhushan
Try like this
Data : Flag type C.
CALL SCREEN 9000.
*&---------------------------------------------------------------------*
*& Module STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_9000 OUTPUT.
SET PF-STATUS 'PF_9000'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_9000 INPUT.
CASE sy-ucomm.
when 'REPORT'.
CALL TRANSACTION 'MB5B'.
When 'EXIT'.
Leave TO SCREEN 0.
When 'CREATE'.
FLAG = 'C'.
endcase.
ENDMODULE. " USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
*& Module hide_head OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module hide_head output.
loop at screen .
if flag eq 'C'.
if screen-group1 eq 'G1'.
screen-input = 0.
modify screen.
endif.
ELSE.
if screen-group1 eq 'G1'.
screen-input = 1.
modify screen.
endif.
endif.
ENDLOOP.
endmodule. " hide_head OUTPUT