12-02-2007 8:58 PM
Hi,
We would like to change a sales order immediately after it is created using standard bapi, BAPI_SALESORDER_CREATEFROMDAT2. The change we would like to make is to add certain partner functions in the sales order at the line item level and not at the header and item level both (as the std bapi does).
1) How do we acheive this?
2) Is there any function module which can help change the sales order by adding the partner functions at the line item level of the sales order only.
3) Is there anyway that the partner functions can be added at the line item level by doing some config change?
4) Is there any way to create a sales order with the partner functions at the line item level only instead of the header and line item level both?
Thanks in advance.
Mick
12-03-2007 4:48 AM
hi,
The following information may be useful for you
2.2.1 Tables for Change Sales Order:
2.2.1.1 ORDER_HEADER_IN:
This table is used to input the header information of the Sales Document to the BAPI for changing the header level information of a Sales Order.
The fields used in solution are as follows:
i. PURCH_NO_C: Customer purchase order number
ii. SALES_ORG: Sales Organization
iii. DISTR_CHAN: Distribution Channel
iv. DIVISION: Division
v. SALES_OFF: Sales office
vi. REQ_DATE_H: Requested delivery date
vii. PURCH_DATE: Customer purchase order date
2.2.1.2. ORDER_HEADER_INX:
This table is an index table used to indicate which fields are being changed. All the fields are single character fields of value X except the UPDATEFLAG.
The fields used in solution are as follows:
i. UPDATEFLAG: This field is used to indicate whether the header data is passed to Add, Change or delete Sales Orders. Possible UPDATEFLAGS are:
a. U = Change(Sales Order Change)
b. D = Delete( Sales Order Delete)
c. I = Insert / Add (Sales Order Create)
ii. SALES_ORG
iii. DISTR_CHAN
iv. DIVISION
v. SALES_OFF
vi. REQ_DATE_H
vii. PURCH_DATE
2.2.1.3. ORDER_ITEM_IN:
This table is used to input the item level information of the Sales Document to the BAPI. The fields used in solution are as follows:
i. ITM_NUMBER: Sales Document Item
ii. CUST_MAT35: Material belonging to the customer (It wont be updated in Change-Change and Change-Delete operations)
iii. PLANT: Plant
iv. BATCH: Batch Number
v. TARGET_QTY: Target quantity in sales units
2.2.1.4. ORDER_ITEM_INX:
This table is an index table used to indicate which fields are being changed. All the fields are single character fields of value X except the UPDATEFLAG.
The fields used in solution are as follows:
i. UPDATEFLAG: This field is used to indicate whether the item data is passed to Add, Change or delete Sales Order items. Possible UPDATEFLAGS are:
a. U = Change(Sales Order Change)
b. I = Insert / Add (Sales Order Add Item)
ii. CUST_MAT35
iii. PLANT
iv. BATCH
v. TARGET_QTY
2.2.1.5. PARTNERCHANGES:
This table is used to input the partner information of the Sales Document to the BAPI. The fields used in solution are as follows:
i. PARTN_ROLE: Partner function
ii. P_NUMB_OLD: Old Partner Number
iii. P_NUMB_NEW: New Partner Number
2.2.1.6. SCHEDULE_LINES
This table is used to input the Schedule Lines information of the Sales Document to the BAPI.
The fields used in solution are as follows:
i. ITM_NUMBER: Line Item Number
ii. SCHED_LINE: Schedule Line(Not required for Add Item or Delete Item)
iii. REQ_QTY: Order quantity in sales units
2.2.1.7. SCHEDULE_LINESX:
This table is an index table used to indicate which fields are being changed. All the fields are single character fields of value X except the ITM_NUMBER.
The fields used in solution are as follows:
i. UPDATEFLAG: This field is used to indicate whether the item data is passed to Add, Change or delete Sales Orders in the Schedules. Possible UPDATEFLAGS are:
i. U = Change(Sales Order Change Item)
ii. I = Add(Sales Order Add Item)
ii. ITM_NUMBER: Line item number
iii. SCHED_LINE: Schedule Line(Not required for operations Change-Add Item, Change-Delete Item)
iv. REQ_QTY: Order Quantity in Sales Units
2.2.1.8. ORDER_TEXT:
This table is used to input the text information of various fields of the Sales Document to the BAPI. The fields used in solution are as follows:
i. ITM_NUMBER: Line Item Number
ii. TEXT_ID: Text ID
iii. LANGU: Language Key
iv. TEXT_LINE: Text line
2.2.1.9. RETURN
This table is used to get return messages from the SAP system
The fields used in solution are as follows:
i. TYPE: Message type: S Success, E Error, W Warning, I Info, A Abort
ii. ID: Messages, Message Class
iii. NUMBER: Messages, Message Number
iv. MESSAGE: Message Text
v. LOG_NO: Application log: log number
vi. LOG_MSG_NO: Application log: Internal message serial number
vii. MESSAGE_V1: Messages, message variables
viii. MESSAGE_V2: Messages, message variables
ix. MESSAGE_V3: Messages, message variables
x. MESSAGE_V4: Messages, message variables
xi. PARAMETER: Parameter Name
xii. ROW: Lines in parameter
xiii. FIELD: Field in parameter
xiv. SYSTEM: Logical system from which message originates
<b>Reward points if useful</b>
regards,
pavan
12-03-2007 7:05 AM
Thanks Pavan.
But these are internal tables for which function module.
Regards,
Mick.
12-03-2007 8:56 AM
Also since we want to add/change partners, we will use the partner changes internal table.
When we use that, wont that impact the partners at the header and item level both? We want to change/add partners at the item level only and not at the header level. How do we acheive that?
Thanks in advance,
Mick
12-03-2007 9:53 AM
12-03-2007 9:55 AM
hi
to add partners we use order partners , to change we use order partnerchange
kindly observe that, i am not sure about header and line item levels
sorry
regards,
pavan
12-03-2007 10:11 AM
Thanks Pavan.
Is there any user exit availbale in function module SD_SALESDOCUMENT_CHANGE or BAPI_SALESORDER_CHANGE?
Also any idea whether the partners can be added only at the item level of the sales order via a configuration change instead of a code change.
Thanks in advance.
Mick