Help to change the price in sales order create bapi

hi,
   i am able to change the price but not what i am trying to do.
   can anybody please help . here i am submitting the code.
    i am trying to enter the 40 into price field but it is takeing 400
<b>report  zmybapi1        .
data : my_order_header_in like bapisdhd1 occurs 0 with header line,
       my_order_header_ix like bapisdhd1x occurs 0 with header line.
data : my_orderitemsin like bapisditm  occurs 0 with header line,
       my_orderitemsix like bapisditmx occurs 0 with header line.
data : my_order_partners like bapiparnr occurs 0 with header line.
data : my_return like bapiret2 occurs 0 with header line.
data : w_vbeln like bapivbeln-vbeln.
data:
     my_orderschedulesin like bapischdl occurs 0 with header line,
     my_orderschedulesinx like bapischdlx occurs 0 with header line.
data : my_orderconditionsin like bapicond occurs 0 with header line,
       my_orderconditionsinx like bapicondx occurs 0 with header line.
start-of-selection.
this is to assign values to internal table my_order_header_in
  my_order_header_in-doc_type   = 'TA'.
  my_order_header_in-sales_org  = 'JNJ1'.
  my_order_header_in-distr_chan = '02'.
  my_order_header_in-division   = 'J1'.
  my_order_header_in-sales_off  = 'JNJ1'.
  my_order_header_in-purch_no_c = 'testbapipo'.
  my_order_header_in-purch_date = sy-datum.
  my_order_header_in-req_date_h = sy-datum.
  append my_order_header_in.
this is to assign values to internal table my_orderitemsin
  my_orderitemsin-material      = '000000000000000727'.
  my_orderitemsin-plant         = 'JNJ1'.
  my_orderitemsin-target_qu     = 'EA'.
  my_orderitemsin-target_qty    = '10'.
  append my_orderitemsin.
this is to assign values to internal table my_order_partners
  my_order_partners-partn_role = 'AG'.
  my_order_partners-partn_numb = '0000000011'.
  append my_order_partners.
  my_order_partners-partn_role = 'WE'.
  my_order_partners-partn_numb = '0000000011'.
  append my_order_partners.
This is to assign values to internal table my_orderschedulesin
my_orderschedulesin-itm_number = '10'.
  my_orderschedulesin-itm_number = '000010'.
  my_orderschedulesin-req_qty   = '10'.
  my_orderschedulesin-SCHED_LINE = '0001'.
  append my_orderschedulesin.
*This is to assign values to internal table my_orderconditionin
  my_orderconditionsin-itm_number = '000010'.
my_orderconditionsin-cond_type = 'ZPR1'.
  my_orderconditionsin-cond_value = '40'.
  append my_orderconditionsin.
  my_order_header_ix-updateflag = 'I'.
  my_order_header_ix-doc_type   = 'X'.
  my_order_header_ix-sales_org  = 'X'.
  my_order_header_ix-distr_chan = 'X'.
  my_order_header_ix-division   = 'X'.
  my_order_header_ix-sales_off  = 'X'.
  my_order_header_ix-purch_no_c = 'X'.
  my_order_header_ix-purch_date = 'X'.
  my_order_header_ix-req_date_h = 'X'.
  append my_order_header_ix.
  my_orderitemsix-updateflag    = 'I'.
  my_orderitemsix-material      = 'X'.
  my_orderitemsix-target_qty    = 'X'.
  my_orderitemsix-plant         = 'X'.
  my_orderitemsix-target_qu     = 'X'.
  append my_orderitemsix.
  my_orderschedulesinx-updateflag = 'I'.
my_orderschedulesinx-sched_line = '0001'.
  my_orderschedulesinx-req_qty    = 'x'.
  append my_orderschedulesinx.
  my_orderconditionsinx-itm_number = '000010'.
  my_orderconditionsinx-cond_type = 'ZPR1'.
  my_orderconditionsinx-updateflag = 'U'.
  my_orderconditionsinx-cond_value = 'X'.
  append my_orderconditionsinx.
  call function 'BAPI_SALESORDER_CREATEFROMDAT2'
    exporting
  SALESDOCUMENTIN               =
      order_header_in               = my_order_header_in
      order_header_inx              = my_order_header_ix
  SENDER                        =
  BINARY_RELATIONSHIPTYPE       =
  INT_NUMBER_ASSIGNMENT         =
  BEHAVE_WHEN_ERROR             =
  LOGIC_SWITCH                  =
  TESTRUN                       =
  CONVERT                       = ' '
    importing
      salesdocument                 = w_vbeln
    tables
      return                        = my_return
      order_items_in                = my_orderitemsin
      order_items_inx               = my_orderitemsix
      order_partners                = my_order_partners
    ORDER_SCHEDULES_IN            =  my_orderschedulesin
      order_schedules_inx           = my_orderschedulesinx
   ORDER_CONDITIONS_IN           =  my_orderconditionsin
   ORDER_CONDITIONS_INX          =  my_orderconditionsinx
  ORDER_CFGS_REF                =
if sy-subrc ne 0.
    write: my_return-message, my_return-number, my_return-type.
  else.
     call function 'BAPI_TRANSACTION_COMMIT'
     EXPORTING
       WAIT          =
     IMPORTING
       RETURN        =
      write: my_return-message, my_return-number, my_return-type.
endif.</b>
Message was edited by: pavan kumar pisipati

Is there any Multiplication happening in the condition type or any other conditions executes. Please check those..
Another way is, if always  a multiplication of 10 is happening then pass the value by dividing it by 10. But this way is not a nice way or programming...
Check out both and let me know if not working.
Cheers,
Thomas.

Similar Messages

  • How to change the price in sales order copying from contract?

    Hi All,
    I am creating a sales order with reference to contract & the same prices in the contract are flowing. But the validity of prices are expired & I am unable to edit the prices in the sales oerder level.
    Please suggest what configuration need to do to edit prices in the sales order level.
    Thanks,
    Madhu

    Hello Madhu,
    I am creating a sales order with reference to contract & the same
    prices in the contract are flowing. But the validity of prices are expired
    & I am unable to edit the prices in the sales oerder level.
    Please suggest what configuration need to do to edit prices in the sales order level.
    The configurational setting for changing the pricing flow from Contract to Sales Order is in Copying control. Go to the T-code VTAA and select your relevant Contract and Sales Order. At the Item level itself, you shall find a control called PRICING TYPE. Select the option as B or C.
    Please try out this approach so that your issue related to pricing flow can be avoided.
    Regards,
    Sarthak

  • Changing the payer in sales order other then BDC, LSMW

    Hi Friends,
    We are working at BHEL,
    here we want to change the payer instead of old payer for all open sales orders is , is there any possibility to change the payer in sales order other then LSMW , BDC , those two are not helpful for us  because there is lot of incompleteness logs in my incomplete procedure,
    please suggest me to proceed further,
    regards,
    Gangi Reddy.

    Hi Gangi,
    I have explained the CATT procedure, step by step, on 31/03/2007 for another mass updation requirement in the same forum with subject as 'Regarding Customer Master'.
    Have a look and let me know if you have further doubts.
    Rewards if helps.
    Regards
    Nadarajah Pratheb

  • How to mark up the price for sales order entry?

    Hi Gurus,
    How to Mark up the price for sales order entry?
    Example: Item Price: $10, Adding 20% Margin
    Selliing price of the item is $12
    we are giving many typs discounts like festival Discount, customerwise, Order value wise etc..
    After giving above discounts, if discount falls below $10 system should not allow to book the order, Trigger should go to respective person or sales person saying that item price falling below cost, system should not allow to book the sales order.
    How to configure this scenarios in Order management Module, appreciate your inputs, advise.
    Regards
    AK

    Thanks for your response,
    can you please guide me step to achieve this requirement.
    Regards
    AK

  • Upload the data for sales order using BAPI

    hi experts,
    how to upload the data for sales order using BAPI.
    what is the FM?
    it would be much helpful if i have the sample code as i am very new to BAPI.
    thanks and Regards
    Shyam

    Hi  Shyam
    Its very useful for u
    BAPISDORDER_GETDETAILEDLIST
    BAPI_ACC_SALES_ORDER_CHECK
    BAPI_ACC_SALES_ORDER_POST
    BAPI_ACC_SALES_QUOTA_CHECK
    BAPI_ACC_SALES_QUOTA_POST
    Reward all the helpful answers..
    With Regards
    Navin Khedikar

  • Getting Error while creating multiple Orders using Sales order Create BAPI

    Hi,
    I am trying to create 2 orders thru the Sales order create BAPI before I commit and save the orders. The Orders are getting created and the BAPI is coming back with success, but it is not setting the system status on the line items of the 1st order. So when I try to cancel the line items on the first order I get the error 'No status object is available for SDI 4924/10' . I would really appreciate if anyone has encountered such error before and could help me out with the reason for this error and the possible solution.
    Thanks in advance,
    David.

    Hi,
    Check the following link:
    http://www.sap-img.com/bapi.htm
    Regards,
    Bhaskar

  • Change price in Sales Order created with reference with Quote

    Hi Experts,
    Need to change price (eg..1000USD to 1100USD) in sales order (va02). Here Sales Order is created (va01)with reference with Quote(va21) where price in maintained (as 1000USD). so price in Sales Order is copied from Quote. Now, If I want to do the change in Sales Order (from 1000USD to 1100USD) kindly suggest me what are all the possible ways. Can I do the changes within the existing documents rather than creating new docs. due to the change.
    Note: User is creating new Quote with 1100USD and creating subsequent new Sales Order with new Quote.
    Thanks
    Viswanathan

    Hi,
    In va02 you double-click on the material that has been entered, then in the new screen goto the condition tab, here u will find the $1000 that you have entered, and then change it to $1100.
    Swapnil

  • What is the tcode  to change the contents of sales order

    hi
    what is the tcode  to change the contents of sales order

    SD Transaction Code Flow:
    Inquiry / Document type IN
                              create chan  disp             tables updated
    Tcode for creation VA11,VA12,VA13. tables VBAK,VBAP
    Quotation / QT
    Tcode for creation VA21,VA22,VA23. tables VBAK,VBAP
    Purchase Order PO
    Tcode for creation ME21,ME22,ME23. tables EKKO,EKPO.
    Sales Order OR
    Tcode for creation VA01,VA02,VA03. tables VBAK,VBAP
    Delivery LF
    Tcode for creation VL01,VL02,VL03. tables LIKP,LIPS
    Billing F2
    Tcode for creation VF01,VF02,VF03. tables VBRK,VBRP

  • Problem regarding the creation of sales order using bapi.

    Hai all,
    I am creating sales order using bapi but i am, get following error messages :
    TYPE ID  NUMBER MESSAGE
    E       VP   112       Please enter sold-to party or ship-to party
    E       V4   219       Sales document  was not changed
    I have entered all the parameters.
    my program is as follows :
    *& Report  ZSD_SALES_ORDER
    REPORT  ZSD_SALES_ORDER.
        Tables
    *table definitions
    TABLES:vbak,      "Sales Document: Header Data
            knvv,     "Customer Master Sales Data
            mara,     "General Material Data
            t001l,    "Plants/Branches
            mvke,     "Sales Data for Material
            vbap,     "Sales Document: Item Data
            konv.     "Conditions (Transaction Data)
        Types
    *type for upload data
    TYPES :BEGIN OF ty_upload,
           matnr(20) TYPE c,                  " Old material number
           quantity(20) TYPE c,               " Cumulative order quantity in sales units
    VALUE TYPE       BAPIKWERT1,
          value(20) TYPE c,                  " Condition value
                 value TYPE konv-kwert,                  " Condition value
    END OF ty_upload.
    *type for final output table
    TYPES :BEGIN OF ty_main,
               bismt  TYPE mara-bismt,    "Old material number
               matnr  TYPE vbap-matnr,    "Material Number
               kunnr  TYPE vbak-kunnr,    "customer number
               auart  TYPE vbak-auart,    "Sales Document Type
               vkorg  TYPE vbak-vkorg,    "Sales Organization
               vtweg  TYPE vbak-vtweg,    "Distribution Channel
               spart  TYPE vbak-spart,    "Division
               vbeln  TYPE vbak-vbeln,    "Sales document
               werks  TYPE marc-werks,    " Plant
               lgort  TYPE mard-lgort,    "Storage Location
               posnr  TYPE vbap-posnr,    "Sales Document Item
               parvw  TYPE vbpa-parvw,    "Partner function
               kwmeng TYPE vbap-kwmeng,   "Cumulative order quantity in sales units
               kschl  TYPE konv-kschl,    "Condition type
              kwert  TYPE konv-kwert,    "Condition value
    KWERT TYPE       BAPIKWERT1,
              kwert(20)  TYPE c,    "Condition value
               waers  TYPE konv-waers,    "Currency
         END OF ty_main.
    *type for old material number
    TYPES: BEGIN OF ty_matnr,
           matnr TYPE mara-matnr,
           bismt TYPE mara-bismt,
           END OF ty_matnr.
    *type for order number
    TYPES :BEGIN OF ty_output,
           vbeln  TYPE vbak-vbeln,       "Sales Document
         END OF ty_output.
        Constants                Begin with C_                           *
    CONSTANTS:
    c_zpmu(4) TYPE c VALUE 'ZPMU',
    c_zpmm(4) TYPE c VALUE 'ZPMM'.
    DATA: c_ch(1) TYPE c VALUE 'X'.
        Data                     Begin with W_                           *
    *global data for validations
    DATA: w_count TYPE i,
          w_vkorg TYPE vbak-vkorg,
          w_vtweg TYPE vbak-vtweg,
          w_spart TYPE vbak-spart,
          w_werks TYPE t001l-werks,
          w_check TYPE c,
          w_itemno TYPE posnr_va,
         W_COND TYPE C.
          w_cond(3) TYPE c.
        Internal tables          Begin with IT_                          *
    *internal table definitions
    DATA : it_upload TYPE STANDARD TABLE OF ty_upload ,
           wa_upload TYPE ty_upload.
    DATA : it_main TYPE STANDARD TABLE OF ty_main,
           wa_main TYPE ty_main.
    DATA: it_matnr TYPE STANDARD TABLE OF ty_matnr,
          wa_matnr TYPE ty_matnr.
    DATA : it_output TYPE STANDARD TABLE OF ty_output.
    Internal table for BAPI.
    DATA: it_bapisdhd1  TYPE STANDARD TABLE OF bapisdhd1,        "Sales and Distribution Document Header
          wa_bapisdhd1 TYPE bapisdhd1.
    DATA: it_bapisditm  TYPE STANDARD TABLE OF bapisditm ,       "Sales and Distribution Document Item
          wa_bapisditm TYPE bapisditm.
    DATA: it_bapiparnr  TYPE STANDARD TABLE OF bapiparnr,        "SD Document Partner: WWW
          wa_bapiparnr TYPE bapiparnr.
    DATA: it_bapischdl  TYPE STANDARD TABLE OF bapischdl,       "Schedule Lines
          wa_bapischdl TYPE bapischdl.
    DATA: it_bapicond TYPE STANDARD TABLE OF bapicond,       "Communication Fields for Maintaining Conditions in the Order
          wa_bapicond TYPE bapicond.
    DATA: it_bapiret2 TYPE STANDARD TABLE OF bapiret2,        "Return Parameter
          wa_bapiret2 TYPE bapiret2.
          Parameters              Begin with PR_                        *
    *selection screen definition
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME .
    PARAMETERS: pr_vkorg TYPE vbak-vkorg OBLIGATORY,
                pr_vtweg TYPE vbak-vtweg  OBLIGATORY,
                pr_spart TYPE vbak-spart  OBLIGATORY,
                pr_kunnr TYPE kna1-kunnr  OBLIGATORY,
                pr_werks TYPE marc-werks  OBLIGATORY,
                pr_lgort TYPE mard-lgort  OBLIGATORY.
    PARAMETERS: pr_auart TYPE vbak-auart OBLIGATORY,
               PR_AUGRU TYPE VBAK-AUGRU OBLIGATORY.
                            pr_augru TYPE vbak-augru.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME.
    PARAMETERS : pr_file TYPE ibipparms-path OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk2.
          At selection-screen                                           *
    AT SELECTION-SCREEN.
      PERFORM f006_validate_vkorg.
      PERFORM f007_validate_vtweg.
      PERFORM f008_validate_spart.
      PERFORM f009_validate_kunnr.
      PERFORM f010_validate_werks.
      PERFORM f011_validate_lgort.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_file.
    *for f4 help----
      PERFORM f003_f4_help.
          S T A R T   O F   S E L E C T I O N                           *
    START-OF-SELECTION.
    *for material ,quantity and value upload
      PERFORM f001_upload_file.
    *get data
      PERFORM  f003_get_data.
    *for check the data
      PERFORM f002_check_data .
      PERFORM f004_process.
    *for posting
      PERFORM f005_posting.
    END-OF-SELECTION.
          E N D       O F   S E L E C T I O N                           *
    *&      Form  f001_upload_file
          upload file
    FORM f001_upload_file .
      DATA : lw_fname TYPE string.
      CLEAR lw_fname.
      lw_fname = pr_file.
      REFRESH it_upload.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lw_fname
          filetype                = 'ASC'
          has_field_separator     = c_ch
        TABLES
          data_tab                = it_upload
        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.
      LOOP AT it_upload INTO wa_upload.
       wa_upload-value = ( wa_upload-value ) / 10.
       MODIFY it_upload FROM wa_upload.
      ENDLOOP.
    ENDFORM.                    "F001_UPLOAD_FILE
    *&      Form  f003_f4_help
          f4 help
    FORM f003_f4_help .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = pr_file.
    ENDFORM.                    " f003_f4_help
    *&      Form  check_data
          text
    FORM f002_check_data .
      DATA: lw_lines TYPE i.
      DESCRIBE TABLE it_main LINES lw_lines.
      IF lw_lines LE 0.
        RETURN.
      ENDIF.
      SELECT a~matnr
             a~bismt FROM mara AS a INNER JOIN mvke AS b
                   ON amatnr = bmatnr
                   INTO CORRESPONDING FIELDS OF TABLE it_matnr
                   FOR ALL ENTRIES IN it_main
                   WHERE a~bismt = it_main-bismt.
      IF sy-subrc = 0.
        LOOP AT it_main INTO wa_main.
          CLEAR : wa_matnr.
          READ TABLE it_matnr INTO wa_matnr WITH KEY bismt = wa_main-bismt.
          IF sy-subrc = 0.
            MOVE: wa_matnr-matnr TO wa_main-matnr.
          ENDIF.
          MODIFY it_main FROM wa_main TRANSPORTING matnr WHERE bismt = wa_main-bismt.
        ENDLOOP.
      ELSE.
       MESSAGE e000(zmsd) WITH  text-001.
      ENDIF.
    ENDFORM.                    "CHECK_DATA
    *&      Form  F009_validate_vkorg
          text
    FORM f006_validate_vkorg .
      CLEAR w_vkorg.
      SELECT SINGLE vkorg
          INTO w_vkorg FROM tvko
          WHERE vkorg EQ pr_vkorg.
      IF sy-subrc <> 0.
        MESSAGE e000(zmsd) WITH text-012 pr_vkorg.
      ENDIF.
    ENDFORM.                    " F009_validate_vkorg
    *&      Form  f007_validate_vtweg
          text
    FORM f007_validate_vtweg .
      CLEAR:w_vtweg.
      SELECT SINGLE vtweg
           INTO w_vtweg FROM tvtw
           WHERE vtweg EQ pr_vtweg.
      IF sy-subrc <> 0.
        MESSAGE e089(zmsd).
      ENDIF.
    ENDFORM.                    " f007_validate_vtweg
    *&      Form  f008_validate_spart
          text
    FORM f008_validate_spart .
      CLEAR:w_spart.
      SELECT SINGLE spart
            INTO w_spart FROM tspa
            WHERE spart EQ pr_spart.
      IF sy-subrc <> 0.
        MESSAGE e087(zmsd).
      ENDIF.
    ENDFORM.                    " f008_validate_spart
    *&      Form  F010_validate_kunnr
          text
    FORM f009_validate_kunnr .
      DATA: l_kunnr TYPE kunnr.
      CLEAR: w_vkorg, w_vtweg,w_spart.
      SELECT  SINGLE  kunnr FROM  knvv
             INTO l_kunnr
             WHERE  kunnr  = pr_kunnr
             AND    vkorg  = pr_vkorg
             AND    vtweg  = pr_vtweg
             AND    spart  = pr_spart.
      IF sy-subrc <> 0.
       MESSAGE e000(zmsd) WITH text-010 pr_kunnr text-011 pr_vkorg  .
      ENDIF.
    ENDFORM.                    " F010_validate_kunnr
    *&      Form  f010_validate_werks
          text
    FORM f010_validate_werks .
      CLEAR:w_werks.
      SELECT SINGLE werks
            INTO w_werks FROM t001w
            WHERE werks EQ pr_werks.
      IF sy-subrc <> 0.
        MESSAGE e088(zmsd).
      ENDIF.
    ENDFORM.                    " f010_validate_werks
    *&      Form  F011_validate_lgort
          text
    FORM f011_validate_lgort .
      CLEAR:w_werks .
      SELECT   SINGLE werks  FROM  t001l
             INTO w_werks
             WHERE  werks  = pr_werks
             AND    lgort  = pr_lgort.
      IF sy-subrc <> 0.
        MESSAGE e000(zmsd) WITH text-007 pr_lgort text-008 pr_werks .
      ENDIF.
    ENDFORM.                    " F011_validate_lgort
    *&      Form  f003_get_data
          text
    FORM f003_get_data .
      CLEAR wa_main.
      REFRESH it_main.
      LOOP AT it_upload INTO wa_upload.
        CLEAR : wa_main.
        MOVE: wa_upload-matnr     TO  wa_main-bismt,
              wa_upload-quantity  TO  wa_main-kwmeng,
              wa_upload-value     TO  wa_main-kwert,
              pr_vkorg            TO  wa_main-vkorg,
              pr_vtweg            TO  wa_main-vtweg,
              pr_spart            TO  wa_main-spart,
              pr_kunnr            TO  wa_main-kunnr,
              pr_werks            TO  wa_main-werks,
              pr_lgort            TO  wa_main-lgort.
        APPEND wa_main TO it_main.
      ENDLOOP.
    ENDFORM.                    " f003_get_data
    *&      Form  f004_process
          text
    FORM f004_process .
    CLEAR w_check.
    LOOP AT it_main INTO wa_main.
       IF wa_main-matnr = ''.
         WRITE:/ text-006,
                     wa_main-bismt.
         w_check = 1.
       ENDIF.
       IF wa_main-kwmeng = 0.
         WRITE:/ text-005,
                 wa_main-bismt.
         w_check = 1.
       ENDIF.
       IF    pr_auart <> 'ZM01'.
         IF wa_main-kwert IS INITIAL.
           WRITE:/ text-004,
                    wa_main-bismt.
           w_check = 1.
         ENDIF.
       ENDIF.
    ENDLOOP.
    ENDFORM.                    " f004_process
    *&      Form  f005_posting
          text
    FORM f005_posting .
      CLEAR: w_itemno,
             w_cond.
      w_itemno = 10.
      w_cond = 1.
    IF w_check = '' OR w_check = 1.
      wa_bapisdhd1-doc_type = pr_auart.
      wa_bapisdhd1-ord_reason = pr_augru.
      LOOP AT it_main INTO wa_main.
        IF w_cond = 1.
          CLEAR: it_bapiret2,
                 it_bapisditm,
                 it_bapiparnr,
                 it_bapischdl,
                 it_bapicond.
          REFRESH:it_bapiret2,
                  it_bapisditm,
                  it_bapiparnr,
                  it_bapischdl,
                  it_bapicond.
          MOVE: wa_main-vkorg TO wa_bapisdhd1-sales_org,
                wa_main-vtweg TO wa_bapisdhd1-distr_chan,
                wa_main-spart TO wa_bapisdhd1-division.
          wa_bapisdhd1-wbs_eleM = 'Y561.1'.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              INPUT         = pr_kunnr
           IMPORTING
             OUTPUT        = pr_kunnr.
          wa_bapisdhd1-PURCH_NO_S = pr_kunnr.
          wa_bapisdhd1-PURCH_NO_C = pr_kunnr.
        ENDIF.
        MOVE: w_itemno TO wa_bapisditm-itm_number,
               wa_main-matnr TO wa_bapisditm-material,
              wa_main-BISMT TO wa_bapisditm-material,
              wa_main-werks TO wa_bapisditm-plant,
              wa_main-lgort TO wa_bapisditm-store_loc.
                           wa_bapisditm-target_qty = '10'.
        wa_bapisditm-PURCH_NO_S = pr_kunnr.
        wa_bapisditm-PURCH_NO_C = pr_kunnr.
        APPEND wa_bapisditm TO it_bapisditm.
        IF w_cond = 1.
          wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-itm_number = 10.
            wa_bapiparnr-partn_role = 'SP'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          wa_bapiparnr-partn_role = 'AG'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          CLEAR wa_bapiparnr-partn_role.
                   wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-partn_role = 'RE'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          CLEAR wa_bapiparnr-partn_role.
                   wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-partn_role = 'RG'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          CLEAR wa_bapiparnr-partn_role.
                   wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-partn_role = 'WE'.
          APPEND wa_bapiparnr TO it_bapiparnr.
        ENDIF.
        wa_bapischdl-itm_number = w_itemno.
        wa_bapischdl-req_qty    = wa_main-kwmeng.
         wa_bapischdl-PURCH_NO_S = pr_kunnr.
        APPEND wa_bapischdl TO it_bapischdl.
        wa_bapicond-itm_number = w_itemno.
        wa_bapicond-cond_type  = 'ZECL'.
         IF    ( wa_bapisdhd1-doc_type = 'ZPMU' ) OR ( wa_bapisdhd1-doc_type = 'ZPMM' ).
           wa_bapicond-cond_type  = 'ZVAL'.
         ELSE.
           wa_bapicond-cond_type  = 'ZMRP'.       "+PK12122006
         ENDIF.
        wa_bapicond-cond_value = wa_main-kwert.
        APPEND wa_bapicond TO it_bapicond.
        w_itemno = w_itemno + 10.
        w_cond   = w_cond + 1.
      ENDLOOP.
      data : SALESDOCUMENTIN like BAPIVBELN-VBELN.
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in     = wa_bapisdhd1
        IMPORTING
          salesdocument       = SALESDOCUMENTIN
        TABLES
          return              = it_bapiret2
          order_items_in      = it_bapisditm
          order_partners      = it_bapiparnr
          order_schedules_in  = it_bapischdl
          order_conditions_in = it_bapicond.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = c_ch.
    ENDIF.
      LOOP AT it_bapiret2 INTO wa_bapiret2.
        DATA : w_err(100) TYPE c,
        w_matnr TYPE matnr.
        IF wa_bapiret2-type = 'E' AND wa_bapiret2-id = 'V1' AND wa_bapiret2-number = 392.
          UNPACK wa_bapiret2-message_v1 TO w_matnr.
          READ TABLE it_matnr INTO wa_matnr WITH KEY matnr = w_matnr.
          IF sy-subrc EQ 0.
            CONCATENATE text-013 wa_matnr-bismt INTO w_err SEPARATED BY space.
            MESSAGE w_err TYPE 'S'.
          ENDIF.
        ENDIF.
        IF WA_BAPIRET2-TYPE = 'S'.  " Comment
          WRITE: 40 TEXT-009, WA_BAPIRET2-MESSAGE_V2+0(10).
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " f005_posting
    I have given all the necessary parameters. it is telling that error is in parameter
    sales_header_in.
    I have checked it.
    i have assigned purch_no_s and purch_no_c of the structure BAPISDHD1(ORDER_HEADER_IN)
    in the bapi with customer number.
    and also i have assigned the partnumber of the structure BAPIPARNR ORDER_PARTNERS
    in the bapi with customer number.
    but still , it is diplaying the error message, please enter the sold to or ship to party number.
    how to resolve this error.
    this is urgent requirement.
    points will be awarded.
    thanking u in advance,
    a.srinivas.

    Hi,
    Did u have a look at the standard programs which make use of BAPI_SALESORDER_CREATEFROMDAT1
    Heres a list...
    LWSSOU08                     
    MV45WF0S                     
    MWWMJF21_BAPI_SALESORDER_CREAT
    RBUS2032                    
    Regards,
    Tanveer.
    <b>Please mark helpful answers</b>

  • Change the status of Sales Order

    Hi,
    I have a scenario wheirin I need to forcefully change the status of a sales order to complete eventhough the delivery / invoice is not complete. Reason is because the user has stopped to take further deliveries.
    I already have 3 deliveries / invoices for my Sales order and I want to stop any subsequent ones. However the status field in a sales order is grayed out so I cant change it manually.
    Is there any other way I can make the status of my sales order to complete or stop further deliveries / invoices?
    If you want any other information then do let me know.

    I understand you already have some deliveries for some of the items in the order and some invoices too. If so then you CAN'T changes the status of THE document. thatd be wrong, as some transaction is already processed hence it is greyed out.
    if you wish to block further deliveries etc for the balance of the items then the blocks too wouldnt be right as again they are on the doc level.
    For the case specific you need to set the "reason of rejection" at the ITEM level thus updating that the balance of the items are irrelevant for the further processing. and save. That would complete the order, and your purpose met.
    Regards,
    Tariq

  • User Exit in the Sales order create BAPI

    Hi,
    Can some one help me in telling if there exists a user exit for the BAPI '/AFS/BAPI_SALESORDER_CREATE'.
    This is urgent. So, pls. throw some light on this.
    Thanks in advance.

    Hi
    User Exits In Sales Document Processing
    System modifications for sales document processing affect different areas. Depending on the modification, you make the changes in the program components provided:
    MV45ATZZ
    For entering metadata for sales document processing. User-specific metadata must start with "ZZ".
    MV45AOZZ
    For entering additional installation-specific modules for sales document processing which are called up by the screen and run under PBO (Process Before Output) prior to output of the screen. The modules must start with "ZZ".
    MV45AIZZ
    For entering additional installation-specific modules for sales document processing. These are called up by the screen and run under PAI (Process After Input) after data input (for example, data validation). The modules must start with "ZZ".
    MV45AFZZ and MV45EFZ1
    For entering installation-specific FORM routines and for using user exits, which may be required and can be used if necessary. These program components are called up by the modules in MV45AOZZ or MV45AIZZ.
    User exits in the program MV45AFZZ
    The user exits which you can use for modifications in sales document processing are listed below.
    USEREXIT_DELETE_DOCUMENT
    This user exit can be used for deleting data which was stored in a separate table during sales document creation, for example, if the sales document is deleted.
    For example, if an additional table is filled with the name of the person in charge (ERNAM) during order entry, this data can also be deleted after the sales order has been deleted.
    The user exit is called up at the end of the FORM routine BELEG_LOESCHEN shortly before the routine BELEG_SICHERN.
    USEREXIT_FIELD_MODIFICATION
    This user exit can be used to modify the attributes of the screen fields.
    To do this, the screen fields are allocated to so-called modification groups 1 - 4 and can be edited together during a modification in ABAP. If a field has no field name, it cannot be allocated to a group.
    The usage of the field groups (modification group 1-4) is as follows:
    Modification group 1: Automatic modification with transaction MFAW
    Modification group 2: It contains 'LOO' for step loop fields
    Modification group 3: For modifications which depend on check tables or on other fixed information
    Modification group 4: is not used
    The FORM routine is called up for every field of a screen. If you require changes to be made, you must make them in this user exit.
    This FORM routine is called up by the module FELDAUSWAHL.
    See the Screen Painter manual for further information on structuring the interface.
    USEREXIT_MOVE_FIELD_TO_VBAK
    Use this user exit to assign values to new fields at sales document header level. It is described in the section "Transfer of the customer master fields into the sales document".
    The user exit is called up at the end of the FORM routine VBAK_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBAP
    Use this user exit to assign values to new fields at sales document item level. It is described in the section "Copy customer master fields into the sales document".
    The user exit is called up at the end of the FORM routine VBAP_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBEP
    Use this user exit to assign values to new fields at the level of the sales document schedule lines.
    The user exit is called up at the end of the FORM routine VBEP_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBKD
    Use this user exit to assign values to new fields for business data of the sales document. It is described in the section "Copy customer master fields into sales document".
    The user exit is called up at the end of the FORM routine VBKD_FUELLEN.
    USEREXIT_NUMBER_RANGE
    Use this user exit to define the number ranges for internal document number assignment depending on the required fields. For example, if you want to define the number range depending on the sales organization (VKORG) or on the selling company (VKBUR), use this user exit.
    The user exit is called up in the FORM routine BELEG_SICHERN.
    USEREXIT_PRICING_PREPARE_TKOMK
    Use this user exit if you want to include and assign a value to an additional header field in the communication structure KOMK taken as a basis for pricing.
    USEREXIT_PRICING_PREPARE_TKOMP
    Use this user exit if you want to include or assign a value to an additional item field in the communication structure KOMP taken as a basis for pricing.
    USEREXIT_READ_DOCUMENT
    You use this user exit if further additional tables are to be read when importing TA01 or TA02.
    The user exit is called up at the end of the FORM routine BELEG_LESEN.
    USEREXIT_SAVE_DOCUMENT
    Use this user exit to fill user-specific statistics update tables.
    The user exit is called up by the FORM routine BELEG-SICHERN before the COMMIT command.
    Note
    If a standard field is changed, the field r185d-dataloss is set to X. The system queries this indicator at the beginning of the safety routine. This is why this indicator must also be set during the maintenance of user-specific tables that are also to be saved.
    USEREXIT_SAVE_DOCUMENT_PREPARE
    Use this user exit to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
    The user exit is carried out at the beginning of the FORM routine BELEG_SICHERN.
    User exits in the program MV45AFZA
    USEREXIT_MOVE_FIELD_TO_KOMKD
    Use this user exit to include or assign values to additional header fields in the communication structure KOMKD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
    USEREXIT_MOVE_FIELD_TO_KOMPD
    Use this user exit to include or assign values to additional item fields in the communication structure KOMPD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
    USEREXIT_MOVE_FIELD_TO_KOMKG
    Use this user exit to include or assign values to additional fields in the communication structure KOMKG taken as a basis for material determination and material listing. This is described in detail in the section "New fields for listing/exclusion".
    USEREXIT_MOVE_FIELD_TO_KOMPG
    Use this user exit to include or assign values to additional fields in the communication structure KOMPG taken as a basis for material determination and material listung. This is described in detail in the section "New fields for listing/exclusion".
    USEREXIT_REFRESH_DOCUMENT
    With this user exit, you can reset certain customer-specific fields as soon as processing of a sales document is finished and before the following document is edited.
    For example, if the credit limit of the sold-to party is read during document processing, in each case it must be reset again before processing the next document so that the credit limit is not used for the sold-to party of the following document.
    The user exit is executed when a document is saved if you leave the processing of a document with F3 or F15.
    The user exit is called up at the end of the FORM routine BELEG_INITIALISIEREN.
    User-Exits in program MV45AFZB
    USEREXIT_CHECK_XVBAP_FOR_DELET
    In this user exit, you can enter additional data for deletion of an item. If the criteria are met, the item is not deleted (unlike in the standard system).
    USEREXIT_CHECK_XVBEP_FOR_DELET
    In this user exit, you can enter additional data for deletion of a schedule line. If the criteria are met, the schedule line is not deleted (unlike in the standard system).
    USEREXIT_CHECK_VBAK
    This user exit can be used to carry out additional checks (e.g. for completion) in the document header. The system could, for example, check whether certain shipping conditions are allowed for a particular customer group.
    USEREXIT_CHECK_VBAP
    This user exit can be used to carry out additional checks (e.g. for completion) at item level.
    USEREXIT_CHECK_VBKD
    The user exit can be used to carry out additional checks (e.g. for completion) on the business data in the order.
    USEREXIT_CHECK_VBEP
    This user exit can be use to carry out additional checks (e.g. for completion) on the schedule line. During BOM explosion, for example, you may want certain fields to be copied from the main item to the sub-items (as for billing block in the standard system).
    USEREXIT_CHECK_VBSN
    You can use this user exit to carry out additional checks (e.g. for completion) on the serial number.
    USEREXIT_CHECK_XVBSN_FOR_DELET In this user exit, you can enter additional criteria for deletion of the serial number. If the criteria are met, the serial number is not deleted (unlike in the standard system).
    USEREXIT_FILL_VBAP_FROM_HVBAP
    You can use this user exit to fill additional fields in the sub-item with data from the main item.
    USEREXIT_MOVE_FIELD_TO_TVCOM_H
    You can use this user exit to influence text determination for header texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
    USEREXIT_MOVE_FIELD_TO_TVCOM_I
    You can use this user exit to influence text determination for item texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
    User-Exits for product allocation:
    The following user exits all apply to structure COBL, in which the data for account determination is copied to item level.
    USEREXIT_MOVE_FIELD_TO_COBL
    Option to include new fields in structure COBL.
    USEREXIT_COBL_RECEIVE_VBAK
    Option to assign values from the document header to the new fields.
    USEREXIT_COBL_RECEIVE_VBAP
    Option to supply values from the item to the new fields.
    USEREXIT_COBL_SEND_ITEM
    A changed field can be copied from the structure into the item. You could use the user exit to display a certain field in the account assignment block (see also MV45AFZB).
    USEREXIT_COBL_SEND_HEADER
    A changed field can be copied from the structure to the header (see source text MV45AFZB)
    USEREXIT_SOURCE_DETERMINATION
    You can use this user exit to determine which plant will be used for the delivery. In the standard system, the delivering plant is copied from the customer master or the customer-material info record. If you want to use a different rule, then you must enter it in this user exit.
    USEREXIT_MOVE_FIELD_TO_ME_REQ
    With this user exit you can include additional fields for the following fields:
    EBAN (purchase requisition)
    EBKN (purchase requisition-account assignment)
    USEREXIT_GET_FIELD_FROM_SDCOM
    Option to include new fields for the variant configuration. Fields that are included in structure SDCOM can be processed and then returned to the order.
    USEREXIT_MOVE_WORKAREA_TO_SDWA
    You can use this user exit to format additional work areas for the variant configuration. You will find notes on the user exit in MV45AFZB.
    User-Exits for first data transfer:
    The following user exits can only be used for the first data transfer.
    Note
    Only use the user exits if the names/fields do NOT have the same name.
    USEREXIT_MOVE_FIELD_TO_VBAKKOM
    Option to include additional fields in structure VBAKKOM (communiction fields for maintaining the sales document header)
    USEREXIT_MOVE_FIELD_TO_VBAPKOM
    Option to include additional fields in structure VBAPKOM (communication fields for maintaining a sales item)
    USEREXIT_MOVE_FIELD_TO_VBEPKOM
    Option to include additional fields in structure VBEPKOM (communication fields for maintaining a sales document schedule line)
    USEREXIT_MOVE_FIELD_TO_VBSN
    You can use this user exit to include fields in structure VBSN (scheduling agreement-related change status).
    USEREXIT_MOVE_FIELD_TO_KOMKH
    You can use this user exit to include new fields for batch determination (document header).
    USEREXIT_MOVE_FIELD_TO_KOMPH
    You can use this user exit to include new fields for batch determination (document item).
    USEREXIT_CUST_MATERIAL_READ
    You can use this user exit to set another customer number in the customer material info record (e.g. with a customer hierarchy)
    USEREXIT_NEW_PRICING_VBAP
    Option for entry of preconditions for carrying out pricing again (e.g. changes made to a certain item field could be used as the precondition for pricing to be carried out again). Further information in MV45AFZB.
    USEREXIT_NEW_PRICING_VBKD
    Option for entry of preconditions for carrying out pricing again (e.g. changes to the customer group or price group could be set as the preconditions for the system to carry out pricing again). Further information in MV45AFZB.
    User-Exits in Program MV45AFZD
    USEREXIT_CONFIG_DATE_EXPLOSION
    The BOM is exploded in the order with the entry date. You can use this user exit to determine which data should be used to explode the BOM (explosion with required delivery date, for example).
    User exits in the program FV45EFZ1
    USEREXIT_CHANGE_SALES_ORDER
    In the standard SAP R/3 System, the quantity and confirmed date of the sales document schedule line is changed automatically if a purchase requisition is allocated, and it or the sales document is changed (for example, quantity, date).
    If you want to change this configuration in the standard system, you can define certain requirements in order to protect your sales orders from being changed automatically. Use this user exit for this purpose. Decide at this point whether the schedule lines are to be changed.
    User-Exits in Program RV45PFZA
    USEREXIT_SET_STATUS_VBUK
    In this user exit you can you can store a specification for the reserve fields in VBUK (header status). Reserve field UVK01 could, for example, be used for an additional order status (as for rejections status, etc.).
    The following workareas are available for this user exit:
    VBUK (header status)
    FXVBUP (item status)
    FXVBUV (Incompletion)
    USEREXIT_SET_STATUS_VBUP
    In this user exit you can you can store a specification for the reserve fields for VBUP (item status).
    The following workareas are available for this user exit:
    FXVBAP (Item data)
    FXVBAPF (Dynamic part of order item flow)
    FXVBUV (Incompletion)
    USEREXIT_STATUS_VBUK_INVOICE
    You can use this user exit to influence billing status at header level.
    User exits in the screens
    Additional header data is on screen SAPMV45A 0309, additional item data on screen SAPMV45A 0459. These screens contain the Include screens SAPMV45A 8309 or SAPMV45A 8459 as user exits.
    Fields which are also to be included in the sales document for a specific installation should be included on the Include screens for maintaining. If an application-specific check module is needed for the fields, this can be included in the Include MV45AIZZ. The module is called up in the processing logic of the Include screens.
    For field transports, you do not have to make changes or adjustments.
    Example
    A new field, VBAK-ZZKUN, should be included in table VBAK.
    If the check is defined via the Dictionary (fixed values or check table) the field must be included with the fullscreen editor in the Include screen SAPMV45A 8309. In this case, no change has to be made to the processing logic.
    User Exits in Program MV45AFZ4
    USEREXIT_MOVE_FIELD_TO_KOMK
    You can use this user exit to add or edit additional header fields in the communication structure - KOMK- for free goods determination. For more information, see the New Fields for Free Goods Determination IMG activity.
    USEREXIT_MOVE_FIELD_TO_KOMP
    You can use this user exit to add or edit additional item fields in the communication structure KOMP for free goods determination. For more information see the New Fields for Free Goods Determination IMG activity.
    User Exits in the SAPFV45PF0E and SAPFV45PF0C Programs
    EXIT_SAPFV45P_001
    You can use this user exit to decide whether intercompany billing data is used in the profitability segment for cross-company code sales, or whether the data comes from external billing (external customer, sales data from the selling company code.

  • Change Pricing procedure in sales order create

    Hi,i need to create a return with reference to an billing document by using FM BAPI_CUSTOMERRETURN_CREATE. I can able to create Return sales order with reference to billing document. But i am not able to copy pricing as per billing document item. It is getting created correctly when i do manual.
    Or Can i change Pricing procedure when i create sales order by using any enhancement ?
    Kindly help.

    Hi,
    Please try using the below EXITS:
    USEREXIT_PRICING_RULE (module pool SAPLV61A, program RV61AFZA)
    In the standard SAP system, it is predefined which condition categories and classes can be copied or recalculated per pricing type. You can change the predefined standard procedure for each pricing type.
    USEREXIT_CHANGE_PRICING_RULE (module pool SAPMV61A, program MV61AFZA)
    You can use this user exit to change the pricing type that has been predefined in the copying control table in billing.
    Hope this might be helpful.
    Regards,
    Shashwath

  • Pricing conditions for sale order create BAPI

    Hi guys and gals,
            i am workin on a object where i would have to create a variant of VA01 screen with pricing details , item details , shipping details etc, visible in  a single screen .
           What i have understood so far is that i would have to use BAPI simulate to get the pricing conditions and ATP details to display to the user before he saves the order , the issue now is when is adding new pricing conditions or changing the existing conditions on my screen i would have to update the other conditions types based on his input and i also understand that some conditions r editable and some arn't and like in regular VA01 the user should be able to delete the pricing conditions also , which means i should taken into account all this when iam finally saving this order , please guide me further in this regards
    Thanks in advance

    Hai
    Try with the following
    U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
    U can find these parameters for a particular condition type in table KONV.
    *& Form saveTransactionJOCR
    text
    --> p1 text
    <-- p2 text
    FORM saveTransactionJOCR .
    data: salesdocument like BAPIVBELN-VBELN,
    order_header_inx like bapisdh1x,
    order_header_in like bapisdh1,
    return type standard table of bapiret2 with header line,
    conditions_in type standard table of bapicond with header line,
    conditions_inx type standard table of bapicondx with header line,
    logic_switch like BAPISDLS,
    step_nr like conditions_in-cond_st_no,
    item_nr like conditions_in-itm_number,
    cond_count like conditions_in-cond_count,
    cond_type like conditions_in-cond_type.
    salesdocument = wa_order_information-VBELN.
    LOGIC_SWITCH-COND_HANDL = 'X'.
    order_header_inx-updateflag = 'U'.
    conditions
    clear conditions_in[].
    clear conditions_inx[].
    clear: step_nr,
    item_nr,
    cond_count,
    cond_type.
    step_nr = '710'.
    item_nr = '000000'.
    cond_count = '01'.
    cond_type = 'ZCP2'.
    CONDITIONS_IN-ITM_NUMBER = item_nr.
    conditions_in-cond_st_no = step_nr.
    CONDITIONS_IN-COND_COUNT = cond_count.
    CONDITIONS_IN-COND_TYPE = cond_type.
    CONDITIONS_IN-COND_VALUE = 666.
    CONDITIONS_IN-CURRENCY = 'EUR'.
    append conditions_in.
    CONDITIONS_INX-ITM_NUMBER = item_nr.
    conditions_inx-cond_st_no = step_nr.
    CONDITIONS_INX-COND_COUNT = cond_count.
    CONDITIONS_INX-COND_TYPE = cond_type.
    CONDITIONS_INX-UPDATEFLAG = 'U'.
    CONDITIONS_INX-COND_VALUE = 'X'.
    CONDITIONS_INX-CURRENCY = 'X'.
    append conditions_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = salesdocument
    ORDER_HEADER_IN = order_header_in
    ORDER_HEADER_INX = order_header_inx
    LOGIC_SWITCH = logic_switch
    TABLES
    RETURN = return
    CONDITIONS_IN = conditions_in
    CONDITIONS_INX = conditions_inx
    if return-type ne 'E'.
    commit work and wait.
    endif.
    ENDFORM. " saveTransactionJOCR
    Thanks & regards
    Sreenivasulu P

  • Sale order create BAPI and output types

    Hi Experts,
           In our organization, we are using BAPI BAPI_SALESORDER_CREATEFROMDAT2 to create sales order.
    We are having no problem creating sales orders. But one more functionality they wanted to add.
    We have a screen where user enters all the data and at the same time he selects weather the order should be printed or Faxed or both.
    Please let me know where i can send this information in that BAPI and how.
    I hope ORDER_KEYS is the table to send the data. If that is the case, could you please explain how that works and how that makes entry in NAST table.
    Thanks,
    ABAPer.

    To propose output type automatically, you need to maintain proper output determination for the sales.
    For example, you want to have BA00 output for every order, than you need to maintain the order type for that condition in VV11 transaction. Here you can maintain customer numbers. Now, when you create a Sales order for this customer and saves it, system automatically propose an output.
    So, you need to maintain on output detemination to propose output.
    Regards,
    Naimesh Patel

  • Need to pull INITIAL(vbap)net price of  Sales Order, after changing viaVA02

    Hi Experts,
    Mine is differetnt requirement..........
    I created a my_Sales_order_12345678 with 2 items, as follows,(all following values/entries r for my_Sales_order_12345678)
    line item_10---->net_value_netpr = $100
    line item_20---->net_value_netpr = $200
    Then the VBAP entries as r as follows,
    POSNR -
    >NETPR
    10----
    > $100
    20----
    > $200
    I changed first time as via VA02 tx, as
    line item_10---->net_value_netpr = $300
    line item_20---->net_value_netpr = $400
    Then the VBAP entries as r as follows,
    POSNR -
    >NETPR
    10----
    > $300
    20----
    > $400
    I changed second time as via VA02 tx, as
    line item_10---->net_value_netpr = $500
    line item_20---->net_value_netpr = $600
    Then the VBAP entries as r as follows,
    POSNR -
    >NETPR
    10----
    > $500
    20----
    > $600
    My requirement: for some reason, I need the initial values, I mean
    the VBAP entries of,
    POSNR -
    >NETPR
    10----
    > $100
    20----
    > $200
    I tried with CDHDR & CDPOS tbls, but no use? So, from Where Can I get/pull them??
    thanq
    Edited by: Srinivas on Jan 24, 2008 12:22 AM

    hi sirnivas..
    Thanq you for the points..these are the first i ever recieved..
    if you are working on peice of code which can get the price history do me a favour if you have finished the code just explain it to me who did u  do that...
    i have been working on an object from last two weeks to get the latest price...
    the thing is even though the price for condition items has been changed it wont get updated in the Sales orders unless new pricing fot the document is done...
    so i have to get all the sales orders who condition items price has been changed and display them in an ALV...so if you can get the exact old values...for the conditions i guess the opposite also can be done.....
    Here i have suggestion for you...in condition items there is a process called SCHEMA ( pricing Schema) which you can see using Condition Analysis button at the bottom of the condition item window...
    you can see all the price changes to the condition when you parse the tree structure of the procedure..EXAMPLE :- R0000 etc...
    so some Sales orders if the Schema has been changed all the existing condition are replaced by New ones from the changed Schema...so i guess that would play an important role in deciding the Price of Sales order...
    I know this is bit long but .....if you did finsish your program do let me know how you did it...
    Thankyou very much and good luck.

Maybe you are looking for

  • Deferred tax: Post down payment clearing individually $1 while f-4E3?

    Hi all, We are booking the invoice as well as clearing the special GL transaction  through F-43/ F-41 001 39S      0009000457 PRADEEP SANGVIKAR          10,000.00- 002 40       6030000039 Testing Charges             9,066.00                 SA 003 40

  • PO mandatory in case of advance payment to vendor

    Dear Experts, We want to implement new practise in our system that all downpayments to vendors should must be made with refrence to Purchase Order. My question is how can we achieve this functionality in System. Expert's reply is awaited. Br Zohaib H

  • How to create infotype while creating another infotype

    Hi All, I have below requirement... Whenever user create infotype 0008, infotype 0014 should be created for the wages available in a  Z table. I created a dynamic action and call function HR_INFOTYPE_OPERATION. When i debug the routine function succe

  • Https 1.4.1 post fails but works in 1.3

    I have a simple app that runs fine on 1.3.1_04 but it does not run on 1.4.* When I debug I notice 1.3 passes SSL as the protocol and 1.4 passes TLSv1. Does anyone know how to resolve this problem? Can I use HttpURLConnection? Do I need to use sockets

  • Selected set assignment to code group

    I have maintained a catalog " S", under which i have maintained code groups and codes in QS41, but here the usage indicator is deactive. I cannot select it. Now when i use QS51,i am unable to view the codes. the selected set is empty. In this case ho