Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem in table control.second row getting errased if not pressed enter after first row

Hello All,

I am designing a table control,in that if I am not pressing 'enter' key after first row and directly giving data in second row,the second row is getting erased,automatically.

I am putting the piece of my code.

IN PBO.
LOOP AT it_item INTO zlc_items WITH CONTROL tabctrl.
    FIELD: zlc_items-mark,
           zlc_items-posting_key,
           zlc_items-account_number,
           zlc_items-special_gl,
           zlc_items-amount,
           zlc_items-cost_center,
           zlc_items-wbs_element,
           zlc_items-text,
           zlc_items-vendor,
           zlc_items-tax_code,
           zlc_items-profit_center.
  ENDLOOP.
IN PAI-
MODULE read_table.
MODULE read_table INPUT.
CLEAR ok_code.

  zlc_items-mark           = wa_item-mark.
  zlc_items-posting_key    = wa_item-posting_key.
  zlc_items-account_number = wa_item-account_number.
  zlc_items-special_gl     = wa_item-special_gl.
  zlc_items-amount         = wa_item-amount.
  zlc_items-cost_center    = wa_item-cost_center.
  zlc_items-wbs_element    = wa_item-wbs_element.
  zlc_items-text           = wa_item-text.
  zlc_items-vendor         = wa_item-vendor.
  zlc_items-tax_code       = wa_item-tax_code.
  zlc_items-profit_center  = wa_item-profit_center.
  APPEND wa_item TO it_item.
  CLEAR wa_item.
ENDMODULE.
LOOP AT it_item.
    MODULE modify_table.
  ENDLOOP.
MODULE modify_table INPUT.

  MODIFY it_item FROM zlc_items
            INDEX tabctrl-current_line.
ENDMODULE.
Kindly help in this regard

Former Member
Former Member replied

Thank you all,i got the solution,I did like this.

MODULE modify INPUT.

       MODIFY it_item FROM zlc_items INDEX tabctrl-current_line.

       if sy-subrc =  0.

          APPEND it_item.

       endif.

     ENDMODULE.

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question