Deleting the values from table control

HI,
I need to remove the selected line from the Table control on my screen.
The point is that the Internal table does not have any records,.
for example in the Customer Create screen,
while entering the bank details we will enter it in a tbale contraol.
but the records doesnt exist in the database. but the record gets deleted from the table control only if we press delete button.
please guide me.
please note : I want to delete the record from Table Control on the screen and I dont have any corresponding database records..
regards

Hi..
The solution to your problem - deleting values from table control.
Here: it_wizard is the internal table which is holding the value of table control.
         wa_wizard is the work are of the internal table it_wizard.
         it_delete is the internal table which holds the deleted record of table control.
         wa_delete is the work area of the internal table it_delete
Also here the field ZSEL is the character field which is used to select the entire record in the table control.
LOOP AT it_wizard into wa_wizard WHERE zsel = 'X'.
       MOVE-CORRESPONDING wa_wizard TO wa_delete.
       APPEND wa_delete TO it_delete.
       delete table it_wizard from wa_wizard.
DELETE  FROM zfin_goods WHERE ZFG = WA_delete-ZFG.
ENDLOOP
if sy-subrc eq 0.
Message 'Delete Successful' type 'S'.
endif.
The above code will delete the record from both the table control.internal table and the database table.
I think this will help you to great extent.
Ward regards,
Bhuvaneswari
Edited by: BHUVANESWARI THIRUNAVUKKARASU on Jan 7, 2009 10:39 AM

Similar Messages

  • Reg:How to delete the column in table control also from database table.

    Hi Experts,
    Once again thank u all for giving the responses.
    one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
    With Regards,
    Saroja.P.

    Hi,
    If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
    "This portion of code inside the LOOP...ENDLOOP.
    IF sy-ucomm eq 'F_DELETE'.
       gt_itab2-check = mark.  " Store the MARK field status into your internal table's correspoding field 'check'
      MODIFY gt_itab INDEX tabcontrol-current_line.
    ENDIF.
    iF sy-ucomm eq 'DELETE1'.
      DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
    ENDIF.
    Now you can modify your database table using the MODIFY statement.
    MODIFY ZDB FROM TABLE gt_itab.

  • How to delete the row in table control with respect to one field in module pool programming?

    Hi,
    Can I know the way to delete the row in table control with respect to one field in module pool programming
    Regards
    Darshan MS

    HI,
    I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
    I have written this code,
    module USER_COMMAND_9000 input.
    DATA OK_CODE TYPE SY-UCOMM.
    OK_CODE = SY-UCOMM.
    CASE OK_CODE.
         WHEN 'DELETE'.
            LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
                APPEND LS_SOURCE TO LT_RESTORE.
                DELETE TABLE LT_SOURCE FROM LS_SOURCE.
                SOURCE-LINES = SOURCE-LINES - 1.
            ENDLOOP.
    But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
    So I thought of doing with respect to the field.

  • How to delete the values from TKOMV at runtime after creating PO

    Hi,
      How to delete the values from TKOMV at runtime after creating PO from IDOC. I am creating PO through IDOC, subsequently need to create Sales order and again need to create 2nd PO with reference of Purchase Requestion(created with sales order). At the time creation of 2nd PO the Header conditions are appearing twice and net price value is appearing wrong.
    Thanks in advance.

    Hi Padma
    Can you do this activity once the company code is in to production. I guess you can not do this activity, if the company code is already in to live. Setting or resetting of the recon accounts will hinder the previous actitivity. Infact resetting of the company code is also not a good option.
    Any how, thanks for the inputs. Please let me know whether i can do this activity only at the subledger level which will not impact other modules. The one solution i can figured out is , reverse all the transactions for the corresponding asset in the year of takeover and pass the entries again in the same year correctly which will have effect in Subledger and also in general ledger. But the business people will not allow this, since for a big client it will require lot of authorizations and approvals. Infact the vendor also, is cleared. So we have to reverse the cleared documents as well which is again a task and require approvals as well.
    Thanks and regards
    Seshu.

  • Retrieving values from table control using DYNP_VALUES_READ

    Hi all,
    I am trying to retrieve the values from the table control using the FM DYNP_VALUES_READ. I have a situation where user enter values in table control in T.code FB60 in Withholding tab for validation purpose. There i'll have to check based on some entries maintained in SET.
    I am unable to get the values when i scroll to the next page in the table control. FM raising an exception invalid_dynprofield.
    Expecting reply...

    You have to populate the dynpfields internal table before calling the function,
    data: repid like sy-repid.
    dynpfields-fieldname = 'PNAME'.
    append dynpfields.
    repid = sy-repid.
    call function 'DYNP_VALUES_READ'
    exporting
    dyname = repid
    dynumb = sy-dynnr
    tables
    dynpfields = dynpfields
    exceptions
    others.
    read table dynpfields index 1.
    pname = dynpfields-fieldvalue.
    Now you will have the field value in pname
    Hope this helps
    Vinodh Balakrishnan

  • How to get the values from table SKB1 R/3  to SRM

    Hi Gurus,
    My requirement is to get all the values from the table SKB1 to SRM (i.e. in to an internal table) for doing some validation(G/L account XXXXXX requires an assignment to a CO objectXXXXXX.)
    Like wise I have many tables for doing validation in SRM
    Help me how to get this, suggest me any Function module with sample code.
    OR
    Any Standard FM which will give all the values of the fields in the table SKB1 when I pass the key fields G/L account & company code alone so that I can improve the performance.
    Suggest me.
    Regards
    Paul

    Hi,
    You can use the FM 's META_READ_TABLE Or RFC_READ_TABLE
    Which SRM / Backend system version are you using ?
    Are you taking care of the Importing paramater - DELIMITER in this case.. ??*
    See related links ->
    Re: Retrieving data from R/3 into SRM
    Re: Product Search TIME lag
    Else you can just call the remote enabled  FM "BAPI_GL_ACC_GETDETAIL"  from SRM.
    BR,
    Disha.
    Do reward points for useufl answers.

  • Dynamically changing the value in table control

    Hello Every one,
    In MD61 transaction table control am trying to change value dynamicaly i.e am trying to change value in table control automaticaly tht value to be captured and i need to show in status bar...
    Ex table control field is number: am giving 10,20,30 tht should show in status bar by adding if u enter 10 at status bar it show 10 then when u enter 20 it should add with 10 and give 30 ..
    in this way when ever u enter value in filed it should add with the status bar value.

    Hi!
    For conversion you can use the function module
    data :   w_amt         TYPE cms_dte_original_amt,
                                                                                    " Amount
                w_conv_amt    TYPE cms_dte_conv_amt,
                                                                                    " Converted amount
                w_kmein       TYPE cms_dte_original_curr,
       CALL FUNCTION 'CMS_API_CURR_CONV'
            EXPORTING
              i_original_curr = w_kmein
              i_original_amt  = w_amt
              i_result_curr   = 'INR'
              i_rate_type     = 'M'
              i_conv_date     = sy-datum
            IMPORTING
              e_conv_amt      = w_conv_amt.
    now accordingly you can move the currency and amount that is changed....
    here as you were saying that on f4 after selecting you want the other field to get the value on that currency.....
    this work can be done as here....
    in this the next field gets populated as the first field gets the value......
    refer to it.....
    https://wiki.sdn.sap.com/wiki/display/ABAP/GettingainputfieldpopulatedonenteringthevalueinoneInputfield
    Regards.

  • How to read the field value from Table Control

    Hello Experts,
    I am creating my first Table Control Screen. Basically I have to create a screen (102) with a table control which has 2 fields: A_QTY, B_QTY and 2 Buttons: SAVE, EXIT.
    When Clicked on 'SAVE' the data (MATNR) from a previous screen (101)  and the data (A_QTY, B_QTY) from the new screen (102) should be saved into a Z-table.
    Internal table t_data has 3 fields.
    MATNR
    A_QTY
    B_QTY.
    Table Control TC_RACK was declared like this:
    controls tc_rack type tableview using screen 0102.
    I/0 Fields:
    A_QTY type ZQTY.
    B_QTY type ZQTY.
    The screen Flow Logic:
    process before output.
    module status_0102.
      loop at t_data into w_data with control tc_rack.
      endloop.
    process after input.
      module exit_0102 at exit-command.
      loop at tc_rack.
      endloop.
    module user_command_0102.
    module status_0102output.
      set pf-status 'STATUS_102'.
      set titlebar 'TITLE_102'.
      describe table t_rack lines tc_rack-lines.
    endmodule.                 "status_0102 output
    process after input.
    module user_command_0615 input.
    case ok_code.
       when 'SAVE_RK'.
       when others.
    endcase.
    endmodule.                 "user_command_0102 input
    Now for eg, when the users enter values for A_QTY and B_QTY like this:
    A_QTY     B_QTY
    1000         2000
    3000         4000
    How can I read these values and pass them to T_DATA so that I can save it into Z-table?
    I greatly appreciate your help.
    I've gone through some previously posted threads and could not understand because my knowledge in this area is preliminary.
    Thanks a lot.
    Could you please let me know
    Edited by: dev a on Jan 13, 2010 2:46 PM

    Hi dev a
    You should use
      DATA: lv_name(30) TYPE c.
      FIELD-SYMBOLS: <QTY> type ZQTY.
    GET CURSOR FIELD lv_name.   "Get the field name in table control
    check sy-subrc = 0.
    assign  (lv_name) to <QTY>.  "Here you get the value in <QTY>
    check sy-subrc = 0.
    Also use <your table control>-current_line to get the table index uo're currently on.
    Hint: Do not use GET CURSOR LINE if you want to get table index since this gives you the line relative to dialog screen
    Good luck
    Dean Q.
    Edited by: Dean Q on Jan 13, 2010 11:11 PM

  • How to delete a row from table control

    I have created a push button on the screen for delete.
    its getting stored in ok_code.
    'FLAG' is the name of the mark on the table control.
    I am getting probs in this line.
    I am not getting anything in mark_field.
    ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
    The code is:
    MODULE tablctrl2_user_command INPUT.
      PERFORM user_ok_tc USING    'TABLCTRL2'
                                  'I_ZSKILLEMP'
                                  'FLAG'
                         CHANGING ok_code.
    ENDMODULE.
    FORM user_ok_tc USING    p_tc_name TYPE dynfnam
                             p_table_name
                             p_mark_name
                    CHANGING p_ok      LIKE sy-ucomm.
    -BEGIN OF LOCAL DATA----
      DATA: l_ok              TYPE sy-ucomm,
            l_offset          TYPE i.
    -END OF LOCAL DATA----
    Table control specific operations                                    *
      evaluate TC name and operations                                    *
      SEARCH p_ok FOR p_tc_name.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      l_offset = strlen( p_tc_name ) + 1.
      l_ok = p_ok+l_offset.
    execute general and TC specific operations                           *
      CASE l_ok.
        WHEN 'INSR'.                      "insert row
          PERFORM fcode_insert_row USING    p_tc_name
                                            p_table_name.
          CLEAR p_ok.
        WHEN 'DELE'.                      "delete row
          PERFORM fcode_delete_row USING    p_tc_name
                                            p_table_name
                                            p_mark_name.
          CLEAR p_ok.
    FORM fcode_delete_row
                  USING    p_tc_name           TYPE dynfnam
                           p_table_name
                           p_mark_name   .
    -BEGIN OF LOCAL DATA----
      DATA l_table_name       LIKE feld-name.
      FIELD-SYMBOLS <tc>         TYPE cxtab_control.
      FIELD-SYMBOLS <table>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <wa>.
      FIELD-SYMBOLS <mark_field>.
    -END OF LOCAL DATA----
      ASSIGN (p_tc_name) TO <tc>.
    get the table, which belongs to the tc                               *
      CONCATENATE p_table_name '[]' INTO l_table_name. "table body
      ASSIGN (l_table_name) TO <table>.                "not headerline
    delete marked lines                                                  *
      DESCRIBE TABLE <table> LINES <tc>-lines.
      LOOP AT <table> ASSIGNING <wa>.
      access to the component 'FLAG' of the table header                 *
        ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
        IF <mark_field> = 'X'.
          DELETE <table> INDEX syst-tabix.
          IF sy-subrc = 0.
            <tc>-lines = <tc>-lines - 1.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.

    Hi...
    i got the same prob...but got the solution too...
    you have to take an internal table of same type of dbase table..and maintain a flag in it...which will be get filled automatically with 'X'.
    here is the code..go throug it..
    REPORT  YH642_DIALOG_TABLECONTROL.
    CALL SCREEN 999.
    DATA:
      W_INDEX TYPE I.
    DATA:
      W_UCOMM LIKE SY-UCOMM.
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'TAB'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   YH642_RAM.
    DATA:
      BEGIN OF DDTAB,
        TAB_FLAG  TYPE C,
        MANDT  LIKE YH642_RAM-MANDT,
        EID    LIKE YH642_RAM-EID,
        ENAME  LIKE YH642_RAM-ENAME,
        MOBILE LIKE YH642_RAM-MOBILE,
      END OF DDTAB.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TAB'
    TYPES: BEGIN OF T_TAB,
             TAB_FLAG TYPE C,
             MANDT LIKE YH642_RAM-MANDT,
             EID LIKE YH642_RAM-EID,
             ENAME LIKE YH642_RAM-ENAME,
             MOBILE LIKE YH642_RAM-MOBILE,
           END OF T_TAB.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TAB'
    DATA:     G_TAB_ITAB   TYPE T_TAB OCCURS 0,
              H_TAB_ITAB   TYPE T_TAB OCCURS 0,
              G_TAB_WA     TYPE T_TAB. "work area
    DATA:     G_TAB_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'TAB' ITSELF
    CONTROLS: TAB TYPE TABLEVIEW USING SCREEN 0999.
    *&SPWIZARD: LINES OF TABLECONTROL 'TAB'
    DATA:     G_TAB_LINES  LIKE SY-LOOPC.
    DATA:     OK_CODE LIKE SY-UCOMM.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    MODULE TAB_INIT OUTPUT.
      IF G_TAB_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'YH642_RAM'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_TAB_itab'
        SELECT * FROM YH642_RAM
           INTO CORRESPONDING FIELDS
           OF TABLE G_TAB_ITAB.
        G_TAB_COPIED = 'X'.
        H_TAB_ITAB[] = G_TAB_ITAB[].
        REFRESH CONTROL 'TAB' FROM SCREEN '0999'.
      ENDIF.
    ENDMODULE.                    "TAB_INIT OUTPUT
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE TAB_MOVE OUTPUT.
      MOVE-CORRESPONDING G_TAB_WA TO DDTAB.
    ENDMODULE.                    "TAB_MOVE OUTPUT
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: GET LINES OF TABLECONTROL
    MODULE TAB_GET_LINES OUTPUT.
      G_TAB_LINES = SY-LOOPC.
    ENDMODULE.                    "TAB_GET_LINES OUTPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MODIFY TABLE
    MODULE TAB_MODIFY INPUT.
      MOVE-CORRESPONDING DDTAB TO G_TAB_WA.
      MODIFY G_TAB_ITAB
        FROM G_TAB_WA
        INDEX TAB-CURRENT_LINE.
    ENDMODULE.                    "TAB_MODIFY INPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: PROCESS USER COMMAND
    MODULE TAB_USER_COMMAND INPUT.
      OK_CODE = SY-UCOMM.
      PERFORM USER_OK_TC USING    'TAB'
                                  'G_TAB_ITAB'
                                  'TAB_FLAG'
                         CHANGING OK_CODE.
      SY-UCOMM = OK_CODE.
    ENDMODULE.                    "TAB_USER_COMMAND INPUT
      INCLUDE TABLECONTROL_FORMS                                         *
    *&      Form  USER_OK_TC                                               *
    FORM USER_OK_TC USING    P_TC_NAME TYPE DYNFNAM
                             P_TABLE_NAME
                             P_MARK_NAME
                    CHANGING P_OK      LIKE SY-UCOMM.
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA: L_OK              TYPE SY-UCOMM,
            L_OFFSET          TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
    *&SPWIZARD: Table control specific operations                          *
    *&SPWIZARD: evaluate TC name and operations                            *
      SEARCH P_OK FOR P_TC_NAME.
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      L_OFFSET = STRLEN( P_TC_NAME ) + 1.
      L_OK = P_OK+L_OFFSET.
      L_OK = 'DELE'.
    *&SPWIZARD: execute general and TC specific operations                 *
      CASE L_OK.
        WHEN 'INSR'.                      "insert row
          PERFORM FCODE_INSERT_ROW USING    P_TC_NAME
                                            P_TABLE_NAME.
          CLEAR P_OK.
        WHEN 'DELE'.           "delete row
         MESSAGE 'Are you really going to delete??' type 'I'.
          PERFORM FCODE_DELETE_ROW USING    P_TC_NAME
                                            P_TABLE_NAME
                                            P_MARK_NAME.
          CLEAR P_OK.
        WHEN 'P--' OR                     "top of list
             'P-'  OR                     "previous page
             'P+'  OR                     "next page
             'P++'.                       "bottom of list
          PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
                                                L_OK.
          CLEAR P_OK.
        WHEN 'L--'.                       "total left
          PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
        WHEN 'L-'.                        "column left
          PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
        WHEN 'R+'.                        "column right
          PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
        WHEN 'R++'.                       "total right
          PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
        WHEN 'MARK'.                      "mark all filled lines
          PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                            P_TABLE_NAME
                                            P_MARK_NAME   .
          CLEAR P_OK.
        WHEN 'DMRK'.                      "demark all filled lines
          PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                              P_TABLE_NAME
                                              P_MARK_NAME .
          CLEAR P_OK.
        WHEN 'SASCEND'   OR
             'SDESCEND'.                  "sort column
          PERFORM FCODE_SORT_TC USING P_TC_NAME
                                      l_ok.
      ENDCASE.
    ENDFORM.                              " USER_OK_TC
    *&      Form  FCODE_INSERT_ROW                                         *
    FORM FCODE_INSERT_ROW
                  USING    P_TC_NAME           TYPE DYNFNAM
                           P_TABLE_NAME             .
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_LINES_NAME       LIKE FELD-NAME.
      DATA L_SELLINE          LIKE SY-STEPL.
      DATA L_LASTLINE         TYPE I.
      DATA L_LINE             TYPE I.
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>                 TYPE CXTAB_CONTROL.
      FIELD-SYMBOLS <TABLE>              TYPE STANDARD TABLE.
      FIELD-SYMBOLS <LINES>              TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: get looplines of TableControl                              *
      CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
      ASSIGN (L_LINES_NAME) TO <LINES>.
    *&SPWIZARD: get current line                                           *
      GET CURSOR LINE L_SELLINE.
      IF SY-SUBRC <> 0.                   " append line to table
        L_SELLINE = <TC>-LINES + 1.
    *&SPWIZARD: set top line                                               *
        IF L_SELLINE > <LINES>.
          <TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
        ELSE.
          <TC>-TOP_LINE = 1.
        ENDIF.
      ELSE.                               " insert line into table
        L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
        L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
      ENDIF.
    *&SPWIZARD: set new cursor line                                        *
      L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
    *&SPWIZARD: insert initial line                                        *
      INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
      <TC>-LINES = <TC>-LINES + 1.
    *&SPWIZARD: set cursor                                                 *
      SET CURSOR LINE L_LINE.
    ENDFORM.                              " FCODE_INSERT_ROW
    *&      Form  FCODE_DELETE_ROW                                         *
    FORM FCODE_DELETE_ROW
                  USING    P_TC_NAME           TYPE DYNFNAM
                           P_TABLE_NAME
                           P_MARK_NAME   .
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE CXTAB_CONTROL.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: delete marked lines                                        *
      DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
        IF <MARK_FIELD> = 'X'.
          W_INDEX = SYST-TABIX.
          DELETE <TABLE> INDEX SYST-TABIX.
          IF SY-SUBRC = 0.
            <TC>-LINES = <TC>-LINES - 1.
          ENDIF.
        ENDIF.
      ENDLOOP.
      READ TABLE H_TAB_ITAB INDEX W_INDEX INTO G_TAB_WA.
      IF SY-SUBRC EQ 0.
        MOVE-CORRESPONDING G_TAB_WA TO YH642_RAM.
        DELETE YH642_RAM.
      ENDIF.
    ENDFORM.                              " FCODE_DELETE_ROW
    *&      Form  COMPUTE_SCROLLING_IN_TC
          text
         -->P_TC_NAME  name of tablecontrol
         -->P_OK       ok code
    FORM COMPUTE_SCROLLING_IN_TC USING    P_TC_NAME
                                          P_OK.
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_TC_NEW_TOP_LINE     TYPE I.
      DATA L_TC_NAME             LIKE FELD-NAME.
      DATA L_TC_LINES_NAME       LIKE FELD-NAME.
      DATA L_TC_FIELD_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE CXTAB_CONTROL.
      FIELD-SYMBOLS <LINES>      TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get looplines of TableControl                              *
      CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
      ASSIGN (L_TC_LINES_NAME) TO <LINES>.
    *&SPWIZARD: is no line filled?                                         *
      IF <TC>-LINES = 0.
    *&SPWIZARD: yes, ...                                                   *
        L_TC_NEW_TOP_LINE = 1.
      ELSE.
    *&SPWIZARD: no, ...                                                    *
        CALL FUNCTION 'SCROLLING_IN_TABLE'
             EXPORTING
                  ENTRY_ACT             = <TC>-TOP_LINE
                  ENTRY_FROM            = 1
                  ENTRY_TO              = <TC>-LINES
                  LAST_PAGE_FULL        = 'X'
                  LOOPS                 = <LINES>
                  OK_CODE               = P_OK
                  OVERLAPPING           = 'X'
             IMPORTING
                  ENTRY_NEW             = L_TC_NEW_TOP_LINE
             EXCEPTIONS
                 NO_ENTRY_OR_PAGE_ACT  = 01
                 NO_ENTRY_TO           = 02
                 NO_OK_CODE_OR_PAGE_GO = 03
                  OTHERS                = 0.
      ENDIF.
    *&SPWIZARD: get actual tc and column                                   *
      GET CURSOR FIELD L_TC_FIELD_NAME
                 AREA  L_TC_NAME.
      IF SYST-SUBRC = 0.
        IF L_TC_NAME = P_TC_NAME.
    *&SPWIZARD: et actual column                                           *
          SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
        ENDIF.
      ENDIF.
    *&SPWIZARD: set the new top line                                       *
      <TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
    ENDFORM.                              " COMPUTE_SCROLLING_IN_TC
    *&      Form  FCODE_TC_MARK_LINES
          marks all TableControl lines
         -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                   P_TABLE_NAME
                                   P_MARK_NAME.
    &SPWIZARD: EGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE CXTAB_CONTROL.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: mark all filled lines                                      *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
        <MARK_FIELD> = 'X'.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Form  FCODE_TC_DEMARK_LINES
          demarks all TableControl lines
         -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                     P_TABLE_NAME
                                     P_MARK_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE CXTAB_CONTROL.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: demark all filled lines                                    *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
        <MARK_FIELD> = SPACE.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Module  STATUS_0999  OUTPUT
          text
    MODULE STATUS_0999 OUTPUT.
      SET PF-STATUS 'SS_STD'.
      SET TITLEBAR 'TITLE'.
    ENDMODULE.                 " STATUS_0999  OUTPUT
    *&      Module  USER_COMMAND_0999  INPUT
          text
    MODULE USER_COMMAND_0999 INPUT.
      DATA:
        H_TAB_WA LIKE G_TAB_WA.
      CASE W_UCOMM.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'TAB_MODI' OR 'SAVE'.
          LOOP AT G_TAB_ITAB INTO G_TAB_WA.
          FORMAT   INPUT OFF.
            MOVE-CORRESPONDING G_TAB_WA TO YH642_RAM.
            READ TABLE H_TAB_ITAB WITH KEY EID = G_TAB_WA-EID INTO H_TAB_WA.
            IF SY-SUBRC EQ 0.
              IF G_TAB_WA NE H_TAB_WA.
                MODIFY YH642_RAM.
              ENDIF.
            ELSE.
              INSERT  YH642_RAM.
            ENDIF.
          ENDLOOP.
    SORT  G_TAB_ITAB.
      ENDCASE.
    *CALL SCREEN 700.
    ENDMODULE.                 " USER_COMMAND_0999  INPUT

  • Reading the data from table control and write log.

    Hi all,
       In va01 trasaction i have table control 'All item'.
       I want to write value of some columns,( Article no, Order, plant ) so on into ecatt Log file after saving the trasction, for all rows which is having article no.
       Is there any possibility in eCATT with going to GETGUI function which is static to spacefic field.
    Regards,
    Sree

    Hi Sreedhar,
    There are two types of variable values you find in transactions, one system generated(generally the unique values) and then the static field values..
    When you want to go for the static field values you can use GETGUI. You can use the same GETGUI n number of times according to the situation(like in loops etc) and for the system generated messages we can handle them from the message blocks.
    MESSAGE.
    ENDMESSAGE.
    In the message block make a rule for the message that you are expecting like
    'E' MSGNR(the message number) and give a variable in the fields MSGV1/MSGV2 where ever you are getting the unique generated value(according to the log) and you can use that variable for LOG purpose..
    Confirm me whether you were looking for this or something else.
    Best regards,
    Harsha

  • Get value from table control

    Hi Guys,
    FYI, im having a table control with field Plant and Material. I have defaulted the <b>std search help</b> to field <u>Material</u> at the screen painter. Meaning system will call up the search help for Material once i press F4.
    Since the search help for field Material is a collective search help, and there is a <u>Plant</u> field available for Material filtering. Thus i may need to get the Plant's value from of same row of the  table control to Populate into the Material's search help.
    I have already tried to create a new module under the LOOP...ENDLOOP at PAI's flow logic. And try to use parameter id to set the value for plant, purpose is to populate it to Material's search help when i click F4 on material field. The problem is the new module that i coded under LOOP...ENDLOOP will never trigger when i click F4. Because there is NO event to trigger my module.
    Other than the above, i tried to code it under POV. But it doesn't work as well, because there is more than 1 record under table control and i can not determine the during runtime which row of F4 for material being click.
    Please comment on this above on how to solve the problem.
    Thanks in advance.

    Hi,
          You can call standard collective search help [say for Eg:<b>MAT1</b>] through Process on value-request event and set the paramenter id of Plant field before calling the funtion module <b>'HELP_START'</b>.Then we can get the materials specific to the PLANT in the corresponding row of the TABLE CONTROL.
    To get which row of the table control is clicked use <b>Get Cursor Line</b> Statement as i mentioned below.
    Flow logic:
    PROCESS ON VALUE-REQUEST.
    FIELD x_marc-matnr MODULE mat_shelp.
    Module definition:
    MODULE mat_shelp INPUT.
      DATA:v_help_info LIKE help_info,n TYPE i,
       it_dyselect LIKE TABLE OF dselc WITH HEADER LINE,
        it_dyvaltab LIKE TABLE OF dval WITH HEADER LINE.
      REFRESH it_dyselect.
      it_dyselect-fldname = 'MANDT'.
      it_dyselect-dyfldname = 'SY-MANDT'.
      APPEND it_dyselect.
      it_dyselect-fldname = 'MATNR'.
      it_dyselect-dyfldname = 'X_MARC-MATNR'.
      APPEND it_dyselect.
      v_help_info-call     =     'M'.
      v_help_info-object     =     'F'.
      v_help_info-program     =      sy-repid.    "'ZVIG_MOD_TABLE_CONTROL_1'.
      v_help_info-dynpro     =     sy-dynnr.    "'9001'.
    v_help_info-tabname     =      'MARC'.
      v_help_info-fieldname = 'MATNR'.
      v_help_info-fieldtype     =  'CHAR'.
      v_help_info-keyword   =   'MATNR'.
      v_help_info-fieldlng = 18.
      v_help_info-fldvalue = ''.
      v_help_info-mcobj = 'MAT1'.
      v_help_info-spras = 'E'.
      v_help_info-menufunct = 'HC'.
      v_help_info-title =     'SAP'.
      v_help_info-dynprofld = 'X_MARC-MATNR'.     <b>----
    > Give ur screen field name</b>
      v_help_info-tcode     =      sy-tcode.       "'ZTC1'.
      v_help_info-pfkey     =      'MEN'.
      v_help_info-docuid     =     'FE'.
      v_help_info-pov     =     'N'.
    v_help_info-curow     =   '2'.
    v_help_info-cucol     =  '1'.
      v_help_info-dynpprog = sy-repid.       " ZVIG_MOD_TABLE_CONTROL_1
      v_help_info-stepl     =   '1'.
      v_help_info-selectart = 'A'.
      GET CURSOR LINE n.
      READ TABLE it_marc INTO x_marc INDEX n.
      SET PARAMETER ID 'WRK' FIELD  X_MARC-WERKS .
      CALL FUNCTION 'HELP_START'
        EXPORTING
          help_infos         = v_help_info
        TABLES
          dynpselect         = it_dyselect
          dynpvaluetab       = it_dyvaltab           .
    ENDMODULE.                 " mat_shelp  INPUT

  • Please help..it's Urgent..How to fetch the value from table row from Page

    Hi,
    I have created a table with 2 LOV's , LOV2 is dependent on LOV2.
    Here I can not use the general Dependent LOV concept, as these values are coming from 2 different LookUps.
    I am not able to fetch the user input for LOV1 (from page) .that is why not able to set the where cluse fro 2nd LOVVO.
    I have used this code:
    if ("ViolationCat".equals(lovInputSourceId)) {
    OAMessageLovInputBean msglov =
    (OAMessageLovInputBean)webBean.findChildRecursive("ViolationCat");
    // String p_violation_category = "'"+(String)msglov.getValue(pageContext)+"'";
    String p_violation_category =
    (String)msglov.getValue(pageContext);
    // System.out.println(" p_violation_category =" +
    // p_violation_category);
    String v_violation_category = "";
    //System.out.println("vcat=" + vCat);
    OAViewObject violationVO =
    (OAViewObject)am.findViewObject("SNI_Violation_DtlsVO2");
    Number vcatViolationIdnum =
    (Number)violationVO.getCurrentRow().getAttribute("ViolationId");
    String vcatViolationId = "" + vcatViolationIdnum;
    pageContext.putTransactionValue("vcatViolationId",
    vcatViolationId);
    pageContext.putTransactionValue("p_violation_category",
    p_violation_category);
    String query =
    " SELECT LOOKUP_CODE, \n" + " MEANING, \n" +
    " LOOKUP_TYPE \n" +
    " FROM apps.fnd_lookup_values \n" +
    " WHERE LOOKUP_TYPE ='SNI_VIOLATION_CATEGORY' AND MEANING=?";
    PreparedStatement ps = txn.createPreparedStatement(query, 1);
    try {
    ps.setString(1, p_violation_category);
    ResultSet rs = ps.executeQuery();
    //System.out.println("before while,");
    // rs.next();
    // v_violation_category = rs.getString("LOOKUP_CODE");
    // System.out.println("v_violation_category="+v_violation_category);
    while (rs.next()) {
    //System.out.println("inside while");
    v_violation_category = rs.getString("LOOKUP_CODE");
    // System.out.println("v_violation_category=" +
    // v_violation_category);
    ps.close();
    } //try ends
    catch (Exception e) {
    e.getMessage();
    //System.out.println("in catch.." + e.getMessage());
    OAViewObject subCatVO =
    (OAViewObject)am.findViewObject("SNI_ViolationSubCategoryVO1");
    //System.out.println("get VO before where clause: subCatVO::"+subCatVO.getQuery());
    subCatVO.setWhereClause("LOOKUP_TYPE like '%SNI_VIOL_SUB_CAT_" +
    v_violation_category + "'");
    System.out.println("after set where clause VO: subCat VO::" +
    subCatVO.getQuery());
    subCatVO.executeQuery();
    // System.out.println("query of subCat VO::" +
    // subCatVO.getQuery());
    //End of sub category Validation
    It is working fine only for the 1st row of teh table.
    I have tried to fetch the value using :
    String violationCategory = (String)violationVO.getCurrentRow().getAttribute("ViolationCategory");
    String violationSubcategory = (String)violationVO.getCurrentRow().getAttribute("ViolationSubcategory");
    But it is fetching null value.
    Please tell me how can I able to fetch the values.

    Hi
    in your scenarion,first u have to identify the particular row of table where the changes is being made ,u have to use this code .when u select the lov ,first it will give the row refernce and then u have to catch the lov event
    OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    262
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Serializable[] parameters = { rowReference };
    // Pass the rowReference to a "handler" method in the application module.
    am.invokeMethod("<handleSomeEvent>", parameters);
    In your application module's "handler" method, add the following code to access the source row:
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    thanx
    Pratap

  • How to get the values from table region and how to set

    Hi,
    I have a requirement as Seeded Page Having One Table Region having around 8 columns, In That Item Description field is there. My Requirement is I need add one more field for that Region and assign the value depending Item Description.
    I will create one new Item in that region and will give name as Item, But how to set the values to Item Depending on Item Description.
    Is it possible to through CO Extension, If yes..Pls help how to get it.
    Thanks in Advance,
    Hanimi

    Hi Hanimi,
    1. You need to extend the VO, add a new Attribute.
    2. In VORowImpl of the extended VO, you can find the getter for your new attribute (example getItem())
    3. In this getter method you can write some code like:
    if("ABC".equals(getItemDescription())
    return "XYZ" ;
    -Prince
    http://princekapoor82.blogspot.com

  • Dynamic selection screen fetching the value from table fields

    hi gurus,
    i have one table say ztable...and i should create a dynamic selection screen which should populate the selection screen by the table field names.
    example..if i have 3 fields im my table..my selection screen should have three selection option fields..and in future if i add one more field in my table it should automatically create another slection-option in selection screen..
    thanks
    Sudheer

    Do you mean like SE16 works. If so, you should notice that if you  amend the selection fields, the screen program is actually re-generated.
    That is what is happening. A program is being created and re-generated.
    To create a dynamic selection screen in a single program is not possible ( I may be wrong ). If it is possible, then you would have problems in defining selection screen field names and using them.

  • Deleting the Row from the table is not refreshing the contents in the form

    Hi,
    We developed a table and form in the same UI based on the following suggestion.
    Display and edit currently selected row of ADF Table in ADF Form
    1. Created one view object based on the employees table.
    2. dragged the view object to the UI as table.
    3. dragged the view object as form.
    4. set partial triggers on the form's container (panelformlayout) as tableId.
    Tested the application with the edit options and everything is working fine. But the problem comes when we delete the record from table. it is not refreshing the form based on the newly selected row after deleting the record. If we commit the data the form contents are updated to the selected row (which is not desired).
    Can you please suggest how to fix the issue, refreshing the form with the selected row after deleting the records.
    Thanks and Regards,
    S R Prasad

    The Code snippet looks fine. I think, the issue is in the partial trigger setting
    4. set partial triggers on the form's container (panelformlayout) as tableId.In order to the table to get refreshed, the table's partialTriggers property should be set to id of the delete Button.
    Go to table, select partialTriggers in the Property Inspector, Click on Expression Builder at the right and select the delete Button.
    Can you set this and check?
    Sample Code:
    <af:panelHeader text="panelHeader 1" id="ph1">
    <f:facet name="context"/>
    <f:facet name="menuBar"/>
    <f:facet name="toolbar">
    <af:commandButton text="Delete" id="cb1"/>
    </f:facet>
    <f:facet name="legend"/>
    <f:facet name="info">
    <af:table var="row" rowBandingInterval="0" id="t1"
    partialTriggers="::cb1">
    <af:column sortable="false" headerText="col1" id="c1">
    <af:outputText value="#{row.col1}" id="ot1"/>
    </af:column>
    <af:column sortable="false" headerText="col2" id="c4">
    <af:outputText value="#{row.col2}" id="ot3"/>
    </af:column>
    <af:column sortable="false" headerText="col3" id="c3">
    <af:outputText value="#{row.col3}" id="ot4"/>
    </af:column>
    <af:column sortable="false" headerText="col4" id="c5">
    <af:outputText value="#{row.col4}" id="ot2"/>
    </af:column>
    <af:column sortable="false" headerText="col5" id="c2">
    <af:outputText value="#{row.col5}" id="ot5"/>
    </af:column>
    </af:table>
    </f:facet>
    </af:panelHeader>
    Thanks,
    Navaneeth

Maybe you are looking for

  • Moving a folder in applications to external hard drive

    Hello! So background story: I recently started moving all of my photos, music, and video library from my Macintosh HD to my external hard drive. I do have my Adobe CS4 suite installed on my Mac HD, and it is a folder inside 'Applications.' So here is

  • Red Giant transitions no longer work in Mac OS 10.9.5

    I recently updated my Mac Pro to 10.9.5 and now my Red Giant Universe transitions, such as Swish Pan (works like Wind Blur in Final Cut) have all stopped working.  Not only do they no longer work, but they make my project crash and I have to create a

  • RAC issue

    Hi, We are facing issues in 2 node RAC...Clusterware 11.2.0.3..database 10.2.0.5.0 We are facing the following errors in the alertlog. Can anyone throw light? node1 is up. When we start node 2 both the nodes get hang. ORA-27062: could not find pendin

  • Build a custom based view where rows are columns in view

    Bit of an odd request but here goes. We have a system whereby we want to give users the ability to add their own fields against our tables. Because we do not want to create columns in each table we had the thought of creating a table that contains ro

  • Australia Back and Forth

    Hi! I believe this question has come up before but I didn't quite follow the answer.  I will be traveling to Australia soon and I am bringing my phone from sweden. What is the easiest way for me to be able to call one of my contacts without a connect