User Exit for maintaining Checking Rule while creating Sales Order

Hi Gurus,
I have a requirement where I need to assign a particular value to Checking Rule (VA02 -> Display Availability Button -> Checking Rule field (beside Checking Group field)) while creating a Sales Order in SD (via. IDOC's).
In my requirement, within one Checking Group there are multiple checking rules assigned. When I am trying to assign the checking group in userexit_move_field_to_vbap (include MV45AFZZ), it is picking up the default checking rule ('A') and not the customized one defined for our requirement.
Is there any other user exit within which I can directly assign the Checking Group and Checking Rule while creating the sales order, please suggest.
Regards,
Arvind.

You can use userexit 'USEREXIT_MOVE_FIELD_TO_VBAP' in include MV45AFZZ. This is executed every time a user changes anything on a material (e.g. put in a material number) and hits return. Just raise your pop-up window there if the user puts in the particular material you are talking about. The material number is available in xvbap-matnr.
Hope that helps,
Michael

Similar Messages

  • User exit for pop-up box in creating sales order

    how to display a pop-up window while entering a particular material in the creation of the sales order

    You can use userexit 'USEREXIT_MOVE_FIELD_TO_VBAP' in include MV45AFZZ. This is executed every time a user changes anything on a material (e.g. put in a material number) and hits return. Just raise your pop-up window there if the user puts in the particular material you are talking about. The material number is available in xvbap-matnr.
    Hope that helps,
    Michael

  • Automatic creation of  settlement rule while creating sales order

    Hi Friends,
    Can any one help me how to create settlement rule automatically while creating sales order i.e saving sales order. Is there any function module or any badi which can be used.. please suggest.
    thanks
    bobby

    Hi,
    Here is the solution , First Create a sustitution by going into OPSN Transaction , only user exit say 'U902'
    and write the form routine in Program named 'ZRGGBS000'
    The code is below ,
    *&      Form  U902
       Automatic Generation of Settlement Rule For WBS and Company 4180
    FORM u902.
    Exit For Automatic Settlement Rule Creation for WBS Billing elements
      IF sy-tcode = 'CJ20N' or sy-tcode = 'CJ01' or sy-tcode = 'CJ02'.
        DATA   lv_proj TYPE ps_pspid.
        lv_proj = proj-pspid.
        EXPORT lv_proj TO MEMORY ID 'PSPID'.
    Calling YGPS_CJB1EXEC Program For Creating Settlement Rule
        SUBMIT ygps_cjb1exec AND RETURN.
      ENDIF.
    ENDFORM.                                                    "u902
    *& Program  YGPS_CJB1EXEC
    PROGRAM  ygps_cjb1exec.
       Automatic Generation of Settlement Rule For WBS and Company 4180
    Called From Exit For Automatic Settlement Rule Creation for WBS Billing elements
    DATA: bdcdata_wa  TYPE bdcdata,
          bdcdata_tab TYPE TABLE OF bdcdata,
          itab TYPE TABLE OF bdcmsgcoll.
    DATA :lv_currm LIKE bkpf-monat,
          lv_curry LIKE bkpf-gjahr,
          lv_prevm LIKE bkpf-monat,
          lv_prevy LIKE bkpf-gjahr,
          lv_proj TYPE ps_pspid,
          lv_mode TYPE c,
          lv_time TYPE sy-uzeit.
    DATA :g_datfm            LIKE usr01-datfm,
          g_dd(2)            TYPE c,                         " Day
          g_mm(2)            TYPE c,                         " Month
          g_yyyy(4)          TYPE c,                         " Year
          g_sydatum(10)      TYPE c.
    IMPORT lv_proj FROM MEMORY ID 'PSPID'.
    lv_mode = 'N'.
    CLEAR bdcdata_wa.
    bdcdata_wa-program  = 'SAPLKAZB'.
    bdcdata_wa-dynpro   = '1000'.
    bdcdata_wa-dynbegin = 'X'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_CURSOR'.
    bdcdata_wa-fval = 'PRZB-VARIANT'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'PRZB-VARIANT'.
    bdcdata_wa-fval = 'ZGPS0001'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CALL FUNCTION 'GET_CURRENT_YEAR'
      EXPORTING
        bukrs = '4180'
      IMPORTING
        currm = lv_currm
        curry = lv_curry
        prevm = lv_prevm
        prevy = lv_prevy.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'RKAUF-FROM'.
    bdcdata_wa-fval = lv_currm.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'RKAUF-GJAHR'.
    bdcdata_wa-fval = lv_curry.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = '=VARC'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-program  = 'RKPSEL00'.
    bdcdata_wa-dynpro   = '1000'.
    bdcdata_wa-dynbegin = 'X'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_CURSOR'.
    bdcdata_wa-fval = 'CN_PROJN-LOW'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'CN_PROJN-LOW'.
    bdcdata_wa-fval = lv_proj.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'CN_PSPNR-LOW'.
    bdcdata_wa-fval = space.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'CN_NETNR-LOW'.
    bdcdata_wa-fval = space.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'CN_ACTVT-LOW'.
    bdcdata_wa-fval = space.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'CN_MATNR-LOW'.
    bdcdata_wa-fval = space.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = '/00'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = '=SAVE'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = '=VBAC'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-program  = 'SAPLSPO1'.
    bdcdata_wa-dynpro   = '0100'.
    bdcdata_wa-dynbegin = 'X'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = '=YES'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-program  = 'SAPLKAZB'.
    bdcdata_wa-dynpro   = '1000'.
    bdcdata_wa-dynbegin = 'X'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'RKAUF-BATCH'.
    bdcdata_wa-fval = 'X'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'RKAUF-TEST'.
    bdcdata_wa-fval = space.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = '=RUN'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-program  = 'SAPLKABA'.
    bdcdata_wa-dynpro   = '0210'.
    bdcdata_wa-dynbegin = 'X'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'KABA01-JNAME'.
    bdcdata_wa-fval = 'CJB1_EXEC'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_SUBSCR'.
    bdcdata_wa-fval = 'SAPLKABA'.
    APPEND bdcdata_wa TO bdcdata_tab.
    Extract the date format from the user settings
    PERFORM f_get_dateformat CHANGING g_datfm.
    Changing the current date format to User Profile Date Settings
    PERFORM f_format_date USING   g_datfm
                                  sy-datum+4(2)
                                  sy-datum+6(2)
                                  sy-datum+0(4)
                         CHANGING g_sydatum.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'KABA01-STDAY'.
    bdcdata_wa-fval = g_sydatum.
    APPEND bdcdata_wa TO bdcdata_tab.
    lv_time = sy-uzeit  + 30.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'KABA01-STTME'.
    bdcdata_wa-fval = lv_time.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'KABA01-PRIKZ'.
    bdcdata_wa-fval = space.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = '=TAKE'.
    APPEND bdcdata_wa TO bdcdata_tab.
    Calling Transaction 'CJB1' for creating settlement rule
    CALL TRANSACTION 'CJB1'  USING bdcdata_tab MODE lv_mode .
    IF sy-subrc = 0.
    ENDIF.
    *&      Form  F_GET_DATEFORMAT
          This subroutine returns the date format in the user setttigs
         <--P_G_DATFM  Date Format
    FORM f_get_dateformat CHANGING p_g_datfm.                   "#EC *
      SELECT SINGLE datfm FROM usr01 INTO p_g_datfm
      WHERE bname = sy-uname.
    ENDFORM.                    " F_GET_DATEFORMAT
    *&      Form  F_FORMAT_DATE
          This subroutine returns the date as per the user settings
         -->P_G_DATFM  Date Format
         -->P_G_MM  Month
         -->P_G_DD  Day
         -->P_G_YYYY  Year
         <--P_G_DATE  Date
    FORM f_format_date USING    p_g_datfm
                                p_g_mm
                                p_g_dd
                                p_g_yyyy
                       CHANGING p_g_date.                       "#EC *
      CONSTANTS: c_dot VALUE '.',
                 c_slash VALUE '/',
                 c_dash VALUE '-',
                 c_1 VALUE '1',
                 c_2 VALUE '2',
                 c_3 VALUE '3',
                 c_4 VALUE '4',
                 c_5 VALUE '5',
                 c_6 VALUE '6'.
      DATA: l_day(2),
            l_month(2).
      l_day = p_g_dd.
      l_month = p_g_mm.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = l_month
        IMPORTING
          output = l_month.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = l_day
        IMPORTING
          output = l_day.
      CASE p_g_datfm.
        WHEN c_1.
          CONCATENATE l_day l_month p_g_yyyy INTO p_g_date
              SEPARATED BY c_dot.
        WHEN c_2.
          CONCATENATE l_month l_day p_g_yyyy INTO p_g_date
           SEPARATED BY c_slash.
        WHEN c_3.
          CONCATENATE l_month l_day p_g_yyyy INTO p_g_date
              SEPARATED BY c_dash.
        WHEN c_4.
          CONCATENATE p_g_yyyy l_month l_day INTO p_g_date
              SEPARATED BY c_dot.
        WHEN c_5.
          CONCATENATE p_g_yyyy l_month l_day INTO p_g_date
              SEPARATED BY c_slash.
        WHEN c_6.
          CONCATENATE p_g_yyyy l_month l_day INTO p_g_date
              SEPARATED BY c_dash.
      ENDCASE.
    ENDFORM.                    " F_FORMAT_DATE
    thanks
    bobby

  • Availability Check Screen while creating sales order

    Hi
    If I see the stock level in MMBE , I find enough stock for some materials .But when I create  the sales order for those  materials , system is taking to availability check screen .
    I am going and saving the sales order and trying to create delivery for that sales order but system is giving error that u201Cno schedule lines due for  upto selected dateu201D .
    What could be the problem and Hoh I can fix it please .
    Jaya

    Hi Jaya
    1. Enough stocks in MMBE means what?
    Have you got enough stocks in unrestricted use
    This needs to be checked
    2. IN OVZ9 t code for your checking group of the material in MMR and checking rule A (sales order) there is a check box of include sales requirements
    If that is ticked upon saving a sales order stocks are reserved for that order
    Like that there might be some open orders existing for the item
    You can see the list of such open orders in VA05N
    Hence the system is taking you to availability check screen while creating order because there are not much stocks for this fresh order
    You have saved that inspite of that
    Hence there are no schedule lines in your order
    Hence there is problem in delivery
    Create the delivery on the scheduled dates given by the system in the schedule lines
    Regards
    Raja

  • Error: Validation failed for the field - Status While creating Sales Order

    Hi,
    I am getting an error while trying to create sales order header.
    I have tried using provided in the metalink as well but it still doesn't seem to work.
    I am on R12.1.1
    Can somebody help me out on this?
    The code is
    set serveroutput on
    DECLARE
    l_header_rec OE_ORDER_PUB.Header_Rec_Type;
    l_header_rec1 OE_ORDER_PUB.Header_Rec_Type;
    l_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
    l_line_tbl1 OE_ORDER_PUB.Line_Tbl_Type;
    l_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type;
    l_header_adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type;
    l_line_adj_tbl OE_ORDER_PUB.line_adj_tbl_Type;
    l_header_scr_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type;
    l_line_scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type;
    l_request_rec OE_ORDER_PUB.Request_Rec_Type ;
    l_return_status VARCHAR2(1000);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2(1000);
    p_api_version_number NUMBER :=1.0;
    p_init_msg_list VARCHAR2(10) := FND_API.G_FALSE;
    p_return_values VARCHAR2(10) := FND_API.G_FALSE;
    p_action_commit VARCHAR2(10) := FND_API.G_FALSE;
    x_return_status VARCHAR2(1);
    x_msg_count NUMBER;
    x_msg_data VARCHAR2(100);
    p_header_rec OE_ORDER_PUB.Header_Rec_Type := OE_ORDER_PUB.G_MISS_HEADER_REC; 
    p_old_header_rec OE_ORDER_PUB.Header_Rec_Type := OE_ORDER_PUB.G_MISS_HEADER_REC;
    p_header_val_rec OE_ORDER_PUB.Header_Val_Rec_Type := OE_ORDER_PUB.G_MISS_HEADER_VAL_REC;
    p_old_header_val_rec OE_ORDER_PUB.Header_Val_Rec_Type := OE_ORDER_PUB.G_MISS_HEADER_VAL_REC;
    p_Header_Adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_TBL;
    p_old_Header_Adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_TBL;
    p_Header_Adj_val_tbl OE_ORDER_PUB.Header_Adj_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_VAL_TBL;
    p_old_Header_Adj_val_tbl OE_ORDER_PUB.Header_Adj_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_VAL_TBL;
    p_Header_price_Att_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_PRICE_ATT_TBL;
    p_old_Header_Price_Att_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_PRICE_ATT_TBL;
    p_Header_Adj_Att_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_ATT_TBL;
    p_old_Header_Adj_Att_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_ATT_TBL;
    p_Header_Adj_Assoc_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL;
    p_old_Header_Adj_Assoc_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL;
    p_Header_Scredit_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_SCREDIT_TBL;
    p_old_Header_Scredit_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_SCREDIT_TBL;
    p_Header_Scredit_val_tbl OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL;
    p_old_Header_Scredit_val_tbl OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL;
    p_line_tbl OE_ORDER_PUB.Line_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_TBL;
    p_old_line_tbl OE_ORDER_PUB.Line_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_TBL;
    p_line_val_tbl OE_ORDER_PUB.Line_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_VAL_TBL;
    p_old_line_val_tbl OE_ORDER_PUB.Line_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_VAL_TBL;
    p_Line_Adj_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_TBL;
    p_old_Line_Adj_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_TBL;
    p_Line_Adj_val_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_VAL_TBL;
    p_old_Line_Adj_val_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_VAL_TBL;
    p_Line_price_Att_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_PRICE_ATT_TBL;
    p_old_Line_Price_Att_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_PRICE_ATT_TBL;
    p_Line_Adj_Att_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_ATT_TBL;
    p_old_Line_Adj_Att_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_ATT_TBL;
    p_Line_Adj_Assoc_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_ASSOC_TBL;
    p_old_Line_Adj_Assoc_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_ASSOC_TBL;
    p_Line_Scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_TBL;
    p_old_Line_Scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_TBL;
    p_Line_Scredit_val_tbl OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_VAL_TBL;
    p_old_Line_Scredit_val_tbl OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_VAL_TBL;
    p_Lot_Serial_tbl OE_ORDER_PUB.Lot_Serial_Tbl_Type := OE_ORDER_PUB.G_MISS_LOT_SERIAL_TBL;
    p_old_Lot_Serial_tbl OE_ORDER_PUB.Lot_Serial_Tbl_Type := OE_ORDER_PUB.G_MISS_LOT_SERIAL_TBL;
    p_Lot_Serial_val_tbl OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LOT_SERIAL_VAL_TBL;
    p_old_Lot_Serial_val_tbl OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LOT_SERIAL_VAL_TBL;
    p_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type := OE_ORDER_PUB.G_MISS_REQUEST_TBL;
    x_header_val_rec OE_ORDER_PUB.Header_Val_Rec_Type;
    x_Header_Adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type;
    x_Header_Adj_val_tbl OE_ORDER_PUB.Header_Adj_Val_Tbl_Type;
    x_Header_price_Att_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type;
    x_Header_Adj_Att_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type;
    x_Header_Adj_Assoc_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type;
    x_Header_Scredit_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type;
    x_Header_Scredit_val_tbl OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type; 
    x_line_val_tbl OE_ORDER_PUB.Line_Val_Tbl_Type;
    x_Line_Adj_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type;
    x_Line_Adj_val_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type;
    x_Line_price_Att_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type;
    x_Line_Adj_Att_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type;
    x_Line_Adj_Assoc_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type;
    x_Line_Scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type;
    x_Line_Scredit_val_tbl OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type;
    x_Lot_Serial_tbl OE_ORDER_PUB.Lot_Serial_Tbl_Type;
    x_Lot_Serial_val_tbl OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type;
    x_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type; 
    X_DEBUG_FILE VARCHAR2(100);
    l_line_tbl_index NUMBER;
    l_msg_index_out NUMBER(10);
    BEGIN
    oe_debug_pub.debug_on;
    DBMS_APPLICATION_INFO.set_client_info (121);
    dbms_output.enable(1000000);
    fnd_global.apps_initialize(2787,50703,660); -- pass in user_id, responsibility_id, and application_id
    oe_msg_pub.initialize;
    oe_debug_pub.initialize;
    MO_GLOBAL.init('ONT');
    X_DEBUG_FILE := OE_DEBUG_PUB.Set_Debug_Mode('FILE');
    oe_debug_pub.SetDebugLevel(5); -- Use 5 for the most debuging output, I warn you its a lot of data
    dbms_output.put_line('START OF NEW DEBUG');
    --This is to CREATE an order header and an order line
    --Create Header record
    --Initialize header record to missing
    l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
    l_header_rec.pricing_date := SYSDATE;
    l_header_rec.sold_to_org_id := 2096;
    l_header_rec.ordered_date := SYSDATE;
    l_header_rec.sold_from_org_id := 121     ;
    l_header_rec.salesrep_id := -3;
    l_header_rec.order_type_id := 1003;
    l_header_rec.operation := OE_GLOBALS.G_OPR_CREATE;
    l_line_tbl_index :=1;
    -- FIRST LINE RECORD
    -- Initialize record to missing
    l_line_tbl(l_line_tbl_index) := OE_ORDER_PUB.G_MISS_LINE_REC;
    -- Line attributes
    l_line_tbl(l_line_tbl_index).inventory_item_id := 124516;
    l_line_tbl(l_line_tbl_index).ordered_quantity := 500;
    l_line_tbl(l_line_tbl_index).ship_from_org_id := 563;
    l_line_tbl(l_line_tbl_index).operation := OE_GLOBALS.G_OPR_CREATE;
    -- CALL TO PROCESS ORDER Check the return status and then commit.
    OE_ORDER_PUB.process_order (
      p_api_version_number => 1.0
      , p_init_msg_list => fnd_api.g_false
      , p_return_values => fnd_api.g_false
      , p_action_commit => fnd_api.g_false
      , x_return_status => l_return_status
      , x_msg_count => l_msg_count
      , x_msg_data => l_msg_data
      , p_header_rec => l_header_rec
      , p_line_tbl => l_line_tbl
      , p_action_request_tbl => l_action_request_tbl
       -- OUT PARAMETERS
      , x_header_rec => l_header_rec1
      , x_header_val_rec => x_header_val_rec
      , x_Header_Adj_tbl => x_Header_Adj_tbl
      , x_Header_Adj_val_tbl => x_Header_Adj_val_tbl
      , x_Header_price_Att_tbl => x_Header_price_Att_tbl
      , x_Header_Adj_Att_tbl => x_Header_Adj_Att_tbl
      , x_Header_Adj_Assoc_tbl => x_Header_Adj_Assoc_tbl
      , x_Header_Scredit_tbl => x_Header_Scredit_tbl
      , x_Header_Scredit_val_tbl => x_Header_Scredit_val_tbl
      , x_line_tbl => l_line_tbl1
      , x_line_val_tbl => x_line_val_tbl
      , x_Line_Adj_tbl => x_Line_Adj_tbl
      , x_Line_Adj_val_tbl => x_Line_Adj_val_tbl
      , x_Line_price_Att_tbl => x_Line_price_Att_tbl
      , x_Line_Adj_Att_tbl => x_Line_Adj_Att_tbl
      , x_Line_Adj_Assoc_tbl => x_Line_Adj_Assoc_tbl
      , x_Line_Scredit_tbl => x_Line_Scredit_tbl
      , x_Line_Scredit_val_tbl => x_Line_Scredit_val_tbl
      , x_Lot_Serial_tbl => x_Lot_Serial_tbl
      , x_Lot_Serial_val_tbl => x_Lot_Serial_val_tbl
      , x_action_request_tbl => l_action_request_tbl
      dbms_output.put_line('OM Debug file: ' ||oe_debug_pub.G_DIR||'/'||oe_debug_pub.G_FILE); 
      oe_debug_pub.debug_off;
      -- Retrieve messages
      FOR i IN 1 .. l_msg_count
      LOOP
       Oe_Msg_Pub.get( p_msg_index => i
        , p_encoded => Fnd_Api.G_FALSE
        , p_data => l_msg_data
        , p_msg_index_out => l_msg_index_out);
       DBMS_OUTPUT.PUT_LINE('message is: ' || l_msg_data);
       DBMS_OUTPUT.PUT_LINE('message index is: ' || l_msg_index_out);
      END LOOP;
    -- Check the return status
    IF l_return_status = FND_API.G_RET_STS_SUCCESS
    THEN
      dbms_output.put_line('Process Order Sucess');
      dbms_output.put_line('new Header id:' || l_header_rec1.header_id);
    ELSE
      dbms_output.put_line('Failed');
    END IF;
    Commit;
    END; Regards
    knick

    Kinck
    The same script worked for me in vision (R12.1). You may have issues with your defaulting of a number of attributes that you are not passing in the API (like price list, line type and so on). You may want to check them.
    Thanks
    Nagamohan

  • User Exit for the Settle rule of a Production Order

    Hello all
    i got a requirement to change the settlement rule of a production order to multiple receivers.
    suppose i have the following rule
    Categeory | Settlement Reciever | Receiver Short text |   %   | Settlement Type | No | Source Assignment
        MAT             ZMDT89                   ZMDT88              100        FUL                 1            left as blank
    now my requirement is that i have to default the source assignment as 200 (Materials) so as to allow the other reciever entered with the same settlement type as FUL and also the No should be 2
    i.e. my req is like this
    Categeory | Settlement Reciever | Receiver Short text |   %   | Settlement Type | No | Source Assignment
        MAT             ZMDT89                   ZMDT88              100        FUL                 1            200
        G/L             G/L A/C no                G/L shor text       100        FUL                 2            100
    the bold one is i have to ADD
    the T-Code is CO02.
    your help is highly appreciated...
    thanks in advance

    hi,
    check these exits in co02.
    Transaction Code - CO02                     Change Production Order
    Enhancement/ Business Add-in            Description
    Enhancement
    PPCO0010                                Enhancement in make-to-order production - Unit of measure
    PPCO0012                                Production Order: Display/Change Order Header Data
    PPCO0013                                Change priorities of selection crit. for batch determination
    PPCO0015                                Additional check for document links from BOMs
    PPCO0016                                Additional check for document links from master data
    PPCO0017                                Additional check for online processing of document links
    PPCO0018                                Check for changes to production order header
    PPCO0019                                Checks for changes to order operations
    PPCO0021                                Release Control for Automatic Batch Determination
    PPCO0022                                Determination of Production Memo
    PPCO0023                                Checks Changes to Order Components
    STATTEXT                                Modification exit for formatting status text lines
    PPCO0009                                Enhancement in goods movements for prod. process order
    CCOWB001                                Customer exit for modifying menu entries
    COIB0001                                Customer Exit for As-Built Assignment Tool
    COZF0001                                Change purchase req. for externally processed operation
    COZF0002                                Change purchase req. for externally procured component
    PPCO0001                                Application development: PP orders
    PPCO0002                                Check exit for setting delete mark / deletion indicator
    PPCO0003                                Check exit for order changes from sales order
    PPCO0004                                Sort and processing exit: Mass processing orders
    PPCO0005                                Storage location/backflushing when order is created
    PPCO0006                                Enhancement to specify defaults for fields in order header
    PPCO0007                                Exit when saving production order
    PPCO0008                                Enhancement in the adding and changing of components
    reward points if hlpful.

  • User Exit for New Field Creation & Updation at Sales Order Level

    Hi All,
    I want to create one new field in Additional Data B Tab of Sales Order.
    Also when the sales order is created with reference to a Contract, that Contract number to be updated in that field.
    Which user exit need to be used for this field Creation & Updation at the time of order creation? Is it MV45AFZZ?
    Pls suggest.
    Rgds,
    Senni.B

    Hi
    Additional header data is on screen SAPMV45A 0309, additional item data on screen SAPMV45A 0459. These screens contain the Include screens SAPMV45A 8309 or SAPMV45A 8459 as user exits.
    Regards
    Madhu

  • RESTRICT USER FROM USING SAME REQUIREMENT TYPE  WHILE CREATING SALES ORDER

    Hi Friends,
    I Have a requirement to in SD while creating any sales order i want the system sholud throw a error
    message when i am using line items having same requirement type more than one time
    i have tried some customer exits v45a0001 & v45a0003 . but was not successfull .
    kindly somebody help me with elaborated steps  .
    thanks in advance  .
    regards
    digvijay rai

    no reply and i am to close this thread so i am putting it as answered ;(

  • User Exit for eliminating double condition type in sales order

    Sir,
    In SE38,  Program SAPMV45A,  I am using user exit ( Userexit_pricing_prepare_tKomp )  to avoid double entry
    of condition type like PR00 in sales order . But i am not getting how to write code.
    Please, help me how to write code in user exit.
    thanks,
    Manoj.

    Thanks for replay.
    Sir, I want to impliment it in sales order (VA01 OR VA02 )
    for pricing  . Here I want to avoide double  condition types like PR00, packing forwarding, frieght ....etc
    in  sales order pricing.
    Here i want to give logic that codition type is already exit and you canot enter same condition type
    again. means if condition type is already exit then system should not allowed to enter again the same condition type
    in sales order pricing.
    Thanks
    Manoj.

  • BOM not exploding for CR doc. type while creating sales order.

    Hi Experts,
    I have a problem in BOM. When created the BOM with sales doc. type OR, then BOM exploding as usual and picking pricing for main item.. But when I tried for sales doc. type CR, then the BOM is not being exploding and also pricing is also not picking. Can any one help me for this problem.
    Thanks in advance,
    Raksha.

    Hi,
    Go to VTAF billing to sales document copy control and check below settings:
    Header:
    Data Transfer -052 Billing doc header  
    Data Transfer Buis - 103 Billing bus header data
    Data Transfer Part - Billing Header Partner
    Copying requirements - 021 Billing Header
    Check Copy item number
    Uncheck complete reference
    Item:
    Item Cat proposal G2N Request
    Item TAN - Standard item
    Data Transfer -153 item from Billing doc
    Data Transfer Buis - 104 Billing bus Item data
    Data Transfer Part - 004 Billing Item Partner
    bl.pl - Leave it blank
    Copying requirements - 303 Billing Header
    uncheck copy schedule lines and do not copy batch
    check update document flow
    Pricing type - D
    Leave blank - Campaign Deter.
    Points to add: If you create without reference to an invoice then it would not explode BOM in RE return order because the configuration not set in REN item category.
    As a standard business process return orders always create with reference to invoice.
    regards
    rc gopi

  • How to manual maintain TAX condition value while creating sales order

    Hi
    I am creating one Tax condition suppose JLST without access sequence .
    while creating sales order I am manually maintain the % value of TAX. suppose it is 1%
    then I see It show some value in TAX .
    save that sales order & creating delivery document for that but when I create Invoice its show error.
    " Tax code  in procedure CMTAXP is invalid ".
    I know the configuration only for Tax condition with vk11 condition record .
    BUT now I want to maintain TAX condition at the time of creating sales order.
    so I remove the access sequence of that condition .
    but It shows tax code error while billing.
    My main question is that If i maintain condition record while creating sales order then how i can assign Tax code .
    Can it is possible ?
    if yes then How?
    please help me.
    thank you

    Hi,
    The "straight-forward" answer for Tax Code creation is contact the FI consultant. He shall help you, by creating Tax codes.
    I have tested, with creating a tax cond type (copy of MWST) & manually entering values. I can create Sorder, Dlv and Bill but I cannot create an Accounting document. That is because of every line (amount) a Tax code is necessary.
    I THINK, you can NOT have manually filled tax codes; access sequence is needed to get the tax value (%) and the Tax code from the condition record.
    There is lot of material on the web to understand Tax classification, code etc. etc. See a useful link below -
    http://www.sapgeek.net/2010/04/sd-determines-tax-code/
    In short Tax code is a must and take the help of your FI consultant for the configuration of the same.
    BTW - Tax code is already made created for MWST, therefore I suggested that you can use MWST. Furthermore, you can change the values corresponding to Tax codes in FTXP.
    But if you are a beginner in these things, better take help.

  • User Exit to check whether chapter id for Material and Plant combination is maintained while creating sales order

    Hello all,
    my requirement is, system should give error message while creating sales order, if chapter ID is not maintained for a material and plant combination.
    please suggest the user exit.

    Hi
    CASE 1 : All Plants are excisable.
    In Material master , Foreign Trade data tab-  mentioned Control code field mandatory. ( i.e nothing but Chapter ID)
    CASE 2 : Few Plants are excisable
    In the Case 2 you need to go for Enhancement
    Program Name : MV45AFZB 
    User Exit:            USEREXIT_CHECK_VBAP ( Item Level Check )
    By using above user exit you write a logic with the help of ABAPer
    Plant and Chapter ID combination table : J_1IMTCHID

  • User Exits for Credit Check

    Hi Friends,
    I got user exits for credit check but I could not understand how to implement these rather these are not found in system (CMOD & SMOD tcodes) We have ECC6.0. These are the following.
    LVKMPTZZ
    LVKMPFZ1: USER_CREDIT_CHECK1
    LVKMPFZ2: USER_CREDIT_CHECK2
    LVKMPFZ3: USER_CREDIT_CHECK3
    Any help how to implement these is appriciable.
    Regards,
    Rajesh Vasudeva

    Hi Rajesh,
    You can make use of the implicit enhancement, where in you can add code to any standard program either at the start or after the last line in a form or function module.
    Refer the URL
    http://help.sap.com/saphelp_nw04s/helpdata/en/8f/f2e540f8648431e10000000a1550b0/frameset.htm
    for more info on Enhancement Framework.
    Hope this helps you.
    Reg
    Praveen Alex Luke.

  • Stock Reserve for customer while creating sales order

    Hi Gurus,
    In our scenario,i want to reserve my stock  while saving the sales order for customer .when the next order will get placed for same article system should not be  allow to use commited stock for pending sales order which is not yet get pgi.
    _Scenario:-_
    I raised order , say N0.20091076 with quantity 100 Boxes
    I raised order , say N0.20091077 with quantity 50 boxes
    Availability check was performed and system has confirmed the quantities as above for both the orders
    Now i have gone to delivery and raised delivery for order N0. 20091077 ( OR.N0.20091076 --- 100 Boxes is still open).
    but in the delivery i changed the quantity to 80 boxes instead of 50 as raised in the order N0.20091077 , but system is allowing to do PGI for order N0. 20091077 with 80 boxes. ( This means order N0.20091076 which contains 100 boxes is having deficit now).
    Can i controll this that if i raise the oder with certain quantity and a particular batch then the system should not allow this quantity to be used by other order in the delivery/PGI irrespective of the customer .
    Thanks & Regards,
    Sunil

    Hi
    No need to do MB1B movement type 412 E
    If  include sales requirements is ticked in OVZ9 for the checking group  in MMR and checking rule A (SD sales order) you cannot increase the qty in order 2
    Example
    Material X stock is 10 units
    order A is created first for 5 and order B is created second for another 5
    Include sales requirements is ticked in OVZ9 for A (sd sales order) combination
    Now if you try to deliver order B with 6 units system will throw error as only 5 units is available
    If you try to deliver order A also with 6 units system will throw error as only 5 units is available
    So stocks are reserved as per sales orders
    I already suggested you to do this sales requirements ito be ticked in OVZ9 in my first post  but i thought it  may not be very effective for the scenario described by you
    But on testing it is found to be very effective provided backorder processing and rescheduling is not carried out
    For your account determination error you have to check OBYC settings and also in t code OMWD whether the valuation grouping code 0001 has been assigned to your plant
    If this not done in then during PGI you will face the same error
    In normal circumstances during PGI only material doc is generated and this error is expected at that time
    Since you are making a hard reservation during MB1B itself you are facing it as this transaction generates material doc
    If you have already done 412 E you can reverse the same with MB1B movement type 411E
    Regards
    Raja

  • Duplication of Purchase Order while creating sales orders for a customer

    when we try to create sales order for one customer it have to create by picking up the purchase order from the table linearly.
    But the problem is that here when we are trying to create multiple sales orders the same purchase order is being picked.
    for example..when we create sales order 1 the purchase order picked is PO1 and
    for creation of sales order 2 the same purchase order PO1 is being picked up instead of PO2.
    No idocs are being generated in this, even to check them..
    How shall i resolve this...? Please help me out ASAP

    Hi Kumar,
    Thanks for the reply. But actually the problem is that this is related to some customized table in the project. When a EDI Batch job runs in the background then automatically the SO is created and the PO is being picked from the table(custom table) and then posted against the respective SO. we are not aware of that job which is triggering this to debug. Once if we can know that particular batch job or pgm or edi or idoc what ever it is then we can debug.
    Do you have any idea how can we find that particular pgm/edi/idoc/job name which triggers this creation of SO?

Maybe you are looking for