BDC Delete

I am working on a requirement where I have to delete the data using BDC for transaction XD02. BDC recording is available.
How can I program the using the BDC available.
Please explain with a sample program.
Thank you.

Hi Kathik,
I would suggest BAPI always than BDC ,
I deleted two customers in my system by using BDC ( I did recording )
See the code below
report ZTEST_DELETE1
       no standard page heading line-size 255.
include bdcrecx1.
start-of-selection.
perform open_group.
perform bdc_dynpro      using 'SAPMF02D' '0101'.
perform bdc_field       using 'BDC_CURSOR'
                              'RF02D-D0110'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'RF02D-KUNNR'
                              '1010019'.
perform bdc_field       using 'RF02D-D0110'
                              'X'.
perform bdc_dynpro      using 'SAPMF02D' '0110'.
perform bdc_field       using 'BDC_CURSOR'
                              'KNA1-NAME1'.
perform bdc_field       using 'BDC_OKCODE'
                              '=0520'.
perform bdc_field       using 'KNA1-NAME1'
                              'p p'.
perform bdc_field       using 'KNA1-SORTL'
                              'P'.
perform bdc_field       using 'KNA1-STRAS'
                              '112 FULTON ST   s'.
perform bdc_field       using 'KNA1-ORT01'
                              'NEW YORK'.
perform bdc_field       using 'KNA1-PSTLZ'
                              '10038'.
perform bdc_field       using 'KNA1-LAND1'
                              'US'.
perform bdc_field       using 'KNA1-REGIO'
                              'NY'.
perform bdc_field       using 'KNA1-SPRAS'
                              'EN'.
perform bdc_dynpro      using 'SAPMF02D' '0520'.
perform bdc_field       using 'BDC_CURSOR'
                              'KNA1-LOEVM'.
perform bdc_field       using 'BDC_OKCODE'
                              '=UPDA'.
perform bdc_field       using 'KNA1-LOEVM'
                              'X'.
perform bdc_transaction using 'XD02'.
perform close_group.
You can modify the above code as per ur requirement.
Thanks
Seshu

Similar Messages

  • WSo2 BDC to delete line item in table control

    Hi all,
    My requirement is to delete material from wso2 table control.
    The only way to delete a line item in this table control is to select the line in table control and delete it.
    The recording doesnt captures any selection of row.
    Any input on how to caputre particular row ??
    Please dont send me links to work with table control in bdc
    Regards
    Bhanu

    DaveL  wrote:
      I am not aware of any way to make the BDC delete the row, other than by running in 'A'-all mode and letting the user step through each screen and delete the rows that should be deleted.
    Well , if the user has to run it in "A" all screen mode why a BDC is required
    DaveL  wrote:
    Deleting them from the table control would obviously have no effect upon the database table though, would it....it would just hide a row from view in this particular table control
    Really ? Well it will delete it from database too i dont know what makes you think that it wont be deleted from database.
    Anways i have figured out how to capture row selection in BDC .
    Thanks for your reply it proves nothing i guess

  • BDC to PFCG (Delete Authority Objects from Roles.)

    When we try to change an authority object it gives an error message saying that 'This authority object is used in roles XXX'.
    To remove Authority Ojects from roles, transaction PFCG is used. But the problem is that BDC is almost impossible to PFCG.
    Is there any way you can suggest us to change an authority object when it is assigned to a role or how we can BDC delete authority object from a role or a function/badi we can call to achieve this.
    This is a very high level question.

    Hi
    U should consider PFCG trx is enjoy trx so it's not suitable for BDC, what doesn't mean you can't do a BDC program for that trx but it won't be easy.
    Anyway you can know the users assigned to certain profile reading table AGR_USERS. I believe PFCG shows them sorted alphabetical, so you can know the position where an user should be, after u should use PAGE UP and PAGE DOWN command to scroll the table control.
    Max

  • How to delete record from table control in BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    Hi,
    While doing recording check for Filter button available for the table control, if it available then do the recording for the same.
    Once it is done while passing the data from internal table put the value into Filter field.
    Hope it resolves your issue.
    Thanks & Regards.
    Nagaraj Kalbavi

  • How to delete record from table control using BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    One option is to identify the table and find out the location as the number of row which should be deleted from the table and then in the bdc program instead of postioning the cursor on the row 1(using the statement perform bdc_cursor ....(01)), replace the 01 with the row number.
    Second option is that if a filter control is available for the table control, then filter the data each and every time with the material number to be deleted and then delete the first row.
    Regards
    Farzan

  • Problem in BDC code of deleteing operations in CA02

    Hi,
    I am working on BDC in which i have to delete the previous operations which are present in the item id's and i want to insert new operations(11,21,25,35,45,55) among the different materials in CA02. i am having a BDC which allows me to insert new operations for the items but the problem is i have to remove the existing operations (11,21,25,35,45,55) in some materials.
    I had performed the recording and when i had done modifications in the code it is selecting only those which i had done in recording,but when i don't mention the any of the operation id in the txt fiel it is selecting the operation.
    *plzz provide me guidelines to solve this problem . *
    my format of the file is :-
    221925 MFPL PAT 0011 QP02 First Pc Inspection For Turning
    and the code which i am using right now:-
    report ZNEW02
    no standard page heading line-size 255.
    include bdcrecx1.
    data: begin of record OCCURS 0,
    MATNR_001(018),
    WERKS_002(004),
    end of record.
    PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME default 'C:\Users\Administrator\Desktop\CA02(UPLOAD).txt'.
    initialization.
    CTUMODE = 'A'.
    CUPDATE = 'A'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    MASK = ',. '
    MODE = 'O'
    IMPORTING
    FILENAME = P_FILNAM
    EXCEPTIONS
    INV_WINSYS = 1
    NO_BATCH = 2
    SELECTION_CANCEL = 3
    SELECTION_ERROR = 4
    OTHERS = 5
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = P_FILNAM
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = RECORD
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    NO_AUTHORITY = 10
    OTHERS = 11
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT RECORD.
    ON CHANGE OF RECORD-MATNR_001.
    perform bdc_dynpro using 'SAPLCPDI' '1010'.
    perform bdc_field using 'BDC_CURSOR'
    'RC271-PLNNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RC27M-MATNR'
    record-MATNR_001.
    perform bdc_field using 'RC27M-WERKS'
    record-WERKS_002.
    *perform bdc_field using 'RC271-PLNNR'
    *perform bdc_field using 'RC271-STTAG'
    '28.03.2009'.
    *perform bdc_field using 'RC271-PLNAL'
    perform bdc_dynpro using 'SAPLCPDI' '1400'.
    perform bdc_field using 'BDC_CURSOR'
    'PLPOD-VORNR(12)'.
    perform bdc_field using 'BDC_OKCODE'
    '=LOE'.
    perform bdc_field using 'RC27X-ENTRY_ACT'
    '1'.
    perform bdc_field using 'RC27X-FLG_SEL(02)'
    'X'.
    perform bdc_field using 'RC27X-FLG_SEL(03)'
    'X'.
    perform bdc_field using 'RC27X-FLG_SEL(05)'
    'X'.
    perform bdc_field using 'RC27X-FLG_SEL(06)'
    'X'.
    perform bdc_field using 'RC27X-FLG_SEL(08)'
    'X'.
    perform bdc_field using 'RC27X-FLG_SEL(10)'
    'X'.
    perform bdc_field using 'RC27X-FLG_SEL(12)'
    'X'.
    perform bdc_dynpro using 'SAPLSPO1' '0100'.
    perform bdc_field using 'BDC_OKCODE'
    '=YES'.
    perform bdc_dynpro using 'SAPLCPDI' '1400'.
    perform bdc_field using 'BDC_CURSOR'
    'RC27X-ENTRY_ACT'.
    perform bdc_field using 'BDC_OKCODE'
    '=BU'.
    perform bdc_field using 'RC27X-ENTRY_ACT'
    '1'.
    perform bdc_transaction using 'CA02'.
    ENDON.
    ENDLOOP.

    hi,
    I working on BDC of CA02 tcode and i have to delete the operations(11,21,25,35,45,55) present in the routing of the materials .  plzzz provide me guidelines to solve this problem .
    Edited by: ricx .s on Apr 8, 2009 6:52 AM

  • BDC for ME01 to delete vendors in the source list

    Hi ABAP'ers,
                         I am trying to write a BDC program to delete a particular vendor from ME01 TCODE. My program runs well till deletion after i delete a record it is showing a pop up to confirm and on clicking yes the vendor is deleted. But the source list is not getting saved, or in other words the BDC flow stops after deletion, though i have handled save ok code in my BDC internal table. is there a solution for this.
    thanx $ regrds
    thrinath k

    Run in mode 'E' and fix whatever you have missed on your BDC.

  • GUI tran to delete shopping cart via BDC

    I'm trying to find a GUI (not web) tran which can delete a shopping cart (set header status = I1040) and can be called via BDC:
    1. I can enter "/n" to get out of the Easy Access Menu and then run tran BBP_MON_SC in the GUI to delete a shopping cart.  However, is there a way to run the GUI tran BBP_MON_SC via BDC considering it has to be done out of the Easy Access Menu?
    2. Is there some other GUI tran that can delete a shopping cart without having to worry about getting out of the Easy Access Menu?
    We're running the EBP extended classic scenario with SRM 4.0 and SRM_SERVER 5.00.
    Thanks,
    Brad

    Hi,
    You can delete form BBPSC04 as well.But all the GUI tcodes need to be run using "/n" only.
    BR,
    Disha.
    <b>Pls reward points for useful answers.</b>

  • Delete terms of payment vaules in xd02 using bdc

    hi ,
         i want to delete terms of payments values  in xd02  using bdc . already i have upload then just i want to remove on that particular filed items how ?
    at a time i want to remove all values .
      pls send me code .

    Hi Chaitanya,
    How did you solve your problem, plz do share with us,It would be helpful for others who are in need of yuor suggestions like me who landed into the same ship.
    Of deleting the Payment card information in XD02.
    Thanks
    Srikanth

  • How to delete BDC session ?

    hi gurus,
    In my scenario , Before runnning BDC ( calll transaction ) , I firstly create a session ( use : BDC_OPEN_GROUP) with group name = the file that used to upload data for BDC execution , Then I check If the BDC run without error I will use BDC_CLOSE_GROUP to delete this group or else the session is kept , But when I check In SM35 , There's no session deleted ? Could you please help me ?
    Thanks

    >I will use BDC_CLOSE_GROUP to delete this group or else the session is kept , But when I check In >SM35 , There's no session deleted ? Could you please help me ?
    BDC_CLOSE_GROUP is used to Close the session Group, if you close it you cannot insert any transactions/records to the the Session group , not for Deletion.
    You want to Delete the session after the processing you have to use KEEP = ' '.
    then once process is over the session will be deleted.

  • BDC for deleting vendors at plant level

    Hi experts..
      I have query regarding BDC. Please read  below.
    Go to  MK02 T-code , select valid combination of vendor and purchase organiation -> select 2 check boxes in general data
    -> select 2 check boxes in purchase oraganization data -> press ' Enter ' -> again press ' Enter '-> again press 'Enter '-> select  ' Alternative Data ' in Tool bar -> There you will see all the plant descriptions belongs to vendor under purchase oraganization .
       Now i have to delete some  plants (  based on certain condition  )  here,this i can do by  selecting plant   and press delete line .
       This procedure i have to repeat many vendors. i wanted to implement this through BDC .
         My question is , through BDC how can i select some plant descriptions ( there in the last screen )  . Dynamically i have to select some plant descriptions .
       Thanks much !!!
        Radhika

    Hello dear Srinivas,
    I want to inform you that your question is not in the most appropriated spot for the experts. It is related to FI area but was posted in the logistic area.
    Please close this thread and open a new one in the following spot (ERP FI)
    -SAP ERP Financials
    Best Regards,
    Christian Rosa

  • BDC : creating Billing frm Dr/Cr Memo - Problem in deletion of  conditions

    Dear Gurus,
    I am facing a problem when I try to develop a BDC for creating a Billing document from a Debit/Credit Memo Sales Order.
    The requirement is to delete some condition when creating billing from debit note for Depot plant.
    The problem I am facing is in time of deleting the condition , as I am not able to move the lines of table control in Pricing tab up or down.
    the ok_code = /00 is not working and I have tried all p+,p- for that.
    My logic is to bring the CONDITION that should be deleted at top position of the table control. but as I am not able to move the scroll bar , I got stuck there.
    So any solution of that available or any alternative is available for the requirement ???
    Thanks
    Shibashis

    V1 498 - Credit already exist for item...
    What the above message means is that lines items have already been used as reference for the creation of credit memo request(s).
    Create a new sales order, delivery and billing document. Then create credit memo request with reference to this new billing document and test.
    In VTAF copy control, at item level, field "Pos./neg. quantity" dictates how the quantity in the source document is affected by copy control.
    PS - I tried to create credit memo with reference to billing document (F2), there were no issues there. Therefore I am taking that the issue is with credit memo request (copied with ref to billing document F2)

  • Is  it possible to DELETE the Sub Asset either from BDC/BAPI etc?

    Hi Experts,
    I am guessing, the following idea may work for my problem, but, pls, let me give some info, abt the same.......
    1 - At the sales order creation time, each LINE ITEM creates the SubAsset, say,
    Line_ Item_1 -
    > creates SubAsset_1,
    Line_ Item_2 -
    > creates SubAsset_2, so on
    2 - if some reasons, if the user deletes Line_ Item_1, I need to delete that particlar SubAsset_1,
    so, pls. let me know that,
    1- If the user, deletes the item_1, then I wanna, to delete the created SubAsset_1, so then, I guess, SubAsset_2 shuld be modified as SubAsset_1
    2- Is it works out? makes sense?
    3- If so, Wht is the best method to delete a SubAsset from Asset Master? Is it AS02 BDC or Is there any BAPI or any other?
    thanq.
    Message was edited by:
            Srinivas

    as i did not hear any thing, so, am closing.

  • Bdc to delete delivery

    hi guyz,
    i  wanna delete delivery  i 've got the bdc and i have to use it se38 .
    BDC
         0000     T     VA02     
    SAPMV45A     0102     X          
         0000          BDC_CURSOR     VBAK-VBELN
         0000          BDC_OKCODE     /00
         0000          VBAK-VBELN     
    SAPMV45A     4001     X          
         0000          BDC_OKCODE     /ELOES
    at the moment im using
    clear: bdcdata, messtab.
      refresh: bdcdata, messtab.
      PERFORM bdc_dynpro USING 'SAPMV45A' '0102'.
      PERFORM bdc_field USING 'VBAK-VBELN'
                               gs_header-del_number.
      PERFORM bdc_field USING 'BDC_OKCODE'
                               '/00'.
      PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
      PERFORM bdc_field USING 'VBAK-VBELN'
                               '/ELOES'.
    does this work to delete the delivery...or ...i have to smother thing...plz advise..
    regards

    Hi Sudheer,
       You can directly use the FM OIK_SD_DELETE_DELIVERY to delete a delivery.
    Rgds,
    Bujji

  • BDC for PFCG for deletion of user roles

    I need to create a BDC for deleting users from roles in PFCG transaction and after deletion you have to click on User comparison in User tab.
    Any idea how to compare and delete theusers from role.
    It comes in Table control.
    1)delete from table control .
    I have not been able to see delete from Table programs.
    George

    Hi
    U should consider PFCG trx is enjoy trx so it's not suitable for BDC, what doesn't mean you can't do a BDC program for that trx but it won't be easy.
    Anyway you can know the users assigned to certain profile reading table AGR_USERS. I believe PFCG shows them sorted alphabetical, so you can know the position where an user should be, after u should use PAGE UP and PAGE DOWN command to scroll the table control.
    Max

Maybe you are looking for

  • Line Item Sorting in Payment Proposal in F110 (Automatic Payment Program)

    Hi all SAP Gurus... I really need a help here... In FBZP, I set up 'note to payee lines on the form' restricted to 17 rows. And the sorting for line items, I use 'document date'. For example, I have 68 open items. When I run F110, in the payment prop

  • Cannot switch tabs past a tab viewing a PDF

    When I have a tab open with a PDF in it (using Adobe Acrobat 9.3.0.148 plugin) I cannot switch tabs using Ctrl-Tab and Ctrl-Shift-Tab past that particular tab. Ctrl-W won't close the tab with the PDF in it either. It looks like if you dont click with

  • HT1535 Syncing question about the iPad mini?

    I have removed some videos from my library on iTunes that have been added into my iPad in the past. I did that so I can save some memory on my computer and don't want to take up so much space. Is there a possible way to sync more videos into my iPad

  • TS1398 imessage waiting for activation

    I am not able to receive or send an imessage from my phone.

  • CSS Popup menu export problems

    I have followed all the instructions to export css popup menus from Fireworks CS3. I can see them when I preview in browser from the launch button top right. But when I export the CSS etc. and view the files in Dreamweaver it simply doesn't make any