Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table control wizard Insert and save

Former Member
0 Likes
285

HI All,

In table control how to identify the record inserted and save it?

Thanks,

Rakesh.

1 REPLY 1
Read only

Former Member
0 Likes
262

Rakesh

Generally, I have a table for the display and a copy of it in a sv_ table.

My normal procedure for this type of thing is once you are ready to save it, is to delete all the table entries from the sv_ table

and then insert all of the new table. This will handle deletes as well.

Something similar to this


  DELETE FROM zlmcont CLIENT SPECIFIED
    WHERE mandt = sy-mandt
      AND leadid = zlmlead-leadid.

  SORT it_zlmcont.

  LOOP AT it_zlmcont INTO wa_zlmcont.

    IF wa_zlmcont-leadid IS INITIAL.
      wa_zlmcont-leadid = zlmlead-leadid.
    ENDIF.

    PERFORM build_search_fields USING wa_zlmcont-lname
                                      wa_zlmcont-fname
                                      wa_zlmcont-mname
                                      wa_zlmcont-city
                                      wa_zlmcont-name_search
                                      wa_zlmcont-city_search.
    MODIFY it_zlmcont FROM wa_zlmcont.
    IF wa_zlmcont-apptyp = 'A'
      AND wa_zlmcont-seqno  = 1.
      a1_zlmcont = wa_zlmcont.
    ENDIF.

  ENDLOOP.

  INSERT zlmcont FROM TABLE it_zlmcont.

  sv_zlmcont = it_zlmcont.