abap2xlsx icon indicating copy to clipboard operation
abap2xlsx copied to clipboard

how to delete a row in worksheet ?

Open ttkk1024 opened this issue 3 years ago • 4 comments

I want to delete a row in worksheet,but I can not find a method which can delete a row. Who can help me? Think you very much

ttkk1024 avatar Feb 23 '22 08:02 ttkk1024

class ZCL_EXCEL_ROWS, method REMOVE ?

AndreaBorgia-Abo avatar Feb 23 '22 22:02 AndreaBorgia-Abo

class ZCL_EXCEL_ROWS, method REMOVE ?

this is my code. It can remove a row from rows. `

  DATA: 
  lo_worksheet TYPE REF TO zcl_excel_worksheet,
  lo_row       TYPE REF TO zcl_excel_row.
  lo_row = lo_worksheet->get_row( ip_row = 11 ).
  lo_rows = lo_worksheet->get_rows( ).
  lo_rows->remove( io_row = lo_row ).

`

I want code can do that: lo_worksheet->delete_row( ip_row = 11 ).

ttkk1024 avatar Feb 23 '22 23:02 ttkk1024

I think the object model must remain as it is (and to be the same as the Microsoft Excel programming model), but maybe we could improve to make this possible?

lo_worksheet->get_rows( )->remove( ip_index = 11 ).

Could you contribute to do this enhancement by forking the project and do a pull request?

sandraros avatar Feb 24 '22 09:02 sandraros

To participate and propose a fix to improve abap2xlsx:

  • at https://github.com
    • Create your github account/space if not done yet (for instance janeorjohndoe)
    • Navigate to https://github.com/abap2xlsx/abap2xlsx
    • Click the "Fork" button at the top of the page; this will duplicate the repository to your github space
  • Run ZABAPGIT at your ABAP server
    • If the abap2xlsx repository is not pulled yet, click "New online", https://github.com/janeorjohndoe/abap2xlsx, enter an ABAP package name/prefix whose abap2xlsx objects will be assigned to, click "Create online", then click "Pull", and confirm till all abap2xlsx objects are activated in your ABAP server
    • Create a branch by clicking master, typing any name you want which describes your fix, then clicking "Create branch"
  • Do your abap2xlsx modifications
  • Run ZABAPGIT at your ABAP server
    • Select the line corresponding to abap2xlsx (click anywhere in the line but hyperlinks)
    • Click "Stage", confirm the objects to stage, do a Diff to verify your changes for the last time, choose your pseudonym and email address, and click "Commit".

sandraros avatar Mar 06 '22 14:03 sandraros