Status in  BAPI_SALESORDER_CREATEFROMDAT2

Hello,
I am using above mentioned FM to create a sales order, i have to make status completed (INDL)for item during the creation,is there any field to do this purpose.
Would appreciate if anyone let me know answer.
Regards, Suresh

Hello Guys,
I have implemented the userexit to change the status to completed.
Regards, Suresh

Similar Messages

  • Problem in lock Sales order create with BAPI BAPI_SALESORDER_CREATEFROMDAT2

    Hi All,
    i have the z program to create the sales order with reff  quotation in SD With BAPI BAPI_SALESORDER_CREATEFROMDAT2.
    this program will  excute every 30 mins .
    Problem: Some times if i excute the program in background it is taking morethan 30mins so second batch excution also gets starting to create the sales order for same quotation then it is creating 2 sales orders at atime with 1 quotation.
    here i am getting duplicate sales orders so i want to lock the creation of duplicate sales order.

    Some solutions
    - Just lock (ENQUEUE) any object at the start of the job(*), if not locked, you can exit or wait in a loop, will be released at end of job (use a _SCOPE '3' so commit work wont release the lock)
    -> This will insure the job runs only once at a time
    - Lock the quotation before calling the BAPI, will be released by the COMMIT_WORK (from where do you fetch the quotation, if it is a customer Z_table, you can use the lock object that you have surely created ?) (use a _scope '2')
    -> This will insure that at most one job will convert a quotation (i suppose you set a "done" flag or status  in the quotation record)
    Read [SAP Locks |http://help.sap.com/abapdocu_70/en/ABENSAP_LOCK.htm] if you are not familiar with the concept of lock in SAP.
    Regards,
    Raymond
    (*) E_TABLEE for table, E_TRDIR for program, anything not required by another process

  • BAPI_SALESORDER_CREATEFROMDAT2 with reference to a contract item

    Hi all,
    i'm having troubles creating an order with reference to a contract item on item level.
    My order is created and also a reference to the contract item is created on item level, but no conditiions are copied from the contract item (no conditions at all are filled)!
    Anyone with an idea?
    Many thanks!
    Siegfried
    Here my code:
    Order Header data
      ls_order_header_in-doc_type        = 'TA'.
      ls_order_header_in-sales_org       = i_basket_head-vkorg.
      ls_order_header_in-distr_chan      = i_basket_head-vtweg.
      ls_order_header_in-division          = i_basket_head-spart.
      ls_order_header_in-incoterms1      = i_basket_head-inco1.
      ls_order_header_in-incoterms2      = i_basket_head-inco2.
      ls_order_header_in-po_method       = 'INT'.
      ls_order_header_in-req_date_h      = i_basket_head-ketdat.
      ls_order_header_in-purch_no_c      = i_basket_head-bstnk.
      ls_order_header_in-purch_date      = sy-datum.  
      ls_order_header_in-refdoctype      = 'KM'.
    Order partners
      ls_order_partners-partn_role    = 'WE'.
      ls_order_partners-partn_numb    = i_basket_head-kunnr_we.
      APPEND ls_order_partners TO lt_order_partners.
      ls_order_partners-partn_role    = 'AG'.
      ls_order_partners-partn_numb    = i_basket_head-kunnr_ag.
      APPEND ls_order_partners TO lt_order_partners.
      CLEAR: lv_counter_posnr, lv_counter_sched.
      LOOP AT it_basket INTO ls_basket.
        lv_counter_posnr = lv_counter_posnr + 10.
        lv_counter_sched = lv_counter_sched + 1.
    Order items
        ls_order_items_in-itm_number    = lv_counter_posnr.
        ls_order_items_in-po_itm_no     = lv_counter_posnr.
        ls_order_items_in-material      = ls_basket-matnr.
        ls_order_items_in-ref_doc_ca = 'G'.
        ls_order_items_in-ref_doc       = ls_basket-vbeln.
        ls_order_items_in-ref_doc_it    = ls_basket-posnr.
       ls_order_items_in-target_qty    = ls_basket-quant.
        ls_order_items_in-target_qu    = 'TO'.
        ls_order_items_in-purch_date    = sy-datum.
        APPEND ls_order_items_in TO lt_order_items_in.
    Scheduling lines
        ls_order_schedules_in-itm_number = lv_counter_posnr.
        ls_order_schedules_in-sched_line = lv_counter_sched.
        ls_order_schedules_in-req_date   = i_basket_head-ketdat.
        ls_order_schedules_in-req_qty    = ls_basket-quant.
        APPEND ls_order_schedules_in TO lt_order_schedules_in.
      ENDLOOP.
      CLEAR: lv_salesdocument.
    Create R/3 sales order
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in    = ls_order_header_in
        IMPORTING
          salesdocument     = lv_salesdocument
        TABLES
          return                  = lt_return
          order_items_in     = lt_order_items_in
          order_partners     = lt_order_partners
          order_schedules_in = lt_order_schedules_in.

    Hi
    how many contracts you have for this material / material group .
    if you have only one contract system automatically assigned to sc.
    assume that you dont assign any source of supply and cart came to cockpit
    take your item into cockpit and click propose source of supply . now all avaialble contract must be available for sourcing or
    you can manually enter the contract and item number in the cockpit and create a PO
    if you dont get a respective contract  for respective material - there is something wrong on the contract. what type of contract . what is the status of the contract
    muthuraman

  • 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 coming  " A   BS   001  No status object is available for SDI 0 "

    Hi Experts,
    I am facing a issue.. I am creation a sales order using BAPI " BAPI_SALESORDER_CREATEFROMDAT2 "  
    In one scenario,  I am able to create Sales Order with Status Profile..
    But For second scenario, its giving error like  "A   BS   001  No status object is available for SDI 0" .
    Between both scenario, only difference is Distribution channel and Condition record.
    DATA : wa_order_header_in TYPE bapisdhd1,
    gt_order_partners TYPE STANDARD TABLE OF bapiparnr,
    gs_order_partners TYPE bapiparnr,
    gs_order_partners1 TYPE bapiparnr,
    gt_order_items_in TYPE STANDARD TABLE OF bapisditm,
    gs_order_items_in TYPE bapisditm,
    gt_order_conditions_in TYPE STANDARD TABLE OF bapicond,
    gs_order_conditions_in TYPE bapicond,
    gt_order_schedules_in TYPE STANDARD TABLE OF bapischdl,
    gs_order_schedules_in TYPE bapischdl,
    *         gt_return TYPE STANDARD TABLE OF bapiret2,
    *         gs_return TYPE bapiret2,
    gt_error TYPE STANDARD TABLE OF bapiret2,
    gs_error TYPE bapiret2,
    gt_log TYPE TABLE OF zsd_ecomerr,
    gs_log TYPE zsd_ecomerr,
    it_item_temp TYPE TABLE OF zst_sfdc_so_items_dom WITH HEADER LINE,
    lt_return TYPE STANDARD TABLE OF bapiret2,
    ls_return TYPE bapiret2,
    lt_order_conditions_in TYPE STANDARD TABLE OF bapicond,
    ls_order_conditions_in TYPE bapicond,
    ls_sfdc TYPE zsd_sfdc_order .
    DATA:  wa_order_header_inx TYPE bapisdhd1x,
    gt_order_items_inx TYPE STANDARD TABLE OF bapisditmx,
    lt_order_items_inx TYPE STANDARD TABLE OF bapisditmx,
    gs_order_items_inx TYPE bapisditmx,
    gt_order_schedules_inx TYPE STANDARD TABLE OF bapischdlx,
    gs_order_schedules_inx TYPE bapischdlx,
    gt_order_conditions_inx TYPE STANDARD TABLE OF bapicondx,
    gs_order_conditions_inx TYPE bapicondx,
    lt_order_conditions_inx TYPE STANDARD TABLE OF bapicondx,
    ls_order_conditions_inx TYPE bapicondx,
    ls_order_items_inx TYPE bapisditmx,
    lv_kbetr TYPE kbetr VALUE '10',
    lv_curr  TYPE waers ,
    lv_ihrez  TYPE ihrez ,
    lv_knumh  TYPE a005-knumh.
    DATA:isrno LIKE vbap-posnr.
    DATA: x_orderitemx LIKE bapisdh1x.
    TYPES: BEGIN OF ty_vbap,
    vbeln TYPE vbap-vbeln,
    posnr TYPE vbap-posnr,
    mwsbp  TYPE vbap-mwsbp,
    END OF ty_vbap.
    DATA: lv_lfstk TYPE vbuk-lfstk,
    lv_cmgst TYPE vbuk-cmgst,
    lt_vbap TYPE TABLE OF ty_vbap,
    ls_vbap TYPE ty_vbap,
    lv_bstnk TYPE vbak-bstnk.
    ****// Checking PO Type. This is mandatory from SFDC
    IF sfdc-potype <> '' .
    ****// Checking here, Whether SFDC Order ID already exist or not. ***//
    SELECT SINGLE * FROM zsd_sfdc_order WHERE sfdcorder = sfdc-sfdcorder AND land1 = 'IN'.
    IF sy-subrc <> 0.
    ****// SO creation Process
    wa_order_header_in-doc_type    = 'ZHOT'.
    wa_order_header_in-sales_org   = '2700'.
    IF sfdc-potype = 'SFSD'.                        " S & D
    wa_order_header_in-distr_chan  = '30'.
    wa_order_header_in-division    = '00'.
    ELSEIF sfdc-potype = 'SFHO'.                    " Hospitality
    wa_order_header_in-distr_chan  = '33'.
    wa_order_header_in-division    = '00'.
    ENDIF.
    wa_order_header_in-purch_date  = sfdc-purch_date.
    wa_order_header_in-purch_no_c  = sfdc-sfdcorder.  "SFDC Order ID
    wa_order_header_in-doc_date    = sy-datum.
    wa_order_header_in-currency    = 'INR'.
    wa_order_header_in-ref_1       = sfdc-purch_no. "sfdc-sfdcorder.
    wa_order_header_in-po_method = sfdc-potype.
    wa_order_header_inx-updateflag  =  'I'.
    wa_order_header_inx-doc_type    =  'X'.
    wa_order_header_inx-sales_org   =  'X'.
    wa_order_header_inx-distr_chan  =  'X'.
    wa_order_header_inx-division    =  'X'.
    wa_order_header_inx-purch_no_c  =  'X'.
    wa_order_header_inx-purch_date  =  'X'.
    wa_order_header_inx-doc_date    =  'X'.
    wa_order_header_inx-currency    =  'X'.
    wa_order_header_inx-ref_1       =  'X'.
    ***// Ship to party
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input  = sfdc-kunag
    IMPORTING
    output = sfdc-kunag.
    gs_order_partners-partn_numb = sfdc-kunag.
    gs_order_partners-partn_role = 'WE'.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input  = gs_order_partners-partn_numb
    IMPORTING
    output = gs_order_partners-partn_numb.
    APPEND gs_order_partners TO gt_order_partners.
    CLEAR: gs_order_partners.
    ***// Sold to Party
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input  = sfdc-kunnr
    IMPORTING
    output = sfdc-kunnr.
    gs_order_partners-partn_numb = sfdc-kunnr.
    gs_order_partners-partn_role = 'AG'.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input  = gs_order_partners-partn_numb
    IMPORTING
    output = gs_order_partners-partn_numb.
    APPEND gs_order_partners TO gt_order_partners.
    CLEAR: gs_order_partners.
    ***// Clubed all materials
    LOOP AT it_items.
    it_item_temp-matnr     = it_items-matnr.
    it_item_temp-kwmeng    = it_items-kwmeng.
    it_item_temp-kwert     = it_items-kwert.
    it_item_temp-reg_dis   = it_items-reg_dis.
    it_item_temp-add_dis   = it_items-add_dis.
    it_item_temp-tann   = it_items-tann.
    COLLECT it_item_temp.
    ENDLOOP.
    ***// Saving Line Item data
    LOOP AT it_item_temp.
    isrno = isrno + 10.
    gs_order_items_in-itm_number = isrno.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input  = it_item_temp-matnr
    IMPORTING
    output = it_item_temp-matnr.
    gs_order_items_in-material = it_item_temp-matnr.
    gs_order_items_in-plant        =  sfdc-werks.
    gs_order_items_in-currency     =  'INR'.
    IF it_item_temp-tann = 'X'.
    gs_order_items_in-item_categ   =  'TANN'.
    ENDIF.
    APPEND gs_order_items_in TO gt_order_items_in.
    CLEAR gs_order_items_in.
    SELECT SINGLE knumh
    INTO lv_knumh
    FROM a005
    WHERE kappl = 'V'
    AND   kschl IN ('ZR04', 'ZR00')
    AND   vkorg = '2700'
    AND   kunnr = sfdc-kunnr
    AND   matnr = it_item_temp-matnr.
    IF sy-subrc = 0.
    SELECT SINGLE kbetr
    INTO it_item_temp-kwert
    FROM konp
    WHERE knumh = lv_knumh.
    ELSE.
    gs_order_conditions_in-itm_number  = isrno.
    IF sfdc-potype = 'SFSD' .                              " Sales and Distribution
    gs_order_conditions_in-cond_type  = 'ZR04'.
    ELSEIF sfdc-potype = 'SFHO'.                           " Hospitality
    gs_order_conditions_in-cond_type  = 'ZR00'.
    ENDIF.
    it_item_temp-kwert = it_item_temp-kwert .
    gs_order_conditions_in-cond_value = it_item_temp-kwert .
    gs_order_conditions_in-currency   = 'INR'.
    APPEND gs_order_conditions_in TO gt_order_conditions_in.
    CLEAR gs_order_conditions_in.
    gs_order_conditions_inx-itm_number   =  isrno.
    gs_order_conditions_inx-cond_type    = 'X'.
    gs_order_conditions_inx-cond_value   = 'X'.
    gs_order_conditions_inx-currency     = 'X'.
    gs_order_conditions_inx-updateflag   = 'X'.
    APPEND gs_order_conditions_inx TO gt_order_conditions_inx.
    CLEAR gs_order_conditions_inx.
    IF sfdc-potype = 'SFSD'.
    ***// Regular Discount to Customer
    IF it_item_temp-reg_dis <> '0.00'.
    gs_order_conditions_in-itm_number  = isrno.
    gs_order_conditions_in-cond_type  = 'ZDID'.
    gs_order_conditions_in-cond_value = it_item_temp-reg_dis * lv_kbetr. " 10 .
    gs_order_conditions_in-currency   = 'INR'.
    APPEND gs_order_conditions_in TO gt_order_conditions_in.
    CLEAR gs_order_conditions_in.
    gs_order_conditions_inx-itm_number  = isrno.
    gs_order_conditions_inx-cond_type    = 'X'.
    gs_order_conditions_inx-cond_value   = 'X'.
    gs_order_conditions_inx-currency     = 'X'.
    gs_order_conditions_inx-updateflag   = 'X'.
    APPEND gs_order_conditions_inx

    Dear Marthanda,
    Is there any Status Profile attachec in to your Sales Order Type in T. Code: VOV8 (Tab: Transaction Flow, Field: Status Profile)?
    If yes, remove it.
    If not, then...
    Check error with:
    T. Code: SM13/ ST22
    For more info, refer link:
    Error in the status table JSTO
    Hope, this may help you.
    Best Regards,
    Amit

  • Set user status

    Hi,
    I am using the BAPI_SALESORDER_CREATEFROMDAT2 to create a sale order.
    I am looking for a function module to set the user status to "VALIDATE"  after the excution the previous bapi.
    Could you help me?
    Abdel

    thank you for your answers
    Done with FM status_change_intern

  • Incoming IDOC - Status Update

    Hi All,
    We are creating Sales Order(Va01) based on Inbound IDOC for Scheduling Agreeemnt(VA31) using BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'
    As per logic sales order is getting created in system with updation in database table but the IDOC status is showing '51' instead of '53'.
    Please suggest solution.
    Regards,
    Ulhas

    Easy - debug the process code and determine the condition that is setting the control record status value to '51'.

  • BADI for CJ20N to get the WBS status when changed

    Hi all,
    Here's the requirement:
    I have to capture the previous status and currently changed status of the WBS element in CJ20N T-CODE and save this in the ZTABLE.
    Every time the STATUS of WBS element changes..the ZTABLE has to get updated.
    Will you please help me out to do this.
    I have tried with BADI - WORKBREAKDOWN_UPDATE, could find that the status part is updated after the call to WORKBREAKDOWN_UPDATE.
    Thanks and Regards,
    Krishna Chaitanya G
    Edited by: Krishna Chaitanya  G on Apr 27, 2009 6:30 PM

    Use BADI WORKBREAKDOWN_UPDATE method AT_SAVE.  The WBS elements are in internal table IT_WBS_ELEMENT which has structure PRPS.  Use OBJNR to find status with function module
    CALL FUNCTION 'STATUS_READ'
      EXPORTING
      CLIENT                 = SY-MANDT
        objnr                  = gs_wbs_element-objnr
        ONLY_ACTIVE            = ' '
      TABLES
        STATUS                 = et_status
      EXCEPTIONS
        OBJECT_NOT_FOUND       = 1
        OTHERS                 = 2
    The statuses are buffered in a separate memory area so be careful if you call any function modules that affect statuses e.g one to create Sales Orders as this initializes the buffered statuses and they are not changed when you save the WBS element.  To get round this problem put the current status in a separate memory area carry out the processing that initializes the statuses and then recall the status from memory.
      CALL FUNCTION 'STATUS_BUFFER_EXPORT_TO_MEMORY'
        EXPORTING
          i_memory_id = 'ZPSS_STATUS'.
      LOOP AT gt_pss_01 ASSIGNING <ls_pss_01>.
        AT NEW sold_to_party.
          CLEAR: ls_order_header,
                 lt_order_items,
                 ls_order_partners,
                 lt_order_partners.
          "Header
          ls_order_header-doc_type = c_rsbill_order_type.
          CALL METHOD <ls_pss_01>-o_pss01->get_sales_area
            IMPORTING
              e_sales_org  = ls_order_header-sales_org
              e_division   = ls_order_header-division
              e_distr_chan = ls_order_header-distr_chan
            EXCEPTIONS
              not_found    = 1.
          IF sy-subrc NE 0.
            CONTINUE.
          ENDIF.
          "Partner
          IF <ls_pss_01>-sold_to_party IS INITIAL.
            CONTINUE.
          ENDIF.
          ls_order_partners-partn_role = 'AG'.
          ls_order_partners-partn_numb = <ls_pss_01>-sold_to_party.
          APPEND ls_order_partners TO lt_order_partners.
        ENDAT.
        "Items
        CLEAR ls_order_items.
        ls_order_items-itm_number = <ls_pss_01>-posnr.
        ls_order_items-material = c_rsbill_material.
        ls_order_items-wbs_elem = <ls_pss_01>-posid.
        APPEND ls_order_items TO lt_order_items.
        AT END OF sold_to_party.
          CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
            EXPORTING
              order_header_in   = ls_order_header
              behave_when_error = space "'P' "Save when error occurs
              testrun           = space
            IMPORTING
              salesdocument     = <ls_pss_01>-sales_order
            TABLES
              return            = <ls_pss_01>-bapireturn
              order_items_in    = lt_order_items
              order_partners    = lt_order_partners.
        ENDAT.
      ENDLOOP.
    *--Re-fill status from memory
      CALL FUNCTION 'STATUS_BUFFER_IMPORT_FROM_MEMO'
        EXPORTING
          i_memory_id = 'ZPSS_STATUS'.
    Hope this is of some use

  • Status profile maintenance in SD

    Hi,
    I am using user status maintenance of sales order, I wanted to change the user status for each line item depending on some conditions. Is there any BAPI to get it.Pls suggest.
    Thanks&Regards
    Giridhar Karnam

    BAPI_SALESORDER_GETSTATUS      Sales Order: Display Status
    BAPISDORDER_GETDETAILEDLIST Sales Order: List of All Order Data
    BAPI_ORDER_CHANGE_STATUS_GET Change status for order
    BAPI_SALESDOCU_CREATEFROMDATA Creating a Sales Document
    BAPI_SALESORDER_CHANGE Sales Order: Change Sales Order
    BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDAT2 Sales Order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDATA Create sales order, no more maintenance
    BAPI_SALESORDER_GETLIST Sales order: List of all orders for customer
    BAPI_SALESORDER_GETSTATUS Sales order: Display status

  • BAPI_SALESORDER_CREATEFROMDAT2: SO not displayed in VA03

    HI,
    While creating sales order through BAPI_SALESORDER_CREATEFROMDAT2 we are getting the following message.
    W-V1-555-The sales document is not yet complete. Edit Data
    S-V1-311-Standard Order 10258 has been saved.
    When I tried to view the sales order through VA03. it is giving the error "SD document 10258 is not in the database or has been archived".
    I have given the following inputs:
    ORDER_HEADER_IN : DOC_TYPE Sales document type
    SALES_ORG Sales organization
    DISTR_CHAN Distribution channel
    DIVISION Division
    ORDER_HEADER_INX : UPDATEFLAG as 'I' and the above fields as 'X'.
    ORDER_PARTNERS..: PARTN_ROLE Partner role, SP sold-to party
    PARTN_NUMB Customer number
    ORDER_ITEMS_IN..: MATERIAL Material number
    ORDER_ITEMS_INX..:
    UPDATEFLAG as 'I' and the Material field as 'X'.
    ORDER_SCHEDULES_IN ::Sales document number POSNR ITM_NUMBER
    Order quantity KWMENG REQ_QTY .
    Please let me know where im going wrong.
    Thnx in advance.

    Hi,
    I tried all the possibilities and still getting the same error. I pasted below the response XML from the SAP system. Pls let me know where i'm going wrong. Thnx in advance.
    <OrderItemsInx xmlns="" />
        <OrderKeys xmlns="">
            <Item>
                <REFOBJTYP />
                <REFOBJECT>HEADER</REFOBJECT>
                <REFOBJKEY />
                <REFLOGSYS />
                <DOC_NUMBER />
                <ITM_NUMBER>000000</ITM_NUMBER>
                <SCHED_LIN>0000</SCHED_LIN>
                <COND_NO />
                <CONDITEMNO>000000</CONDITEMNO>
                <COND_ST_NO>000</COND_ST_NO>
                <COND_COUNT>00</COND_COUNT>
                <COND_TYPE />
                <STATUS />
                <TINDEX>000000</TINDEX>
                <ADDRESS />
                <ABRLI>0000</ABRLI>
                <ABART />
            </Item>
        </OrderKeys>
        <OrderPartners xmlns="" />
        <OrderSchedulesIn xmlns="" />
        <OrderSchedulesInx xmlns="" />
        <OrderText xmlns="" />
        <PartnerAddresses xmlns="" />
        <Return xmlns="">
            <Item>
                <TYPE>E</TYPE>
                <ID>VP</ID>
                <NUMBER>112</NUMBER>
                <MESSAGE>Please enter sold-to party or ship-to party</MESSAGE>
                <LOG_NO />
                <LOG_MSG_NO>000000</LOG_MSG_NO>
                <MESSAGE_V1 />
                <MESSAGE_V2 />
                <MESSAGE_V3 />
                <MESSAGE_V4 />
                <PARAMETER>SALES_HEADER_IN</PARAMETER>
                <ROW>0</ROW>
                <FIELD />
                <SYSTEM>ENTCLNT100</SYSTEM>
            </Item>
            <Item>
                <TYPE>E</TYPE>
                <ID>V4</ID>
                <NUMBER>219</NUMBER>
                <MESSAGE>Sales document  was not changed</MESSAGE>
                <LOG_NO />
                <LOG_MSG_NO>000000</LOG_MSG_NO>
                <MESSAGE_V1 />
                <MESSAGE_V2 />
                <MESSAGE_V3 />
                <MESSAGE_V4 />
                <PARAMETER />
                <ROW>0</ROW>
                <FIELD />
                <SYSTEM>ENTCLNT100</SYSTEM>
            </Item>
        </Return>
    </SalesOrder.CreateFromDat2.Response>

  • Any ideas for a status or "at a glance" splash screen / presentation?

    This is an idea I've been tossing around and wanted to know if there was something easy out there that would accomplish this...
    I'd like to mount a monitor in one of our common areas for the management team and have it display current statuses of some of our IT features/services and maybe quick bits on what we are currently working on, major issues, etc... 
    I've seen some company lobbies with similar setups that display company-wide information, weather, etc.. so I know the capability is out there but I don't know squat regarding what that would entail. The easier, the better, naturally... as I don't want this to turn into an entire job position updating it, haha. But something that I could hopefully remotely update would be nice.
    Any ideas? Thanks!
    This topic first appeared in the Spiceworks Community

    Please see the two articles below:
    http://support.apple.com/kb/TS3694
    http://support.apple.com/kb/TS3125

  • Purchase order status open

    Hi Experts,
    Due to some other reasons we tried clear GR/IR clearing a/c. i will explain clearly.
    We have some purchase orders pertaining to 2006 year. we have not done MIGO and we did MIRO, So that we could not able to clear GR/IR A/C. SO, we have posted manual entry with fb50 same as MIGO posting then we cleared both documents with f-03 its done every thing was fine now But if we see purchase order report status showing OPEN
    How to change the status please some one let me know.this is high priority issue.
    Regards,
    JC

    Hi,
    First make sure that you will not receive goods against your PO..Then go to me22n and delete the item in your PO.
    This will resolve your issue.
    Thanks,
    Srinu

  • Sale Order Status Report

    Dear Expert.
    I want Sales Order Status report as below mentioned format required quarry base report from Date to To Date.
    Location-OrderSeries-OrderNo-CardCode-CardName-ItemCode-Item Descripotion-Inv.UOM-Order Qty-Allocated Qty-DeliverQty-Peniding Qty adn Pending Order Value.

    Hi,
    You can check this :
    select t3.location as 'Location',t0.series as 'Order Series',
    t0.docnum as 'Order No.',t0.cardcode as 'Business Partner Code',
    t0.cardname as 'Business Partner Name', t1.itemcode as 'Item',
    t1.dscription as 'Item Name', t2.invntryUom as 'Inventory UoM',t1.quantity as 'Order Qty',
    t1.QtyToship as 'Allocated Qty- Qty to Ship', t1.delivrdQty as 'Delivered Qty',
    t1.OrderedQty as 'Ordered Qty', t1.openCreQty as 'Pending Qty',
    t1.Opensum as 'Pending Order Row Value'
    from ORDR t0 inner join RDR1 t1 on t1.docentry = t0.docentry
    inner join OITM t2 on t2.itemcode = t1.itemcode
    inner join OLCT t3 on t3.code = t1.loccode
    where t0.docdate >= '2011.01.01' and t0.docdate <= '2011.12.31'
    Hope it helps.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • PF STATUS IN ALV REPORT

    hi,
    How to use PF STATUS IN ALV REPORT?

    HI,
    see this code.
    TABLES:MARA.
    SELECT-OPTIONS: MATNR FOR MARA-MATNR.
    DATA:BEGIN OF ITAB OCCURS 0,
         MATNR LIKE MARA-MATNR,
         ERSDA LIKE MARA-ERSDA,
         MTART LIKE MARA-MTART,
         MBRSH LIKE MARA-MBRSH,
    END OF ITAB.
    SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR
    IN MATNR.
    TYPE-POOLS SLIS.
    DATA:FCAT TYPE slis_t_fieldcat_alv.
    DATA:LAYOUT TYPE slis_layout_alv.
    DATA:EVE TYPE slis_t_event WITH HEADER LINE.
    DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    SORT-UP = 'X'.
    SORT-SPOS = 1.
    SORT-FIELDNAME = 'ERSDA'.
    SORT-tabname = 'MARA'.
    APPEND SORT.
    SORT-SPOS = 2.
    SORT-FIELDNAME = 'MTART'.
    SORT-tabname = 'MARA'.
    APPEND SORT.
    EVE-NAME = 'TOP_OF_PAGE'.
    EVE-FORM = 'TOPOFPAGE'.
    APPEND EVE.
    EVE-NAME = 'TOP_OF_LIST'.
    EVE-FORM = 'TOPOFLIST'.
    APPEND EVE.
    EVE-NAME = 'END_OF_LIST'.
    EVE-FORM = 'ENDOFLIST'.
    APPEND EVE.
    LAYOUT-ZEBRA = 'X'.
    LAYOUT-no_hline = 'X'.
    LAYOUT-NO_VLINE = 'X'.
    LAYOUT-window_titlebar = 'MATERIAL DETAILS'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = SY-REPID
       I_INTERNAL_TABNAME           = 'ITAB'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
       I_INCLNAME                   = SY-REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = FCAT
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 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.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = SY-REPID
    <b>   I_CALLBACK_PF_STATUS_SET       = 'STATUS'
       I_CALLBACK_USER_COMMAND        = 'UCOMM'</b>
      I_STRUCTURE_NAME               =
       IS_LAYOUT                      = LAYOUT
       IT_FIELDCAT                    = FCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
       IT_SORT                        = SORT[]
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
       IT_EVENTS                      = EVE[]
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 5
      I_SCREEN_START_LINE            = 5
      I_SCREEN_END_COLUMN            = 120
      I_SCREEN_END_LINE              = 25
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB                       = ITAB
    EXCEPTIONS
      PROGRAM_ERROR                  = 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.
    FORM TOPOFPAGE.
    REFRESH HEAD.
        HEAD-TYP = 'H'.
        HEAD-INFO = 'MATERIALS'.
        APPEND HEAD.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY       = HEAD[]
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
    ENDFORM.
    FORM TOPOFLIST.
    REFRESH HEAD.
        HEAD-TYP = 'H'.
        HEAD-INFO = 'MATERIALS-LISTTOP'.
        APPEND HEAD.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY       = HEAD[]
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
    ENDFORM.
    FORM ENDOFLIST.
    REFRESH HEAD.
        HEAD-TYP = 'H'.
        HEAD-INFO = 'MATERIALS-LISTEND'.
        APPEND HEAD.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY       = HEAD[]
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
    ENDFORM.
    <b>FORM STATUS USING MYMENU.
        SET PF-STATUS 'MENU' excluding MYMENU.
    ENDFORM.
    FORM UCOMM USING CODE STEXT.
        CASE CODE.
            WHEN 'ABC'.
            WRITE:/ 'YOU HAVE CLICKED ON ABC'.
            WHEN 'XYZ'.
            WRITE:/ 'YOU HAVE CLICKED ON XYZ'.
        ENDCASE.
    ENDFORM.</b>
    rgds,
    bharat.

  • Sale Order Status Change after delivery of materials from projects

    have ETO sccenario which consists of all modules such as SD,PS.PP etc. Materials will be procured from external vendors & manufactured inhouse through project systems. After delivery of materials from project systems, billing & invoicing will be done at sales level.
    On delivery of materials from projects, sale order status remain open. Request you to look into the matter & suggest about status change of sale order after delivery / billing.
    Regards,
    Ranjan

    Hi,
    In sale order, WBSE is assigned. Delivery of materials are through cns0. then subsequently picking / packing / billing will happen at sales level. Billing is of delivery related. Please suggest to fix the issue.
    Thanks & Regards,
    Biplab Ranjan

Maybe you are looking for