Is there any BAPI or function module  to delete entries from a table (VBAK)

Hi Everybody,
this is my first thread in SDN...
my problem follows...
A report is be created that selects all sales orders created by e-Sales that are more than 20 minutes old and still have a delivery block:
tables:
VBAK     sales document: header data
selection fields:
VBAK-LIFSK      &#8800;     <BLANK>
VBAK-ERNAM     =     userID used by e-Sales / IVE
          (EP-BATCH / EAI-BATCH)
VBAK-ERDAT      <=     Current system Date
VBAK-ERZET     <=     Current system Time - 20 minutes
These orders should be deleted from SAP system.
This report should be scheduled to run regularly every 10 minutes.
my doubt : is ther any BAPI or Function module to delete entries from a standard table...if no what is the way to delete the enteries from a std table...
best replies will be rewarded....
regards
Reddy

Hi Vasanth ,
thanks for your reply.
i tried in the same manner what u mentioned.
but how to pass only one parameter to the functionmodule..
here in this case we have to pass only update flag as 'D'..
i did the same it giving dump..
An exception occurred that is explained in detail below.                          
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was      
  not caught and                                                                   
therefore caused a runtime error.                                                 
The reason for the exception is:                                                  
The call to the function module "BAPI_SALESORDER_CHANGE" is incorrect:                                                                               
In the function module interface, you can specify only                            
fields of a specific type and length under "ORDER_HEADER_INX".                    
Although the currently specified field                                            
"INT_ORDER_HEADER_INX" is the correct type, its length is incorrect.              
my pgm :
*& Report  YNEW_ORDER_DELETION
REPORT  ynew_order_deletion.
TABLES:vbak.
PARAMETERS:
     p_lifsk LIKE vbak-lifsk DEFAULT '02'.
SELECT-OPTIONS:
   s_lifsk FOR vbak-lifsk DEFAULT '10',
    s_ernam FOR vbak-ernam,
    s_erdat FOR vbak-erdat,"DEFAULT sy-datum.
    s_erzet FOR sy-uzeit.
*PARAMETERS:
p_erzet LIKE sy-uzeit.
   s_erdat like vbak-erdat,
   s_erzet like vbak-erzet.
DATA:
   BEGIN OF int_final OCCURS 0,
        w_vbeln TYPE vbak-vbeln,
   END OF int_final.
DATA:
  int_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: int_order_header_inx LIKE bapisditmx OCCURS 0 WITH HEADER LINE.
DATA:
  wf_time TYPE sy-uzeit.
INITIALIZATION.
  s_ernam-low = 'KULKARMA'.
  s_ernam-sign = 'I'.
  s_ernam-option = 'EQ'.
  APPEND s_ernam.
s_ernam-low = 'EAI-BATCH'.
s_ernam-sign = 'I'.
s_ernam-option = 'EQ'.
APPEND s_ernam.
wf_time = sy-uzeit - 1200.
p_erzet = sy-uzeit - 1200.
p_erzet-low = wf_time.
APPEND s_erzet.
  int_order_header_inx-updateflag = 'D'.
  APPEND int_order_header_inx.
START-OF-SELECTION.
  SELECT vbeln FROM vbak
                   INTO TABLE int_final
                   WHERE lifsk EQ p_lifsk
                     AND ernam IN s_ernam
                     AND erdat IN s_erdat
                     AND erzet IN s_erzet.
  IF sy-subrc = 0.
    LOOP AT int_final.
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument         = int_final-w_vbeln
  ORDER_HEADER_IN             =
    order_header_inx            = int_order_header_inx
  SIMULATION                  =
  BEHAVE_WHEN_ERROR           = ' '
  INT_NUMBER_ASSIGNMENT       = ' '
  LOGIC_SWITCH                =
  NO_STATUS_BUF_INIT          = ' '
        TABLES
          return                      = int_return
  ORDER_ITEM_IN               =
  ORDER_ITEM_INX              =
  PARTNERS                    =
  PARTNERCHANGES              =
  PARTNERADDRESSES            =
  ORDER_CFGS_REF              =
  ORDER_CFGS_INST             =
  ORDER_CFGS_PART_OF          =
  ORDER_CFGS_VALUE            =
  ORDER_CFGS_BLOB             =
  ORDER_CFGS_VK               =
  ORDER_CFGS_REFINST          =
  SCHEDULE_LINES              =
  SCHEDULE_LINESX             =
  ORDER_TEXT                  =
  ORDER_KEYS                  =
  CONDITIONS_IN               =
  CONDITIONS_INX              =
  EXTENSIONIN                 =
    ENDLOOP.
    LOOP AT int_return.
      WRITE:/ int_return-type,
              int_return-id,
              int_return-number,
              int_return-message.
    ENDLOOP.
  ENDIF.
please help me ..its a very urgent issue to be solved...
am waiting for ur reply...
regards
gangareddy

Similar Messages

  • HR-ABAP Any BAPI or Function module to update infotypes 167 & 170

    Hi,
        Can anyone let me know is there any BAPI or Function module to update infotypes 167(Health Plans) & 170(Flexible Spending Accounts).
    Thanks,
    Sandeep

    Hi,
       U can use HR_BEN_CREATE_PLANS internally it calls HR infotype operation as specified by suresh.
    Suresh  : If there are approximately 3000 records to be updated on regular basis do u think is it better to use BAPI's or BDC
    regards
    Vick

  • Any Bapi or function Module to update standard table

    Can u Plz let me know , is there any bapi or function module to update few fields of a standard table using an internable.

    I don't know if any FM exists for your requirement. But you may like to copy it into a custom table and modify it according to your enterprise needs.

  • Any Bapi or Function module for transaction CA22

    Hi experts,
    Is there any Bapi or Function module for transaction CA22(Change Rate Routing).
    Thanks,
    Yogesh

    Hi,
    The following r the Enhancement's and BADI'S fro CA22
    Enhancement
    CMDI001                                 Determine explosion control for BOM
    CPAU0001                                Enhancement for Authorization Check in Task Lists
    CPDO0001                                Test units of measure for reference operation set
    CPRE0001                                Enhancement for Reorgnization Checks in Task Lists
    XCZD0004                                Extend authority check for the material-recipe allocation
    Business Add-in
    CEWB_OPR_MENU_EXTERN                    Menu Extensions in the Engineering Workbench
    CEWB_OPR_MENU_INTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_SEQ_MENU_INTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_TSK_MENU_EXTERN                    Menu Extensions in the Engineering Workbench
    CEWB_TSK_MENU_INTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_TSK_SCREENS                        Screen Extensions for Task Lists in the EWB
    CEWB_TSK_UPDATE                         Task List Maintenance and Checks in the EWB
    CP_DIG_SIGNATURE                        Digital Signature for Routings
    EWB_SELECTION                           Selection Within the Engineering Workbench
    ROUTING_EXIT                            User Exits for Routings
    CEWB_MTK_MENU_INTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_MST_MENU_INTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_MST_MENU_EXTERN                    Menu Extensions in the Engineering Workbench
    CEWB_ITM_MENU_INTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_ITM_MENU_EXTERN                    Menu Extensions in the Engineering Workbench
    CEWB_GEN_MENU_INTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_GEN_MENU_EXTERN                    Menu Extensions in the Engineering Workbench
    CEWB_COM_MENU_INTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_COM_MENU_EXTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_CHA_MENU_INTERN                    Menu Extensions in the EWB (SAP Internal)
    CEWB_CHA_MENU_EXTERN                    Menu Extensions in the Engineering Workbench

  • Any BAPI or Function module upload data into /LOT/LEOMM01

    Hi ,
      Could you tell me please if there is any BAPI or Function module to upload LEO material Property group data (/LOT/LEOMM01)
    Thanks & Regards
    RK
    null

    Hi Rk,
    take this pavkage name MGA go to se80
    in se80 provide package name click on display
    open  function group folder see the function modules and BAPI s that ful fill u r requirement
    Regards
    kishore ale

  • Is there a BAPI or Function module can create a Customer Master record?

    Hi experts,
    In SE37, Is there a BAPI or Function module can create a Customer Master record?
    Regards

    BAPI_CUSTOMER_CREATEFROMDATA1
    also see this thread.
    Re: Create customer record  in SAP via BAPI
    кu03B1ятu03B9к

  • Program or Function module to delete data from Open Hub Destination Table

    Hi All,
    Can anybody suggest me a Program or Function module to delete data from Open Hub Destination Table.
    Thanks & Regards,
    Vinay Kumar

    You can simply goto t-code SE14 mention the open hub destination table and Delete data by clicking on "Activate and Adjust database" with radio button "Delete Data".
    Regards,
    Arminder

  • Is there any BAPI or Funtion module to replace 'call tran KB11'?

    Hello,
    Now we use 'call transaction KB11' in 46C, but it seems not to work in ERP2005.
    So I'd like to change it to BAPI or Function module.
    Does anyone know which one is appropriate fot it?
    Any help would be higly appreciated.
    Thank you
    Yuko

    Hi,
      Check with BAPI, BAPI_ACC_PRIMARY_COSTS_POST,
    Rgds,

  • Is there a BAPI or function module for price condition?

    Hi experts,
      I just want to create price condition info record to purchase order.
      we create price condition through tcode MEK1/MEK2/MEK3.
      it is more different from tcode ME11. it doesn't need to input purchase group, tax code etc.
      but I can't find the BAPI or function module for this tcode.
      does anyone know it?
      thanks in advance.
      looking for your reply.
    jack

    Please check this answered link:
    Re: Bapi_prices_conditions does not delete old condition properly
    Re: bapi for condition recaords
    Edited by: Afshad Irani on Jun 13, 2010 3:38 PM

  • BAPI or Functional Module Reads Profit Segment From PR

    Hello, does anybody know about BAPI or Functional module to read profit segment, created in Purchase requisition?
    Or another technic to get: PAOBJNR

    Here is a solution which was useful to us:
    Take paobjnr form ebkn, and then: CALL FUNCTION 'RKE_CONVERT_PAOBJNR_COPADATA' and just read exported table with fields inside the profit segment
    + 1 simple select for customer description for example J

  • Is there any BAPI for Goods receipt that uses LIKP and LIPS tables?

    Hi experts
             I want to pull info for a given delivery note(DN) by joining LIKP and LIPS tables. Is there any existing BAPI that can give my info by using the two tables?
    Please help
    Thanks
    Gopal

    Check the above link and reward points if helpful
    http://help.sap.com/saphelp_nw04/helpdata/en/b0/dad2b40b3611d2a55a0060087832f8/content.htm

  • Function Module to get address from adrc table

    Hi,
    Is there any Function module which is retrieving data from ADRC table by passing address number.
    I tried in SDN and I got address_read but its obsolete.

    Hi,
    Please try this piece of code
    data: wa_addr1_sel like addr1_sel,
    wa_addr1_val like addr1_val.
    clear : wa_addr1_sel, wa_addr1_val.
    wa_addr1_sel-addrnumber = it_adrnr-adrnr.
    call function 'ADDR_GET'
    exporting
    address_selection = wa_addr1_sel
    importing
    address_value = wa_addr1_val
    exceptions
    parameter_error = 1
    address_not_exist = 2
    version_not_exist = 3
    internal_error = 4
    others = 5.
    if sy-subrc eq 0.
    it_addr-adrnr = wa_addr1_val-addrnumber.
    it_addr-name1 = wa_addr1_val-name1.
    it_addr-street = wa_addr1_val-street.
    it_addr-city = wa_addr1_val-city1.
    it_addr-region = wa_addr1_val-region.
    append it_addr.
    clear it_addr.
    endif.
    Regards
    Hiren k.Chitalia

  • Function Module to retrieve Address from the table ADRC

    Is there any function module available to retrieve data from ADRC by using the ADDRNUMBER as input

    Try using FM: ADDR_GET
    This has import parameter ADDRESS_SELECTION which contains ADDRNUMBER.
    Hope this helps.
    Please reward if it works.
    Vallabh.

  • Generic datasource by function module to fetch data from multiple tables?

    I'm writing a function module to fetch price, for generic datasource.
    At first, extract test is OK. But InfoPackage never stop  when loading data to PSA in BW.
    And I find the example codes:
         OPEN CURSOR WITH HOLD S_CURSOR FOR
          SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
                                   WHERE CARRID  IN L_R_CARRID AND
                                         CONNID  IN L_R_CONNID.
        ENDIF.                             "First data package ?
    * Fetch records into interface table.
    *   named E_T_'Name of extract structure'.
        FETCH NEXT CURSOR S_CURSOR
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE E_T_DATA
                   PACKAGE SIZE S_S_IF-MAXSIZE.
        IF SY-SUBRC <> 0.
          CLOSE CURSOR S_CURSOR.
          RAISE NO_MORE_DATA.
        ENDIF.
        S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
      ENDIF.
    There using Cursor to fetch data package by package, and raise exception NO_MORE_DATA to stop the loading process.
    Now I fetch data from multiple tables, I don't think I can use Cursor.
    Then How can I handle this?  
    Thanks a lot.

    Thanks
    IF IT_999[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH  AND
           ( ( A~KSCHL = 'ZPRC' AND VKORG = 'Z000' AND VTWEG = 'Z1' ) OR
                          ( A~KSCHL = 'ZPRD' AND VKORG = 'A000' AND VTWEG = 'Y3' ) ) AND
    *                      A~DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR AS KHETR  KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH AND
          A~KSCHL = 'ZPR3' AND A~VKORG = 'I000' AND
    *                      DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
      ENDIF.
      IF IT_997[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VTWEG A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A997 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_997
                    WHERE
    *      A~KNUMH = IT_997-KNUMH      AND
          A~KSCHL = 'ZPRA' AND VTWEG = 'Y1' AND
    *                      DATBI >= SY-DATUM AND
                      LOEVM_KO = ''.
      ENDIF.
      IF IT_996[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
           TABLE TP_DATA
             FROM A996 AS A
               INNER JOIN KONP AS B
                   ON A~KNUMH = B~KNUMH
               INNER JOIN MARA AS C
                  ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_996
                    WHERE
    *      A~KNUMH = IT_996-KNUMH AND
          A~KSCHL = 'ZPRB' AND
    *                       DATBI >= SY-DATUM AND
          LOEVM_KO = ''.
      ENDIF.
      SELECT   MATNR     "u7269u6599u53F7u7801
               MEINH     "u4ED3u50A8u5355u4F4Du7684u5907u7528u8BA1u91CFu5355u4F4D
               UMREZ     "u57FAu672Cu8BA1u91CFu5355u4F4Du8F6Cu6362u5206u5B50
               UMREN     "u8F6Cu6362u4E3Au57FAu672Cu8BA1u91CFu5355u4F4Du7684u5206u6BCD
          FROM MARM
          INTO CORRESPONDING FIELDS OF TABLE IT_MARM
           FOR ALL ENTRIES IN TP_DATA
         WHERE MATNR = TP_DATA-MATNR AND  MEINH = TP_DATA-KMEIN.
      LOOP AT TP_DATA.
        IF TP_DATA-KPEIN NE 0.
          TP_DATA-KBETR =  TP_DATA-KBETR / TP_DATA-KPEIN.
          TP_DATA-KHETR =  TP_DATA-KHETR / TP_DATA-KPEIN.
        ENDIF.
        IF TP_DATA-KSCHL = 'ZPRA'.
    *       TP_DATA-MEINH = 'ZI'.
    *      TP_DATA-KSCHL = 'B4'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'CT'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRB'.
    *      TP_DATA-KSCHL = 'L0'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRC' OR TP_DATA-KSCHL = 'ZPRD'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'WZI'.
            TP_DATA-KBETR = TP_DATA-KBETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPR3'.
    *      TP_DATA-KSCHL = 'B2'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ENDIF.
        TP_DATA-MEINH = '01'.
        MODIFY TP_DATA.
    E_T_DATA-MATNR =   TP_DATA-MATNR.
    E_T_DATA-KSCHL =   TP_DATA-KSCHL.
    E_T_DATA-KHETR =   TP_DATA-KHETR.
    E_T_DATA-KBETR =   TP_DATA-KBETR.
    E_T_DATA-KMEIN =   TP_DATA-KMEIN.
    E_T_DATA-DATAB =   TP_DATA-DATAB.
    E_T_DATA-DATBI =   TP_DATA-DATBI.
    APPEND E_T_DATA.
        CLEAR WA_MARM1.
        CLEAR WA_MARM2.
      ENDLOOP.
    Edited by: Shen Peng on Oct 20, 2010 10:09 AM

  • Function modules for data retrieval from diff. tables

    Hi,
    I would just like to ask if there are function modules that can be used to retrieve data from the ff. tables:
    TSAD3T
    KNVV
    ESTRH
    for TSAD3T i need to get the value of title_medi
    for KNVV    i need to get the fields klabc vkorg vtweg
    for ESTRH  i need to get the fields subcat subid.
    Thanks.

    I doubt if you have such a FM

Maybe you are looking for

  • Request.getParameter("checkbox") Returns only one value

    Hello Friends, I have a very urgent problem on live site. I moved my project from jrun2.3.3 to Jrun 3.1 and I was using multiple select and checkboxes. With Jrun3.1 if you select multiple select or multiple checkboxes it returns only one value instea

  • How to view file item count in finder window?

    Hi all, Pre-Lion, I had things set up so that I was able to view the number of files/items in a finder window that was in list view. This information would show up at the bottom of my finder windows. I know I had intially pressed some kind of OS X sh

  • Is there a way for my hard drive to show up in itunes?

    MY hard drive is getting full on my computer and i was wondering if there is a way to have my external hard drive show up in itunes so i can play music off of it? Let me know thanks

  • Replace drive with SSD

    Hi All I have a late 2008 Aluminium macbook. I was wondering about replacing the current har drive with an ssd drive. I know I should get fatser boot time etc but does anyone know what sort of extra battery life I would get by using 1. Thanks

  • Error message on Java 1.4.2_06

    Hello everyone, I am really new to Java so bear with me. I am running an application that used java to display views on the web. this view used to be working fine in the beginning but now I always receive the following error message. Kindly find belo