09-19-2008 3:23 AM
Dear All,
Now, i find some code as below.
The BAPI is uesd to create or update the sales order; but checkbox for bapi parameter have not been give values 'X'. why?
take the first bapi for example, i think table order_items_inx (table parameter) should be given value 'X' for the field which will be update.
Could you teach what happed?
...........................
case gt_all_hd-sd_doc_cat.
when 'C'.
call function 'BAPI_SALESORDER_CREATEFROMDAT2'
exporting
order_header_in = gs_order_hd
importing
salesdocument = gv_vbeln
tables
return = gt_return
order_items_in = gt_items
order_partners = gt_partners
order_schedules_in = gt_schedules
order_conditions_in = gt_conditions.
when others.
call function 'BAPI_SALESDOCU_CREATEFROMDATA1'
exporting
sales_header_in = gs_order_hd1
importing
salesdocument_ex = gv_vbeln
tables
return = gt_return
sales_items_in = gt_item1
sales_partners = gt_part1
sales_schedules_in = gt_sch1
sales_conditions_in = gt_cond1.
endcase.
....................
09-19-2008 10:54 AM
If you want to change a value, you need to pass the value in the 'order_items_in = gt_items' structure.
You also need to add an 'X' in the 'order_items_inx = gt_itemsx' structure for the same field.
If you do not pass the 'X' then the value will not be updated...
It looks like you are not passing the required '...x' structures.
For more info see the documentation:
Notes
1. Mandatory entries:
ORDER_HEADER_IN : DOC_TYPE Sales document type
SALES_ORG Sales organization
DISTR_CHAN Distribution channel
DIVISION Division
ORDER_PARTNERS..: PARTN_ROLE Partner role, SP sold-to party
PARTN_NUMB Customer number
ORDER_ITEMS_IN..: MATERIAL Material number
2. Ship-to party:
If no ship-to party is entered, use the following: Ship-to party =
sold-to party.
3. Commit control:
The BAPI does not have a database commit. This means that the
relevant application must leave the commit, in order that can be
carried out on on the database. The BAPI BAPI_TRANSACTION_COMMIT is
available for this.
4. German key words:
The following key words must be entered in German, independantly of
the logon language:
DOC_TYPE Sales document type, for example: TA for standard order
PARTN_ROLE Partner role, for example: WE for ship-to party
Further information
You can find further information in the OSS. The note 93091 contains
general information on the BAPIs in SD.
09-22-2008 4:51 AM