BAPI for Trade promotion create in CRM

Hi All,
I have to create a Trade promotion(tcode - CRM_MKTPL).
Please let me know if any BAPI or any useful function modules exists for Create or Change of the same
Any suggestion or inputs on this will be helpful
Thanks,
Anoop

Hi Anoop,
Thank you so much for your input. That was very helpful. I was able to create the Deals successfully
I have one problem though, I also need to upload the product & volumes/tradespends. With the product I used method "prod_assign_create" which is ok, but with the volume/tradespends, i have no idea.
Would you know if there's any related class/method or BAPI that may upload the volume/tradespends within deals/trade promotion?
Your help will be higly appreciated.
Regards,
Elynor

Similar Messages

  • I need to get link for the complete customization steps for Trade Promotion

    Hi Champs,
    I appreciate if anyone of you can provide me the complete customization steps or the link on the sap portal for trade promotions .A link of it`s theory will can also be useful but I specifically need the lin k fore the crm customization steps needed for trade promotions.
    Thanks + Regards,
    Conte

    Conte,
    Honestly your question is too broad to be answered here.  In addition to those forum threads please check the best practices for CRM to see how to confgure some of the components used by TPM:
    http://help.sap.com/bp_crmv12007/CRM_DE/HTML/index.htm
    In addition review your solution manager along with the standard SAP help for information.
    If you have specific questions when configuring your system, please feel free to post those as new separate questions.
    I'm going to lock this thread from further replies, as this question is too vague to receive a correct response.
    Thank you,
    Stephen

  • BAPI for cost centre create/change

    Hi,
    Is there a BAPI for Cost centre create and change?
    Thanks in advance.
    Regards,
    Arun Mohan

    Hi Ravi,
    My system is 4.6B.
    I found BAPI_COSTCENTER_CREATEMULTIPLE,
    but the BAPI for CC change is not present.
    Is there any other BAPI for CC change?
    Arun

  • Retreiving the guid for target group selected for trade promotion in CRM 7

    HI,
    I am working on building API for creating trade promotion. I need to find a way where I could retreive the GUID of the target group to be assigned to the trade promotion.
    Please share you thoughts on this. Let me know if we could use any standard function module or SAP class which could be used to achieve the objective.
    Awaiting your replies.
    Thanks

    Check this function module
    CRM_MKTTG_TG_H_GETLIST_OW

  • BAPI or IDOC to create the Delivery in R/3 for the SaleOrder created in CRM

    Dear All,
    When ever I create a sales order and save the sales order in the crm system, an outbound delivery is created in the R/3 system.
    I have added some new fields in the tables LIKP and LIPS.(related to delivery)
    Now I have to populate data into these new fields with the CRM data.
    So can any one tell me when I create a sales order in CRM, does the system uses any BAPI or IDOC to create the Delivery in R/3.
    The BAPI name or Idoc information will be very useful.so that I can extend them
    In crm the BDOC ‘BUS_TRANSACTION_MESSAGE’ is used.
    Thanks in advance.
    Regards
    Shafath

    Hi All,
    I found a solution to my problem.
    The BAPI ‘BAPI_DELIVERYPROCESSING_EXEC’ will be enhanced to add the new fields into the BAPI structure.
    The BADI ‘/SPE/BAPI_DLVEXEC_EX’ and the user exit ‘EXIT_SAPLV50R_CREA_001’ will be used to populate the data into the new fields created in the BAPI structure and the new fields added into the tables LIKP and LIPS.
    Regards
    Shafath

  • Trade promotion in a CRM order

    Dear All
    I have created a trade promotion and released it. My questions are
    - The trade promotion I have created does not appear in the header overview section of the Order when I am trying to manually add it to the order- Do i have to do any customizing settings
    - How to determine the trade promotion in the order- automatically?
    Please let me know.
    I will award with full points .
    Regards
    Tarang

    Hi Tarang,
    For an trade promotion to be automatically determined in a sales order , you need to do the following
    1. Customizations in IMG>CRM> Basic settings--> Campaign Determination (which is very similar to pricing procedures settings   )
    2. If you want to assign only one TP to an order item, then choose blank for multiple promotions in the path IMG> CRM> Basic Settings> Campaign Determination> Assign Determination Procedures
    Hope this will help
    Regards,
    Rekha Dadwal
    <b>
    You gain a point for every point that you reward. So reward helpful answers generously</b>

  • Making Marketing Calendar Read only for Trade Promotion

    Hi,
    We are trying to use Marketing Calendar in CRM 7.0 to view the trade promotions.  But the client wants the Marketting Calendar to be read only view.  The end users should not be able to drag the TPs to extend the date. Also they should not be able to create, copy or delete the TPs.  These end users will be able to create TPs when going through the TP link. 
    Please advise how can I achieve this.
    Regards
    Kavitha

    Hi Kavitha,
    This feature in introduced in the new Integrated Marketing Calendar. See if you can use it.
    http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/704e0c72-a7ed-2d10-c2bb-d4162cf5cbca
    Best Regards,
    Roshan

  • Bapi for free goods create

    hi all.. can anyone pls tell me bapi for creating FREE GOODS.. t-code is vbn1..
    thanks..

    Hi
    check the BAPIs
    BAPI_FREEGOODS_CONDITIONS    
    CND_FREEGOODS_CALL_BAPI      
    CND_FREEGOODS_DEL_AFTER_INIT 
    CND_FREEGOODS_MAP_BAPIMTCS   
    if doesn't serve the purpose do it by BDC method
    Regards
    Anji

  • Required BAPI for CK74N Transaction - Creating Additive Costs

    Hi Experts, Good Day.
    My functional guy has given a requirement to create BDC for transaction CK74N. But as it is an 'Enjoy' Transaction I thought to opt BAPI instead of BDC. But in the forum I did not find exact BAPI for this and also found some suggestions to develop BDC for old transaction CK74.
    So, as of now I have return BDC for CK74. Here also I have a doubt. When I am executing BDC with 'N' - No-Screen mode I am getting an error like "No batch data found for this field" for some materials. This message is raised only those materials for which Costs has not maintained even for once. In this case at one screen the BDC_CURSUR is showing in some other field instead of Pricing field. So, I am getting error. But same BDC is fine with materials for those Costs has been maintained at-least one time.
    So, I hope with BAPI I can overwrite this error. Can anyone please let me know a BAPI for creating Additive Costs (CK74N).
    Regards,
    Vijay

    Vijay
    If you will pass data to above mentioned function module the SAP standard code will make sure BDC is coded in correct way. Please try to use it..Else you will have to determine via code in your BDC whether its first time or not..if first time means a new subscreen will come.
    Nabheet

  • BAPI for Quality notification create QM01

    Hi,
    any body plz provide me bapi for creating qualyty notification of type ZS/ZV
    which are store to dc,mail to vendor,w.r.t delivery etc.
    Thanks.
    Regards.

    Hi,
    Use the following BAPI's
    BAPI_ALM_NOTIF_CREATE - Create PM notification
    BAPI_SERVICENOTIFICAT_CREATE - service Notification
    <b>Reward points</b>
    Regards

  • User status and System status for Trade Promotion

    Hi all!
    CRM 7.0 Web UI Trade Promotion Management.
    I have a trade promotion with custom status already assigned and visible from WEB UI, Is it possible assigning to such TP also a standard status picked amongst TP system status?
    Take into account that in the as is configuration we find in the same TP drop down list user status and system status.
    2 questions:
    1.     How can I hide the system status?
    2.     It is possible to group together user status and system status? E.g. User status: fundrequest, inplanning, submitted...+ released (system status).

    Hi Virginia Zitun,
    Can you tell me how did you manage to solve the issue.
    rgds,
    Venkat

  • Need BAPI for MIGO to create a Goods Receipt against PO &Outbound Delivery

    Hi Friends,
    GRN’s (Good receipt notifications) created in DHL (Non SAP system) will need to be communicated to SAP.
    I need to post goods receipt using input data in MIGO. Is there any BAPI that i can use.The requirement is like below:
    PO number field in output file is checked against entries in EKKO-EBELN, if a match is found the GR is posted against a Purchase Order otherwise LIKP-VBELN is checked and if a match is found GR is posted against an Outbound Delivery.
              If PO Number = EKKO-EBELN    GR against Purchase Order
                            = LIKP-VBELN      GR against Outbound Delivery
    Based on the above condition I need to create a Goods Receipt. 
    Could you please tell me the GM code, movement types and the required fields to be passed for the BAPI?
    The fields available are with us are...
    Header text. - Bill of Lading- Posting Date-Quantity- UOM--- Vendor Batch / Batch / Serial No --- PO Number or Delivery Number… SLED
    Are these fields sufficient for doing MIGO with the BAPI or do we require more fields???
    Please provide sample code if possible.
    Waiting for replies,
    Thanks and Regards,
    Sudha

    Hi Friends,
    GRN’s (Good receipt notifications) created in DHL (Non SAP system) will need to be communicated to SAP.
    I need to post goods receipt using input data in MIGO. Is there any BAPI that i can use.The requirement is like below:
    PO number field in output file is checked against entries in EKKO-EBELN, if a match is found the GR is posted against a Purchase Order otherwise LIKP-VBELN is checked and if a match is found GR is posted against an Outbound Delivery.
              If PO Number = EKKO-EBELN    GR against Purchase Order
                            = LIKP-VBELN      GR against Outbound Delivery
    Based on the above condition I need to create a Goods Receipt. 
    Could you please tell me the GM code, movement types and the required fields to be passed for the BAPI?
    The fields available are with us are...
    Header text. - Bill of Lading- Posting Date-Quantity- UOM--- Vendor Batch / Batch / Serial No --- PO Number or Delivery Number… SLED
    Are these fields sufficient for doing MIGO with the BAPI or do we require more fields???
    Please provide sample code if possible.
    Waiting for replies,
    Thanks and Regards,
    Sudha

  • BAPI for service order create/change

    Hi,
    I need to create and update service order on release 4.6C. I have searched for available BAPI but did not come up with anything. Searching the OSS and forums, I found that there are function modules BAPI_ALM_ORDER_CREATE and BAPI_ALM_ORDER_MAINTAIN available on release 4.7 . There are notes about downgrading these function modules to 4.6C (Note 655926 is one of them, search ALMBAPI).
    My question is, has anybody done this ? What all is part of this downgrade ? There are numerous correction notes, and did you have to apply those ?
    Any help will be greatly appreciated.
    Regards,
    Rajendra Salecha

    Hi Rajendra,
    The note 655926 you mentioned, clearly details all the steps involved in downgrading the BAPIs to 46C. You just have to follow the steps in that order and yes, you need to have all the notes that are mentioned in there, unless they are delivered as part of some support pack and you are on that support pack level already.
    Srinivas

  • BAPI for transaction IW31 (creating a work order)

    Hi all,
    I need to be able to create a work order ( IW31) using ABAP code and was wondering if any knew if there was a BAPI that should be used for this functionality.
    Thanks in advance
    Mart

    hi,
    You can use
    BAPI_ALM_ORDER_MAINTAIN.
    Have a look at the following documentation.
    FU BAPI_ALM_ORDER_MAINTAIN
    Text
    Process Maintenance-/Service Order
    Functionality
    This Business Application Programming Interface (BAPI) is used for changing maintenance- or service orders and their lower-level objects. The following objects of an order can be processed (for restrictions, see the note at the end of the documentation):
    Order header
    Partner
    User status
    Order operations
    Relationships
    Components
    Long texts for order header, operations, and components
    Function
    Calling up this BAPI once allows you to perform all the operations. For this the system supplies the function module with a method table containing the methods to be performed. The entries in the method table refer to data records in the optionally filled-out data tables. All the methods from the method table are performed. Alternatively, just lower- level objects from existing orders can be changed.
    You can process the transferred data with the Business Add-In (BAdI) IBAPI_ALM_ORD_MODIFY to, for example, merge data from the external system with data from the R/3 system. The BAdI is called up as soon as the transferred data is converted into the internal format. The tests then take place after this.
    Construction of Method Table
    REFNUMBER Reference number for linking object methods - attributes
    The reference number is the line of the database which contains the corresponding data. The data table is determined by the object type.
    OBJECTTYPE Object category
    The object category specifies which object from the order should be processed. The key words listed here are not language-dependent and must be transferred exactly as they are. The following objects exist:
    HEADER Order header
    PARTNER Partner data
    USERSTATUS User status
    OPERATION Operation data
    RELATION Relationships
    COMPONENT Components
    TEXT Long texts
    (empty) ,General BAPI functions (save)
    METHOD Methods
    The methods with which the data should be processed. The following functions exist:
    CREATE Create objects
    CHANGE Change objects
    DELETE Delete objects
    RELEASE Release
    TECHNICALCOMPLETE Technically complete
    ATPCHECK Availability check
    CALCULATE Calculate
    SCHEDULE Schedule
    DELELTEDSEX Delete the status for external scheduling at operation level
    SAVE Save all data
    DIALOG Call-up dialog. See explanation below.
    TRACE Write trace file in the specified file to the frontend
    OBJECTKEY SAP external object key
    This key is for assigning the lower-level objects correctly to the corresponding objects, as there is always just one key in the data table. The key must have the following structure:
    1-12 Order number
    When creating orders with internal number assignment, a reference number beginning with % must be entered here. The BAPI then returns this number and the number actually assigned.
    13-16 Operation number
    17-20 Sub-operation number
    For relationships, the key is structured as follows:
    1-12 ,Order number from
    13-16 Operation number from
    17-28 Order number to
    29-32 Operation number to
    The following methods are permissible for the individual objects:
    HEADER:
    CREATE, CHANGE, RELEASE, TECHNICALCOMPLETE, ATPCHECK, CALCUALTE, SCHEDULE
    OPERATION
    CREATE, CHANGE, DELETE, DELETEDSEX
    PARTNER, RELATION, COMPONENT, USERSTATUS, TEXT:
    CREATE, CHANGE, DELETE
    (empty):
    SAVE, DIALOG, TRACE
    Data tables and update tables
    The objects have one or more data tables. For some objects you can specify which of the fields specified in the structure should be changed. For this you must set the field in the corresponding table to X as in the data table. If no update-table is transferred, then only those fields are set that have a value that is not initial. This simplifies the transfer data. However, this means it is not possible to delete fields. If an update structure should only be specified for some data records, the table with the update fields must nonetheless have the same amount of lines as the data table. The empty lines are then treated as if no update structure was transferred. The objects "Partner", "User Status", and "Text" have no update tables. The whole data record is always copied here.
    References
    The objects use the field REFNUMBER from the method table to refer to the lines in the data table. Counting always begins with 1. In doing this, REFNUMBER also refers to the update table. However, in the method table there is a second reference to higher-level objects for lower-levels objects. The field OBJECTKEY must be filled with order number, operation number, and sub-operation number, as specified above. If lower-level objects of a newly-created order should be changed, then you must enter a temporary order number that must begin with %. Several orders can be numbered serially, for example, with %00000000001, %00000000002 ... .
    The following objects have special treatment for REFNUMBER:
    Partner
    Texts
    Partners have an order number in the data table. During processing of the method table, all those entries in the data table are processed which have an order number that is the same as that in the line to which the method refers. Thus, through just one entry in the method table, several partners can be changed.
    Texts are composed of two tables. The first table (IT_TEXT) is made up of the header data of the text. Here you must specify the object and the first and last line of the text table (respectively inclusive, counting from 1). Through this, a line segment is specified in the text line table (IT_TEXT_LINES).
    Peculiarities in processing
    The BAPI processes the transferred methods in a particular sequence, which must not correspond to the sequence in the methods table.
    Write trace file
    Change user status time period 1
    Delete objects (dependent first)
    Create new objects
    Change existing or newly-created objects
    Change user status time period 2
    Status change of order
    Save data
    The methods are performed such that lower-level objects can also be assigned to newly-created objects. For example, first the operations are created, and then the components. Long texts can also be created for the objects.
    Components have an exceptional position. Components are created through the assignment to an operation, that is, using the "key" order/ operation (item number). However, as this is not the unique component key, you can only access the components to change them, delete them, or add long texts by using the reservation number/-item, which is only given after saving. This means that, for example, you cannot create a long text when you create the component.
    User status changes can take place at two different time points. Time point 1 is before the object changes, time point 2 is after the object changes and before the status change of the system. These time points should be defined in the transfer table in the field CHANGE_EVENT. The field documentation contains the possible values.
    The external scheduling is offered by the BAPI as a special function. THe BAPI can set the date field directly at the operation level, and select the operation with the status DSEX "Date set by external system". This status prevents any further scheduling of the operation, it keeps the transferred dates. For this, set the category 'X' in the restriction categories. When reading the operation, this category is also returned, independent of the category of restriction set in the dialog. To delete the status, you can call up the method DELETEDSEX for the object operation. The external scheduling cannot be influenced in the dialog. All changes to the scheduling restrictions in the dialog are saved as normal, but are not relevant for the scheduling as long as the status DSEX is active.
    Every time the BAPI is called up, a SAVE or DIALOG method must be transferred. Normally, calling up a BAPI is seen as a transaction. All data that is changed in the BAPI should be saved to the database immediately. The BAPI checks whether a SAVE method exists, otherwise it terminates processing. A test run of the BAPI is composed of a normal call-up using the SAVE method and a subsequent BAPI_TRANSACTION_ROLLBACK. To call up the BAPI without the SAVE method, for example, to realize dialog transactions, the BAPI can be called up with the DIALOG method. This switches off the check for the SAVE method. The processor must then ensure that later either a SAVE method or a BAPI_TRANSACTION_ROLLBACK is called up.
    A BAPI_TRANSACTION_COMMIT without SAVE method terminates processing in the update to ensure that no inconsistent data is written to the database. The processor who called up the BAPI does not receive any confirmation for the termination of the update in the target system. This logic is necessary as the order data was flagged for updating with BAPI_TRANSACTION_COMMIT through the SAVE method. However, the status information was already flagged for updating when the BAPI was called up. A BAPI_TRANSACTION_COMMIT without SAVE method then just saves the status information and would generate inconsistent orders, if the updating was not terminated.
    Customer Enhancement
    The BAdI IBAPI_ALM_ORD_MODIFY can be used to change the transferred data. The BAdI is called up after the conversion of the transfer structure into the structures used internally. Additional data can be transferred using the table EXTENSION_IN. Only then is the data checked.
    Example
    The following examples should clarify the use.
    Creating an order
    OBJECTKEY should be filled with a temporary key. The BAPI returns this key together with the assigned order number in the return table ET_NUMBERS . The order number in the HEADER table should also be filled with the number. For external number assignment, the external number should be specified. The update structure can be transferred if necessary.
    Methods table
    REFNUMBER OBJECTTYPE METHOD OBJECTKEY
    1 HEADER CREATE %00000000001
    IT_HEADER
    ORDERID ORDER_TYPE PLANPLANT ...
    %00000000001 PM01 1000 ...
    Creating an order with operation and long text
    Methods table
    REFNUMBER OBJECTTYPE METHOD OBJECTKEY
    1 HEADER CREATE %00000000001
    1 OPERATION CREATE %00000000001
    1 TEXT CREATE %000000000010010
    IT_HEADER
    ORDERID ORDER_TYPE PLANPLANT ...
    %00000000001 PM01 1000 ...
    IT_OPERATION
    ACTIVITY SUB_ACTIVITY CONTROL_KEY WRK_CNTR ...
    10 PM01 MECHANIC ...
    IT_TEXT
    ACTIVITY ... TEXTSTART TEXTEND
    10 ... 1 2
    IT_TEXT_LINES
    TDFORMAT TDLINE
    Longtext for operation 10, line 1
    Line 2 of the long text
    Notes
    Using the BAPI to process the order data cannot support all the functions of the transaction. This applies in particular for the following functions:
    Order header data
    The object list cannot be processed.
    Refurbishment orders are not supported.
    The estimated costs cannot be processed - only the estimated overall costs of the order.
    Notification data cannot be processed with the order BAPI. Even if the settings in Customizing are such that the orders and notifications can be maintained on one screen, no notification is created for the order.
    Permits cannot be processed.
    The order addresses cannot be processed.
    Individual partner addresses cannot be maintained.
    The settlement rule cannot be maintained.
    Order functions
    Printing the papers is not possible.
    Locking and unlocking the order is not possible.
    Accepting and rejecting quotations is not possible.
    Business completion is not possible.
    Flagging for deletion is not possible.
    The log cannot be displayed.
    User default values are not used.
    The field selection is not checked.
    The Customer Exits/BAdIs are not executed completely.
    Joint ventures are not supported.
    Funds Management is not supported.
    Investment orders are not supported.
    No integration of service products with task lists possible.
    No integration of configurable service products possible.
    Assignment of sales document items with service products in accordance with the aforementioned conditions.
    Operation data
    A change of the control key in the operation is not possible, if this leads to a change of the processing type (internal-/external processing)
    User status change not possible.
    Production resources and tools cannot be processed.
    Service lines cannot be processed.
    Task list integration is not supported.
    Linking operations with object list is not supported.
    Component data
    User status change not possible.
    BOM data cannot be processed.
    The delivery address cannot be processed.
    Further Information
    See also the documentation for the individual transfer tables.
    Parameters
    IT_METHODS
    IT_HEADER
    IT_HEADER_UP
    IT_HEADER_SRV
    IT_HEADER_SRV_UP
    IT_USERSTATUS
    IT_PARTNER
    IT_PARTNER_UP
    IT_OPERATION
    IT_OPERATION_UP
    IT_RELATION
    IT_RELATION_UP
    IT_COMPONENT
    IT_COMPONENT_UP
    IT_TEXT
    IT_TEXT_LINES
    EXTENSION_IN
    RETURN
    ET_NUMBERS
    Exceptions
    Function Group
    IBAPI_ALM_ORDER
    ~~Guduri

  • BAPI for sales order create

    My query is
    In BAPI_SALESORDER_CREATEFROMDAT2, when pricing condition types have been passed in ORDER_CONDITIONS_IN  tables, after creation of sales order, double conditions types occurred in sales order.
    How to remove that duplicacy ?
    Suggestion is that
    1st set of condition types occurring based on config
    2nd set of conditions types coming from FM.
    How to ignore 1st of data?

    hi
    Hi,
    Go through this one
    *& Report ZSD_j_SALESORDER
    report zsd_j_salesorder1 line-size 132 message-id zmmbapi .
    *& Created By : janani
    *& Created on : 13.10.2007
    *& Requested By : vardhman
    *& Description of program :
    Internal table definition *
    data: gt_order_header_in like bapisdhead occurs 0 with header line,
    gt_return like bapireturn1 occurs 0 with header line, " Return Messages
    gt_order_items_in like bapiitemin occurs 0 with header line, " Item Data
    gt_salesdocument like bapivbeln-vbeln , "Number of Generated Document
    gt_order_partners like bapiparnr occurs 0 with header line, "Document Partner
    gt_return1 like bapiret2 occurs 0 with header line.
    Data definition *
    types: begin of ty_gt_ft_sales ,
    partn_numb(10) type n ,"Customer Number 1
    partn_role(2) ,"Partner function
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    material(18), "MATERIAL
    targetquantity(020),"Target quantity
    reqqty(020), "Req quantity
    reqdate(010), "req date
    *REQ_DATE_H(010),
    ref_1(012), "Ref
    unload_pt(025),
    *PARTN_ROLE(2) ,"Partner function
    *PARTN_NUMB(10) ,"Customer Number 1
    end of ty_gt_ft_sales,
    begin of ty_header ,
    partn_numb(10) ,"Customer Number 1
    partn_role(2) ,"Partner function
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    unload_pt(025),
    req_date_h(010),
    end of ty_header,
    begin of ty_item,
    material(18), "MATERIAL
    targetquantity(020),"Target quantity
    reqqty(020), "Req quantity
    reqdate(010), "req date
    ref_1(012), "Ref
    *UNLOAD(025),
    end of ty_item.
    data : 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
    v_matnr like mara-matnr,
    v_parvw type parvw.
    data : gt_ft_sales type standard table of ty_gt_ft_sales with header line.
    data : wa_gt_ft_sales type ty_gt_ft_sales,
    wa_order_items_in like gt_order_items_in,
    wa_gt_ft_sales1 type ty_gt_ft_sales,
    wa_header type ty_header,
    salesdocument like bapivbeln-vbeln.
    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 .
    perform getname.
    form getname.
    call function 'F4_FILENAME'
    exporting
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    importing
    file_name = file.
    endform.
    *TOP-OF-PAGE.
    top-of-page.
    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, 121 sy-uname,
    / text-004, 13 sy-datum , 104 text-005, 121 sy-uzeit.
    format color col_negative inverse off.
    skip 3.
    *START-OF-SELECTION.
    start-of-selection.
    perform get_data.
    perform bapi.
    *end-of-page.
    perform result.
    form result.
    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.
    endform.
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    form get_data .
    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.
    endform. " get_data
    *& Form BAPI
    form bapi .
    loop at gt_ft_sales into wa_gt_ft_sales.
    wa_gt_ft_sales1 = wa_gt_ft_sales.
    at new partn_numb.
    wa_header-doc_type = wa_gt_ft_sales1-doc_type..
    wa_header-sales_org = wa_gt_ft_sales1-sales_org . "'0001'
    wa_header-distr_chan = wa_gt_ft_sales1-distr_chan. "'01'
    wa_header-division = wa_gt_ft_sales1-division. " '01'
    wa_header-purch_no = wa_gt_ft_sales1-purch_no.
    wa_header-req_date_h = wa_gt_ft_sales1-reqdate.
    call function 'CONVERSION_EXIT_PARVW_INPUT'
    exporting
    input = wa_gt_ft_sales1-partn_role
    importing
    output = v_parvw.
    wa_header-partn_role = v_parvw.
    wa_header-partn_numb = wa_gt_ft_sales1-partn_numb.
    wa_header-unload_pt = wa_gt_ft_sales1-unload_pt.
    move-corresponding wa_header to gt_order_partners.
    move-corresponding wa_header to gt_order_header_in.
    append gt_order_header_in.
    append gt_order_partners.
    endat.
    call function 'CONVERSION_EXIT_CCMAT_INPUT'
    exporting
    input = wa_gt_ft_sales1-material
    importing
    output = v_matnr.
    gt_order_items_in-material = v_matnr .
    gt_order_items_in-target_qty = wa_gt_ft_sales1-targetquantity . "'1000'
    gt_order_items_in-req_qty = wa_gt_ft_sales1-reqqty.
    gt_order_items_in-req_date = wa_gt_ft_sales1-reqdate.
    *GT_ORDER_ITEMS_IN-BILL_DATE = wa_GT_FT_SALES1-REQDATE.
    gt_order_items_in-ref_1 = wa_gt_ft_sales1-ref_1.
    append gt_order_items_in.
    clear : wa_gt_ft_sales1,wa_header.
    at end of partn_numb.
    call function 'BAPI_SALESORDER_CREATEFROMDAT1'
    exporting
    order_header_in = gt_order_header_in
    WITHOUT_COMMIT = ' '
    CONVERT_PARVW_AUART = 'X'
    importing
    salesdocument = salesdocument
    SOLD_TO_PARTY =
    SHIP_TO_PARTY =
    BILLING_PARTY =
    return = gt_return
    tables
    order_items_in = gt_order_items_in
    order_partners = gt_order_partners.
    ORDER_ITEMS_OUT =
    ORDER_CFGS_REF =
    ORDER_CFGS_INST =
    ORDER_CFGS_PART_OF =
    ORDER_CFGS_VALUE =
    ORDER_CCARD =
    ORDER_CFGS_BLOB =
    ORDER_SCHEDULE_EX =
    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-number = '000'.
    s_rec = s_rec + 1.
    format color col_positive inverse on.
    msg = 'SUCCESS'.
    condense msg.
    write: / msg .
    format color col_positive inverse off.
    write :/ salesdocument, 'Has been created'.
    perform commit_mm.
    endif.
    clear: gt_return[], msg.
    endat.
    endloop.
    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_return1.
    clear: gt_order_items_inhttp://].\"GT_ORDER_CONDITIONS_IN[.
    endform. " COMMIT_MM
    inthis pass re_doc field in header...

Maybe you are looking for

  • Adobe Photoshop CS is installed on my computer, however the icon is missing from my desktop.

    Adobe Photoshop is installed on my computer, however I am not able to open the program.  I clicked on the start menu and typed in the word photoshop to get the program, but it did not showup.

  • App Store problem??

    On both my iPad 3 and iPhone 5 the App Store is showing updates are available, yet when I go into the store nothing is showing up.  I've tried restarting both devices and same thing.  No connection issues, is there an issue with the App Store?

  • How to run the Server Side Existing rule in Exchange 2010

    Hi All, There were requirement to create a auto forward rule for almost more than 5000 users, which we did, but the we want to apply this rules to the messages which are already in the inbox for all those users where we have created the rule. Right n

  • FCPX 10.1 Very slow on iMac and lots of spinning beach balls

    I have noticed since I have started to use FCPX 10.1 on my Late 2012 iMac (32GB RAM, 680MX Graphics, i7 quad core, thunderbold Arecca Raid) I am getting lots of spinning beach balls and things are generally slower. I am really hoping Apple thought ab

  • Problem when integrating Web based system

    I want to integrate a web based system.I tried to use appintegrater, but my web system only has one page that accept URL parameters to let you login. So, I need to try Http system and URL iView. There is an "Authentication URL" property in http syste