Skip to Content
author's profile photo Former Member
Former Member

HELP IN TABLE CONTROL

Hi all,

Iam using the following code to make rows inactive so that its not possible to give input to the table control in one of may screen 9002

IF OK_CODE = 'SAVE'.

loop at cnt_STS-cols into w_cnt_acct.

if w_cnt_acct-screen-group1 = 'TES'.

w_cnt_acct-SCREEN-active = '0'.

modify cnt_STS-cols from w_cnt_acct.

endif.

endloop.

ENDIF.

ACTUALLY I HAVE TWO SCREENS 9001 AND 9002, I PRESS NEW IN SCREEN 9001 ,INORDER TO GO TO SCREEN 9002.

WHEN I SAVE IN SCREEN 9002 THE ABOVE CODE TRIGGERS AND MAKE MAKES THE TABLE CONTROL GREY.

WHEN I GO BACK TO SCREEN 9002 AND COME BACK AGAIN TO SCREEN 9003 ITS STILL GREY.NOW I NEED THE TABLE CONTROL TO ACCEPT MY INPUTS .ITS ONLY WHEN I SAVE EVERYTHING SHOULD TURN GREY OTHERWISE IT SHOULD BE NORMAL/

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 02, 2006 at 02:31 PM

    Hi,

    Change the loop like this,

    loop at cnt_STS-cols into w_cnt_acct.

    if w_cnt_acct-screen-group1 = 'TES' and ok_code = 'SAVE.

    w_cnt_acct-SCREEN-active = '0'.

    elseif w_cnt_acct-screen-group1 = 'TES' and ok_code NE 'SAVE'.

    w_cnt_acct-SCREEN-active = '1'.

    endif.

    modify cnt_STS-cols from w_cnt_acct.

    endloop.

    Whenever the ok_code = SAVE u r making the screen-active = '0' at the sametime u have to make the screen-active = '1' when the ok_code NE 'SAVE'.

    Regards,

    Prakash.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 02, 2006 at 02:34 PM

    hi Venki,

    loop at cnt_STS-cols into w_cnt_acct.
     if ok_code = 'SAVE and w_cnt_acct-screen-group1 = 'TES'.
      w_cnt_acct-SCREEN-active = '0'.
     elseif ok_code = 'XYZ' and w_cnt_acct-screen-group1 = 'TES'.
      w_cnt_acct-SCREEN-active = '1'.
     endif.
     //modify your screen
     modify cnt_STS-cols from w_cnt_acct.
    endloop.

    ya, instead of active, use input.

    Regards

    Richa.

    Message was edited by: Richa Singh

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi richa,

      i guess screen -active is not the right thing to use in here.

      Rich ,remember u gave gave ur email id to me. I have emailed you couple of times. Could you give ur email which you check regularly.

      Venki use like this

      if ok_code eq 'SAVE'.

      loop at cnt_ABC-cols into w_cnt_acct.

      if w_cnt_acct-screen-group1 = 'SAV'.

      w_cnt_acct-SCREEN-input = '0'.

      modify cnt_ABC-cols from w_cnt_acct.

      endif.

      endloop.

      else.

      loop at cnt_ABC-cols into w_cnt_acct.

      if w_cnt_acct-screen-group1 = 'SAV'.

      w_cnt_acct-SCREEN-input = '1'.

      modify cnt_ABC-cols from w_cnt_acct.

      endif.

      endloop.

      endif.

      THANKS

      kAJOL

  • author's profile photo Former Member
    Former Member
    Posted on Oct 02, 2006 at 03:29 PM

    Hi,

    in PBO of screen 9002 write below code

    IF OK_CODE <> 'SAVE'.

    loop at cnt_STS-cols into w_cnt_acct.

    if w_cnt_acct-screen-group1 = 'TES'.

    w_cnt_acct-SCREEN-active = '1'.

    endloop.

    endif.

    regards

    amole

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 02, 2006 at 03:30 PM

    try this sample code

    SCREEN 100

    PROCESS BEFORE OUTPUT.

    MODULE STATUS_0100.

    LOOP WITH CONTROL TCTRL_USERDATA.

    MODULE DISPLAY_USERDATA.

    ENDLOOP.

    MODULE AFTER_LOOPING.

    *

    PROCESS AFTER INPUT.

    MODULE USER_COMMAND_0100.

    LOOP WITH CONTROL TCTRL_USERDATA.

    MODULE EXTRACT_USERDATA.

    ENDLOOP.

    MODULE USER_COMMAND_0100_AFTER_LOOP.

    -


    ZTBLDTOP

    &----


    *& Include ZTBLDEMO Report ZTBLDEMO *

    *& *

    &----


    REPORT ZTBLDEMO MESSAGE-ID AT .

    DATA: BEGIN OF RECORD,

    NAME(30),

    PHONE(20),

    EMAIL(50),

    END OF RECORD.

    DATA: ITAB_PHONELIST LIKE RECORD OCCURS 0 WITH HEADER LINE.

    CONTROLS: TCTRL_PHONELIST TYPE TABLEVIEW USING SCREEN 100.

    DATA: SAVE_CODE(4),

    OK_CODE(4),

    FILENAME LIKE RLGRAP-FILENAME,

    CONFIRMATION,

    SELECTION.

    -


    ZTBLDEMO

    &----


    *& Report ZUSRDATA *

    *& *

    &----


    *& *

    *& *

    &----


    INCLUDE ZTBLDTOP. " global Data

    • INCLUDE ZUSRDO01. " PBO-Modules *

    • INCLUDE ZUSRDI01. " PAI-Modules *

    • INCLUDE ZUSRDF01. " FORM-Routines *

    &----


    *& Module STATUS_0100 OUTPUT

    &----


    • text

    ----


    MODULE STATUS_0100 OUTPUT.

    SET PF-STATUS 'FOR100'.

    SET TITLEBAR '100'.

    ENDMODULE. " STATUS_0100 OUTPUT

    &----


    *& Module DISPLAY_USERDATA OUTPUT

    &----


    • text

    ----


    MODULE DISPLAY_USERDATA OUTPUT.

    READ TABLE ITAB_PHONELIST INDEX TCTRL_PHONELIST-CURRENT_LINE.

    IF SY-SUBRC EQ 0.

    RECORD-NAME = ITAB_PHONELIST-NAME.

    RECORD-PHONE = ITAB_PHONELIST-PHONE.

    RECORD-EMAIL = ITAB_PHONELIST-EMAIL.

    ELSE.

    EXIT FROM STEP-LOOP.

    ENDIF.

    ENDMODULE. " DISPLAY_USERDATA OUTPUT

    &----


    *& Module USER_COMMAND_0100 INPUT

    &----


    • text

    ----


    MODULE USER_COMMAND_0100 INPUT.

    SAVE_CODE = OK_CODE.

    CLEAR OK_CODE.

    CASE SAVE_CODE.

    WHEN 'BACK'.

    CALL FUNCTION 'COPO_POPUP_TO_GOON'

    EXPORTING

    TEXTLINE1 = 'Any modifications will be lost!'

    TEXTLINE2 = 'Are you sure?'

    TITEL = 'Exit The Program'

    IMPORTING

    answer = confirmation.

    if confirmation = 'G'.

    LEAVE PROGRAM.

    ENDIF.

    WHEN 'DELE'.

    CALL FUNCTION 'COPO_POPUP_TO_GOON'

    EXPORTING

    TEXTLINE1 = 'Selected rows will be deleted!'

    TEXTLINE2 = 'Are you sure?'

    TITEL = 'Delete rows'

    IMPORTING

    answer = confirmation.

    IF CONFIRMATION = 'G'.

    REFRESH ITAB_PHONELIST.

    CLEAR ITAB_PHONELIST.

    ENDIF.

    WHEN 'SAVE'.

    REFRESH ITAB_PHONELIST.

    CLEAR ITAB_PHONELIST.

    WHEN 'APND'.

    REFRESH ITAB_PHONELIST.

    CLEAR ITAB_PHONELIST.

    WHEN 'READ'.

    IF NOT FILENAME IS INITIAL.

    CALL FUNCTION 'COPO_POPUP_TO_GOON'

    EXPORTING

    TEXTLINE1 = 'Any modifications will be lost!'

    TEXTLINE2 = 'Are you sure?'

    TITEL = 'Read Another File'

    IMPORTING

    answer = confirmation.

    ENDIF.

    if confirmation = 'G' or

    FILENAME IS INITIAL.

    CALL FUNCTION 'UPLOAD'

    EXPORTING

    FILENAME =

    'c:\temp\fonelist.txt'

    IMPORTING

    ACT_FILENAME = FILENAME

    TABLES

    DATA_TAB = ITAB_PHONELIST.

    ENDIF.

    ENDCASE.

    ENDMODULE. " USER_COMMAND_0100 INPUT

    &----


    *& Module EXTRACT_USERDATA INPUT

    &----


    • text

    ----


    MODULE EXTRACT_USERDATA INPUT.

    CASE SAVE_CODE.

    WHEN 'DELE'.

    IF SELECTION IS INITIAL AND

    confirmation = 'G'.

    PERFORM TRANSFER.

    ENDIF.

    WHEN 'SAVE'.

    PERFORM TRANSFER.

    WHEN 'APND'.

    PERFORM TRANSFER.

    ENDCASE.

    ENDMODULE. " EXTRACT_USERDATA INPUT

    &----


    *& Form TRANSFER

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM TRANSFER.

    CLEAR ITAB_PHONELIST.

    ITAB_PHONELIST-NAME = RECORD-NAME.

    ITAB_PHONELIST-PHONE = RECORD-PHONE.

    ITAB_PHONELIST-EMAIL = RECORD-EMAIL.

    APPEND ITAB_PHONELIST.

    ENDFORM. " TRANSFER

    &----


    *& Module USER_COMMAND_0100_AFTER_LOOP INPUT

    &----


    • text

    ----


    MODULE USER_COMMAND_0100_AFTER_LOOP INPUT.

    CASE SAVE_CODE.

    WHEN 'SAVE'.

    CALL FUNCTION 'DOWNLOAD'

    EXPORTING

    FILENAME = FILENAME

    TABLES

    DATA_TAB = ITAB_PHONELIST.

    WHEN 'APND'.

    CLEAR ITAB_PHONELIST. " a blank row being created.

    APPEND ITAB_PHONELIST. " a blank row being added.

    ENDCASE.

    ENDMODULE. " USER_COMMAND_0100_AFTER_LOOP INPUT

    -


    Field List

    -


    GUI Status

    -


    Objects

    -


    Table Attributes

    -


    Table Columns

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.