Pricing in Service order
We are into the business of Building products like manufacturing of aluminum. Doors & window. Once we sold this to the customers, we have to install also. Sometimes we have to charge from the customers & sometimes not. Installation takes a lot of time i.e. 2-3 months.
The scenario we are using now is
n Sales order--Del-- Billing.
n
But by this we could not track how much material is install at customer site.
For this now we are planning to make one service order ref. to the billing doc.
In service order we are taking one service material & do the billing.
In some cases we are not charging anything from the customer but we have to calculate internal expenses that is bear by company & pass this information to accounts.
Could any body please suggest me how I will do the pricing in service order.
My requirements are-
1---I am charging installation charges from customer(for this we can use simple any condition type)
2---I am not charging from customer but I want to show the cost that is bear by company & want to pass this to accounts/Controlling
..I need the help in this scenario
Is there any specific condition types are there for service order.
Dear Sunil,
You will have to work on the item category level for this.
1)For your first requirement define item category determination(t.code VOV4) rules which will get you a item category which is relevant for pricing. (I think you will not have any problems in defining this)
2) In the same transaction define a item category which is an alternative entry to the above determined item category.
3)You need to have the following settings for this alternative item category:-
a) The pricing relevance should be 'B'.
b) Condition type R100% with requirement 55.
After this settings when you enter the sales order by default your services will be charged. In case you dont want to charge the customer, manually change the item category to the one defined as the alternative item category.
Do give me the feedback of the settings.
With Regards,
PATHIK
Similar Messages
-
Change log for CRM service order
Dear Experts,
I've created log profile in CRM under IMG path Customer Relationship Management->Basic Functions-> Change log with protocolo " Changed document " & segment " PRICING_I ". This log profile is attached to transaction type service order.
Basic idea is to capture the changes made on the pricing in service order. Now with this setup where can i see the trace of changes done in service order. Is there any table that fills with the log ?
Basically i'm trying to find log DB table for pricing with this setup.Can anyone pls suggest me to resolve the issue.
Regards
Devika.SHi,
there are no change logs for CUMULAT_H object because this is only a temporary object in CRM Order buffer. Check for example the function module CRM_CUMULAT_H_READ_OB. You will find out the this module does not read the CUMULATE_H from the DB cumulates the values by reading the item values. Because of that you will also see that in view CRMV_OBJECTS the change document relevance is not maintained for this object.
So you will not a change entry for CUMULAT_H in CDHDR/CDPOS. As a workaround for your requirement you can read the changes of CRMD_PRICING_I-NET_VALUE from the change document tables or write a change entry on save into a customer field and/or table.
Regards
Nicolai -
Initial Load of Service Order by loading histor. prices (w/o Pricing P.)
Hi Experts,
in our actual proyect we need to load historical service orders into the system via report. No our problem is if we shut of the pricing procedure the prices are set in the report are not taking into account. The result is that the products in the tickets are with 0,00 Euros. If we do not shut of the pricing procedure the prices are loaded which are assigned to the products.
But we need to load the tickets with the prices that are included in the report. How can we do that? Someone has an ABAP Example.
Best Regards
OliverSolution not necessary anymore.
-
Pricing date change on service order when creating confirmation.
Hi gurus,
I want to change the pricing date (and recalculate prices)on service order to the date confirmation is created from the service order.I would like to know if this can be achieved by copy control BADI or order save BADI or pricing BADI ?
Please guide if anybody has already achieved this functionality.
Thanks
DonaHi Dona,
Pricing manipulation for an order can be done by using CRM_PRICING_BADI.Use the method CRM_PRICING_MERGE, here you can use the changing parameter CS_PRICING_BADI to change the pricing data.
Hope it helps you.
Regards,
Shweta -
Pricing date for Service Order and Service Confirmation
Hi,
I cretated a Service Confirmation as followup for Service Order.
Client is asking "Pricing Date" should be same Same in Service Order and Service Confirmation. But, I am not seeing any such field in the screen.
I need to check T&C field and Zone field. But, I am not seeing these fields also.
Can you please let me know, where can I find this fields. (In which assignment block).
Thanks,
Sandeep
Edited by: Sandeep Reddy on May 31, 2010 7:21 PMHi,
I think by PRICING DATE they mean BILLING DATE.
In date profile of SERVICE ORDER and SERVICE CONFIRMATION you assign the BILLING DATE date type (i think it is there in the standard itself- however just ensure it).
Or customize a PRINCING DATE date type in the DATE PROFILE of SERVICE ORDER and CONFIRMATION and copy the date set in SERVICE ORDER to SERVICE CONFIRMATION.
This is one strategy you can use.
Regards
Surendra More -
Internal error during pricing in CRM service order
Hello Guys,
Here is an issue when i add line item in service order, it pops up with an error message " Internal error during pricing "at header & line item. Its observed that output tax condition type MWST is not called from TTE. Pricing procedure has picked up perfectly & even TTE setting is maintained which in turn calls Tax Calculation procedure 11000. But then we are unable to trace where system is falling to call MWST condition type. Request you to guide me on the issue.
Regards
Devika.SHi Devika,
please refer to following SAP notes:
559836 FAQ: tips & tricks for CRM pricing
559876 FAQ: Tricks and hints for the error analysis in pricing
559866 FAQ: tips & tricks for the IPC installation
best regards,
Johannes -
Dectivate pricing condition for sales order not service order.
Hi,
We are on ECC6.0 and CRM5.0
I need to add new condition type to the existing pricing procedure.It should be activtaed only for service orders and not for sales order.I can achive this by adding new requirement in pricing procedure to limit this condition type based on order type.
Example: if KOMK-AUART eq ORDER_TYPE.
sy-subrc = 0.
But I don't want to do this,because I would need to change this requirement everytime I add new service order type.
Is there any field in Pricing structure KOMK bu using which we can achieve this. ?
Please suggest any other idea by which I can achieve this
Thanks
DonaCurrently ,we have one pricing procedures for both the scenarios...
We control if the perticular condition type to be active or not by writing a requirement which checks the order types.
This has been done this way because we built the pricing procedure in ECC and tranfer it to CRM.Also we donot have service orders in ECC.
any further alternatives guys.. -
Pricing procedure picked up from the service order not from the contract
Hello, All
I am working on CRM 5.0 service order and service contract,
While creating a service order a popup screen shows that there is a contract which should be assigned, after assigning the contract an error message appears showing that a condition type is missing, the missing condition type is in the pricing procedure of the service order not in pricing procedure of the service contract
Note: I set the copy control for the item category to copy all the condition
Regards
Jacopo FrançoisHi Jacopo,
Please check your pricing procedure settings and check for mandatory pricing condition.
Secondly, check the pricing agreement in the contract.
Best Regards,
Pratik Patel.
Reward with points if it is of any help to you! -
Contract Pricing Discount Not Applied to Service Order
Hi Guru's
We have recently applied Enhancement Pack 3 to our system and now have an issue where the service contract discount is not applying to new service order items. The service contract is being determined correctly, but the pricing condition for contract discount is not being applied - so has to be added manually.
Has anyone else applied EHP3 and seen this issue?
Thanks
AndrewThis issue is now resolved - an OSS message was raised with the note, http://service.sap.com/sap/support/notes/2074890, written to resolve the issue.
-
Creation of service order from campaign element
Hi,
We have a requirement where service orders are to be created for all those business partners who responded to the campaign. We are using standard service order type SVRO. We have set up campaign automation by creating campaign and element, assigned target group, set decision point (rule & condition) to split target group in two; one for those who have replied to campaign and others who have not replied. These target groups are also linked to other campaign elements within the campaign.
The question is, how to create a follow-on transactions such as service orders through campaign, so that one service order gets created for each successful BP from campaign result?
Thanks in advance for your advice / suggestions.
Regards
Umesh
Edited by: Umesh Singh on Sep 30, 2009 6:36 PMHi Shatnhala,
Thank you for your help. I'll try this and will come back to you.
My further requirenment is to re-trigger pricing to upade latest price information on these service orders and then to create and send letter to all those customer with price informations. Can I use the same workflow with different steps to complete all these task?
Also, how will these service orders (created through workflow) be linked with the campaign? Is their a way to link one campaign with many orders?
Thanks
Umesh -
Creating service order using BAPI_BUSPROCESSND_CREATEMULTI
Hi Experts,
I have a requirement to create a Service order using a BAPI.
I'm trying to use the BAPI BAPI_BUSPROCESSND_CREATEMULTI. I found some code related to this BAPI on this forum and and I've written my code based on that and while executing it i'm getting a short dump. Could anyone please help me figure out what the problem is.
My code is as follows:
data: lv_header_guid type guid_32.
data: begin of lit_header occurs 0,
include type BAPIBUS20001_HEADER_INS,
end of lit_header.
data: wa_header type BAPIBUS20001_HEADER_INS.
data: begin of lit_inputfields occurs 0,
include type BAPIBUS20001_INPUT_FIELDS,
end of lit_inputfields.
data: wa_inputfields type BAPIBUS20001_INPUT_FIELDS.
data: begin of lit_partner occurs 0,
include type BAPIBUS20001_PARTNER_INS,
end of lit_partner.
data: wa_partner type BAPIBUS20001_PARTNER_INS.
Create Contract header guid
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = lv_header_guid.
Fill orderadm_h
wa_header-guid = lv_header_guid.
wa_header-process_type = 'YSC'.
APPEND wa_header TO lit_header.
Fill input fields
MOVE: lv_header_guid TO wa_inputfields-ref_guid,
'A' TO wa_inputfields-ref_kind,
'0001' TO wa_partner-ref_partner_handle,
'ORDERADM_H' TO wa_inputfields-objectname,
'PROCESS_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
CLEAR wa_inputfields.
Fill PARTNER DETAILS
Sold to Party
MOVE: lv_header_guid TO wa_partner-ref_guid,
'A' TO wa_partner-ref_kind,
'0001' TO wa_partner-ref_partner_handle,
'CRM000' TO wa_partner-partner_fct,
'5000000288' TO wa_partner-partner_no,
'BP' TO wa_partner-no_type,
'BP' TO wa_partner-display_type,
'X' TO wa_partner-mainpartner.
APPEND wa_partner TO lit_partner.
CLEAR wa_partner.
Fill input fields
MOVE: lv_header_guid TO wa_inputfields-ref_guid,
'A' TO wa_inputfields-ref_kind,
'0001' TO wa_inputfields-logical_key,
'PARTNER' TO wa_inputfields-objectname.
MOVE 'PARTNER_FCT' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'PARTNER_NO' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'NO_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'DISPLAY_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
CLEAR wa_inputfields.
CALL FUNCTION 'BAPI_BUSPROCESSND_CREATEMULTI'
TABLES
HEADER = lit_header
ITEM =
ACTIVITY =
SALES =
PARTNER = lit_partner
ORGANISATION =
SHIPPING =
APPOINTMENT =
TEXT =
SERVICE_OS =
STATUS =
INPUT_FIELDS = lit_inputfields
CREATED_PROCESS =
RETURN =
LEAD =
OPPORTUNITY =
PRODUCT =
SCHEDULELINE =
CUSTOMER_HEAD =
CUSTOMER_ITEM =
PRICING =
PRICING_ITEM =
CONDITION_CREATE =
BILLING =
CONFIG_CFG =
CONFIG_BLB =
CONFIG_INS =
CONFIG_PRT =
CONFIG_VAL =
CONFIG_VK =
CONFIG_REF =
ADDRESS =
BILLPLAN =
BILLPLAN_DATE =
EXTENSIONIN =
DOCUMENT_FLOW =
BATCH =
PRICING_AGR_CRM =
FINPROD_ITEM =
CANCEL =
CANCEL_IR =
PRODUCT_LIST =
PRODUCTS =
OBJECTS =
PAYPLAN =
PAYPLAN_DATE =
CONFIG_FILTER_CFG =
CONFIG_FILTER_INS =
CONFIG_FILTER_PRT =
CONFIG_FILTER_VAL =
ACTIVITY_I =
EXT_REF =
ENDFUNCTION.
I'm getting the following dump.
Runtime Errors ITAB_ILLEGAL_COMPONENT
Date and Time 07.09.2006 21:29:03
Short dump has not been completely stored (too big)
Short text
Invalid line component &V2 in "... KEY k1 = v1 ... kn = vn".
Error analysis
When the ABAP/4 program "SAPLCRM_BUSPROCESSND_BAPI" attempted to process the
internal table "HEADER[]"
with "... KEY k1 = v1 ... kn = vn", a component "HANDLE " was specified
dynamically as the contents
of the field "LV_STR_HANDLE". However, the line type "u" of the internal table
"HEADER[]"
contains no component "HANDLE ".
| -
Information on where terminated
Termination occurred in the ABAP program "SAPLCRM_BUSPROCESSND_BAPI" - in
"SET_RETURN_VALUES".
The main program was "RS_TESTFRAME_CALL ".
In the source code you have the termination point in line 36
of the (Include) program "LCRM_BUSPROCESSND_BAPIF80".
Source Code Extract
Line
SourceCde
6
7
text
8
9
-->P_LT_ORDERADM_H_COM text
10
-->P_LT_ORDERADM_I_COM text
11
<--P_HEADER text
12
<--P_ITEM text
13
14
form set_return_values tables header structure BAPIBUS20001_HEADER_INS
15
item structure BAPIBUS20001_item
16
using p_lt_orderadm_h_com type any table
17
p_lt_orderadm_i_com type any table
18
19
20
data: lv_str_handle type fieldname,
21
lv_str_headerhandle type fieldname,
22
lv_str_objectid type fieldname.
23
24
25
field-symbols: <ls_orderadm_h> type crmt_orderadm_h_com,
26
<ls_orderadm_i> type crmt_orderadm_i_com,
27
<ls_header> type BAPIBUS20001_HEADER_INS,
28
<ls_item> type BAPIBUS20001_item.
29
30
31
lv_str_handle = 'HANDLE'.
32
lv_str_headerhandle = 'HEADER_HANDLE'.
33
lv_str_objectid = 'OBJECT_ID'.
34
35
loop at p_lt_orderadm_h_com assigning <ls_orderadm_h>.
>>>>>
read table header with key (lv_str_handle) = <ls_orderadm_h>-handle
37
(lv_str_objectid) = <ls_orderadm_h>-object_id
38
assigning <ls_header>.
39
if sy-subrc = 0.
40
<ls_header>-guid = <ls_orderadm_h>-guid.
41
endif.
42
endloop.
| 43|
Could anyone please help me with this.
Thanks,
Preethi
Message was edited by: Preethi SoothFirst off. Debug.
Put a break point on the line that is generating the short dump and run your code. The ABAP debugger should display before the dump...now....
The error specifies that the line type of the table HEADER (which is the internal representation of your lit_header table and has line type BAPIBUS20001_HEADER_INS ) doesn't have a field called HANDLE.
Check if it does (it should have or something is very wrong, and you should report a bug to SAP).
Check all runtime variables for that command. See if the table has any values in it. Try using your lit_header table with header-line or not.
Your in a far better position to determine what the error is then me. Right now, I don't have access to a CRM server.
From my experience that BAPI is a piece of .... It is hard finding functions in CRM that actually do what you want...properly...Try using CRM_ORDER_CREATE (i think it's called like that). Much better, and if you need RFC capability just write a wrapper RFC.
Message was edited by: João Sousa -
Service order - Error during account assignment - Avoid the transfer to ERP
Hello SAP Experts,
I am facing a problem in CRM when saving Service Orders. An error is coming from my ERP system because the system is trying to tranfer the cost from the CRM Service Order to R3.
This is the error: Orgfinder: No value found for Organizational Unit BILL_ORG
I don't need the transfer of costs to the ERP. Can anyone tell me how we can deactivate this option? The item category is relevant for pricing but it is not relevant for invoicing and costs.
Please help.
Thanks in advance and regards.Hi Savan,
SAP CRM Status Management is a part of SAP CRM Basic or Base Customization and the link is available in the following path
IMG --> CRM --> Transactions --> Basic Settings --> Status Management --> Change Status Profile for User Status.
Here you can influence the status. You can also have a look at the status profile documentation here
[Status Profile|http://help.sap.com/saphelp_crm70/helpdata/en/92/8269126d1547578aab640f097de32c/frameset.htm]
Hope this will help.
Thanks,
Samantak. -
Calculate Pricing in Sales Order Based on Characterestic Values
Hi All,
We are using Sales Order and assigning service product as material. On saving sales order, a service order is created. Per SAP standard design, we can only assign Qty=1 for the service product. As a work around, we have a characteristics that captures service quantity. Now I want to influence pricing based on this char value using Calculation Type Formula in the pricing procedure.
Please suggest as to how I can capture the characteristics value in the formula routine created using VOFM? Is there any structure that shows the characteristics value during run time of order creation?hey,
go throw structures KOMP ( VBAP ) and KOMV ( VBAK) and manipulate with your subroutine
the qty and the net value .
Before Saving - KOMK,KOMP --> running the pricing functions ( matching according to the access )
---> KOMV --> XKOMV
After Saving ========> VBAK/VBAP
you can capture the values throw this structures .
BR
ASA -
Different product hierarchy in sales order and in service order
Dear experts,
In VA03, I notice that
- under Line Item > Sales B, there is a field Product Hierarchy
- under Line Item > Account assignment, there is a field Order. From here, it links to a service order. In the service order, I can see a field Product Hierarchy too.
I would like to know if there is an implication when the field Product Hierarchy in sales order and in service order are different. Is it possible that this will cause an inconsistency?
Usually these two fields have the same value, since the value in sales order is copied from service order. However, in my case, the product hierarchy is changed/updated in service order, but not in sales order.Hi,
We have document pricing procedure maintained at two levels for Sales order or Billing type.
The pricing procedure is determined based on SAles Area Customer pricing procedureDocument Pricing procedure+pricing procedure.
Example :For Sales Document type the document pricing rpocedure will be A and for billing type 'B"
Sales Area1A+Pricing procedure A
Sales Area1B+Pricing procedure B
Now A will be maintained in VOV8 and B will be maintained in VOFA.So two pricing procedures.
Regards, -
Create sales order with reference to service order
Hi
I need to create sales order based on the service order . Is there any BAPI function module available for this ?
Please help...
Regards
Sujith** プログラムID       : ZBAPI_SALESORDER_CREATE *
** プログラム名称      : Upload Sales Order Creation *
** 処理概要         : *
** 作成者           : Karthik.P *
** 作成日           : 2006/08/10 *
REPORT ZBAPI_SALESORDER_CREATE LINE-SIZE 132 MESSAGE-ID ZMMBAPI .
Internal table definition *
****<<<<<Communication Fields: Sales and Distribution Document Header>>>>>>>>
DATA: GT_ORDER_HEADER_IN LIKE BAPISDHD1,
*******<<<Checkbox Fields for Sales and Distribution Document Header>>>>>>>>>
GT_ORDER_HEADER_INX LIKE BAPISDHD1X,
*****<<<<<Return Parameter>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
GT_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE, " Return Messages
*********<<<Communication Fields: Sales and Distribution Document Item<>>>>>
GT_ORDER_ITEMS_IN LIKE BAPISDITM OCCURS 0 WITH HEADER LINE, " Item Data
*********<<<Communication Fields: Sales and Distribution Document Item>>>>>>>
GT_ORDER_ITEMS_INX LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE, "Item Data Checkbox
*********<<<Communication Fields: Sales and Distribution Document Item>>>>>>>
GT_SALESDOCUMENT LIKE BAPIVBELN-VBELN , "Number of Generated Document
*********<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
GT_ORDER_PARTNERS LIKE BAPIPARNR OCCURS 0 WITH HEADER LINE, "Document Partner
********<<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
GT_ORDER_SCHEDULES_IN LIKE BAPISCHDL OCCURS 0 WITH HEADER LINE, "Schedule Line Data
****<<<<<<<<Checkbox List for Maintaining Sales Document Schedule Line>>>>>>>>
GT_ORDER_SCHEDULES_INX LIKE BAPISCHDLX OCCURS 0 WITH HEADER LINE, " Checkbox Schedule Line Data
*******Communication Fields for Maintaining Conditions in the Order
GT_ORDER_CONDITIONS_IN LIKE BAPICOND OCCURS 0 WITH HEADER LINE,
******Communication Fields for Maintaining Conditions in the Order
GT_ORDER_CONDITIONS_INX LIKE BAPICONDX OCCURS 0 WITH HEADER LINE.
Data definition *
DATA: BEGIN OF GT_FT_SALES OCCURS 0,
DOC_TYPE(4) , "Sales Document Type
SALES_ORG(4) , "Sales Organization
DISTR_CHAN(2) , "Distribution Channel
DIVISION(2) , "DIVISION(2)
SALES_DIST(6) , "Sales district
INCOTERMS1(3) , "Incoterms (part 1)
INCOTERMS2(28) , "Incoterms (part 2)
PMNTTRMS(4) , "Terms of payment key
PRICE_DATE(8) , "Date for pricing and exchange rate
PURCH_NO_C(35) , "Customer purchase order number
PURCH_NO_S(35) , "Ship-to Party's Purchase Order Number
EXCHG_RATE(8) , "Directly quoted exchange rate for pricing and statistics
CURRENCY(5) , "SD document currency
MATERIAL(18), "MATERIAL
TARGET_QTY(13) , "Target quantity in sales units
ITEM_CATEG(4) , "Sales document item category
MATL_GROUP(8) , "Material Group
PURCH_NO_C1(35), "Customer purchase order number
SALES_DIST1(6) , "Sales district
INCOTERMS11(3) , "Incoterms (part 1)
INCOTERMS21(28), "Incoterms (part 2)
PMNTTRMS1(4) , "Terms of payment key
EXCHG_RATE1(8) , "Directly quoted exchange rate for pricing and statistics
PRICE_DATE1(8) , "Date for pricing and exchange rate
TRG_QTY_NO(5) , "Factor for converting sales units to base units (target qty)
DIVISION1(2) , "DIVISION1
SALQTYNUM(5) , "Numerator (factor) for conversion of sales quantity into SKU
GROSS_WGHT(3) , "Gross Weight of the Item
NET_WEIGHT(15) , "Net Weight of the Item
UNTOF_WGHT(3) ,"Weight Unit
PARTN_ROLE(2) ,"Partner function
PARTN_NUMB(10) ,"Customer Number 1
********<<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
ITM_NUMBER(6) ,"Item number of the SD document
REQ_QTY(8) , "Schedule line date
DLV_DATE(8) , "Schedule line date
MS_DATE(8) , "Material availability date
LOAD_DATE(8) , "Loading time (local time with reference to a shipping point)
GI_DATE(8), "Time of goods issue (local DATE, with reference to a plant)
TP_DATE(8) , "Transportation planning -time (local w/ref. to shipping pnt)
ITM_NUMBER2(6) , "Condition item number
END OF GT_FT_SALES,
MSG(240) TYPE C, " Return Message
E_REC(8) TYPE C, " Error Records Counter
REC_NO(8) TYPE C, " Records Number Indicator
S_REC(8) TYPE C, " Successful Records Counter
T_REC(8) TYPE C. " Total Records Counter
selection block for EXCEL UPLOAD FILE>>>>>>>>>>>>>>>>>>>>>>>>
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
PARAMETERS FILE TYPE IBIPPARMS-PATH OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
*<<<<AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .>>>>>>>>>>>>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = FILE.
**<<<<<<<<<<<<<<<<<START-OF-SELECTION.>>>>>>>>>>>>>>>>>>>>>>>>>>>
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD' "#EC *
EXPORTING
FILENAME = FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = GT_FT_SALES
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11.
IF SY-SUBRC <> 0 .
MESSAGE E000.
ENDIF.
SKIP 3.
FORMAT COLOR COL_HEADING INVERSE ON.
WRITE 40 TEXT-001.
FORMAT COLOR COL_HEADING INVERSE OFF.
SKIP 1.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE :/ TEXT-002, 13 SY-MANDT , 104 TEXT-003, 111 SY-UNAME,
/ TEXT-004, 13 SY-DATUM , 104 TEXT-005, 111 SY-UZEIT.
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
SKIP 3.
LOOP AT GT_FT_SALES.
PERFORM SLALE_UPLOAD_DATA.
ENDLOOP.
T_REC = E_REC + S_REC.
SKIP 3.
FORMAT COLOR COL_TOTAL INVERSE ON.
WRITE: /38 TEXT-007, T_REC.
FORMAT COLOR COL_TOTAL INVERSE OFF.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE: /38 TEXT-008, E_REC.
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
FORMAT COLOR COL_TOTAL INVERSE ON.
WRITE: /38 TEXT-009, S_REC.
FORMAT COLOR COL_TOTAL INVERSE OFF.
*& Form SLALE_UPLOAD_DATA
text
--> p1 text
<-- p2 text
FORM SLALE_UPLOAD_DATA .
*******<<<<<<<<<<Communication Fields: Sales and Distribution Document Header>>>>>>
GT_ORDER_HEADER_IN-DOC_TYPE = 'TA'.
GT_ORDER_HEADER_IN-SALES_ORG = GT_FT_SALES-SALES_ORG . "'0001'
GT_ORDER_HEADER_IN-DISTR_CHAN = GT_FT_SALES-DISTR_CHAN. "'01'
GT_ORDER_HEADER_IN-DIVISION = GT_FT_SALES-DIVISION. " '01'
GT_ORDER_HEADER_IN-SALES_DIST = GT_FT_SALES-SALES_DIST ."'000001'
GT_ORDER_HEADER_IN-INCOTERMS1 = GT_FT_SALES-INCOTERMS1. "'CFR'
GT_ORDER_HEADER_IN-INCOTERMS2 = GT_FT_SALES-INCOTERMS2 . "'HAMBURG'
GT_ORDER_HEADER_IN-PMNTTRMS = GT_FT_SALES-PMNTTRMS . "'0001'
GT_ORDER_HEADER_IN-PRICE_DATE = GT_FT_SALES-PRICE_DATE ."'20060818'
GT_ORDER_HEADER_IN-PURCH_NO_C = '32'.
GT_ORDER_HEADER_IN-PURCH_NO_S = '32'.
GT_ORDER_HEADER_IN-EXCHG_RATE = GT_FT_SALES-EXCHG_RATE ."'1.00000'
GT_ORDER_HEADER_IN-CURRENCY = GT_FT_SALES-CURRENCY . " 'EUR'
********<<<Checkbox Fields for Sales and Distribution Document Header>>>>>>>>>
GT_ORDER_HEADER_INX-DOC_TYPE = 'X'.
GT_ORDER_HEADER_INX-SALES_ORG = 'X'.
GT_ORDER_HEADER_INX-DISTR_CHAN = 'X'.
GT_ORDER_HEADER_INX-DIVISION = 'X'.
GT_ORDER_HEADER_INX-SALES_DIST = 'X'.
GT_ORDER_HEADER_INX-INCOTERMS1 = 'X'.
GT_ORDER_HEADER_INX-INCOTERMS2 = 'X'.
GT_ORDER_HEADER_INX-PMNTTRMS = 'X'.
GT_ORDER_HEADER_INX-PRICE_DATE = 'X'.
GT_ORDER_HEADER_INX-PURCH_NO_C = 'X'.
GT_ORDER_HEADER_INX-PURCH_NO_S = 'X'.
GT_ORDER_HEADER_INX-EXCHG_RATE = 'X'.
GT_ORDER_HEADER_INX-CURRENCY = 'X'.
*****<<<<<<Communication Fields: Sales and Distribution Document Item>>>
GT_ORDER_ITEMS_IN-ITM_NUMBER = '000010'.
GT_ORDER_ITEMS_IN-MATERIAL = GT_FT_SALES-MATERIAL .
GT_ORDER_ITEMS_IN-PO_ITM_NO = '32'.
GT_ORDER_ITEMS_IN-CUST_MAT22 = 'AGNI-IV'.
GT_ORDER_ITEMS_IN-BILL_DATE = '20060808'.
GT_ORDER_ITEMS_IN-PLANT = '0001'.
*GT_ORDER_ITEMS_IN-STORE_LOC = '0001'.
GT_ORDER_ITEMS_IN-TARGET_QTY = GT_FT_SALES-TARGET_QTY . "'1000'
GT_ORDER_ITEMS_IN-ITEM_CATEG = GT_FT_SALES-ITEM_CATEG . "'TAN'
GT_ORDER_ITEMS_IN-MATL_GROUP = GT_FT_SALES-MATL_GROUP . "'01'
GT_ORDER_ITEMS_IN-PURCH_NO_C = GT_FT_SALES-PURCH_NO_C . "'32'
GT_ORDER_ITEMS_IN-SALES_DIST = GT_FT_SALES-SALES_DIST . "'000001'
GT_ORDER_ITEMS_IN-INCOTERMS1 = GT_FT_SALES-INCOTERMS1 . "'CFR'
GT_ORDER_ITEMS_IN-INCOTERMS2 = GT_FT_SALES-INCOTERMS2 . "'HAMBURG'
GT_ORDER_ITEMS_IN-PMNTTRMS = GT_FT_SALES-PMNTTRMS . "'0001'.
GT_ORDER_ITEMS_IN-EXCHG_RATE = GT_FT_SALES-EXCHG_RATE . "'1.00000'
GT_ORDER_ITEMS_IN-PRICE_DATE = GT_FT_SALES-PRICE_DATE . "'20060808'
*GT_ORDER_ITEMS_IN-SALES_UNIT = 'DZ'.
GT_ORDER_ITEMS_IN-TRG_QTY_NO = GT_FT_SALES-TRG_QTY_NO . "'23'
GT_ORDER_ITEMS_IN-DIVISION = GT_FT_SALES-DIVISION . "'01'
GT_ORDER_ITEMS_IN-SALQTYNUM = GT_FT_SALES-SALQTYNUM . "'32'
GT_ORDER_ITEMS_IN-GROSS_WGHT = GT_FT_SALES-GROSS_WGHT. " ' 25272000'
GT_ORDER_ITEMS_IN-NET_WEIGHT = GT_FT_SALES-NET_WEIGHT. "'24464000'
GT_ORDER_ITEMS_IN-UNTOF_WGHT = GT_FT_SALES-UNTOF_WGHT . " 'KG'
*GT_ORDER_ITEMS_IN-CURRENCY = 'EUR'.
APPEND GT_ORDER_ITEMS_IN.
****<<<<<<Communication Fields: Sales and Distribution Document Item>>>
GT_ORDER_ITEMS_INX-ITM_NUMBER = '000010'.
GT_ORDER_ITEMS_INX-MATERIAL = 'X'.
*GT_ORDER_ITEMS_INX-PO_ITM_NO = 'X'.
GT_ORDER_ITEMS_INX-CUST_MAT22 = 'X'.
GT_ORDER_ITEMS_INX-BILL_DATE = 'X'.
GT_ORDER_ITEMS_INX-PLANT = 'X'.
*GT_ORDER_ITEMS_INX-STORE_LOC = 'X'.
GT_ORDER_ITEMS_INX-TARGET_QTY = 'X'.
GT_ORDER_ITEMS_INX-ITEM_CATEG = 'X'.
GT_ORDER_ITEMS_INX-MATL_GROUP = 'X'.
GT_ORDER_ITEMS_INX-PURCH_NO_C = 'X'.
GT_ORDER_ITEMS_INX-SALES_DIST = 'X'.
GT_ORDER_ITEMS_INX-INCOTERMS1 = 'X'.
GT_ORDER_ITEMS_INX-INCOTERMS2 = 'X'.
GT_ORDER_ITEMS_INX-PMNTTRMS = 'X'.
GT_ORDER_ITEMS_INX-EXCHG_RATE = 'X'.
GT_ORDER_ITEMS_INX-PRICE_DATE = 'X'.
*GT_ORDER_ITEMS_INX-SALES_UNIT = 'X'.
GT_ORDER_ITEMS_INX-TRG_QTY_NO = 'X'.
GT_ORDER_ITEMS_INX-DIVISION = 'X'.
GT_ORDER_ITEMS_INX-SALQTYNUM = 'X'.
GT_ORDER_ITEMS_INX-GROSS_WGHT = 'X'.
GT_ORDER_ITEMS_INX-NET_WEIGHT = 'X'.
GT_ORDER_ITEMS_INX-UNTOF_WGHT = 'X'.
*GT_ORDER_ITEMS_IN-CURRENCY = 'x'.
APPEND GT_ORDER_ITEMS_INX.
*****<<<<<<Communications Fields: SD Document Partner: WWW
GT_ORDER_PARTNERS-PARTN_ROLE = 'WE'.
GT_ORDER_PARTNERS-PARTN_NUMB = '0000000057'.
***GT_ORDER_PARTNERS-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER . " '000010'.
APPEND GT_ORDER_PARTNERS.
*********<<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
GT_ORDER_SCHEDULES_IN-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER." '000010'
GT_ORDER_SCHEDULES_IN-REQ_QTY = GT_FT_SALES-REQ_QTY . "'234'
GT_ORDER_SCHEDULES_IN-DLV_DATE = GT_FT_SALES-DLV_DATE ." '20060824'.
GT_ORDER_SCHEDULES_IN-MS_DATE = GT_FT_SALES-MS_DATE . "'20060808'
GT_ORDER_SCHEDULES_IN-LOAD_DATE = GT_FT_SALES-LOAD_DATE. " '20060822'
GT_ORDER_SCHEDULES_IN-GI_DATE = GT_FT_SALES-GI_DATE . " '20060823'
GT_ORDER_SCHEDULES_IN-TP_DATE = GT_FT_SALES-TP_DATE . "'20060821'
APPEND gt_ORDER_SCHEDULES_IN.
*********<<<<Communications Fields: SD Document Partner: WWW FLAG>>>>>>>>>>>>>>>>>>
GT_ORDER_SCHEDULES_INX-ITM_NUMBER = '000010'.
GT_ORDER_SCHEDULES_INX-REQ_QTY = 'X'.
GT_ORDER_SCHEDULES_INX-DLV_DATE = 'X'.
GT_ORDER_SCHEDULES_INX-MS_DATE = 'X'.
GT_ORDER_SCHEDULES_INX-LOAD_DATE = 'X'.
GT_ORDER_SCHEDULES_INX-GI_DATE = 'X'.
GT_ORDER_SCHEDULES_INX-DLV_DATE = 'X'.
APPEND gt_ORDER_SCHEDULES_INX.
********Communication Fields for Maintaining Conditions in the Order
GT_ORDER_CONDITIONS_IN-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER ." '000010'
APPEND GT_ORDER_CONDITIONS_IN.
***Communication Fields for Maintaining Conditions in the Order
GT_ORDER_CONDITIONS_INX-ITM_NUMBER = '000010'.
APPEND GT_ORDER_CONDITIONS_INX.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
ORDER_HEADER_IN = GT_ORDER_HEADER_IN
ORDER_HEADER_INX = GT_ORDER_HEADER_INX
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT = GT_SALESDOCUMENT
TABLES
RETURN = GT_RETURN
ORDER_ITEMS_IN = GT_ORDER_ITEMS_IN
ORDER_ITEMS_INX = GT_ORDER_ITEMS_INX
ORDER_PARTNERS = GT_ORDER_PARTNERS
ORDER_SCHEDULES_IN = GT_ORDER_SCHEDULES_IN
ORDER_SCHEDULES_INX = GT_ORDER_SCHEDULES_INX
ORDER_CONDITIONS_IN = GT_ORDER_CONDITIONS_IN
ORDER_CONDITIONS_INX = GT_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 GT_RETURN-TYPE EQ 'E' .
E_REC = E_REC + 1.
READ TABLE GT_RETURN WITH KEY ID = 'V1'.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
REC_NO = E_REC + S_REC.
CONCATENATE TEXT-006 REC_NO ':'
GT_RETURN-MESSAGE INTO MSG SEPARATED BY SPACE .
CONDENSE MSG.
WRITE: / MSG.
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
ELSEIF GT_RETURN-TYPE EQ 'S'.
S_REC = S_REC + 1.
FORMAT COLOR COL_POSITIVE INVERSE ON.
MSG = GT_RETURN-MESSAGE.
CONDENSE MSG.
WRITE: / MSG .
FORMAT COLOR COL_POSITIVE INVERSE OFF.
PERFORM COMMIT_MM.
ENDIF.
CLEAR: GT_RETURN[], MSG.
ENDFORM. " SLALE_UPLOAD_DATA
*& Form COMMIT_MM
text
--> p1 text
<-- p2 text
FORM COMMIT_MM .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = GT_RETURN.
clear: GT_ORDER_ITEMS_IN[],GT_ORDER_CONDITIONS_IN[].
ENDFORM. " COMMIT_MM
Maybe you are looking for
-
Help needed with Windows 8.1 boot and recovery issue
Hi. I hope someone can help me out with this Windows 8.1 issue. A friends computer (HP 2000-2c27CL Notebook) was badly infected and while I was able to do some cleaning in normal Windows I had to do some in Safe Mode. I was not being able to access S
-
Need to be within 3 feet of base station!
I have just had broadband put in to my house and we have a Belkin High-Speed Mode Wireless G Router. Both my house mates, who are using Windows laptops are able to use wireless perfectly. However, my iBook G4 will only detect the base station if it i
-
Hello experts, how can I establish a connection between XI and Novell eDirectory or Microsoft Active Directory via LDAP? Best regards David
-
I have a time capsule in my home that I want to attach a usb hard drive to. My time capsule only has 1 usb port and I usually use that port for my printer so I can print wirelessly. I bought a usb hub to try and expand the usb ports but the hard driv
-
TUNING DATA WAREHOUSE DATABASE INSTANCE
Hi, I have to tune one of the DATA WAREHOUSE DATABASE INSTANCE. Any advice for tuning this instance. How different is tuning the data warehouse instance than normal instance; Regards