Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem in screen painter

Former Member
0 Likes
524

hello!!!

i have two screens, in screen 1 i manually enter the project_no(input output field) and

press the DISPLAY button to call screen 2. in screen 2, i have drop down list boxes,

input output fields and radio buttons. all these elements are filled with information that are

retrieved from a transparent table zproject_details with project_no as its primary key...

this screen allows changes to be made in the info... thus if i change some value in this screen,

and press the SAVE button, then the change is updated in the table zproject_details...

the problem is, if i select another the value from dropdown list box the table gets updated,

if i select another radio button then also the table gets updated

but when i manually change the value from input output box, table does not change.

if the list boxes are originator and proj_type and if func_code of radio buttons is rad.

in pbo of screen 002.

data: up_originator(35) type c,

up_proj_type(15) type c,

up_radio(1) type c.

in pai of screen 002.

case ok_code.

when 'originator'.

move zproject_details-originator to up_originator.

when 'proj_type'.

move zproject_details-proj_type to up_proj_type.

when 'rad'.

if radio1 = 'x'.

up_radio = 'A'.

clear : radio2.

elseif radio2 = 'x'.

up_radio = 'B'.

clear: radio1.

endif.

when 'save'.

if not up_originator is initial.

update zproject_details set originator = up_originator.

clear up_originator.

endif.

if not up_proj_type is initial.

update zproject_details set proj_type = up_proj_type.

clear up_proj_type.

endif.

if not up_radio is initial.

update zproject_details set radio = up_radio.

clear up_radio.

endif.

endcase.

this is the logic i used, but i cannot do no_days(input output field) as

when 'no_days'.

...

plz help me out...

thx...

1 REPLY 1
Read only

Former Member
0 Likes
350

Hi,

Use below approch (syntax may not be correct as I have typed it in notepad but use it as guide line)

***In screen flow logic

PROCESS AFTER INPUT.
  module cancel at exit-command.
  chain.
    field: zproject_details-originator,
	   zproject_details-proj_type.
    module check_data on chain-request.	   
  endchain.
  
  module user_command_002.

***In abap code

module cancel input.
  leave program.
endmodule.

module check_data input.
  if zproject_details-originator is initial.
    message exxxx "throw error message here
  endif. 

  if zproject_details-proj_type is initial.
    message exxxx "throw error message here
  endif. 	
endmodule.

module user_command_002.
  save_ok = ok_code.  "good practice to save okcode
  clear ok_code.

  case save_ok.
    when 'save' " using constant for fcode here is better 
      perform save_data. "make it moduler instead of writing whole code in case statement
    
  enscase.
endmodule.

form save_data.
 ** do some additional checks if required before saving

 update zproject_details from zproject_details. " update database table here from work area contents
endform.

Regards,

Vishal