Is their any function module for deleting condition record i am trying

Hi Experts,
Is their any function module for deleting condition record i am trying  this way.......
DATA: TABLE (4) TYPE C.
DATA: KNUM LIKE KONH-KNUMH
DATA: K_VEWE LIKE T681-KVEWE VALUE 'A'.
DATA: T681_STR LIKE T681.
DATA: LV_NUM TYPE I.
GET PARAMETERS
PARAMETERS: TABNO LIKE T681-KOTABNR.
PARAMETERS: TESTMODE DEFAULT 'X' AS CHECKBOX.
REFRESH INT_KNUMH.
Select single * from T681 into T681_STR
where kvewe = K_VEWE AND
KOTABNR = TABNO.
IF SY-SUBRC NE 0.
WRITE: / 'No entry in T681 for number ', TABNO.
WRITE: / 'Check whether corresponding condition table exists.'.
EXIT.
ENDIF.
TABLE = T681_STR-KOTAB.
SELECT KNUMH FROM (TABLE) INTO KNUM.
SELECT SINGLE * FROM KONH WHERE KNUMH = KNUM.
IF SY-SUBRC NE 0.
INT_KNUMH-KNUMH = KNUM.
COLLECT INT_KNUMH.
ENDIF.
ENDSELECT.
DESCRIBE TABLE INT_KNUMH LINES LV_NUM.
IF LV_NUM EQ 0.
WRITE: / 'No inconsistent entries found.'.
WRITE: / 'Each record in the condition table has a corresponding.'.
WRITE: / 'entry in the KONH table.'.
EXIT.
ENDIF.
LOOP AT INT_KNUMH.
IF TESTMODE IS INITIAL.
DELETE FROM (TABLE) WHERE
KNUMH = INT_KNUMH-KNUMH.
IF SY-SUBRC = 0.
WRITE: / 'KNUMH =', INT_KNUMH-KNUMH(10), ' deleted from table ' ,TABLE.
ELSE.
WRITE: / 'DELETE: SY-SUBRC is', SY-SUBRC , ' FOR KNUMH = ' .
WRITE: INT_KNUMH-KNUMH(10).
ENDIF.
ELSE.
WRITE: / 'TESTRUN: KNUMH =', INT_KNUMH-KNUMH(10).
ENDIF.
ENDLOOP.
is their any Standerd Function module  for comparing  tables if the condition record not exist in it has to exit if it is their then compare  those two tables if not exist in one table also that has  to be delete  the condition record
Please let me know .....

Hi,
   You can use Function module PRICING_CHECK to check condition record. Do a where-used list on it to see how to call it.
Regards
Kiran Sure

Similar Messages

  • Function Module for creating condition record (XKOMV table record)

    Hi,
    I have a requirement as like below,
    In the repair order i need to sum the GRWR condition type's  conditional values for all the line items (Except deliverable line item) and then i need to create an condition type GRWR under the deliverable line item with the above calculated conditional values,
    the table XKOMV will be having details about all the line item's condition types, in this table i need to add one more new record with the condition type of GRWR and the above calculated conditional values under the deliverable line item.
    for the above logic i am using the user exit
    USEREXIT_SAVE_DOCUMENT_PREPARE
    All the above things need to be done when the user click the save button in the transaction (VA01/VA02).
    Problem here is table XKOMV contains somany fields so manually we can't create xkomv record, is there any Function module to create condition type record?
    Regards,
    Manikumar
    Edited by: Manikumar Shanmugam on Mar 8, 2008 3:53 PM

    Hi,
       You can use Function module PRICING_CHECK to check condition record. Do a where-used list on it to see how to call it.
    Regards
    Kiran Sure

  • Any BAPI/Function Module for adding new record with dates in PA0027

    Hi all,
    I am tryig to find is there any BAPI/Function module for updating new record with Start Date and End date for specified Personal Number in PA0027 Table.
    In PA0027 table i will be passing start date and end date for selected personal number, it needs to add new record with this details in the table checking the condition that this start date and end dates should not be between any of of start date and end dates for the specified personal number.
    thanks for ur time.
    Murali

    Hi Raj/Suresh thanks for ur answers.
    but i am having a problem,i gave this values.
    INFTY               -
                0027
    NUMBER              -
                00000010
    SUBTYPE             -
                010
    OBJECTID
    LOCKINDICATOR
    VALIDITYEND         -
                03/12/2006
    VALIDITYBEGIN       -
                03/01/2006
    RECORDNUMBER        -
                000
    RECORD              -
                P0027
    OPERATION           -
                CHK
    TCLAS               -
                A
    DIALOG_MODE         -
                0
    NOCOMMIT            -
                Y
    VIEW_IDENTIFIER
    SECONDARY_RECORD
    i am getting short dump saying that
    The source field is too short.
    The current program, "SAPLHRMM", tried to assign a field to a field symbo
    However, the field is shorter than the type of the field symbol, which
    is not allowed.
    The statement in question is in the form ASSIGN f TO <fs> CASTING or
    ASSIGN f TO <fs> with a field symbol that was created using the
    STRUCTURE addition.
    I tried  operation - Chage,Create (same thing for all inputs)
    is this correct funtion moduel for my requirment?
    what ever i am passing the start and end dates this should check in the table records with this personal number and if this start date and end dates are not between of any start and end dates then it should add new record with this dates.
    Thanks for ur time.
    Murali.

  • Is there any function module for getting distribution list name

    Hi all,
    Is there any function module for getting distribution list name when there is same description for two distribution list name.
    or
    help me how to fetch the correct distribution name when there is same description.
    In order to send mails.
    Tell me ASAP.
    thanks
    sagar.

    http://www.sapbrainsonline.com/REFERENCES/FunctionModules/SAP_function_modules_list.html
    list of Fms

  • Is there any function module for purchase order change

    Hi Experts,
    Is there any function module for purchase order change or i need to do new recording in me22n.
    Thanks,
    Senthil

    Hi
    Function module <b>BAPI_PO_CHANGE</b> enables you to change purchase orders. The Change method uses the technology behind transaction ME22N.
    Regards,
    Viven

  • Hi is there any function module for radix conversion

    Hi,
    I need to convert number of base 36 to decimal number. Is there any function module for that.
    i.e) z to 35
         10 to 36
         11 t0 37

    Hai,
    This program perfectly converts a number from one number system to another number system.
    REPORT  Z_RADIX_CONVERSION.
    PARAMETERS:
      P_S_RAD(2) TYPE N,                   " Source Radix
      P_D_RAD(2) TYPE N,                   " Destination Radix
      P_S_NUM(5) TYPE C.                   " Source Number
    *" Data declarations...................................................
    Work variables                                                      *
    DATA:
      W_LEN         TYPE I,
      W_FACT        TYPE I,
      W_D_NUM(5)    TYPE N,
      W_T_LEN       TYPE I,
      W_NUM         TYPE C,
      W_NUM1        TYPE I,
      W_REM         TYPE I,
      W_INDEX       TYPE I VALUE 20,
      W_T_NUM(30)   TYPE C,
      W_T_NUMBER(5) TYPE N.
    IF P_S_RAD GE 1  AND
       P_S_RAD LE 16 AND
       P_D_RAD GE 1  AND
       P_D_RAD LE 16.
      IF P_S_RAD EQ 01 AND P_S_NUM CO '0 ' OR
         P_S_RAD EQ 02 AND P_S_NUM CO '01 ' OR
         P_S_RAD EQ 03 AND P_S_NUM CO '012 ' OR
         P_S_RAD EQ 04 AND P_S_NUM CO '0123 ' OR
         P_S_RAD EQ 05 AND P_S_NUM CO '01234 ' OR
         P_S_RAD EQ 06 AND P_S_NUM CO '012345 ' OR
         P_S_RAD EQ 07 AND P_S_NUM CO '0123456 ' OR
         P_S_RAD EQ 08 AND P_S_NUM CO '01234567 ' OR
         P_S_RAD EQ 09 AND P_S_NUM CO '012345678 ' OR
         P_S_RAD EQ 10 AND P_S_NUM CO '0123456789 ' OR
         P_S_RAD EQ 11 AND P_S_NUM CO '0123456789A ' OR
         P_S_RAD EQ 12 AND P_S_NUM CO '0123456789AB ' OR
         P_S_RAD EQ 13 AND P_S_NUM CO '0123456789ABC ' OR
         P_S_RAD EQ 14 AND P_S_NUM CO '0123456789ABCD ' OR
         P_S_RAD EQ 15 AND P_S_NUM CO '0123456789ABCDE ' OR
         P_S_RAD EQ 16 AND P_S_NUM CO '00123456789ABCDEF ' .
        W_LEN = STRLEN( P_S_NUM ).
        W_T_LEN = W_LEN - 1.
        DO W_LEN TIMES.
          W_NUM = P_S_NUM+W_T_LEN(1).
          CASE W_NUM.
            WHEN 'A'.
              W_NUM1 = 10.
            WHEN 'B'.
              W_NUM1 = 11.
            WHEN 'C'.
              W_NUM1 = 12.
            WHEN 'D'.
              W_NUM1 = 13.
            WHEN 'E'.
              W_NUM1 = 14.
            WHEN 'F'.
              W_NUM1 = 15.
            WHEN OTHERS.
              W_NUM1 = W_NUM.
          ENDCASE.
          W_D_NUM = W_D_NUM + W_NUM1 * ( P_S_RAD ** W_FACT ).
          ADD 1 TO W_FACT.
          SUBTRACT 1 FROM W_T_LEN.
        ENDDO.
      ELSE.
        WRITE'Invalid Number'(003).
      ENDIF.
    ELSE.
      WRITE'Enter radix between 1 and 16 '(002).
    ENDIF.
    W_T_NUMBER = W_D_NUM.
    IF P_D_RAD = 1.
      DO W_D_NUM TIMES.
        WRITE'O'.
      ENDDO.
    ELSE.
      WHILE W_T_NUMBER NE 0.
        W_REM = W_T_NUMBER MOD P_D_RAD.
        CASE W_REM.
          WHEN  10.
            W_T_NUM+W_INDEX(1) = 'A'.
          WHEN  11.
            W_T_NUM+W_INDEX(1) = 'B'.
          WHEN  12.
            W_T_NUM+W_INDEX(1) = 'C'.
          WHEN  13.
            W_T_NUM+W_INDEX(1) = 'D'.
          WHEN  14.
            W_T_NUM+W_INDEX(1) = 'E'.
          WHEN  15.
            W_T_NUM+W_INDEX(1) = 'F'.
          WHEN OTHERS.
            W_T_NUM+W_INDEX(1) = W_REM.
        ENDCASE.                           " CASE W_REM.
        SUBTRACT 1 FROM W_INDEX.
        W_T_NUMBER = W_T_NUMBER DIV P_D_RAD.
      ENDWHILE.
    ENDIF.
    WRITE:
      /10 'The Equivallent number in Base'(001),
           P_D_RAD,
           'is',
           W_T_NUM.
    <b>Reward points if helpful .</b>
    regards,
    rama pammi

  • Any Function module for Date conversion

    Hi,
    In my output the date is coming like 80999898 but the actual date is 01.01.1900.
    Could you please tell me is there any Function module for that.
    Regards,
    Tushar

    Use the conv. exit CONVERSION_EXIT_INVDT_OUTPUT for this purpose.
    BR,
    Suhas

  • Is their any function module to  see the details of employee ?

    Hello ,
    Is their any function module through which we can  see the details of employee
    ASAP
    SANDEEP JADHAV

    BAPI_EMPLOYEE_GETLIST
    BAPI_EMPLOYEE_GETDATA
    BAPI_PERSDATA_GETDETAIL: Read personal data
    BAPI_PERSDATA_GETDETAILEDLIST: Read instances with data
    BAPI_PERSDATA_GETLIST: Read instances

  • 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

  • Any function module for getting fiscal year week numbers

    can any one provide me function module for getting fiscal year week numbers ? if no function module please let me know work around.
    Thanks!
    Lakshmikandh

    hi,
    Use FM <b>'DATE_GET_WEEK'</b>...
    parameter D1 LIKE SCAL-DATE.
    Data w like scal-week.
    CALL FUNCTION <b>'DATE_GET_WEEK'</b>
    EXPORTING
    date = D1
    IMPORTING
    WEEK = W
    EXCEPTIONS
    DATE_INVALID = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write W+4(2).
    Regards,
    Santosh

  • Any Function Module For getting Shipment Details

    Hi All,
    I want to get all details of shipment. i tired , but unable to get any function? I was able to find the creation or change shipment function modules, but not able to find the function module for getting the details for Shipment.
    like BAPI_SHIPMENT_CHANGE           Change Shipment
    BAPI_SHIPMENT_CREATE           Create Shipment
    similary
    Do you have any idea for getting (display)the details of Shipments?
    Regards,
    Raju

    hi,
    you can use
    VTTP,VTTK
    or
    RV_SHIPMENT_READ

  • Search for a function module for deleting document originals (DMS)

    Hi,
    I'm searching for a function module to delete originals in documents (like manually with transaction cv02n). I'm only able to set an delete mark with the module 'BAPI_DOCUMENT_DELETE'.
    The module 'BAPI_DOCUMENT_CHANGE2' can only add new originals to an existing document. I need a possibility to delete all originals in an document without deleting the document itself.
    Has anyone an idea?
    Thanks.
    Jan-Christian Treusch

    Many thanks!
    That's especially the method I've searched for so long....
    best regards.
    Jan-Christian Treusch

  • Any function module for  validation

    Hi,
    I am new to ABAP.
    Can any body tell me whether there is any built in function module for
    field validation.
    Thanks in advance
    Archana

    Hi,
    u can validate the field values using at selectiion-screen
    •     AT SELECTION-SCREEN
    When user enters the values in the fields of selection screen and clicks on execute button, this event gets triggered. This event is basically for checking the values entered by the user for the fields of the selection screen i.e., data validity checking. This event is for entire selection screen.  For example:
    You are accepting carrid, connid, fldate from user and you don’t want to proceed if user enters no value for carrid and fldate.  Using AT SELECTION-SCREEN can do this.
    Select-options: carrid1 for sflight-carrid,
              Connid1 for sflight-connid,
              F1date1 for sflight-f1date.
    AT SELECTION-SCREEN.
    If carrid1-low ne ‘  ’ and fldate1-low = ‘  ’.
        Error message.
    Endif.
    In this case, if both the fields are entered blank, then the user gets error message.
    Basically, this event is for many fields on selection screen.  Usually, it is for the fields which are logically related.
    •     AT SELECTION-SCREEN ON  <field>
    When you want to check for specific value of a field. For example, carrid should be in the range of ‘LH’ and ‘SQ’. This can be done in this event.  Basically, this event is for checking individual fields. You can have many AT selection-screen events in your program (i.e., for each field specified in the Select-Options).
    Select-Options carrid1 for sflight-carrid.
    AT SELECTION-SCREEN.
    If carrid1-low ne ‘LH’ and carrid1-high ne ‘SQ’.
       Error message.
    Endif.
    Here the system will not proceed on entering wrong values.
    Regards,
    Sruthi

  • Any function module for PIC01??

    Hi Guys,
    Could you please tell me, do we have any function module / BAPI for the transaction PIC01 - to create supersession....
    suggest me if any one worked on supersession conversion....
    -Mahesh.

    Hi Ragesh,
    try with requirements (in the VOFM area).
    Cheers,
    Stefan.

  • Is there any function module for converting text to hyperlink?

    Hello all,
              I am designing an application in BSP wherein the user can enter hypertext values for some
              of the data enteries in the database table. Is there any function module available for converting
              text into hypertext. Eg. if the user enters 'www.mypersonalwp.com' then it should convert this
              text value into a hyperlink.
    Thanks in advance.
    Gurmahima.

    Hi,
    Refer the given below link
    http://help.sap.com/saphelp_erp2004/helpdata/EN/85/ce25c2d7ae11d3b56d006094192fe3/content.htm
    Hope it helps you
    Thanks
    Arun Kayal

Maybe you are looking for

  • No videeo on A31

    I have an A31 that has no video. The system boots up, but there is no video or any sign of video. I was using the system earlier in the day with no problems. It may have gone into suspend mode, it may have gone into hibernate mode. I don't know for s

  • Transfer games and games scores to a new ipad

    I have an Ipad 2. My husband plays games on it and his Angry Bird score is very good. He wants to put Angry Birds on his Ipad but doesn't want to lose his scores/ranking etc. I don't play the game. Is there a way to do this so he can use his own mach

  • Only Load Tab Once Clicked When Opening Large Groups of Bookmarks

    I have a bookmarks folder containing a few websites I like to visit regularly. When I want to open all of these websites at once I open the bookmark folder, scroll to the bottom of the folder and click "Open All in Tabs". This opens *and* loads all o

  • No timeline showing in after effect cs5.5.How Can I get it manually?

    I have downloade an after effect templete from net.When I open the project file timeline is gone.This is only happen to thsee templete only.Doed any one know how to get time line manully?

  • Iphone not syncing all outlook events

    hi, so my boss has an iphone that isn't syncing some appointments or changes to his outlook calendar.  this happens randomly and intermittantly.  when another person on the same server adds or invites to an appointment, his Mac will show it but it do