Commit work in the customer exit

Hi ,
Iam getting this dump in my system.
Exception condition
"DUMP_STATUS_INCONSYSTENCY_FRE" raised. 
As per this dump one note is there saying you should not use commit work in user exit or customer exit .
But i need to update the table at that point so please tell me with out using commit work can i update the table at that point.
Please help me its imp.
Thank you .

Use the function Modules ENQUEUE_E_TABLEE and DEQUEUE_E_TABLEE.Update the table between these function modules.
Example :
CALL FUNCTION 'ENQUEUE_E_TABLEE'
    EXPORTING
      mode_rstable   = c_e
      tabname        = c_sold_table
    EXCEPTIONS
      foreign_lock   = 1
      system_failure = 2
      OTHERS         = 3.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
*********End Lock********
  IF i_del_sold[] IS NOT INITIAL.
    DELETE ztsa_ft_soldtp FROM TABLE i_del_sold.
  ENDIF.
  IF i_del_ship[] IS NOT INITIAL.
    DELETE ztsa_ft_shiptp FROM TABLE i_del_ship.
  ENDIF.
  IF i_db_ship[] IS NOT INITIAL.
    MODIFY ztsa_ft_shiptp FROM TABLE i_db_ship.
  ENDIF.
  IF i_db_sold[] IS NOT INITIAL.
    MODIFY ztsa_ft_soldtp FROM TABLE i_db_sold.
  ENDIF.
*Sold to Party Table
  CALL FUNCTION 'DEQUEUE_E_TABLEE'
    EXPORTING
      mode_rstable = c_e
      tabname      = c_sold_table.

Similar Messages

  • COMMIT WORK within an user exit

    Hi every one,
         I got a lill question here, can i use COMMIT WORK (AND WAIT ) within a user
    exit FM, if yes is do i need any thing extra. Please help.
    Thanks in advance
    Jahan.

    Hi Jahan,
    although your question has been answered, just a few words on COMMIT WORK.
    During a LUW (logical unit of work, i.e. transaction) all changes of database records are done within a so-called rollback segment of the database. That means they are visible within the current LUW but invisible to other users.
    This makes it easy to do all necessary changes to all tables step by step. And if any step fails, all changes can be thrown away. Thats what we call a rollback - A rollback will just dump the rollback segment.
    The reason you should not COMMIT WORK in a user exit is simply you have no idea what other database changes have already been done and what other database changes may follow after the user exit. If in one of the following steps a severe error is detected, all prior changes cannot be rolled back. COMMIT WORK means that all changes still in the rollback segment of the database will be applied and finalized to the database. The rollback segment will also be dumped that there is no chance to find out details about the changes.
    An Error message (Type E or A) will automatically finish the LUW without commiting the data in the rollback segment -  implicit rollback.
    The end of a report not caused by any error will commit the rollback segment to the database -  implicit commit.
    All function modules called IN UPDATE TASK will be executed in their own update process after COMMIT or DUMPED after rollback.
    All form routines called as PERFORM ... ON COMMIT or PERFORM ... ON ROLLBACK will be executed only after explicit COMMIT WORK or ROLLBACK WORK.
    The addition 'AND WAIT' just means that the next program statement is not executed before all update processes started with COMMIT WORK have finished.
    The general rule derived from this can be:
    Never do a commit or rollback in a process which is called by another process. The only place for COMMIT or ROLLBACK is at the end of reports and transactions using CALL ... IN UPDATE TASK or PERFORM ... ON COMMIT - if you call any functions you should be aware that function modules may initiate update calls and/or form calls ...ON COMMIT/ROLLBACK. An explicit COMMIT WORK at the end of a process (or ROLLBACK WORK in case of error) will be OK.
    Regards,
    Clemens

  • How to use Multiple Single Option for selection in the Customer Exit

    Hi,
    How can we handle the multiple single values in the customer exit variable.
    I have a requirement which is as follows -
    Table A fiields -> Field Coach, Partner 2, Relation between PArtner 1 & Partner 2, Valid from, valid to date.
    Table B ->  Service Month, Start Date, End Date.
    Table C -> Billing Date, Execution Partner,cal month /year.
    For the Field coach in TABLE A, multiple Partner 2 are present.
    Report has to be built on Table C.
    User inputs the Service month and Field Coach . User can enter multiple field coach values.
    For the All the Field Coach values entered, corresponding Partner2's have to be found from Table A and to be passed to the Execution Partner in Table C.
    Now if we want to use customer exit variable on the field Execution Partner, how can we handle the Multiple Single selections in the customer exit.
    Thanks,
    Shubham

    Hi,
    While creating the variable you must have to specify multiple value.
    In customer exit
    write code multiple times and append the values.
    For example:
    when 'variable'.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 1.
    APPEND L_S_RANGE TO E_T_RANGE.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 2.
    APPEND L_S_RANGE TO E_T_RANGE.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 3.
    APPEND L_S_RANGE TO E_T_RANGE.
    Regards,
    Ranganath.

  • How to find out the customer exit and sap exit variables created provider?

    Hi all,
    How to identify what are all the customer exit and sap exit variables are been created for an info provider. is there any tables which allow us to find out.
    thanxs
    haritha

    Hello haritha,
           SAP Exit and Customer Exit variables are created for  Characteristics and not for individual InfoProviders.
    So whenever the characteristic is used in the InfoProvider, by selection the appropriate variable the exit can be called.
    So the same Exit can be in one or more InfoProviders.
    Hope it helps.
    Thanks,
    Chandran

  • Looking for an ABAP-code for the customer-Exit Variable

    Hello,
    I have defined a Variable (Interval) which should be processed through Customer-Exit on characteristic Supplier-Date (date format). This Customer-Exit Variable is called ZDATE.
    We have another time characteristic Fiscal year / period (0FISCPER) which has single mandatory input variable for ex.  003.2011. This input variable is called ZFISCPER.
    Now I have to write an ABAP-Code where the customer exit variable ZDATE is derived (fiscal last year to last period) from input variable ZFISCPER in INCLUDE ZXRSRU01.
    Means when the input variable (ZFISCPER) is 003.2011 then the customer exit variable ZDATE should be calculated in INCLUDE ZXRSRU01 as 01.01.2010 u2013 28.02.2011 (fiscal last year to last period).
    Since I am quite new in ABAP, I will be grateful if you could write me sample ABAP for this.
    Many thanks.

    Hi,
    should be something like:
    DATA: l_s_range TYPE rsr_s_rangesid,
    input LIKE sy-datum.
    When 'ZDATE'
    CONCATENATE '0101' 0FISCPER+3(4)-1 into l_s_range-low. "You get 01012010
    CONCATENATE '01' Fiscper+1(6) into input.                            "You get 01032011
    l_s_range-high = input-1.                                                     "You get 28022011
    APPEND l_s_range TO e_t_range.
    Greetings
    Roman

  • Problem in transporting the Customer exit variable

    Hi all,
    i have careated a variable to capture the current date in my report, with the processing type, Customer Exit. and, its getting populated fine in my DEV environment. basically, i have to compute the number of days, in which net due date is being compared to the current date.  when i transport this to the QA environment, the values for number of days is gettting some junk value, wherein in DEV its showing the exact values. It seems i have to take cetain measures in transportation of the Customer Exit.
    please advice.
    Thanks in advance
    Sneel

    Hello ,
               In the Quality after you run the report check in the layout option>display text elements> variables and check what value is displayed for the use exit variable , if it is correct then problem may be in the selection you gave when you run the report if the user exit variable value is wrong , then set a break point in the code and run the report from rsrt and check where the error is.
    hope it is clear
    assign points if useful

  • How to do coding in the customer exit

    Hi I have found the customer exit by finding "Call function Exit" in the program. Now my question is how to do coding for that exit as I can not enter it directly in CMOD.

    Hi Suchender,
    in TA CMOD you first have to create a Z- project. Then assign an enhancement.
    The assigned enhancement offers one or more components. After assigning the enhamcement,
    display the components. in case enhancemnet is a function exit simply double click it and you will navigate
    to function builder. there you will find an include, where you can place your coding.
    regards
    rea

  • Bex variable value manipulation in the customer exit

    Hello Experts - I have a situation where I need to manipulate the value of a variable in the customer exit based on certain conditions. I have a customer class variable defined in the query with the processing by Manual Input/Default Value. I need to restrict the values that this variable gets based on values that are selected for another variable (division). For example if the division value is 01, class variable can not have value 'CB'. Any ideas how this can be accomplished. Any input will be appreciated.
    Rgds,
    Venu.

    Mansi & Guy - Thanks for your input. The query is not used interactively and it is used as dashboard query in VC for which the variables are fed via Adobe Flex application. In detail here is my requirement -
    Division is a mandatory field that is selected on the dashboard (You can think this for query)
    Class is a Optional field (users have option to select multiple values).
    If the users choose particular division (say in my case 04) and not any Class, at the query level, I want to exclude CB which I can do it in i_step3 logic.
    In case if the user selects any class, I want to skip the logic of exclusion in the i_step3 (This is because, I can restrict the user what class they can pick based on the Division they choose, so the i_step3 logic wouldn't be required in this case).
    Basically, I do not want to raise messages and this needs to handled based on user selections.
    Appreciate your help,
    Venu.
    Edited by: Venu on Sep 14, 2009 10:03 PM

  • How to find the customer exits for a particular transaction

    hi
    how to find the customer exits for a particular transaction

    Hi jyothsna vankadari ,
    ther is a convenient way to find all BADIS called. You may know that BADIS are the newer version of EXITs.
    I would suggest you to go for BADI.
    Follow the below steps to find out what all BADI's are called when you press any button in any transaction.
    1) Goto se24 (Display class cl_exithandler)
    2) Double click on the method GET_INSTANCE.
    3) Put a break point at Line no.25 (CASE sy-subrc).
    Now
    4) Execute SAP standard transaction
    5) Press the required button for which you need to write an exit logic, the execution will stop at the break point.
    6) Check the values of variable 'exit_name', it will give you the BADI name called at that time.
    7) This way you will find all the BADIs called on click of any button in any transaction.
    Regards,
    Clemens

  • Does commit work (commiting the changess to database take same time for ..

    Does commit work (commiting the changess to database )take same time for one record and 1000 records

    Hi ,
    There is some micro seconds differences in updating the recors . If you have huge records ,split the data into parts and insert it .
    To avoid errors  or warnings ,you can use 'WAIT UPTO 5 SECONDS ' .
    Thanks
    Jagadeesh.G

  • How do I use the Exclude in the customer exit

    I have to create a customer variable which will be passed back to the program and used for an exclusion.  the user enters company codes and this passes into the user exit.  In the exit i need to just place and S in from of then and these need to be used to exclude data.  I tried restricting the variable in the query but it doesn't allow me to exclude.  How do i accomplish this?

    Hi MICK,
      If you want to write code in customer exit and exclude some values for the variable in query,note the following things
    -  l_s_range-sign = 'E'.
       Here 'E' means exclude
    - Create the variable with OPTIONAL
      Otherwise your customer exit won't work
    Hope this helps.
    Assign points if helpful
    Regards,
    Aaron Wang

  • Number of working days in customer exit?

    Hi, this is actually an extension to the following thread.
    How to calculate number of working days
    I have very similar requirement. Determine the number of working days (excluding weekends and holidays) from 2 given dates. But the <b>difference here</b> is that, one of the date in the calculation is the<b> current date.</b>
    1: Creation Date - this is present as infoobject in the ODS.
    2: Current Date - this is 'today''s date.
    And, No. of Working days(Zworkdays)  = Current Date - Creation Date.
    So, as mentioned in the thread 305257 speaks about including the logic in the update rules, I can use system variable sy-datum to get the current date in update routine. But if the load is not scheduled for every day (say,once in 2 days), then when i report this infoobject Zworkdays on Day2, then it will hold Day1 calc rite?
    PLease correct me if I am wrong.
    Could you please help me with other approachs I can follow. One I can think is Customer Exit in Bex for the same.... but I am not sure how to do the same (i am new to Bex and Customer exit). Could any one of you please guide me how to achieve the same. I Have 0CalDate in the ODS also. 
    Any other ideas/inputs is greatly appreciated.
    Thanks in advance
    Ramya

    Hi,
    search for virtual key figures.
    Rgds.
    Juergen
    P.S. Thanks for assigning points
    Message was edited by:
            Jürgen Hemelt

  • Logic of the  Customer Exit Variable

    Hi Experts,
    Could you please explain me the logic (Functionality) of the below  Customer Exit Variable .....
    WHEN 'AKFR05'. "M-5 monthly forecast version
            CALL FUNCTION 'END_TIME_DETERMINE'
              EXPORTING
                duration         = -5
                unit             = 'MON'
                factory_calendar = l_LACID
              IMPORTING
                end_date         = l_fn_dte
              CHANGING
                start_date       = sy-datum
                start_time       = sy-uzeit.
            CHECK sy-subrc = 0.
            CLEAR l_s_range.
            l_s_range-low(4) = 'LGMN'.
            l_s_range-low+4(6) = l_fn_dte(6).
            l_s_range-sign = k_sign_inclusive.
            l_s_range-opt = k_option_equals.
            APPEND l_s_range TO e_t_range.
    Thanks in Advance

    Thanks for the update...
    The First Part
            CALL FUNCTION 'END_TIME_DETERMINE'
              EXPORTING
                duration         = -5
                unit             = 'MON'
                factory_calendar = l_fcalid
              IMPORTING
                end_date         = l_fn_date
              CHANGING
                start_date       = sy-datum
                start_time       = sy-uzeit.
    For Example:
        Current Date : 27.04.2009
    By using the FM END_TIME_DETERMINE the END_DATE (27.11.2008) is exported to l_fn_date
    Could you please explain me the logic after exporting the end date
    l_s_range-low(4) = 'LGMN'.
            l_s_range-low+4(6) = l_fn_date(6).
            l_s_range-sign = k_sign_inclusive.
            l_s_range-opt = k_option_equals.
            APPEND l_s_range TO e_t_range.
    Thanks in Advance

  • Code (ABAP) for the Customer Exit Variable (CMOD)

    Scenario
    An employee can purchase any no of policies in a day or month.each policy will have start date and expiry date.
    My requirment
    Count all the policies(valid) by employee on a ranges basis exception reporting
    (0-10;10-20;20-30;30-40) and then able to drill down by policy start date and expiry date.
    As per the requirment is to show policies that employee had with in the give date intreval  which are not yet expired (active) i need to write a condition that will count only policies whose Expiry date is > Current calender day
    As Policy Expiry Date is a char i am converting it to KF using fourmala variable so that i can write a condition on it using current cal day formula variable sap exit
    Requirment:
    Need a code for SAP exit variable which will meet the following requirment
    There are the following 2 variables in the query
    1) A variable (User Input)(Date Range) on Policy Start Date and
    2) Authorisation Variable which is based on Authorisation Object(Analysis Authorisations)
    I need a SAP Exit variable (CMOD) that will
    BAsed on the user entered Policy Start date it has to pick all the policy exiry date of the policies and display all the policies whose expiry date is greate than Sy Date (Current Date) and also if Policy Expiry Date is blank or # it has to display
    Arun supplied me with the below code...but i think it doesn't include blank expiry date or #...as i am new to ABAP please update me with releavent code
    Policy Start Date : ZPST_DTE
    Policy Expiry Date: ZPSP_DTE
    Variable (Type:Customer Exit) on Expiry Date: ZEEXP_DTE
    Arun's Code:
    IF I_STEP = 1.
    CASE V_NAME
    WHEN 'X' " X is the variable u created for the exit
    l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.
    END CASE.
    Please modify above code to include Blank or # values of Expiry Date
    Thanks Arun
    Please ask if you need further info as this is urgent
    Thanks

    Hi Arun,
    Thanks for the help...will definetly assign points
    (Closed the previous thread)
    Please spare bit of ur time as this is my first ABAP Code
    Can i include 2 restrictions..# and Variable (Customer Exit)...But how can i include Records with Blank Values
    As the data from Source system the expiry date is filled up with either Date or # or Blank...my requiorment is to include all 3 and
    Question:
    As there are 2 other variables defined ..one on Policy Start Date (User input date intreval) and Location (Authorization Variable..Analysis Authorisations)...Do i need to change I_STEP in the code
    (Req: Reports shows all the(still valid) policies emp has purchased between  2 give date (Variable on Policy Start date)
    IF I_STEP = 1.
    CASE V_NAME
    WHEN 'X' " X is the variable u created for the exit
    l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.
    END CASE.

  • Explain the customer exit code?

    Hi,
    Any one explain this customer Exit written for a variable.
    When 'Zabcdefg'.
          clear: beg_fiscper, end_fiscper.
          call function 'DATE_TO_PERIOD_CONVERT'
            exporting
              i_date               = sy-datum
          I_MONMIT             = 00
              i_periv              = 'S1'
           importing
             e_buper              = period
             e_gjahr              = year
           exceptions
             input_false          = 1
             t009_notfound        = 2
             t009b_notfound       = 3
             others               = 4.
          if sy-subrc eq 0.
          Period = Period - 1.
            concatenate year period
                         into beg_fiscper.
            concatenate year period
                         into end_fiscper.
          endif.
          clear: l_s_range.
          l_s_range-sign   = 'I'.
          l_s_range-opt = 'BT'.
          l_s_range-low    = beg_fiscper.
          l_s_range-high   = end_fiscper.
          append l_s_range to e_t_range.
    Points will be definitely assigend.
    Vasu

    When 'Zabcdefg'.
    clear: beg_fiscper, end_fiscper.
    bold A fucntion module whcih converts the given date into the period
    call function 'DATE_TO_PERIOD_CONVERT'
    exporting
    i_date = sy-datum
    bold The date passed is the system date.
    boldThe other variable values are passed below
    I_MONMIT = 00
    i_periv = 'S1'
    importing
    e_buper = period
    e_gjahr = year
    exceptions
    bold Exceptions in case of not found values
    input_false = 1
    t009_notfound = 2
    t009b_notfound = 3
    others = 4.
    bold checking whether the execution is true and if true, the period is geting a period less minus one which is output from the function module.
    if sy-subrc eq 0.
    Period = Period - 1.
    bold joining the period and year
    concatenate year period
    into beg_fiscper.
    concatenate year period
    into end_fiscper.
    endif.
    bold passing output to the variable in the report.
    clear: l_s_range.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    l_s_range-low = beg_fiscper.
    l_s_range-high = end_fiscper.
    append l_s_range to e_t_range.

Maybe you are looking for

  • Transfer file to an external FTP SERVER

    HI Gentelemen!!, I'm trying to open an external FTP connection, sending a file from the  MiniSAP. Which is the appropiate RFC connection that I have to use?? Anybody know how to set RFC connection to access an external FTP server. This are the MF tha

  • Calling javascript function with StageWebView problems

    I have a test html page I made to R&D some functionality, in my view I have a stageWebView and am calling a local html file from inside the app like this: stageWebView.loadURL(new File(new File('app:/assets/html/reports.html?stuff=1234').nativePath).

  • Updated to V21.0.025, but, now messages will not o...

    I have a5800 and have just updated to V21.0.025 and now I cannot open messages in my inbox or sent boxetc. I open the Inbox scroll to the message I want to open "click" and nothing happens, if I "click" on options that does not open either. I have tr

  • Why doesn't this cycle work?

    drain = true; onEnterFrame = function(){     if(drain == true){water_mc.waterlv_mc._alpha -= 2;}     if(water_mc.waterlv_mc._alpha < 3){water_mc.waterlv_mc._alpha += 2; drain = !true;}        if(water_mc.waterlv_mc._alpha > 97){drain = true;} the bas

  • Locked sim what does this mean?

    Locked sim what does this mean?