Skip to Content

Hi all, i need to create a one method in assistance class for updating the custom table.

Req as follows :

1. i need to create one method in a assistance calss for updating custom table .

2. now i have to pass the multiple entries to that table then inside the method based need to update the Ztable. based on this entries

3. My internal table is having 2 fields ( Customernumber (key field) , Shiftloc ).(Multiple entries ex : 500)

based on customernumber need to update the new shiftloc in my custom table.

Can any one give some inputs please. i have doubt can we pass mupltiple entries (internal) as a importing parameter to the method?



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Mar 13, 2014 at 03:40 PM

    Hi Venu,

    You need to create a table type to pass internal table data into method as parameter.

    You can achieve your requirement as below.

    • Go to SE11 t code and create a table type ZTT_DATA by using your internal table's structure/table.
    • Create a method SAVE in assistance class with importing parameter it_data of type ZTT_DATA
    • Now you can use the it_data move data to local internal table LT_ZDATA of type Ztable .
    • Modify ZTABLE from table Lt_zdata

    Hope this helps you.



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Venu,

      Well,updating data base table a record by record is not suggested. Instead, you update all customers data at once.

      you can update the ship to address only for the customers from the internal table as below

      let us say your internal table is having fields : new_bp and custnum

      Now, prepare the internal table of type Zcustom as below

      data lt_zcustom type table of zcustom.

      data ls_zcustom like line of lt_zcustom.

      clear lt_zcustom.

      " Prepare data for updation

      loop at it_data into ls_data.

      clear ls_zcustom.

      ls_zcustom-mandt = sy-mandt.

      ls_zcustom-ship_to_address = ls_data-new_bp.

      ls_zcustom-cust_no = ls_data-custnum.

      " ....... some other columns data

      append ls_zcustom to lt_zcustom.


      "now update records to data base

      modify ZCUSTOM from table lt_zcustom.

      Hope this helps you.



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.