Module pool - table control - update ztable

hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
pd: sorry for my bad english
this is my code:
TOP:
PROGRAM  z_pp_lote_etiquetas MESSAGE-ID zz.
TABLES:zc2p_lote_etique,
       zc2p_lider_modul.
DATA: ok_code LIKE sy-ucomm.
DATA save_ok LIKE sy-ucomm.
* internal table
DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
**************Workarea
DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
DATA: sel.
DATA: MARK.
DATA: init.
DATA:  col TYPE scxtab_column.
DATA: lines TYPE i.
* Variable Declaration
DATA : flg, "Flag to set the change mode
ln TYPE i. "No. of records
* Table Control Declartion.
CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
**PROCESS BEFORE OUTPUT INCLUDE **
*&  Include           Z_PP_LOTE_ETIQUETAS_O01
*& Module set_status OUTPUT
* Setting the GUI status
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
  SET TITLEBAR 'Z_PP_LOT_ETIQ'.
ENDMODULE. " set_status OUTPUT screen 100
*  MODULE status_0101 OUTPUT
* Setting the GUI status
MODULE status_0101 OUTPUT.
  SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
  SET TITLEBAR 'Z_PP_LOT_ETIQ'.
* Data retreving
  if init is INITIAL.
  select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
    DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
    zc2p_lider_crtl-lines = ln + 10.
    init = 'X'.
endif.
ENDMODULE.                    "status_0101 OUTPUT
module change_sdyn_conn output.
* you can change the content of current table control line via
* sdyn_conn
  READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
endmodule.                             " FILL_TABLE_CONTROL  OUTPUT
MODULE set_screen_fields OUTPUT.
LOOP AT SCREEN.
IF flg IS INITIAL.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
*ENDIF.
* Modifying the screen after making changes
MODIFY SCREEN.
ENDLOOP.
ENDMODULE. " set_screen_fields OUTPUT
PROCESS AFTER INPUT INCLUDE.
*  MODULE USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
  CASE ok_code.
    WHEN 'LIDM'.
      CALL SCREEN 101.
    WHEN 'CANC'.
      LEAVE PROGRAM.
    WHEN 'BACK'.
      LEAVE PROGRAM.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                    "USER_COMMAND_0100 INPUT
*  MODULE USER_COMMAND_0101 INPUT
MODULE user_command_0101 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'SORT'.
      DATA: fldname(100),help(100).
      READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
      SPLIT col-screen-name AT '-' INTO help fldname.
      SORT it_zc2p_lider_modul BY (fldname).
    WHEN 'CHANGE'.
* Setting the flag to make the table control in editable mode[excluding
* primary key].
      flg = 'Y'.
    WHEN 'BACK'.
      CALL SCREEN 100.
      LEAVE SCREEN.
    WHEN 'CANCEL'.
      LEAVE PROGRAM.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
    WHEN 'SAVE'.
      MODIFY  zc2p_lider_modul FROM it_zc2p_lider_modul.
      COMMIT WORK.
  ENDCASE.
ENDMODULE.                    "USER_COMMAND_0101 INPUT
*  MODULE read_table_control INPUT
MODULE read_table_control INPUT.
* Check input values
  IF mark = 'X' AND save_ok = 'DELETE'.
    DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
    DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
  ENDIF.
ENDMODULE.                             " READ_TABLE_CONTROL  INPUT
Screen Flow Logic 100
PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE user_command_0100.
Screen Flow Logic 101.
PROCESS BEFORE OUTPUT.
  MODULE status_0101.
  LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
zc2p_lider_crtl.
* Dynamic screen modifications
    MODULE set_screen_fields.
    MODULE change_sdyn_conn.
  ENDLOOP.
PROCESS AFTER INPUT.
  MODULE user_command_0101.
  LOOP AT it_zc2p_lider_modul.
    MODULE read_table_control.
  ENDLOOP.
i hope somebody can help for what i missing here  thanks

>
Sanjeev Kumar wrote:
> Hello Edgar,
>
> Problem seems to be there in the flow logic of 101
>
>
> PROCESS BEFORE OUTPUT.
>   MODULE status_0101.
>   LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
> zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
> * Dynamic screen modifications
>     MODULE set_screen_fields.
>     MODULE change_sdyn_conn.
>   ENDLOOP.
> *
> PROCESS AFTER INPUT.
>   MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.

>   LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
>     MODULE read_table_control.
>   ENDLOOP.
>
>
>
> With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
>
> Try these changes and I hope it will work.
>
> Thanks
> Sanjeev
i do the firts advice but the second one i get syntax error :
my code :
PROCESS AFTER INPUT.
  LOOP  at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
    MODULE read_table_control.
  ENDLOOP.
   MODULE user_command_0101.
error :
In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP     
AT".

Similar Messages

  • How can i decleare select-options in module pool table control?

    Hi everybody!!
    Can anyone tell me how can I decleare select-options in module pool table control screen?. I have declared it in a screen with a table control but a dump is triggered due to an error when generating the selection screen.
    Regards...

    My suggestion will be try to use fm
        call function 'FREE_SELECTIONS_DIALOG'
    Please search this forum you can find lot of threads related to this.

  • Dynamic text in module pool table control

    Hi ,
    Can we have dynamic header text in module pool table control. Like dynamic header text in ALV report.
    Thanks,
    Prem.

    Hi,
    Populate an internal table with the header text that you want.
    Replace the headers with I/O fields.
    Populate the Headers in the PBO.

  • Module Pool - Table Control - Data not getting displayed in Control

    Hi,
    I have a table contol in my module pool program. In my processing I am filling an internal table & then in my PBO I am linking the internal table to table control. The issue is that even though the internal table is getting filled correctly (found through debugging), the data is not getting populated in table control. Nothing is populated on screen. I am writing part of code below
    Declaration:
    Types: begin of ty_control,
            SELECTED TYPE C,
            TEXT TYPE DPR_CAUSE_T-TEXT,
          end of ty_control.
    CONTROLS :  TBL_CONT TYPE TABLEVIEW USING SCREEN '9001'.
    DATA:       lt_table_cont type TABLE OF ty_control with header line.
    Fields in TBL_CONT:
       TBL_CONT-SELECTED
      TBL_CONT-TEXT
    PBO Flow Logic:
      MODULE STATUS_9001.
    MODULE fill_data.
      LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.
      ENDLOOP.
    PAI Flow Logic:
    Loop at lt_table_cont.
       MODULE UPDATE_DATA.
    endloop.
    MODULE USER_COMMAND_9001.
    PLZ let me know what might be the problem. I have been trying to figure out but cant.
    Thanks.

    Hi Sonali,
               When ever you need to do anything with the table control, i mean if u want to display data in table control or you want to validate the data entered in table control Should be done within Loop and Endloop.(PBO or PAI's which ever is appropriate)
    Here the data is not bieng displayed in ur table control because you have not used the MODULE fill_data  between
    LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.
    ENDLOOP.
    so do it like this
    LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.
    MODULE fill_data 
    ENDLOOP.
    this will solve your problem.
    Regards,
    Syed

  • Module Pool table controle row level prob

    Hi Experts,
    I am working in a module pool program where in table controle  i want a perticular row should become in display mode if a specific field is NE SPACE. is it possible if possible than please sugest me how.
    Thanks and Regards,
    D Tarun Kumar

    In this case all the rows will be in display mode
    Exactly My Requirement I am describing  with example
    Suppose in table control I have three Records and the first field is main field which is if initial than the row should in change mode otherwise is should be in display mode.
    Field1          Field2          Field3          Field4          Field5
    1abc2          1abc3          1abc4          1abc5          Record 1
    2xyz1          2xyz2          2xyz3          2xyz4          2xyz5          Record 2
    3pqr2          3pqr3          3pqr4          3pqr5          Record 3
    So here the second rowu2019s first field is not initial so I need here in table control the second row should be in display mode and next first  and second row should be in change mode.
    Now You tell me is it possible or not if possible than please suggest me what I have to do
    Thanks & regards,
    D Tarun Kumar
    Edited by: Devalla T Kumar on Oct 24, 2009 9:17 AM

  • Strange Syntax Error in module pool table control........

    Hi Techies ,
    In module pool am not able to validate the checkbook field that i have included in the table control screen .
    i was able to pass the other field defined in the same structure where checkbox field is declared .

    Hi MAX and Glen ,
    Thanks for ur answers .
    i was not the one developing and i didnt had much touch in TBCL.
    Anyways issue resolved , it was sitting outside of TBCL hence i deleted and created new and included the CHK .
    now its working .
    Positive and quick gestures from you both .

  • What is the use of table control in bdc is it same in module pool table con

    Hi,
    What is the use of table control in bdc is it same in module pool table control?
    regards
    eswar

    Hi,
    Table control means it contains as table and it will scroll in vertical and horizontal.
    In module pool by using screen we can create new table control.
    But  BDC table control means here we can populate the data into the table control.
    i.e.if you take VA01 for sales order creation in the belwo of VA01 screen there is table control for the filling of material details so here we will write the code to populate the data into the table control screen.
    Thanks and regards,
    shyla

  • Function module for table control

    Hi experts,
    I am creating the BDC program, In that I need to select the particular item from the table control say for example item 0010 or 0020 based on the input file and need to process from there.
    Is there any function module to select the particular item by passing item no say 0010 or 0020.
    Thanks in advance
    sai

    Hi
    I suppose there is no function module for table control.
    below solution might be useful to you.
    1) Do BDC recording for the table control with each condition you would like to incorporate in your program.
    2) copy the code of Table Control recording in your program and place the code in Loop of internal table.
    3) based on the condition  call the respective BDC recording of the table control
    4) By the above steps  you can manage the table control based on the condition.
    Regards
    Santosh Kumaar.M

  • Module Pool (tabstrip control Error :  )

    I am trying to activate tabstrip control in module pool but error is coming like no sub screen is assigned to tabstrip pushbutton
    tab12.
    my main screen is : 0221
    flow logic for 0221 is below :
    PROCESS BEFORE OUTPUT.
    CALL SUBSCREEN SUB1 INCLUDING SY-REPID '0321'.
    CALL SUBSCREEN SUB2 INCLUDING SY-REPID '0322'.
    PROCESS AFTER INPUT.
    CALL SUBSCREEN SUB1.
    CALL SUBSCREEN SUB2.
    MODULE USER_COMMAND_0221.
    and 0321 and 0322 is subscreen and i also gave ref field sub1 and sub2 .
    can you plz help me to solve the problem ?

    Hi,
    yes i created sub screen. i am going to explain what i have done .
    step : i created screen 200 (i choose subscreen)and inside 200 i put  tabstripcontrol then in tab1 i gave ref field sub1 and tab2 i gave ref field sub2 and fatch code ic1 and ic2.
    and then i created screen 221 and 222.
    inside 200 flow logic i wrote below code but still its giving me same error.
    PROCESS BEFORE OUTPUT.
    CALL SUBSCREEN SUB1 INCLUDING SY-REPID '0221'.
    CALL SUBSCREEN SUB2 INCLUDING SY-REPID '0222'.
    PROCESS AFTER INPUT.
    CALL SUBSCREEN SUB1.
    CALL SUBSCREEN SUB2.
    MODULE USER_COMMAND_0221.
    i dont know is it required to make any normal screen .
    please try to give me ans as soon as possible.

  • Module pool-Custom controls

    Hi,
         Cany any one tell me with example how we will use the customccontrols in module pool program..Why it is used

    I got answer, i am using same editor for displaying all the custom controls.
    i.e. was the problem.
    anyway Thanks for looking into this issue.

  • Table control updation to  database table

    hi
    iam using a table control concept where i have used the internal table and database table as similar,,,,
    now when i give the statement as
    modify <it_name> from source
    only internal table gettting reflected not the database table
    what can be done here?? suggestion and advice appreciated
    thanks

    Use MODIFY <DB_TABLE> from table <IT_TABLE>.

  • Module pool + Tabe control

    I have a Table control where i have certain field which is editable.Now i need to check which row i have changed.Where can i get the particular row number.

    Hi Pankaj,
    It is possible..
    If Tab_control is the name of the table control variable, then
    Tab_control-current_line will give you the current line which is getting edited.
    Regards,
    Amit.

  • Module pool immediate value update

    Hi,
    I need to populate a value for a field automatically when the user inputs the date of another field.
    I am able to achieve this if I press ENTER, so that PBO triggers and I can populate the other field with the required value.
    Suggest me a solution so that without pressing ENTER I need to achieve the scenario.

    Hi
    Please find below code.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR XXXX " first field
      DATA  :it_dynpread TYPE TABLE OF dynpread,
             wa_dynpread TYPE  dynpread.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname     = sy-repid
          dynumb     = sy-dynnr
          request    = 'A'
        TABLES
          dynpfields = it_dynpread.
      READ TABLE it_dynpread INTO wa_dynpread WITH KEY fieldname = 'S_CAT-LOW'.
      yyyyyy (2ndd field )= wa_dynpread-fieldvalue .

  • Module pool in table control wizared

    Hi
    I have created in module pool table control wizared created insert and delete rows in output.
    insert the data in table control the colume is not save.
    can u tell me the save the data in table control.
    pls tell me the flow of save button.
    after insert the record how to save the data in table control wizard in module pool.
    can u tell me the save button functionality.
    after save data will add in table.

    Hi Venkat,
    I think you have already posted this query with the subject line "Table control" with the thread below today.
    table control
    Try with the online link we have provided you will learn that way on your own.
    Nobody here will write the whole logic for you.
    Try to put in your efforts.
    Regards
    Abhii
    Edited by: Abhii on Sep 8, 2010 3:13 PM

  • How to update DBtable in table control (MPP) for selected lines.

    Hi Folks,
    I need to update DBtable from the table control after modification of  only multiple selected rows.
    But my issue. any row if edited is being modified in DBtable.
    Client does not want me to use Check box so im using Selcolumn in module pool table control.
    Please help me in resolving the issue. Let me know if you have any queries
    Thanks
    Reddy

    Hi Reddy,
    Hope it helps.
    For  Sel column.
    Declare:
    Data : SEL  TYPES XFELD in Structure.
    Double click on the sel  field     give the structure name and field name as below in screen shoot.
    In Flow logic.
    PROCESS AFTER INPUT.
    loop at it_tab.
        FIELD YTBLCTRL-SEL.
    MODULE update.
    ENDLOOP.
    MODULE Updatedb.
    In Editor.
    MODULE UPDATE INPUT.
       MODIFY it_tab FROM YTBLCTRL INDEX tbc1-current_line.
       if ytblctrl-sel IS NOT INITIAL.
       lv_cnt = lv_cnt + 1.
       endif.
    ENDMODULE.
    MODULE UPDATEDB INPUT.
    Case sy-ucomm.
    WHEN 'SAVE'.
    if lv_cnt is NE '1'.
    Message 'select more than one item.
    else.
    Update DB.
    endif.
    Endcase.
    Regards,
    Venkat.

Maybe you are looking for

  • Is there a way to create more memory on iphone 4s??

    Is there a way to create more memory on iphone 4s??

  • Hi, a bit of a complicated one :)

    We have move from Switzerland to Italy and I used a time capsule as back up disk and wireless in Switzerland. The Italian telephone company came to install the internet with their own wireless router and had no idea what to do with my time machine. W

  • Runtime Errors         "READ_REPORT_LINE_TOO_LONG"

    i am using a include program to alv list display. and when i execute the main program.. it gives the following dump. Runtime Errors         READ_REPORT_LINE_TOO_LONG Exception              CX_SY_READ_SRC_LINE_TOO_LONG analysis.. An exception occurred

  • Insufficient rights - How to determine the correct rights?

    All, Does anyone know how to determine the correct rights if you get the error message "Insufficient rights for operation"? In SAP backend systems you can start transaction SU53 to check your "missing" authorizations, but is something like that also

  • CFSELECT and queries

    I am trying to pull some dates out of my database, and have them show up in a <cfselect> that users than then pick. I have: <cfselect name="ClassDate" size="1" required="yes" message="Please select the date the class began." query="RequestDate" value