Skip to Content
avatar image
Former Member

Add row in Sales Order Matrix

Hi,

I try to add new row in system sales order form with item code and quantity value. But i got a error msg like "item in form is not-editable". How can i solve this problem? Can i change "quantity col" in matrix to editable when i catch form_load event?

Thnaks in advance.

Message was edited by: bill le

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 22, 2006 at 03:00 PM

    Hi,

    How do you add the new row in the matrix?

    Are you doing it in the form while the user has the Sales Order form open?

    The Quantity column is not editable in your Sales Order form?

    Are you able to do the same operation with B1 application by hand?

    Maybe you can share your code with us so we can have a look to it.

    Regards

    Trinidad.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi forum,

      i have to create a sales order with items, i tried and i got error " Sales document was not changed - 219 E". i am submitting the code. i am doing this on 4.7 ides. can anybody help .

      thanks in advance

      report zmybapi1 .

      data : my_order_header_in like bapisdhd1 occurs 0 with header line,

      my_order_header_ix like bapisdhd1x.

      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.

      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 = '50'.

      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-req_qty = '10'.

      append my_orderschedulesin.

      my_orderschedulesin-itm_number = '20'.

      my_orderschedulesin-req_qty = '20'.

      append my_orderschedulesin.

      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'.

      my_orderitemsix-updateflag = 'I'.

      my_orderitemsix-material = 'X'.

      my_orderitemsix-target_qty = 'X'.

      my_orderitemsix-plant = 'X'.

      my_orderitemsix-division = 'X'.

      my_orderitemsix-target_qu = 'X'.

      append my_orderitemsix.

      my_orderschedulesinx-updateflag = 'I'.

      my_orderschedulesinx-itm_number = 'X'.

      my_orderschedulesinx-req_qty = 'x'.

      append my_orderschedulesinx.

      my_orderschedulesinx-itm_number = 'X'.

      my_orderschedulesinx-req_qty = 'x'.

      append my_orderschedulesinx.

      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 =

      • ORDER_CONDITIONS_INX =

      • 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.

      regards,

      pavan