<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Deleting Bank vendor data using class VMD_EI_API in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/14177269#M2042277</link>
    <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;Instead of get_data, I tried to build the structure manually (hence the current_state field is empty) like below, and the entry is removed from&amp;nbsp;&lt;!-- StartFragment  --&gt;&lt;SPAN&gt;&lt;STRONG&gt;lfbk&lt;/STRONG&gt; with success:&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;      "Manually structure data to delete
      ls_vendor-header-object_task = 'U'.                       "Header task: Update
      ls_vendor-header-object_instance-lifnr = ls_ylfbk-lifnr.  "Header key : Vendor code
      ls_bankdetail-task = 'D'.                                 "Entry task : Delete
      ls_bankdetail-data_key-bankl = ls_ylfbk-bankl.            "Entry key  : Bank code
      ls_bankdetail-data_key-banks = ls_ylfbk-banks.            "Entry key  : Country
      ls_bankdetail-data_key-bankn = ls_ylfbk-bankn.            "Entry key  : Bank account
      APPEND ls_bankdetail TO lt_bankdetail.
      ls_vendor-central_data-bankdetail-bankdetails = lt_bankdetail[].
      APPEND ls_vendor TO lt_vendor.
      ls_master_data-vendors = lt_vendor[].&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;However, this bank account entry is apparently not removed from&amp;nbsp;BUT0BK... I'm tying to understand why.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Aug 2025 08:38:57 GMT</pubDate>
    <dc:creator>diella</dc:creator>
    <dc:date>2025-08-11T08:38:57Z</dc:date>
    <item>
      <title>Deleting Bank vendor data using class VMD_EI_API</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/446922#M13435</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;Currently I need to delete the entire bank data associated to
a vendor from table LFBK, I’m using class “VMD_EI_API” since it allows modifying
vendor data in its method “MAINTAIN_BAPI”, in a test programs I have been able
to insert new bank data and modify existing one without issues, but is not
working when I try to delete it, I wonder if this class can truly be use to achieve
that goal or if I need another class or function.&lt;/P&gt;&lt;P&gt;This is my test program for deleting bank data, first I’m
using method “GET_DATA” of class “VMD_EI_API_EXTRACT” to get the complete data
of the vendor, then I try to update it and set all the current bank data to a
delete task but in the end it isn’t deleting the information, not sure if I’m
missing something in the class configuration&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ytest_update_vendor_del.

PARAMETERS: p_lifnr TYPE lifnr OBLIGATORY.

START-OF-SELECTION.

  PERFORM update_data.

FORM update_data .

  DATA: lo_vmd_ei_api TYPE REF TO vmd_ei_api.
  DATA: l_ti_is_master_data    TYPE vmds_ei_main,
        l_ti_is_master_data_in TYPE vmds_ei_main.
  DATA: ls_vmds_ei_extern TYPE vmds_ei_extern.
  DATA: lc_lifnr TYPE lifnr.

**********************************************************************
  CHECK p_lifnr IS NOT INITIAL.

  CREATE OBJECT lo_vmd_ei_api.

  ls_vmds_ei_extern-header-object_instance-lifnr = p_lifnr.
  ls_vmds_ei_extern-header-object_task = 'U'.

  APPEND ls_vmds_ei_extern TO l_ti_is_master_data_in-vendors.

* Capture all the vendor data
  CALL METHOD vmd_ei_api_extract=&amp;gt;get_data
    EXPORTING
      is_master_data = l_ti_is_master_data_in
    IMPORTING
      es_master_data = DATA(l_ti_is_master_data_es)
      es_error       = DATA(l_error).


* Get the current vendor data into a structure
 READ TABLE l_ti_is_master_data_es-vendors INTO ls_vmds_ei_extern WITH KEY header-object_instance-lifnr = p_lifnr.

  IF sy-subrc EQ 0.

    ls_vmds_ei_extern-header-object_instance-lifnr = p_lifnr.
    ls_vmds_ei_extern-header-object_task = 'U'.

    LOOP AT ls_vmds_ei_extern-central_data-bankdetail-bankdetails ASSIGNING FIELD-SYMBOL(&amp;lt;lfs_bank&amp;gt;).

* This is the delete order

      &amp;lt;lfs_bank&amp;gt;-task = 'D'.

* I try to check all the fields to see if it helped but it didn´t

      &amp;lt;lfs_bank&amp;gt;-datax-bkont = abap_true.
      &amp;lt;lfs_bank&amp;gt;-datax-bvtyp = abap_true.
      &amp;lt;lfs_bank&amp;gt;-datax-xezer = abap_true.
      &amp;lt;lfs_bank&amp;gt;-datax-bkref = abap_true.
      &amp;lt;lfs_bank&amp;gt;-datax-koinh = abap_true.
      &amp;lt;lfs_bank&amp;gt;-datax-iban = abap_true.
      &amp;lt;lfs_bank&amp;gt;-datax-iban_from_date = abap_true.

    ENDLOOP.

    APPEND ls_vmds_ei_extern TO l_ti_is_master_data-vendors.

    CALL METHOD lo_vmd_ei_api-&amp;gt;maintain_bapi
      EXPORTING
        is_master_data           = l_ti_is_master_data
        iv_collect_messages      = abap_true
      IMPORTING
        es_master_data_correct   = DATA(ls_es_master_data_correct)
        es_message_correct       = DATA(ls_es_message_correct)
        es_master_data_defective = DATA(ls_es_master_data_defective)
        es_message_defective     = DATA(ls_es_message_defective).



    IF ls_es_message_defective-is_error   IS INITIAL AND

       ls_es_message_defective-messages[] IS INITIAL.

      COMMIT WORK AND WAIT.

    ELSE.

      ROLLBACK WORK.

    ENDIF.

  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As always any help is appreciated, thanks for the time.&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 22:26:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/446922#M13435</guid>
      <dc:creator>ronald_cadena</dc:creator>
      <dc:date>2017-05-19T22:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Bank vendor data using class VMD_EI_API</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/446923#M13436</link>
      <description>&lt;P&gt;Sadly I wasn’t able to achieve this, I couldn’t delete Bank
vendor data, but I did find something interesting, if you update all the Bank
vendor data items with the same data in the fields banks, bankl and bankn. The
BAPI class “CMD_EI_API” in its method “MAINTAIN_BAPI” it will delete all but one
item, in the end this was the solution we used.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 14:16:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/446923#M13436</guid>
      <dc:creator>ronald_cadena</dc:creator>
      <dc:date>2017-06-16T14:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Bank vendor data using class VMD_EI_API</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/446924#M13437</link>
      <description>&lt;P&gt;I know that question has been asked long time ago but here is an answer:&lt;/P&gt;&lt;P&gt;Since you have got all of yours bank accounts accquired from vmd_ei_api_extract class, then you have to simply remove bank accounts, which you want to be deleted, from table: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ls_vmds_ei_extern-central_data-bankdetail-bankdetails&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Unfortunately deletion of bank accounts is not possible with "D" indicator.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 14:14:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/446924#M13437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2021-02-11T14:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Bank vendor data using class VMD_EI_API</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/13645688#M2027276</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the update.&lt;/P&gt;&lt;P&gt;I'm facing similar issue, my requirement was to delete the customer bank details based on Kunnr. I've tried by deleting the bankdetails table entirely, still it does not delete the bank details from KNBK.&lt;/P&gt;&lt;P&gt;Please find logic below. Please advise on how to fix.&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;DATA: l_is_master_data TYPE cmds_ei_main,
                      l_es_master_data TYPE cmds_ei_main,
                      l_es_error       TYPE cvis_message.
                DATA: t_customers TYPE cmds_ei_extern_t,
                      s_customers TYPE LINE OF cmds_ei_extern_t.
                s_customers-header-object_instance-kunnr = lv_kunnr
                s_customers-header-object_task = 'M' .
                APPEND s_customers TO t_customers.
                l_is_master_data-customers = t_customers.
                cmd_ei_api_extract=&amp;gt;get_data(
                  EXPORTING
                    is_master_data = l_is_master_data
                  IMPORTING
                    es_master_data = l_es_master_data
                    es_error       = l_es_error ).
                IF l_es_master_data IS NOT INITIAL.
                  s_customers = l_es_master_data-customers[ header-object_instance-kunnr = ls_cdhdr-objectid ].
                  LOOP AT s_customers-central_data-bankdetail-bankdetails ASSIGNING FIELD-SYMBOL(&amp;lt;lfs_bankdetails&amp;gt;).
                    CLEAR &amp;lt;lfs_bankdetails&amp;gt;.
                    &amp;lt;lfs_bankdetails&amp;gt;-task = 'D'.
                    CLEAR l_es_master_data-customers.
                    s_customers-header-object_task = 'U' .
                    s_customers-central_data-bankdetail-current_state = space.
                    APPEND s_customers TO l_es_master_data-customers.
                    cmd_ei_api=&amp;gt;maintain_bapi(
                      EXPORTING
                    iv_test_run              = space            
                    iv_collect_messages      = space            
                    is_master_data           = l_es_master_data 
                  IMPORTING
                    es_master_data_correct   =  DATA(es_master_data_correct)   
                    es_message_correct       =  DATA(es_message_correct)       
                    es_master_data_defective =  DATA(es_master_data_defective) 
                    es_message_defective     =  DATA(es_message_defective)     
                    ).
                    IF es_message_defective-is_error IS INITIAL AND es_message_defective-messages[] IS INITIAL.
                      COMMIT WORK AND WAIT.
                    ELSE.
                      ROLLBACK WORK.
                    ENDIF.
                  ENDLOOP.
                ENDIF.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 13:10:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/13645688#M2027276</guid>
      <dc:creator>Patrick_9114</dc:creator>
      <dc:date>2024-03-21T13:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Bank vendor data using class VMD_EI_API</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/14025456#M2038594</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I managed this by setting the flag&amp;nbsp;&lt;SPAN&gt;current_state to 'X' and the bankdetails task type to 'I'. This is basically telling the system to ignore the current master data situation and just save whatever information you are passing in the current call. If you need to delete all the data, just pass an empty table.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 09:43:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/14025456#M2038594</guid>
      <dc:creator>thelazyhangman</dc:creator>
      <dc:date>2025-02-24T09:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Bank vendor data using class VMD_EI_API</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/14177269#M2042277</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;Instead of get_data, I tried to build the structure manually (hence the current_state field is empty) like below, and the entry is removed from&amp;nbsp;&lt;!-- StartFragment  --&gt;&lt;SPAN&gt;&lt;STRONG&gt;lfbk&lt;/STRONG&gt; with success:&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;      "Manually structure data to delete
      ls_vendor-header-object_task = 'U'.                       "Header task: Update
      ls_vendor-header-object_instance-lifnr = ls_ylfbk-lifnr.  "Header key : Vendor code
      ls_bankdetail-task = 'D'.                                 "Entry task : Delete
      ls_bankdetail-data_key-bankl = ls_ylfbk-bankl.            "Entry key  : Bank code
      ls_bankdetail-data_key-banks = ls_ylfbk-banks.            "Entry key  : Country
      ls_bankdetail-data_key-bankn = ls_ylfbk-bankn.            "Entry key  : Bank account
      APPEND ls_bankdetail TO lt_bankdetail.
      ls_vendor-central_data-bankdetail-bankdetails = lt_bankdetail[].
      APPEND ls_vendor TO lt_vendor.
      ls_master_data-vendors = lt_vendor[].&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;However, this bank account entry is apparently not removed from&amp;nbsp;BUT0BK... I'm tying to understand why.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2025 08:38:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-bank-vendor-data-using-class-vmd-ei-api/m-p/14177269#M2042277</guid>
      <dc:creator>diella</dc:creator>
      <dc:date>2025-08-11T08:38:57Z</dc:date>
    </item>
  </channel>
</rss>

