Code for validating the sales order

Hi,
    can any body can send the code for validating sales order and shipment,when we enter the sales order or shipment as input in the selection screen.
It is very urgent....................
Thanks in advance.

HI,
SEE TO THIS CODE.
--TABLE DECLARATION--
TABLES : VBAK,VBAP.
TYPE-POOLS : SLIS.
--STRUCTURE DECLARATION--
TYPES : BEGIN OF TY_VBAK,
        VBELN TYPE VBELN_VA,
        ERDAT TYPE ERDAT,
        ERZET TYPE ERZET,
        ERNAM TYPE ERNAM,
        END OF TY_VBAK.
--SELECT OPTIONS--
SELECT-OPTIONS : S_VBAK FOR VBAK-VBELN.
--START OF SELECTION--
START-OF-SELECTION.
SELECT VBELN
       ERDAT
       ERZET
       ERNAM
       FROM VBAK
       INTO TABLE IT_VBAK
       WHERE VBELN IN S_VBAK.

Similar Messages

  • Need IDOC and segment for mappping the sales order number

    Hi,
    we need the IDOC name and segment for mapping the sales order number created by oracle in sap for transaction VA01.
    Whether the sales order number created by Oracle can be used to create the sales order in sap using the idoc ACC_SALES_ORDER01?
    . If we can do,then what is the segment and field for the sales order number in the idoc ?
    Please reply asap it's very urgent
    Thanks
    Edited by: suresh kumar nandhagopal on May 16, 2008 12:07 PM

    Hi,
    IDOC for sales order is ORDERS05. Segment E1EDKA1, for field go to SE11 and enter E1EDKA1 to find field for sales order.
    Cheers.
    ...Reward if useful.

  • Exit or routine or BADI for save the sales order

    Exit or routine or BADI for save the sales order.
    Please give your input Asap.
    Thanks & regards,
    Vinayak More.

    Hi Vinayak,
    please go through the steps and u will be able to find BADI of any transaction.
    &*************Reward point if helpful**************&
    BADI Info:
    Method 1:
    Go to Tranaction: SE24.
    open class CL_EXITHANDLER
    Open the method " GetInstance"
    Put Break point in the statement
    call method cl_exithandler=>get_class_name_by_interface
    Now execute the Transaction which you need teh BDC it will automatically stops at the the method. In debugging mode double click on the variable: " exit_name" It will return the BADI Name.
    Method 2:
    find the Package name and go to the tranaction SE84.
    Enter the package name
    inside the left navaigaiton panel there is one option " Enhancements" click on this enhancement and then enter the package name and execute it. you will get hte number of enhancement.

  • Issues in Web service created for updating the Sales Order

    Hi All,
    We created a Web service using the Web service tool in CRM 7.0 ( Using the Component WS_DESIGN_TOOLS )
    Web service was created for three modes such as READ, CREATE and CHANGE Modes.
    READ Web Service we tested and its working fine as we were able to see the data for an existing Sales Order in the Web Service.
    We expect that the Change Web Service will update the data of an existing Sales Order.
    Through our Web service we are passing the Order GUID ,Order ID and some Header Fields as well as Item Fields but  the in the Web Service we are getting a message that Web service executed successfully but the CRMD_ORDERADM_H Table isnot getting updated.
    What could be problem.
    Any suugestions will be highly appreciated.
    Regards,
    Sijo

    Hi Gourav,
    I checked in SICF for the Webservice name created.
    this is the service path
    /default_host/sap/bc/srt/rfc/sap/ for the corresponding Web Service created in DEV 200 Client.
    I checked in SOAMANAGER and saw  that the  endpoitnts were zero.
    the Search Operation for Webservice have got three query fields mainly
    Object Id, Posting Date,Procees Type
    If we give Process Type
    sign - blank
    option - blank
    low - YPO ( Custom )
    High - blank we are getting 126 entries.
    and if we check for the Process Type YPO (Custom ) in CRMD_ORDERADM_H Tbale also we are getting the same no of entries.
    but only for option BT , for Posting Date issue is thr..
    Any inputs to move forward will be highly appreciated.
    Regards,
    Sijo.
    Edited by: sijokjohn85 on Mar 5, 2010 10:52 PM

  • Prerequisites for archiving the sales order

    Hi ,
    What are the prerequisites for archiving a sales order? What is the last business transaction from which the archiving process is triggered? Is it necessary to set status CLSD on the sales order for archiving ? what are the other system statuses that should be set for archiving a sales order?
    Thanks & Regards
    San

    Hi Santosh,
    Sales Order is linked to other subsequent documents in the Order Processing cycle like Delivery, Invoice , Shipments, etc. So, we've to make sure that all the dependencies are removed before we can start to archive an SO.
    You can see the dependencies in SARA Transaction (Goto->Network Graphic).
    The SO archiving program checks if the status of the subsequent documents are Completed or not. (status in VBUK table is "C") .
    There are other options like Residence Time, Existence of PO , Existing of Accouting Doc.
    You can select the options, based on your company's decision regarding the extent of SO archiving they wanted to achieve.
    The program will throw the messages appropriately, based on the checks it performed and appropriate actions can be taken from the document side .
    This is a link , which explains the checks the program does before archiving.
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/a9/55c7d490a111d1a5510000e82deaaa/content.htm
    Regards,
    Shail.

  • Exit for save the sales order

    When a new sales order created at that time based on perticular order type (ZRE) i need to check the vale of
    Screen field: KNVV-KZAZU (combine delivery) needs to deactivated.
    Program Name: SAPMF02D
    Please suggest the active user exit or routine that will trigger at the time save the sales order.
    Thanks & regards,
    Vinayak More.

    If you want to deactivate the field then you need to check this form..
    FORM USEREXIT_FIELD_MODIFICATION.
    * CASE SCREEN-NAME.
    *   WHEN 'VBAK-VBELN'.
    *     SCREEN-ACTIVE = 0.
    * ENDCASE.
    ENDFORM.

  • Looking for Exit/Badi for VA03 TC for blocking the sales order

    Dear Experts,
    I would like to know the user exit/badi for sales order(tc VA03)and program name:SAPMV45A
    1)if the minimum order quantity is less than the order quantity.the order will block and in the second line item for the same material they are charging 100$ and then they will release. the existing logic is user dont want this now.
    2)If a line item is created below the minimum order quantity, the order should get blocked and the user should get a warning message regarding the addition of ZMOQ condition type [u201C Line item Quantity is less than minimum order quantity, ZMOQ condition type is missing u201C
    Please provide the exit name and provide some inputs.
    Thanks,
    V.V.

    Hi Gurus,
    I am trying to find out the exit for warning messages where the SAP has maintained.
    whenever the salesorder creating if the order quantity is less than the minimum order quantity it will give two warning messages. 1.Take minimum order quantity 400 DEV into account in item 000010
                       2.Consider delivery unit 40 DEV in item 000010
    so i want to add the third warning message for condition type is missing.
    I am trying to find the exit in the program SAPMV45A and include names MV45AFZZ and MV45AFZB.
    Please let me know if anyone knows the exit name. where the warning messages maintaining.
    Thanks
    V.V.

  • Want to know the sale order report for Delivery bclok at header level

    Dear,
    i would like to know some reports
    1). I would like to know  is ther any  SAP std report  is available for Sale order if Blocked for delivery(VBAK-LIFSK)??
    2). is ther any report for knowing the Sale order  if header/item text  is maintained??
    Pl advice if any std report is available.
    Thanks in advance

    Dear Pradyumna,
    Thanks for your reply, I did't find any Header r item text in the report.
    Pl suggest is there any other report is availble???
    Thanks in adv.

  • When will EK02 appear in the Sales Order?? For different planning strategy?

    Hi Experts,
    In our SAP system ,when you create a sales order with a material which planning strategy is
    50 Planning without final assembly (MTO) , in the item detail screen , on the "Conditions"
    TAB, we will see condition type EK02 and its value.
    But when I create a sales order with a material which planning strategy is 40 Planning with
    final assembly (MTS),in the item detail screen , on the "Conditions" TAB, condition type
    EK02 will not appear.
    I have checked the customizing of our SAP system ,as follows:
    For planning strategy 50, the Requirements class is "045"(MTO val. with cons.),and on the
    configuration screen of Requirements class,we see "Condition type for copying costs from
    line items" (CndTyLineItems) is null ,no value ,not "EK02".
    And for planning strategy 50,the the Requirements class is "050"(Warehouse consumpt.) and
    and on the configuration screen of Requirements class,we see "Condition type for copying
    costs from line items" (CndTyLineItems) is also null ,no value ,not "EK02".
    And on the configuration screen of Sale Order Type screen(VOV8), we see  "Condition type for
    copying costs from line items" (CndTyLineItems) is "EK02" for all the sales order type we
    have used.
    So I am very confused.
    Why material with planning strategy 40 there is no EK02 in the sales order?
    Why material with planning strategy 50 there is EK02 in the sales order?
    Where is the EK02 come from? The requriement class ? Or the Salse order Type?
    Are there any other customizing for Condition type EK02 determination?
    Thanks very for any reply!!

    Hi,
    In MTO you will create Process order.
    And to Produce a Item you use Sub components that is Raw material
    That raw material cost is EK02 which you maintain in the Material Master - Accounting View 1.
    You can see cost in the Process Order also .
    Note : Dont post same in different posts

  • Error while creating the sales order using Proxy

    Hi Folks,
    I am trying to create a Sales Order using Proxy via BAPI "BAPI_SALESORDER_CREATEFROMDAT2" :
    and i got this type of standard error message
    <Message>FB call: insufficient parameters</Message>
    few days back only i used the same bapi for creating the Sales Order and did it successfully...using the same parameters
    I don't have any clue about this type error .
    Kindly guide .
    Regards,

    Hi Nikhil,
    How refreshing the cache and restart the server will help ?
    basically i am testing the scenario at R/3 end only by generating XML template in SPROXY.
    My ECC 6.0 is on sp 12....I am not sure is it configuration related error or a bug ? as i have used the same code in ECC 6.0 with sp 09.
    regards,

  • Field missing in the sales order.

    Hi Experts,
    We have notification for which the sales orders are created.
    Whenever some changes are made in the notification they get reflected in teh sales order once u open it an save it again.
    But this time when we made some changes on the notification and hence opened and saved the sales order along with reflecting the changes in the sales order as per the notification one crucial field got cleared.
    But we are not able to trace how is this field getting cleared.
    We have tried creating new sales orders and again tried the same changes  but this time no field got cleared and everything is fine.
    But the original sales order still have the field blank which is important.
    Please advice.

    Hi,
    The copying controls are same as for other notifications.
    We have tried creating sales orders without changing the copy controls. But this prob has not occurred with the sales orders we are creating now. But the prob that has occured in case of original sales order still persist.
    Please advice.

  • One line item delivery for 3rd party sales order

    Hello Experts,
    We have configured a 3rd party sales order process where the PR gets created. We are using scheduling agreement(PO) and creating Schedule line and doing a GR for partial line items.  The stock is recieved as a Sales Order stock.
    But when i create a Sales Delivery the delivery document copies all the line items (ieven for the ones which we don't have GR)  from the sales order and we have to manually delete the line items from delivery doc.
    Is there a way i can restrict the delivery document to only copy the line items from the sales order  for which the sales order stock is available? If so how can we do that?
    Appreicate your help.
    Thanks
    Arpita Rani

    Hello All,
    We have configured a 3rd party sales order process. The schedule line category is configured with account assignment categoory as "M". when we are creating GR the Moving average price of the material  is not getting updated.
    But if i replace with "E" it is getting updated, but the CO-PA is not getting generated for Profitability segment reporting.--we need profitability segment reportng.
    Can some one tell me how we can update the moving average price using acc. asssignment category type "M" at the same time the Profitability segement information is updated.
    THanks in advance
    Appreciate your help
    Arpita Rani

  • Creating the Sales Order using the bapi BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    My problem is , i have created one module pool program for accelerating the Sales Order creation.
    I am using the bapi BAPI_SALESORDER_CREATEFROMDAT2 for sales order creation. After executing the program
    bapi is given an errot that, incomplete sales order document is saved.
    Can any body tell me plz what are the necessary fields i need to take in the header and item level , so that the complete
    document will be saved through BAPI.
    <removed_by_moderator>
    Thanks
    Edited by: Julius Bussche on Jan 11, 2010 12:09 PM

    TABLES: VBAK,                             "Sales Document: Header Data
            VBAP.                             "Sales Document: Item Data
    *************************************WORK AREA DECELERATION************************
    DATA: BEGIN OF WA_HEADER,
            LI    TYPE I,                      "LINE TYPE
            AUART TYPE VBAK-AUART,             "Sales Document Type
            VKORG TYPE VBAK-VKORG,             "Sales Organization
            VTWEG TYPE VBAK-VTWEG,             "Distribution Channel
            SPART TYPE VBAK-SPART,             "Division
            KUNNR TYPE BAPIPARNR-PARTN_NUMB,   "Customer number
          END OF WA_HEADER.
    DATA: BEGIN OF WA_ITEM,
            LI     TYPE I,
            MATNR  TYPE VBAP-MATNR,            "MATERIAL NUMBER
            ZMENG  TYPE VBAP-ZMENG,           "QUANTITY
          END OF WA_ITEM.
    ***********************************INTERNAL TABLE DECELERATION***************************************
    DATA: IT_HEADER      LIKE TABLE OF WA_HEADER WITH HEADER LINE.                   "IT FOR HEADER
    DATA: IT_ITEM        LIKE TABLE OF WA_ITEM WITH HEADER LINE.                     "IT FOR ITEM
    DATA: IT             LIKE VBAK OCCURS 0 WITH HEADER LINE.
    ***************************SALES ORDER INTERNAL TABLE DECELERATION********************************
    DATA:
          HEADER  TYPE TABLE OF BAPISDHEAD WITH HEADER LINE,        "SALES HEADER DATA
          ITEMS   TYPE TABLE OF BAPIITEMIN WITH HEADER LINE,         "SALES ITEM DATA
          PARTNERS TYPE TABLE OF BAPIPARTNR WITH HEADER LINE.      "SALLES PARTNERS
    ***********************************DYNAMIC FIEL PATH GETTING DECELERATION************************
    DATA : HL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_SPATH',              "SCREEN FIELD NAME
           HL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_SPATH',                  "Local file for upload/download
           IL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_EPATH',              "SCREEN FIELD NAME
           IL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_EPATH',                  "Local file for upload/download
           FL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_EPATH',              "SCREEN FIELD NAME
           FL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_EPATH'.                  "Local file for upload/download
    DATA : CTR TYPE I .
    DATA : CTR2 TYPE STRING.
    DATA : CTR1 TYPE STRING.
    Sales document number
    DATA : L_VBELN LIKE BAPIVBELN-VBELN.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE T1.
    SELECTION-SCREEN : SKIP.
    PARAMETER        : P_HPATH TYPE STRING.
    PARAMETER        : P_IPATH TYPE STRING.
    SELECTION-SCREEN : SKIP.
    SELECTION-SCREEN : END OF BLOCK B1.
    SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME TITLE T2.
    SELECTION-SCREEN : SKIP.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN : PUSHBUTTON 10(14) UPLOAD USER-COMMAND CLICK1.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN   END OF BLOCK B2.
    ******************************************INITIALIZATION.***************************************************
    INITIALIZATION.
      T1       = 'Putchase Order Source File Path'.
      T2       = 'Push Button'.
      UPLOAD   = 'Upload'.
    *******************************************AT SELECTION SCREE EVENT********************************************
    AT SELECTION-SCREEN.
      CASE SY-UCOMM.
        WHEN 'CLICK1'.
          IF P_HPATH IS INITIAL AND P_IPATH IS INITIAL.      "CHECKING BTHE THE TEXT BOX
            MESSAGE I009.
          ELSE.
            PERFORM SELECT.                                  "CALLING THE SELECT SUBROUTINE
          ENDIF.
        WHEN OTHERS.
          MESSAGE 'PRESS FORM BUTTON' TYPE 'I'.      "WHEN EXECUTE BUTTON IS PRESSED
      ENDCASE.
    ***********************************GETTING HEADER FIEL PATH*******************************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_HPATH.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = HL_FIELD_NAME
        IMPORTING
          FILE_NAME     = HL_FILE_NAME.
      P_HPATH = HL_FILE_NAME.
    ***********************************GETTING ITEM FIEL PATH*******************************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_IPATH.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = IL_FIELD_NAME
        IMPORTING
          FILE_NAME     = IL_FILE_NAME.
      P_IPATH = IL_FILE_NAME.
    START-OF-SELECTION.
    *&      Form  SELECT
          text
    -->  p1        text
    <--  p2        text
    FORM SELECT .
      CALL FUNCTION 'GUI_UPLOAD'             " function resposible to get the local flat
          EXPORTING                          " and upload it in a internal table
            FILENAME            = P_HPATH
            FILETYPE            = 'ASC'
            HAS_FIELD_SEPARATOR = '#'
          TABLES
            DATA_TAB            = IT_HEADER.
      CALL FUNCTION 'GUI_UPLOAD'             " function resposible to get the local flat
          EXPORTING                          " and upload it in a internal table
            FILENAME            = P_IPATH
            FILETYPE            = 'ASC'
            HAS_FIELD_SEPARATOR = '#'
          TABLES
            DATA_TAB            = IT_ITEM.
      LOOP AT IT_HEADER.
        Initialize Header values
        HEADER-DOC_TYPE     =  IT_HEADER-AUART.
        HEADER-SALES_ORG    =  IT_HEADER-VKORG.
        HEADER-DISTR_CHAN   =  IT_HEADER-VTWEG.
        HEADER-DIVISION     =  IT_HEADER-SPART.
        APPEND HEADER.
        PARTNERS-PARTN_ROLE = 'WE'.
        PARTNERS-PARTN_NUMB = IT_HEADER-KUNNR.
        APPEND PARTNERS.
        CTR = 10.
        LOOP AT IT_ITEM WHERE LI = IT_HEADER-LI.
          CTR2 = CTR.
          CONCATENATE '0000' CTR2 INTO CTR1.
    ***Initialize Item values
         ITEMS-ITM_NUMBER   = IT_ITEM-ITEM.
          ITEMS-ITM_NUMBER   = CTR1.
          ITEMS-MATERIAL     = IT_ITEM-MATNR.
          ITEMS-REQ_QTY   = IT_ITEM-ZMENG.
          APPEND ITEMS.
          CTR = CTR + 10.
        ENDLOOP.
        CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
          EXPORTING
            ORDER_HEADER_IN = HEADER                      "SALES HEADER DATA
          IMPORTING
            SALESDOCUMENT   = L_VBELN                        "RETRIEVED SALES DOCUMENT NUMBER
          TABLES
            ORDER_ITEMS_IN  = ITEMS                       "SALES ITEM LEVEL DATA
            ORDER_PARTNERS  = PARTNERS.                    "SAKES PARTNERS
        APPEND L_VBELN TO IT.
        COMMIT WORK AND WAIT.
        CLEAR : HEADER , ITEMS[] ,PARTNERS,CTR,CTR1,CTR2.
        REFRESH : ITEMS.
      ENDLOOP.
      IF IT[] IS NOT INITIAL.
        LOOP AT IT.
          WRITE: / 'SALES ORDER', IT-VBELN , 'CREATED'.
        ENDLOOP.
        LEAVE TO LIST-PROCESSING.
        SET PF-STATUS SPACE.
      ELSE.
        MESSAGE I044.
      ENDIF .
    ENDFORM.                    " SELECT

  • Error in doing LSMW for uploading in Sale order

    Dear Sir,
    While doing test run for LSMW for uploading 15 Sale order , first order saved with no error and from second order the following error is displayed.
    Exchange rate of 1 in INR 2  for date 25.05.2009 3 could not be determined.
    Kindly do the needfull.

    Sir,
    If we manually enter, order getting saved for all the sale order.
    Why it is not possible while doing LSMW. 
    Please clarify.
    Regards
    Sethuraman

  • Promotion number in the sales order for free goods promotion.

    Hi,
    I have a business scenario in which "Sales Orders are created" for the customers in SAP IS Retail System.(This is for helpdesk ordering). In most of the occasions, free goods promotion would be running. The free goods promotions(exclusive) are maintained using promotion module in IS Retail system(condition type NA00). In this situation, the promotion number is not getting populated in the sales order automatically. Is there any specific configuration required or any BADI needs to be activated?
    Note: Free goods item is getting generated automatically in the sales order with item category TANN.
    Can any one advice pls.
    Thanks and Regards,
    Selvakumar

    Hi selva
    1)Check in Change Promotion T.code - WAK2
    in the item level   Promotion announcement category(Ann column) - set indicator as F     Promotion announcement
    2)Check sales periods dates - Sales order from to TO it should be valid date
    if not works, reply me i will give some more solutions
    regards
    Satish

Maybe you are looking for