‎2007 Jul 18 7:31 AM
freinds
i had a standard toolbar which had save button
and application toolbar which had add button
wen i click on add then only save button is shown(this is done i m sending u code for that)
<b>but now i want that wen record saved then save button again disables till we click again add button</b>
(u send me changes or additions for above bold line requiremnt
code
in PBO
if flag is initial.
SET PF-STATUS 'EMPMASTER' excluding 'SA'.
else.
SET PF-STATUS 'EMPMASTER'.
ENDIF.
in PAI
CASE SY-UCOMM.
WHEN 'A'.
*break-point.
perform yn_popup using 'AD' 'Do You Want To Add ?'.
if user_answer = '1'.
MESSAGE I000.
perform max_emp_no.
PERFORM INSERTION.
endif.
flag = 'X'.
now i want
when
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
endif.
message e001.
endif.
again save button 'SA' should disbale
Please Help me out
Thanx
With Best Regards
Ruby
‎2007 Jul 18 7:33 AM
Hi,
Check the change in <b>blod.</b>
in PBO
if flag is initial.
SET PF-STATUS 'EMPMASTER' excluding 'SA'.
else.
SET PF-STATUS 'EMPMASTER'.
ENDIF.
in PAI
CASE SY-UCOMM.
WHEN 'A'.
*break-point.
perform yn_popup using 'AD' 'Do You Want To Add ?'.
if user_answer = '1'.
MESSAGE I000.
perform max_emp_no.
PERFORM INSERTION.
endif.
flag = 'X'.
now i want
when
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
<b>clear flag.</b>
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
endif.
message e001.
endif.
Regards,
Sesh
‎2007 Jul 18 7:35 AM
f flag is initial.
SET PF-STATUS 'EMPMASTER' excluding 'SA'.
else.
SET PF-STATUS 'EMPMASTER'.
ENDIF.
So...If Flag is initial the u are making the button SA as disabled.Hope I am correct.
After processing the SA Button, Then make the field flag as initial again.
‎2007 Jul 18 7:47 AM
How?
Tell the syntax to change flag as intial
an friends clear flag or flag2 options does not work out
i tried all the above solutions
Please reply me another if u know
With Best Regards
Ruby
‎2007 Jul 18 7:53 AM
Hi Rubi,
Tell me onething. What is this 'SA'.
IS it the fxn code for Save button.
Fi yes
Create
data :it_ucomm TYPE STANDARD TABLE OF sy-ucomm,
wa_ucomm type sy-ucomm.
APPEND 'SA' to it_ucomm.
then set pf-status excluding it_ucomm.
See it helps.
regards
Azad.
‎2007 Jul 18 8:40 AM
friend
i had done that
and after that i tried code given by u above
so plz tell me how to co forward
'SA' is standard toolbar and SA is function code
Please answer the solution for sure
Me waiting
With Best Regards
Ruby
‎2007 Jul 18 8:46 AM
Hi Ruby,
Now you got the fxn code in it_itucomm.
now try to put this code.
DATA: flag2 TYPE C default 'X'.
in PBO
IF flag2 = 'X'
SET PF-STATUS 'EMPMASTER' EXCLUDING it_ucomm.
Else.
SET PF-STATUS 'EMPMASTER' .
ENDIF.
in PAI
CASE SY-UCOMM.
WHEN 'A'.
*break-point.
CLEAR flag2.
perform yn_popup using 'AD' 'Do You Want To Add ?'.
if user_answer = '1'.
MESSAGE I000.
perform max_emp_no.
PERFORM INSERTION.
endif.
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
endif.
flag2 = X.
message e001.
endif.
Hope this will solve your probelm.
IF it doesnt work. Give me your email-id. I will send you sample code Ruby.
Thanks & Regards,
Azad.
‎2007 Jul 18 8:57 AM
FRIEND
Now see
<b>top declaration****************</b>
data: flag2 type c .
data :it_ucomm TYPE STANDARD TABLE OF sy-ucomm,
wa_ucomm type sy-ucomm.
<b>PBO declaration**************</b>
module STATUS_0001 output.
APPEND 'SA' to it_ucomm.
IF flag2 = 'X'.
SET PF-STATUS 'EMPMASTER' EXCLUDING it_ucomm.
Else.
SET PF-STATUS 'EMPMASTER' .
ENDIF.
endmodule. " STATUS_0001 OUTPUT
<b>PAI************</b>
module USER_COMMAND_0001 input.
CASE SY-UCOMM.
WHEN 'A'.
*break-point.
CLEAR flag2.
perform yn_popup using 'AD' 'Do You Want To Add ?'.
if user_answer = '1'.
MESSAGE I000.
perform max_emp_no.
PERFORM INSERTION.
endif.
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
endif.
flag2 = 'X'.
message e001.
endif.
endmodule. " USER_COMMAND_0001 INPUT
Now see the full above code
That is the final i tried but its not diabling the SA after saving data
Hope now u got and can give changes in the above code
With Best Regards
Rubi
‎2007 Jul 18 9:03 AM
Hey Ruby,
see in bold the changes.
top declaration****************
data: flag2 type c <b>DEFAULT 'X'</b>.
data :it_ucomm TYPE STANDARD TABLE OF sy-ucomm,
wa_ucomm type sy-ucomm.
PBO declaration**************
module STATUS_0001 output.
IF flag2 = 'X'.
<b>REFRESH it_ucomm.</b>
<b>APPEND 'SA' to it_ucomm.</b>
SET PF-STATUS 'EMPMASTER' EXCLUDING it_ucomm.
Else.
SET PF-STATUS 'EMPMASTER' .
ENDIF.
endmodule. " STATUS_0001 OUTPUT
PAI************
module USER_COMMAND_0001 input.
CASE SY-UCOMM.
WHEN 'A'.
*break-point.
CLEAR flag2.
perform yn_popup using 'AD' 'Do You Want To Add ?'.
if user_answer = '1'.
MESSAGE I000.
perform max_emp_no.
PERFORM INSERTION.
endif.
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
endif.
flag2 = 'X'.
message e001.
endif.
endmodule. " USER_COMMAND_0001 INPUT
Regards,
Azad.
IF still there is any probelm. Tell me exactly wats happening.
‎2007 Jul 18 9:13 AM
when i do
data: flag2 type c DEFAULT 'X'..
then its error
",", "VALUE ...", "LENGTH ...", "DECIMALS ...", or "VALUE IS INITIAL"
expected after "C".
and if i remove default and run the program then
SA does not disable in the initial screen
With Best regards
Rubi
‎2007 Jul 18 9:36 AM
Hey Ruby,
data: flag2 type c VALUE 'X'.
Use it like this.
Regards
Azad.
‎2007 Jul 18 9:46 AM
********Top Declaration
data: flag2 type c value 'X'.
data :it_ucomm TYPE STANDARD TABLE OF sy-ucomm,
wa_ucomm type sy-ucomm.
*********PBO
if flag2 = 'X'.
refresh it_ucomm.
append 'SA' to it_ucomm.
set pf-status 'EMPMASTER' excluding it_ucomm.
else.
set pf-status 'EMPMASTER' .
endif.
********PAI
module user_command_0001 input.
case sy-ucomm.
when 'A'.
clear flag2.
perform yn_popup using 'AD' 'Do You Want To Add ?'.
if user_answer = '1'.
message i000.
perform max_emp_no.
perform insertion.
endif.
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
endif.
flag2 = 'X'.
message e001.
endif.
Now also same question as my first post
Save button is disabled at the start but does not disbaled after records save in database
Now no error in program and i m sending u full code
Now tell wat to do
My GOD is it so tuff
Ohhhhhhhh
Please reply the solution
With Best Regards
Ruby
‎2007 Jul 18 9:53 AM
Hey
tell me onething in this code.
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
endif.
flag2 = 'X'.
message e001.
where r u updating the records. Try to sset this flag2 = X after updation.
Regards
Azad.
‎2007 Jul 18 7:36 AM
Hi ruby
Do it like this,
DATA: flag2 TYPE c.
in PBO
IF flag2 = 'X'
SET PF-STATUS 'EMPMASTER'.
Else.
SET PF-STATUS 'EMPMASTER' excluding 'SA'.
ENDIF.
in PAI
CASE SY-UCOMM.
WHEN 'A'.
*break-point.
CLEAR flag2.
perform yn_popup using 'AD' 'Do You Want To Add ?'.
if user_answer = '1'.
MESSAGE I000.
perform max_emp_no.
PERFORM INSERTION.
endif.
flag = 'X'.
now i want
when
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
endif.
flag2 = X.
message e001.
endif.
Hope it will work.,
Regards
Azad.
If ne query reply me back.
‎2007 Jul 18 7:37 AM
See the code
code
in PBO
if flag is initial.
SET PF-STATUS 'EMPMASTER' excluding 'SA'.
else.
SET PF-STATUS 'EMPMASTER'.
ENDIF.
in PAI
CASE SY-UCOMM.
WHEN 'A'.
*break-point.
perform yn_popup using 'AD' 'Do You Want To Add ?'.
if user_answer = '1'.
MESSAGE I000.
perform max_emp_no.
PERFORM INSERTION.
endif.
flag = 'X'.
now i want
when
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
<b>clear flag.</b>
endif.
message e001.
endif.
‎2007 Jul 18 7:39 AM
Hi,
Change like this
when 'SA'.
perform yn_popup using 'SA' 'Do You Want To Save ?'.
if user_answer eq '1'.
perform chck_required_fields.
if req_fields eq '1'.
modify zhr_per_m .
perform free_all_fields.
<b>clear flag.</b> " if the saving is succesful it will disable the save button.
endif.
message e001.
endif.