Creating sales order using BAPI, through BSP using 2 pages. one for input

Hi Friends,
i have a Requirement that....
i want to create a BSP pages, in first page i have to give input data (in input fields) which is required to create a sales order through BAPI function module (BAPI_SALESORDER_CREATEFROMDAT1).
in the second page what ever the result given by BAPI FM, that result i want to display on the second page.
so how i can i proceed with input fields in first page and result in second page. please through some input on this.
thanks in advance.
sree

Hi Sree,
   If you are going to use MVC pattern to do the following steps.
For example. company code selection...
In Model class-INIT() method.
DATA : S_COMP LIKE LINE OF <table>.
READ TABLE <table> INTO S_COMP INDEX 1.
  IF SY-SUBRC <> 0.
    S_COMP-TEXT = <variable>.
    S_COMP-KEY = '1'.
    APPEND S_COMP TO <i_table>.
    CLEAR S_COMP.
    INSERT S_COMP INTO <i_table> INDEX 1.
  ENDIF.
HTML View page.
<htmlb:dropdownListBox id = "comp"
                  table   = "//model/<table>"
              selection   = "//model/<variable>"
        nameOfKeyColumn   = "text"
        nameOfValueColumn = "text"
        onSelect          = "<Event name>" />
Thanks,
Suriya.

Similar Messages

  • Created sales order in crm does not use userexit MV45 in r3 - why ?

    Hello experts,
    while creating an sales order in crm and replicating this order
    into r3-system, the user-exit MV45 is not used in r3.
    But when I create an sales order in r3, there system use the user-exit .
    But I need this user exit, also the sales order is coming from crm.
    Does anybody know why this is so ? Is there a solution ?
    Thanks
    Gerd

    Hello again,
    while creating/changing sales order in crm,
    the user exit mv45 is called in R3.
    Problem solved.
    Thanks
    Gerd

  • Problem in uploading multiple line items while Creating sales order by BAPI

    Hi experts ,  Im able to create sales order  with one item while using this program, but the problem is  when iam having multiple  items or multiple sales order  , iam not able to createthe line items , though its creating  sales order header , Iam copy pasting my code , please add the additional code to my code to take more than 1 line items ,This is urgent requirement . Points will be rewarded for answers , Thanks in advance
    *& Report  Z_SO_CREATE_BAPI
    REPORT  Z_SO_CREATE_BAPI.
    DATA: i_header TYPE bapisdhd1 occurs 0 with header line.
    DATA: i_details TYPE bapisditm OCCURS 0 WITH HEADER LINE.
    DATA: i_partner TYPE bapiparnr OCCURS 0 WITH HEADER LINE.
    DATA: i_return1 TYPE bapiret2 OCCURS 0 WITH HEADER LINE.
    DATA: i_return2 TYPE bapiret2.
    data : ORDER_HEADER_IN like BAPISDHD1.
    data : ORDER_ITEMS_IN like BAPISDITM occurs 0 with HEADER LINE .
    data : ORDER_ITEMS_INX Like BAPISDITMX occurs 0 with HEADER LINE .
    data : RETURN like BAPIRET2 occurs 0 with header line.
    data : ORDER_PARTNERS like BAPIPARNR occurs 0 with
    header line.
    DATA : ORDER_KEYS LIKE BAPISDKEY OCCURS 0 WITH HEADER
    LiNE.
    data : ORDER_SCHEDULES_IN like BAPISCHDL occurs 0 with
    header line.
    data : ORDER_SCHEDULES_INX like BAPISCHDLX occurs 0 with
    header line.
    data : BEGIN OF TAB OCCURS 0,
           SRNO(4),
            DOC_TYPE like ORDER_HEADER_IN-dOC_TYPE,
            SALES_ORG LIKE ORDER_HEADER_IN-SALES_ORG,
            DISTR_CHAN LIKE ORDER_HEADER_IN-DISTR_CHAN,
            DIVISION like ORDER_HEADER_IN-DIVISION,
           REQ_DATE_H(10),
           PURCH_DATE(10),
           PMNTTRMS LIKE ORDER_HEADER_IN-PMNTTRMS,
           PURCH_NO_C LIKE ORDER_HEADER_IN-PURCH_NO_C,
           ITM_NUMBER like BAPISDITM-ITM_NUMBER,
            MATERIAL   LIKE  ORDER_ITEMS_IN-MATERIAL ,
            PLANT LIKE ORDER_ITEMS_IN-PLANT,
           TARGET_QTY LIKE ORDER_ITEMS_IN-TARGET_QTY,
           ITM_NUMBERX like  ORDER_ITEMS_INX-ITM_NUMBER ,
           MATERIALX   LIKE  ORDER_ITEMS_INX-MATERIAL ,
           CUST_MAT22 LIKE ORDER_ITEMS_IN-CUST_MAT22,
           PLANTX LIKE ORDER_ITEMS_INX-PLANT,
           TARGET_QTYX LIKE ORDER_ITEMS_INX-TARGET_QTY,
           ITM_NUMBER LIKE ORDER_ITEMS_IN-ITM_NUMBER,
           MATERIAL   LIKE  ORDER_ITEMS_IN-MATERIAL ,
            PARTN_ROLE LIKE ORDER_PARTNERS-PARTN_ROLE,
            PARTN_NUMB LIKE ORDER_PARTNERS-PARTN_NUMB,
          END OF TAB.
    DATA: v_vbeln TYPE bapivbeln-vbeln.
    selection-screen begin of block b1 with frame.
    skip 3.
    parameter:p_infile like rlgrap-filename obligatory.
    skip 3.
    selection-screen end  of block b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
      PERFORM value_help.
    start-of-selection.
    CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
        filename                     = p_infile
       FILETYPE                      = 'DAT'
      HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      tables
        data_tab                      = tab.
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    **Validation for the Create SO screen
    *AT SELECTION-SCREEN ON BLOCK na_create.
    Loop at Tab.
    i_header-doc_type =  TAB-DOC_TYPE .
    i_header-sales_org = TAB-SALES_ORG.
    i_header-distr_chan = TAB-DISTR_CHAN .
    i_header-division = TAB-DIVISION .
    append i_header.
    *endloop.
    i_partner-partn_role = TAB-PARTN_ROLE .
    i_partner-partn_numb =  TAB-PARTN_NUMB.
    APPEND i_partner.
    i_details-material =  TAB-MATERIAL .
    APPEND i_details.
    endloop.
    *Bapi for Creating SO
                   CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
                     EXPORTING
                     SALESDOCUMENTIN               = v_vbeln
                       order_header_in               = i_header
                     ORDER_HEADER_INX              =
                     SENDER                        =
                     BINARY_RELATIONSHIPTYPE       =
                     INT_NUMBER_ASSIGNMENT         =
                     BEHAVE_WHEN_ERROR             =
                     LOGIC_SWITCH                  =
                     TESTRUN                       =
                     CONVERT                       = ' '
                    IMPORTING
                      SALESDOCUMENT                 = v_vbeln
                     tables
                      RETURN                        = i_return1
                      ORDER_ITEMS_IN                = i_details
                      ORDER_ITEMS_INX               = ORDER_ITEMS_INX
                       order_partners                = i_partner .
                     ORDER_SCHEDULES_IN            =
                     ORDER_SCHEDULES_INX           =
                     ORDER_CONDITIONS_IN           =
                     ORDER_CONDITIONS_INX          =
                     ORDER_CFGS_REF                =
                     ORDER_CFGS_INST               =
                     ORDER_CFGS_PART_OF            =
                     ORDER_CFGS_VALUE              =
                     ORDER_CFGS_BLOB               =
                     ORDER_CFGS_VK                 =
                     ORDER_CFGS_REFINST            =
                     ORDER_CCARD                   =
                     ORDER_TEXT                    =
                     ORDER_KEYS                    =
                     EXTENSIONIN                   =
                     PARTNERADDRESSES              =
    IF NOT v_vbeln IS INITIAL.
    *Bapi Commit Work
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT =
    IMPORTING
    return = i_return2
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
    IMPORTING
    RETURN =
    ENDIF.
    LOOP AT i_return1 .  "INTO wa_return1.
    WRITE:/ i_return1-message.
    ENDLOOP.
    FORM value_help .
      CALL FUNCTION 'DSVAS_DOC_WS_FILENAME_GET_50'
        EXPORTING
          DEF_FILENAME     = ' '
          DEF_PATH         = ' '
          MASK             = ',.,..'
          MODE             = 'O'
          TITLE            = ' '
        IMPORTING
          FILENAME         = p_infile
        EXCEPTIONS
          INV_WINSYS       = 1
          NO_BATCH         = 2
          SELECTION_CANCEL = 3
          SELECTION_ERROR  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.
    txt file data
    order type  salesorg   distch      divison       materialno                  parter role
    TA     PB01     01     00     000000000000000852     WE
    Partner no
    8101000000

    Hi Neerja,
    you can reffer this sample code. It may not be complet soluation for your poblem,
    but you will get some idea.
    *& Report  ZBAPI_SALESORDER_CREATE
    *& Author : Karthik
    REPORT  ZBAPI_SALESORDER_CREATE.
    data : ORDER_HEADER_IN like BAPISDHD1.
    data : ORDER_ITEMS_IN like BAPISDITM occurs 0 with
    header line.
    data : RETURN like BAPIRET2 occurs 0 with header line.
    data : ORDER_PARTNERS like BAPIPARNR occurs 0 with
    header line.
    DATA : ORDER_KEYS LIKE BAPISDKEY OCCURS 0 WITH HEADER
    LINE.
    data : ORDER_SCHEDULES_IN like BAPISCHDL occurs 0 with
    header line.
    data : BEGIN OF TAB OCCURS 0,
            SRNO(4),
            DOC_TYPE like ORDER_HEADER_IN-dOC_TYPE,
            SALES_ORG LIKE ORDER_HEADER_IN-SALES_ORG,
            DISTR_CHAN LIKE ORDER_HEADER_IN-DISTR_CHAN,
            DIVISION like ORDER_HEADER_IN-DIVISION,
           REQ_DATE_H(10),
            PURCH_DATE(10),
            PMNTTRMS LIKE ORDER_HEADER_IN-PMNTTRMS,
            PURCH_NO_C LIKE ORDER_HEADER_IN-PURCH_NO_C,
            ITM_NUMBER like BAPISDITM-ITM_NUMBER,
            CUST_MAT22 LIKE ORDER_ITEMS_IN-CUST_MAT22,
            PLANT LIKE ORDER_ITEMS_IN-PLANT,
            TARGET_QTY LIKE ORDER_ITEMS_IN-TARGET_QTY,
            PARTN_ROLE LIKE ORDER_PARTNERS-PARTN_ROLE,
            PARTN_NUMB LIKE ORDER_PARTNERS-PARTN_NUMB,
          END OF TAB.
    data: itab1 like alsmex_tabline occurs 0 with header
    line.
    DATA: gd_currentrow type i.
    data : PURCHASEORDER like ekko-ebeln.
    Data: tot_rec type i,     "Total Records
         gd_update type i,   "Main Table Increement Counter
         gd_lines type i,    "Success Table increement Counter
         w_textout like t100-text. "VARIABLE TO GET ERRORLOG
    data : begin of it_success occurs 0,
            SALESDOCUMENT LIKE BAPIVBELN-VBELN,  "PROJECT
          end of it_success.
    data : begin of it_error occurs 0,
            srno(4),
            err_msg(73) TYPE c,    "TO RETREIVE ERROR MESSAGES
         end of it_error.
    data : srno(4).
    DATA : SALESDOCUMENT LIKE  BAPIVBELN-VBELN.
    selection-screen begin of block b1 with frame.
    skip 3.
    parameter:p_infile like rlgrap-filename obligatory.
    skip 3.
    selection-screen end  of block b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
      PERFORM value_help.
    start-of-selection.
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_infile
          i_begin_col             = '1'
          i_begin_row             = '2' "Do not require
    headings
          i_end_col               = '22'
          i_end_row               = '10000'
        TABLES
          intern                  = itab1
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          others                  = 3.
      if sy-subrc <> 0.
        message e010(zz) with text-001. "Problem uploading
    Excel Spreadsheet
      endif.
    *perform open_group.
      sort itab1 by row col.
    Get first row retrieved
      read table itab1 index 1.
    Set first row retrieved to current row
      gd_currentrow = itab1-row.
      loop at itab1.
    Reset values for next row
        if itab1-row ne gd_currentrow.
          append tab .
          clear tab.
          gd_currentrow = itab1-row.
        endif.
        SHIFT ITAB1-VALUE LEFT DELETING LEADING SPACE.
        case itab1-col.
          when '0001'.
            TAB-SRNO = itab1-value.
          when '0002'.
            TAB-DOC_TYPE = itab1-value.
          when '0003'.
            TAB-SALES_ORG = itab1-value.
          when '0004'.
            TAB-DISTR_CHAN = itab1-value.
          when '0005'.
            TAB-DIVISION = itab1-value.
         when '0006'.
           TAB-REQ_DATE_H =  itab1-value.
          when '0006'.
            TAB-PURCH_DATE = itab1-value.
          when '0007'.
            TAB-PMNTTRMS = itab1-value.
          when '0008'.
            TAB-PURCH_NO_C = itab1-value.
            when '0009'.
            TAB-ITM_NUMBER = itab1-value.
           when '0010'.
            TAB-CUST_MAT22 = itab1-value.
          when '0011'.
            TAB-PLANT  = itab1-value.
          when '0012'.
            TAB-TARGET_QTY = itab1-value.
          when '0013'.
            TAB-PARTN_ROLE = itab1-value.
          when '0014'.
            TAB-PARTN_NUMB = itab1-value.
        endcase.
      endloop.
      append tab.
      clear tab.
      sort tab by SRNO.
      LOOP AT TAB.
       concatenate tab-REQ_DATE_H+4(4)
    tab-REQ_DATE_H2(2) tab-REQ_DATE_H0(2) into
    tab-REQ_DATE_H.
        concatenate tab-PURCH_DATE+4(4)
    tab-PURCH_DATE2(2) tab-PURCH_DATE0(2) into
    tab-PURCH_DATE.
        SRNO = TAB-SRNO.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            INPUT  = tab-PARTN_NUMB
          IMPORTING
            OUTPUT = tab-PARTN_NUMB.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            INPUT  = tab-CUST_MAT22
          IMPORTING
            OUTPUT = tab-CUST_MAT22.
        IF TAB-SRNO = SRNO.
          ORDER_HEADER_IN-DOC_TYPE = TAB-DOC_TYPE.
          ORDER_HEADER_IN-SALES_ORG = TAB-SALES_ORG.
          ORDER_HEADER_IN-DISTR_CHAN = TAB-DISTR_CHAN.
         ORDER_HEADER_IN-REQ_DATE_H = TAB-REQ_DATE_H.
          ORDER_HEADER_IN-PURCH_DATE = TAB-PURCH_DATE.
          ORDER_HEADER_IN-PMNTTRMS = TAB-PMNTTRMS.
          ORDER_HEADER_IN-PURCH_NO_C = TAB-PURCH_NO_C.
          ORDER_HEADER_IN-DIVISION  = tab-DIVISION.
          ORDER_ITEMS_IN-ITM_NUMBER = tab-ITM_NUMBER.
          ORDER_ITEMS_IN-material = TAB-CUST_MAT22.
          ORDER_ITEMS_IN-PLANT      = TAB-PLANT.
          APPEND ORDER_ITEMS_IN.
          ORDER_PARTNERS-PARTN_ROLE = TAB-PARTN_ROLE.
          ORDER_PARTNERS-PARTN_NUMB = TAB-PARTN_NUMB.
          APPEND ORDER_PARTNERS.
          ORDER_SCHEDULES_IN-ITM_NUMBER = tab-ITM_NUMBER.
          ORDER_SCHEDULES_IN-REQ_QTY = tab-TARGET_QTY.
          append ORDER_SCHEDULES_IN.
        ENDIF.
        AT END OF SRNO.
          CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
            EXPORTING
               SALESDOCUMENTIN               =
                 ORDER_HEADER_IN               = ORDER_HEADER_IN
               ORDER_HEADER_INX              =
               SENDER                        =
               BINARY_RELATIONSHIPTYPE       =
               INT_NUMBER_ASSIGNMENT         =
               BEHAVE_WHEN_ERROR             =
               LOGIC_SWITCH                  =
               TESTRUN                       =
               CONVERT                       = ' '
           IMPORTING
             SALESDOCUMENT                 = SALESDOCUMENT
            TABLES
             RETURN                        = RETURN
                 ORDER_ITEMS_IN                = ORDER_ITEMS_IN
               ORDER_ITEMS_INX               =
                 ORDER_PARTNERS                = ORDER_PARTNERS
                 ORDER_SCHEDULES_IN            = ORDER_SCHEDULES_IN
               ORDER_SCHEDULES_INX           =
               ORDER_CONDITIONS_IN           =
               ORDER_CONDITIONS_INX          =
               ORDER_CFGS_REF                =
               ORDER_CFGS_INST               =
               ORDER_CFGS_PART_OF            =
               ORDER_CFGS_VALUE              =
               ORDER_CFGS_BLOB               =
               ORDER_CFGS_VK                 =
               ORDER_CFGS_REFINST            =
               ORDER_CCARD                   =
               ORDER_TEXT                    =
             ORDER_KEYS                    = ORDER_KEYS
               EXTENSIONIN                   =
               PARTNERADDRESSES              =
          IF SALESDOCUMENT <> SPACE.
            commit work.
            ADD 1 TO gd_update.
            it_success-SALESDOCUMENT = SALESDOCUMENT.
            append it_success.
            CLEAR :SALESDOCUMENT,ORDER_HEADER_IN.
            REFRESH : RETURN,ORDER_ITEMS_IN,ORDER_PARTNERS.
          ELSE.
            loop at return.
              it_error-SRNO = tab-SRNO.
              it_error-err_msg = return-MESSAGE .
              Append it_error.
            ENDLOOP.
            CLEAR :SALESDOCUMENT,ORDER_HEADER_IN.
            REFRESH : RETURN,ORDER_ITEMS_IN,ORDER_PARTNERS.
          ENDIF.
        endat.
      endloop.
      DESCRIBE TABLE it_success LINES gd_lines.
      IF gd_lines GT 0.
        Display result report column headings
        PERFORM display_column_headings.
        Display result report
        PERFORM DISPLAY_SUCESS.
      ENDIF.
    IF SUCESS FAILS Display Error Report
      DESCRIBE TABLE it_error LINES gd_lines.
      IF gd_lines GT 0.
        PERFORM errorheadings.
        PERFORM errorreport.
      ENDIF.
    *&      Form  display_column_headings
          text
    FORM display_column_headings.
      WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
      SKIP.
      WRITE:2 'The following records inserted
    successfully:'(013).
      WRITE:/ sy-uline(15).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
               (10) 'Sales order'(004), sy-vline.
      WRITE:/ sy-uline(15).
    ENDFORM.                    "display_column_headings
    *Subroutine to display SUCESS REPORT
    FORM DISPLAY_SUCESS.
      FORMAT COLOR COL_NORMAL.
      LOOP AT it_success.
        WRITE:/      sy-vline,
            (10)  it_success-SALESDOCUMENT, sy-vline.
        CLEAR it_success.
      ENDLOOP.
      WRITE:/ sy-uline(15).
      REFRESH: it_success.
      FORMAT COLOR COL_BACKGROUND.
    ENDFORM.                               "
    DISPLAY_REPORT
    *&      Form  errorreport
          text
    FORM errorreport.
      LOOP AT it_error.
        WRITE:/      sy-vline,
                (10) it_error-SRNO, sy-vline,
                 (40) it_error-err_msg, sy-vline.
      ENDLOOP.
      WRITE:/ sy-uline(104).
      REFRESH: it_error.
    endform.                    "errorreport
    *&      Form  ERRORHEADINGS
          text
    FORM ERRORHEADINGS.
      SKIP.
      WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
      SKIP.
      WRITE:2 'The following records failed during
    update:'(008).
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'ERROR.'(009), sy-vline.
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_NORMAL.
    ENDFORM.                    "ERRORHEADINGS
    **&      Form  value_help
          text
    -->  p1        text
    <--  p2        text
    FORM value_help .
      CALL FUNCTION 'DSVAS_DOC_WS_FILENAME_GET_50'
        EXPORTING
          DEF_FILENAME     = ' '
          DEF_PATH         = ' '
          MASK             = ',.,..'
          MODE             = 'O'
          TITLE            = ' '
        IMPORTING
          FILENAME         = p_infile
        EXCEPTIONS
          INV_WINSYS       = 1
          NO_BATCH         = 2
          SELECTION_CANCEL = 3
          SELECTION_ERROR  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.                    "value_help
    Regards,
    Amit.

  • Avoid substitute material.., while creating sales order with BAPI?

    Hi experts.
    I use BAPI_SALESDOCU_CREATEFROMDATA1 function module to create a sales order.
    Material A has a substitute material B with substitute reason 0005.
    So if I use material A when creating sales order with above BAPI function, the order is created with material B.
    I don't want to substitute the material automatically. I want to create the sales order with material A.
    What should I do? Help me please.
    Thanks in Advance.

    Hi bvrn Reddy,
    I know, your message is almost two years old, but, did you find a solution? I'm facing the same problem. The material A has B as substitute, but in va01 a popup appears (its customizing inside the substitution reason, strategy = A). Of course, we have no popup inside the bapi, but there must be a way to decide which material the bapi should use. At the moment I only get the substitute, never the old mat (even there is something in stock).
    Maybe you've got a helpful hint for me, thanks!
    Ben

  • CREATE SALES ORDER WITH REFERENCE TO INVOICE USING RECORDING

    Hi,
    I wanted to know if it was possible to create a sales order with reference to an invoice using recording(SHDB transaction).If there is some other method please explain the method in detail(Its very urgent)

    Hi,
    You should be able to use BAPI_SALESORDER_CREATEFROMDAT2 instead of doing a BDC and you can populate the reference document in the relevant header field.
    Gareth.

  • CMIR data not copied while creating sales order from BAPI

    hi all,
    we are using BAPI to crate sales order.
    but when we create SO manually, few fields at item level are derived automatically from CMIR...
    Can we achieve same behavior through bapi also...
    regards,
    taranam

    Hi Suraj,
    So, You mean we need to derive COPA derivations for Copy by reference of a Sales Order,
    If so could you please let me know how to do it.
    Regards,
    sg

  • Create sales order va02--bapi

    i copied the program to create s.order from wiki,
    works fine.
    noew i need to add this
    item-hg_lv_item  = p_uepos.
    itemx-hg_lv_item = 'X'.
    and i get err why??
    pls.

    Hi Stephanie,
      Check this following link for creation of sales order using bapi:
    http://www.sap-img.com/fu036.htm
    Have a look at these links also:
    http://abaplovers.blogspot.com/2008/02/bap-sales-order-create.html
    http://abaplovers.blogspot.com/2008/02/bapi-sales-order-create-code.html
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • While creating sales order got error version "0" is not defined for company

    Hi,
    i got a error  while creating a sales order(va01) ,i got an error
    saying that "version 0(zero) is not defined for company code
    if there is any solution please provide....
    Thanks&regards
    kishore kumar

    Go to TCODE:OKEQ
    1)select version 0 here and ext select settings for each fiscal year under controlling area settings
    2)give your controlling area XXXX and version 0 then enter
    3)select new entries maintain data for new year 2008.
    Hope this will give u
    Sri

  • Creating sales order using web dynpro JAVA

    Hello everyone,
    i am new to web dynpro. Can any one tell me how to creating sales order by web dynpro JAVA using BAPI.
    Thanks.
    Vinita Sharma

    Hi...
    you can use Adaptive RFC methodology in web dynpro java to work with BAPIs..... these are standard bapi's provided
    Here are required Bapis... select which one you want....
    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_SIMULATE Sales Order: Simulate Sales Order
    check this thread SALES ORDER creation using BAPI
    sample java program which will call SAP bapi function sales order create
    PradeeP

  • Create Sales order using ORDERS05 idoc

    Hi Experts,
      i need to create sales order from an external system using Idocs. we are using ORDERS05. We needs to save data in some custom fields. hence we have extended the idoc. But the Z* fields are not at the screen level. The function module 'IDOC_INPUT_ORDERS' uses call transaction and hence we are unable to save data in the Z fields.
    Please advice some alternate approach.
    We are looking into the possibility of using a custom function module and calling the create BAPI. Please advice is there is a better approach.
    Thanks & Regards,
    Amit

    The process code ORDE does not use BAPIs. It uses call transaction to VA01. This is the reason i am facing the problem. The custom fields which i have are not in the VA01 screen.
    The BAPi is called by IDOC_INPUT_SALESORDER_CREATEFR for message type SALESORDER_CREATEFROMDAT202. But i am not sure if this works.
    Regards,
    Amit

  • Sales Order Creation against Quotation reference using FM IDOC_INPUT_ORDERS

    Hi Experts,
      I have to create sales order against reference of Quotation using Function module IDOC_INPUT_ORDERS. Can any one help me out regarding this.
    In which segment of IDOC do we need to populate QUOTATION NO.? I am using WE19 with a IDOC and executing FM IDOC_INPUT_ORDERS.
    Regards,
    Rajiv Singh.

    e1edp02-qualf = '004'.
    e1edp02-belnr = vbap-vbeln.
    e1edp02-zeile = vbap-posnr.
    vbap-vbeln is the quotation document and vbap-posnr the item number of the quotation.
    Regards Jack

  • Create Sales Order through VB

    Hi Experts
              I am new to BAPI, my requirement is to create sales order in SAP through VB.
              Please provide me the BAPI coding part which are needed and also suggest me the steps to be followed in SAP and VB.
             Thanks in advance.
    Regards
    Rajaram

    Hi Vinodh
      I tried this coding as part of your link, but it contains Run-time error as Object Required.
          Anything needs to be added in my VB Project, i have already added the BAPI ActiveX contol in my project.
    Pls sugges me.
    Dim boOrder As Object 'Business object SalesOrder
    Dim oPartners As Object 'Parameter OrderPartners of BAPI method
    Dim oHeader As Object 'Parameter OrderHeaderIn of BAPI method
    Dim oItemsIn As Object 'Parameter OrderItemsIn of BAPI method
    Dim oReturn As Object 'Parameter Return of BAPI method
    Private Sub Form_Load()
    'Connect to business object SalesOrder
    '(this creates an anonymous object with an empty key field):
    Set boOrder = oBAPICtrl.GetSAPObject("SalesOrder")
    'Get structure/table objects:
    Set oPartners = oBAPICtrl.DimAs(boOrder, "CreateFromData", "OrderPartners")
    Set oHeader = oBAPICtrl.DimAs(boOrder, "CreateFromData", "OrderHeaderIn")
    Set oItemsIn = oBAPICtrl.DimAs(boOrder, "CreateFromData", "OrderItemsIn")
    'Fill header:
    oHeader.Value("DOC_TYPE") = "TA" 'Standard order
    oHeader.Value("SALES_ORG") = "0001" 'Sales organization
    oHeader.Value("DISTR_CHAN") = "01" 'Sales channel
    oHeader.Value("DIVISION") = "01" 'Division
    oHeader.Value("PO_NUMBER") = "" 'Customer purchase orderNumber
    oHeader.Value("PRICE_DATE") = Now 'Date
    'Fill partners:
    oPartners.Rows.Add
    oPartners.Value(1, "PARTN_ROLE") = "AG" 'PartnerRoll: Person posting the order
    oPartners.Value(1, "PARTN_NUMB") = "0000010096" 'Customer number
    'Fill items:
    oItemsIn.Rows.Add
    oItemsIn.Value(1, "REQ_QTY") = "0000000010000" 'Quantity
    oItemsIn.Value(1, "MATERIAL") = "BERLINER" 'Product ID
    oItemsIn.Value(1, "COND_VALUE") = "1432" 'Rate
    'Call the method:
    boOrder.CreateFromData OrderHeaderIn:=oHeader, _
    OrderPartners:=oPartners, _
    OrderItemsIn:=oItemsIn, _
    Return:=oReturn
    'Free the business objects:
    Set boOrder = Nothing
    End Sub
    Regards
    Rajaram

  • Inbound Files Create Sales Order

    Dear All,
    I am working one Assignments For Sales Order Creation Through Inbound Files and Its working fine.
    But I have one Issue during creation of Sales Order through inbound files ( Which Contains Quotation Number Which Already Exist in SAP ) and Quotation Number updated in PO Number (BSTKD) filed in Sales Order.
    And My Problem is How we can update Quotation in Document Flow during creation of Sales Order through inbound files..
    Any Help or Suggestion will very helpful for me.
    Thanx in Advance.
    Regards
    Vijay Maurya

    HI Vijay,
    Could you please let me know, how are you processing the file to make sales order. In other words are you using BDC or something else for creating sales order.
    If you are using a BDC to create sales order, you need to re-record it so that the sales order is created in reference to the quotation. In this way, the sales order will automatically get linked to sales order. And all the document flows will be updated, also the issues of pricing, delivery date will also be perfectly copied.
    Also since the SAP will update the tables on its own, hence you will not need to direct update any table in SAP.
    Hope this helps,
    Abhishek
    Edited by: Abhishek Purwar on Nov 20, 2008 9:11 PM

  • Ensure payment is received before creating sales order

    Hi
    For some customers we want to ensure that payment is received in advance. i.e., before the sales order is created.
    Unless the payment is entered in SAP, system should not allow the users to either create sales order or delivery or billing document.
    What should be the best SAP process for this ??
    thanks and regards

    Dear Sagar,
    You can configure Credit Management for this.
    FD32 is the T-Code to give limits to Customers. You can give Re.1 limit for the Customers you want advance payment.
    This would ensure that useless advance payment is received & posted in FI (Customer Ledger) the systgem will not allow to create Sales Order.
    You can configure Simple Credit Management for this:
    IMG - Sales and Distribution - Basic Functions - Credit Management/Risk Management - Credit Management - Assign Sales Documents And Delivery Documents - Credit limit check for order types -
    Here assign "B" (Run simple redit limit check and error message) to your required Sales Order types.
    Now go to T-Code FD32 - Inset Customer Code & Credit Control Area & put tick mark in Status check box. Put required Credit Limit (Re. 1) & save.
    This would ensure that no Sales Orders are not created for the Customers you have set the limits unless advance payment is posted in accounts.
    Hope this helps...
    Give points if useful..
    Thanks,
    Jignesh Mehta

  • Creating sales order from contract ISA R/3 Edition

    Hi Forum,
    Our scenario are
    1 - customer select product from catalog and place order from internet
    2 - sometimes, customer already have a contract with us (created earlier manually on SAP) and want to create sales order from internet referencing a SAP-contract.
    For scenario No.1 - we can use standard SAP
    For scenario No.2 - is there any standard way to do so? or we have to do customization?
    Any suggestion are welcome.
    Thanks a million.!!

    Hello
    "Contract Processing" is not supported out-of-the-box in ISA R/3 edition.
    However, you have a good news. The OSS Note [788245 |https://service.sap.com/sap/support/notes/788245]- "ISA R/3 4.0: contract processing", explains how to implement this feature on a project basis.
    We have implemented this feature successfully at few customers.
    Hope this helps.
    Easwar
    http://www.parxlns.com

Maybe you are looking for

  • Two Fact tables with Different set of Dimension Tables

    Here is my scenario: I got two fact tables: X and Y (actually, they are the same tables, but with different level of data) and four dimension tables: A, B, C, D X joins relationship to all dimensions (A, B, C, D). Y joins relationship to only A, B, C

  • My X1 platform fails about every hour, requiring a restart

    In the last 3 weeks, my X1 service fails.  It starts when I engage the remote, whether it's on demand or just the guide, and I get an error message stating something to the effect - your box isn't working - try back in a moment.  The only way to reso

  • Changing the value of the field in message

    hi i have a input message to XI like this <records>        <data_records> 1 to unbound             field1             field2             field3 the target structure is as below <records>        <data_records> 1 to unbound             field0          

  • Quality Inspection in WM

    Dear All, I have 2 questions: 1) I want to receive materials under quality inspection during MIGO. How? I only managed to do it by entering Q at the PO. 2) After receiving quantities in quality inspection, how to transfer them in Unrestricted in WM?

  • AIR 3.7

    I had a complaints from Android users that were getting the error "package file was not signed correctly" when trying to install my app.  I found one of my test devices had the same issue (Galaxy Note).  Most didn't see if but other apps I compiled a