Skip to Content
author's profile photo
Former Member

Screen Painter - Enter clears all fields

I have 2 input fields in a screen and a table control. When I press the enter key all fields are cleared except the table control values. How to retain the values

PROCESS BEFORE OUTPUT.

  MODULE status_0100.

  MODULE tblcntrl_change_tc_attr.
  LOOP AT   i_items
       INTO wa_items
       WITH CONTROL tblcntrl
       CURSOR tblcntrl-current_line.
  ENDLOOP.

PROCESS AFTER INPUT.

  LOOP AT i_items.
    MODULE tblcntrl_modify.
  ENDLOOP.

  MODULE user_command_0100.

MODULE tblcntrl_change_tc_attr OUTPUT.
  DESCRIBE TABLE i_items LINES tblcntrl-lines.
  tblcntrl-lines = tblcntrl-lines + 10.
ENDMODULE.           

MODULE tblcntrl_modify INPUT.
  MODIFY i_items FROM wa_items INDEX tblcntrl-current_line.
  IF sy-subrc <> 0.
    INSERT wa_items INTO i_items INDEX tblcntrl-current_line.
  ENDIF.
ENDMODULE. 

MODULE user_command_0100 INPUT.

  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'BACK'.   LEAVE PROGRAM.
    WHEN 'EXIT'.   LEAVE PROGRAM.
    WHEN 'CANCEL'. LEAVE PROGRAM.
    WHEN 'CREATE'.
      SET SCREEN 200.
    WHEN OTHERS.   CALL SCREEN 100.
  ENDCASE.

ENDMODULE.   

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Posted on Sep 28, 2007 at 01:25 PM

    in event PROCESS AFTER INPUT you have to specify all the input fields so that the values are transferred from screen to your variables

    currently you have fields of your table control (in the LOOP) but you don't have the two other fields. Just add

    FIELD w_field1.

    FIELD w_field2.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 01:34 PM

    I tried this .. but it does not work.

    PROCESS AFTER INPUT.
    
      FIELD p_vorna.
      FIELD p_bednr.
    
      LOOP AT i_items.
        MODULE tblcntrl_modify.
      ENDLOOP.
    
      MODULE user_command_0100.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 02:24 PM

    The way I solved it is ..

    * All the fields in screen
    DATA:
      p_vorna  TYPE pa0002-vorna,
      p_bednr  TYPE ekpo-bednr,
      p_vstel  TYPE ekpv-vstel,
      p_notes  TYPE pa0002-cname,
      p_ekorg  TYPE ekko-ekorg,
      p_ekgrp  TYPE ekko-ekgrp,
      p_bukrs  TYPE ekko-bukrs,
      p_swerks TYPE ekpo-werks,
      p_rwerks TYPE ekpo-werks.
    
    MODULE user_command_0100 INPUT.
    
      MOVE p_vorna  TO wa_header-vorna.
      MOVE p_bednr  TO wa_header-bednr.
      MOVE p_vstel  TO wa_header-vstel.
      MOVE p_notes  TO wa_header-notes.
      MOVE p_ekorg  TO wa_header-ekorg.
      MOVE p_ekgrp  TO wa_header-ekgrp.
      MOVE p_bukrs  TO wa_header-bukrs.
      MOVE p_swerks TO wa_header-swerks.
      MOVE p_rwerks TO wa_header-rwerks.
    
    MODULE status_0100 OUTPUT.
    
      SET TITLEBAR 'TITLE_0100'.
      SET PF-STATUS 'SCREEN_100'.
    
      MOVE wa_header-vorna  TO p_vorna.
      MOVE wa_header-bednr  TO p_bednr.
      MOVE wa_header-vstel  TO p_vstel.
      MOVE wa_header-notes  TO p_notes.
      MOVE wa_header-ekorg  TO p_ekorg.
      MOVE wa_header-ekgrp  TO p_ekgrp.
      MOVE wa_header-bukrs  TO p_bukrs.
      MOVE wa_header-swerks TO p_swerks.
      MOVE wa_header-rwerks TO p_rwerks.

    Add comment
    10|10000 characters needed characters exceeded