PO Creation from Sales Order User Exit

Hi,
I have a business requirement where I need to  create a Stock Transport Order (STO) for a particular kind of sales order. I outlined different options for achieving this functionality.
1. Trigger a workflow for creating STO.
2. Configure it an EDI output for sales orders. Using the EDI document, create STO in the same system.
3. Create STO using BAPI from the sales order exit 'USEREXIT_SAVE_DOCUMENT'.
I am trying to understand the issues if I go with option of creating STO from sales order user-exit. I tested it and it is working fine. But what concerns is me transaction integrity. In other words I am trying to  execute another transaction within a transaction. Both Transactions (VA01 and ME21N/BAPI) may be trying to access same tables. Anyways I havent see any potential overlap.
I would like to know anybody implemented such a solution?
What could be the potential issues? Does it really affect transaction integrity?
Thanks A Lot
Anil

I would also be concerned with the possibility of the order failing to update AFTER you call the BAPI.  You could create a custom output type that processes on order create for that order type.  You could add your BAPI call to the processing routine of the output type.

Similar Messages

  • Change Confirmed Qty in Sales Order User exit/ATP User exit

    HI
    We have a requirement to change the ATP Qty for certain meterials & Order Types  duing sales Order User exit(FORM USEREXIT_MOVE_FIELD_TO_VBEP.? ) or ATP User exit.( ATP...OUT?).
    Is this ok to update the XVBEP in FORM USEREXIT_MOVE_FIELD_TO_VBEP of MV45AFZZ ?
    Our requirement will be like this, for one order type ZSAL( and for certain Materials)  we need to reserve 4 qty, if any order comes with 10 qty and the confimed qty is only 6( total available stock at present) , then we should only confirm  2 qty for the other order type( For Non ZSAL Order Type), and reserve the 4 QTY for ZSAL Order Type.
    If there are multiple schedule lines for an Item, we need to reduce the qty equally( as possible) from all schdule lines.
    i.e. date1 qty 4
         date2 qty 6,
    in  this case we should confirm  Date1 QTY 2, date2 qty 4, so that the remaining 4 will be reserved for ZSAL Order type.
    Whats the Best way to achieve this ?
    Edited by: agrud agrud on Sep 8, 2011 4:01 AM

    Hi Agrud,
    Did you check the possibilities with configuration.If it is not possible with configuration then you can use that exit.Before i used this but only to display not to change any thing.
    Regards,
    Madhu.

  • Blocking RdA creation from Sales Order Schedule Line

    Hi Gurus,
    please do you know if there is a way to block the RdA creation from Sales Order schedule line, for TAS item category? I tried with Header Delivery block without quantity confirmation but even if quantity on schedule lines are not confirmed, RdA is created anyway.
    Thank you very much
    Kind Regards
    Andrea

    thank you

  • Automatic PR Creation from Sales order

    Hi All,
              This is with respect to PR creation from Sales order for 3rd party items.
    I am able to create PR from standard sales order and i dont have any issues with that.  I have used schedule line categories which is configured with Order type Z2, Item rel for dlvy checked and Acct assigment group as E.
    Now my question is , I want to copy partners from sales order to Purchas req. Currently some partners are getting transferred from Sales order to P.Req, But not all there in sales order. Where do we control the data that can be copied from Sales order to P. Req
    Thank you
    Kris

    Hi,
    Genrating PR, Mostely depends on shedule line,see which shedule line u r determining for HIGH LEVEL ITEM ,for that shedule line maintain setting is VOV6.
    kapil

  • Need All Sales Order user exit

    Neeed all Sales Order user exits

    Hi,
    Check these Exits and their corresponding Programs
    User Exits In Sales Document Processing
    This IMG step describes additional installation-specific processing in sales document processing. In particular, the required INCLUDES and user exits are described.
    Involved program components
    System modifications for sales document processing affect different areas. Depending on the modification, you make the changes in the program components provided:
    MV45ATZZ
    For entering metadata for sales document processing. User-specific metadata must start with "ZZ".
    MV45AOZZ
    For entering additional installation-specific modules for sales document processing which are called up by the screen and run under PBO (Process Before Output) prior to output of the screen. The modules must start with "ZZ".
    MV45AIZZ
    For entering additional installation-specific modules for sales document processing. These are called up by the screen and run under PAI (Process After Input) after data input (for example, data validation). The modules must start with "ZZ".
    MV45AFZZ and MV45EFZ1
    For entering installation-specific FORM routines and for using user exits, which may be required and can be used if necessary. These program components are called up by the modules in MV45AOZZ or MV45AIZZ.
    User exits in the program MV45AFZZ
    The user exits which you can use for modifications in sales document processing are listed below.
    USEREXIT_DELETE_DOCUMENT
    This user exit can be used for deleting data which was stored in a separate table during sales document creation, for example, if the sales document is deleted.
    For example, if an additional table is filled with the name of the person in charge (ERNAM) during order entry, this data can also be deleted after the sales order has been deleted.
    The user exit is called up at the end of the FORM routine BELEG_LOESCHEN shortly before the routine BELEG_SICHERN.
    USEREXIT_FIELD_MODIFICATION
    This user exit can be used to modify the attributes of the screen fields.
    To do this, the screen fields are allocated to so-called modification groups 1 - 4 and can be edited together during a modification in ABAP. If a field has no field name, it cannot be allocated to a group.
    The usage of the field groups (modification group 1-4) is as follows:
    Modification group 1: Automatic modification with transaction MFAW
    Modification group 2: It contains 'LOO' for step loop fields
    Modification group 3: For modifications which depend on check tables or on other fixed information
    Modification group 4: is not used
    The FORM routine is called up for every field of a screen. If you require changes to be made, you must make them in this user exit.
    This FORM routine is called up by the module FELDAUSWAHL.
    See the Screen Painter manual for further information on structuring the interface.
    USEREXIT_MOVE_FIELD_TO_VBAK
    Use this user exit to assign values to new fields at sales document header level. It is described in the section "Transfer of the customer master fields into the sales document".
    The user exit is called up at the end of the FORM routine VBAK_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBAP
    Use this user exit to assign values to new fields at sales document item level. It is described in the section "Copy customer master fields into the sales document".
    The user exit is called up at the end of the FORM routine VBAP_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBEP
    Use this user exit to assign values to new fields at the level of the sales document schedule lines.
    The user exit is called up at the end of the FORM routine VBEP_FUELLEN.
    USEREXIT_MOVE_FIELD_TO_VBKD
    Use this user exit to assign values to new fields for business data of the sales document. It is described in the section "Copy customer master fields into sales document".
    The user exit is called up at the end of the FORM routine VBKD_FUELLEN.
    USEREXIT_NUMBER_RANGE
    Use this user exit to define the number ranges for internal document number assignment depending on the required fields. For example, if you want to define the number range depending on the sales organization (VKORG) or on the selling company (VKBUR), use this user exit.
    The user exit is called up in the FORM routine BELEG_SICHERN.
    USEREXIT_PRICING_PREPARE_TKOMK
    Use this user exit if you want to include and assign a value to an additional header field in the communication structure KOMK taken as a basis for pricing.
    USEREXIT_PRICING_PREPARE_TKOMP
    Use this user exit if you want to include or assign a value to an additional item field in the communication structure KOMP taken as a basis for pricing.
    USEREXIT_READ_DOCUMENT
    You use this user exit if further additional tables are to be read when importing TA01 or TA02.
    The user exit is called up at the end of the FORM routine BELEG_LESEN.
    USEREXIT_SAVE_DOCUMENT
    Use this user exit to fill user-specific statistics update tables.
    The user exit is called up by the FORM routine BELEG-SICHERN before the COMMIT command.
    Note
    If a standard field is changed, the field r185d-dataloss is set to X. The system queries this indicator at the beginning of the safety routine. This is why this indicator must also be set during the maintenance of user-specific tables that are also to be saved.
    USEREXIT_SAVE_DOCUMENT_PREPARE
    Use this user exit to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
    The user exit is carried out at the beginning of the FORM routine BELEG_SICHERN.
    User exits in the program MV45AFZA
    USEREXIT_MOVE_FIELD_TO_KOMKD
    Use this user exit to include or assign values to additional header fields in the communication structure KOMKD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
    USEREXIT_MOVE_FIELD_TO_KOMPD
    Use this user exit to include or assign values to additional item fields in the communication structure KOMPD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
    USEREXIT_MOVE_FIELD_TO_KOMKG
    Use this user exit to include or assign values to additional fields in the communication structure KOMKG taken as a basis for material determination and material listing. This is described in detail in the section "New fields for listing/exclusion".
    USEREXIT_MOVE_FIELD_TO_KOMPG
    Use this user exit to include or assign values to additional fields in the communication structure KOMPG taken as a basis for material determination and material listung. This is described in detail in the section "New fields for listing/exclusion".
    USEREXIT_REFRESH_DOCUMENT
    With this user exit, you can reset certain customer-specific fields as soon as processing of a sales document is finished and before the following document is edited.
    For example, if the credit limit of the sold-to party is read during document processing, in each case it must be reset again before processing the next document so that the credit limit is not used for the sold-to party of the following document.
    The user exit is executed when a document is saved if you leave the processing of a document with F3 or F15.
    The user exit is called up at the end of the FORM routine BELEG_INITIALISIEREN.
    User-Exits in program MV45AFZB
    USEREXIT_CHECK_XVBAP_FOR_DELET
    In this user exit, you can enter additional data for deletion of an item. If the criteria are met, the item is not deleted (unlike in the standard system).
    USEREXIT_CHECK_XVBEP_FOR_DELET
    In this user exit, you can enter additional data for deletion of a schedule line. If the criteria are met, the schedule line is not deleted (unlike in the standard system).
    USEREXIT_CHECK_VBAK
    This user exit can be used to carry out additional checks (e.g. for completion) in the document header. The system could, for example, check whether certain shipping conditions are allowed for a particular customer group.
    USEREXIT_CHECK_VBAP
    This user exit can be used to carry out additional checks (e.g. for completion) at item level.
    USEREXIT_CHECK_VBKD
    The user exit can be used to carry out additional checks (e.g. for completion) on the business data in the order.
    USEREXIT_CHECK_VBEP
    This user exit can be use to carry out additional checks (e.g. for completion) on the schedule line. During BOM explosion, for example, you may want certain fields to be copied from the main item to the sub-items (as for billing block in the standard system).
    USEREXIT_CHECK_VBSN
    You can use this user exit to carry out additional checks (e.g. for completion) on the serial number.
    USEREXIT_CHECK_XVBSN_FOR_DELET
    In this user exit, you can enter additional criteria for deletion of the serial number. If the criteria are met, the serial number is not deleted (unlike in the standard system).
    USEREXIT_FILL_VBAP_FROM_HVBAP
    You can use this user exit to fill additional fields in the sub-item with data from the main item.
    USEREXIT_MOVE_FIELD_TO_TVCOM_H
    You can use this user exit to influence text determination for header texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
    USEREXIT_MOVE_FIELD_TO_TVCOM_I
    You can use this user exit to influence text determination for item texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
    User-Exits for product allocation:
    The following user exits all apply to structure COBL, in which the data for account determination is copied to item level.
    USEREXIT_MOVE_FIELD_TO_COBL
    Option to include new fields in structure COBL.
    USEREXIT_COBL_RECEIVE_VBAK
    Option to assign values from the document header to the new fields.
    USEREXIT_COBL_RECEIVE_VBAP
    Option to supply values from the item to the new fields.
    USEREXIT_COBL_SEND_ITEM
    A changed field can be copied from the structure into the item. You could use the user exit to display a certain field in the account assignment block (see also MV45AFZB).
    USEREXIT_COBL_SEND_HEADER
    A changed field can be copied from the structure to the header (see source text MV45AFZB)
    USEREXIT_SOURCE_DETERMINATION
    You can use this user exit to determine which plant will be used for the delivery. In the standard system, the delivering plant is copied from the customer master or the customer-material info record. If you want to use a different rule, then you must enter it in this user exit.
    USEREXIT_MOVE_FIELD_TO_ME_REQ
    With this user exit you can include additional fields for the following fields:
    EBAN (purchase requisition)
    EBKN (purchase requisition-account assignment)
    USEREXIT_GET_FIELD_FROM_SDCOM
    Option to include new fields for the variant configuration. Fields that are included in structure SDCOM can be processed and then returned to the order.
    USEREXIT_MOVE_WORKAREA_TO_SDWA
    You can use this user exit to format additional work areas for the variant configuration. You will find notes on the user exit in MV45AFZB.
    User-Exits for first data transfer:
    The following user exits can only be used for the first data transfer.
    Note
    Only use the user exits if the names/fields do NOT have the same name.
    USEREXIT_MOVE_FIELD_TO_VBAKKOM
    Option to include additional fields in structure VBAKKOM (communiction fields for maintaining the sales document header)
    USEREXIT_MOVE_FIELD_TO_VBAPKOM
    Option to include additional fields in structure VBAPKOM (communication fields for maintaining a sales item)
    USEREXIT_MOVE_FIELD_TO_VBEPKOM
    Option to include additional fields in structure VBEPKOM (communication fields for maintaining a sales document schedule line)
    USEREXIT_MOVE_FIELD_TO_VBSN
    You can use this user exit to include fields in structure VBSN (scheduling agreement-related change status).
    USEREXIT_MOVE_FIELD_TO_KOMKH
    You can use this user exit to include new fields for batch determination (document header).
    USEREXIT_MOVE_FIELD_TO_KOMPH
    You can use this user exit to include new fields for batch determination (document item).
    USEREXIT_CUST_MATERIAL_READ
    You can use this user exit to set another customer number in the customer material info record (e.g. with a customer hierarchy)
    USEREXIT_NEW_PRICING_VBAP
    Option for entry of preconditions for carrying out pricing again (e.g. changes made to a certain item field could be used as the precondition for pricing to be carried out again). Further information in MV45AFZB.
    USEREXIT_NEW_PRICING_VBKD
    Option for entry of preconditions for carrying out pricing again (e.g. changes to the customer group or price group could be set as the preconditions for the system to carry out pricing again). Further information in MV45AFZB.
    User-Exits in Program MV45AFZD
    USEREXIT_CONFIG_DATE_EXPLOSION
    The BOM is exploded in the order with the entry date. You can use this user exit to determine which data should be used to explode the BOM (explosion with required delivery date, for example).
    User exits in the program FV45EFZ1
    USEREXIT_CHANGE_SALES_ORDER
    In the standard SAP R/3 System, the quantity and confirmed date of the sales document schedule line is changed automatically if a purchase requisition is allocated, and it or the sales document is changed (for example, quantity, date).
    If you want to change this configuration in the standard system, you can define certain requirements in order to protect your sales orders from being changed automatically. Use this user exit for this purpose. Decide at this point whether the schedule lines are to be changed.
    User-Exits in Program RV45PFZA
    USEREXIT_SET_STATUS_VBUK
    In this user exit you can you can store a specification for the reserve fields in VBUK (header status). Reserve field UVK01 could, for example, be used for an additional order status (as for rejections status, etc.).
    The following workareas are available for this user exit:
    VBUK (header status)
    FXVBUP (item status)
    FXVBUV (Incompletion)
    USEREXIT_SET_STATUS_VBUP
    In this user exit you can you can store a specification for the reserve fields for VBUP (item status).
    The following workareas are available for this user exit:
    FXVBAP (Item data)
    FXVBAPF (Dynamic part of order item flow)
    FXVBUV (Incompletion)
    USEREXIT_STATUS_VBUK_INVOICE
    You can use this user exit to influence billing status at header level.
    User exits in the screens
    Additional header data is on screen SAPMV45A 0309, additional item data on screen SAPMV45A 0459. These screens contain the Include screens SAPMV45A 8309 or SAPMV45A 8459 as user exits.
    Fields which are also to be included in the sales document for a specific installation should be included on the Include screens for maintaining. If an application-specific check module is needed for the fields, this can be included in the Include MV45AIZZ. The module is called up in the processing logic of the Include screens.
    For field transports, you do not have to make changes or adjustments.
    Example
    A new field, VBAK-ZZKUN, should be included in table VBAK.
    If the check is defined via the Dictionary (fixed values or check table) the field must be included with the fullscreen editor in the Include screen SAPMV45A 8309. In this case, no change has to be made to the processing logic.
    User Exits in Program MV45AFZ4
    USEREXIT_MOVE_FIELD_TO_KOMK
    You can use this user exit to add or edit additional header fields in the communication structure - KOMK- for free goods determination. For more information, see the New Fields for Free Goods Determination IMG activity.
    USEREXIT_MOVE_FIELD_TO_KOMP
    You can use this user exit to add or edit additional item fields in the communication structure KOMP for free goods determination. For more information see the New Fields for Free Goods Determination IMG activity.
    User Exits in the SAPFV45PF0E and SAPFV45PF0C Programs
    EXIT_SAPFV45P_001
    You can use this user exit to decide whether intercompany billing data is used in the profitability segment for cross-company code sales, or whether the data comes from external billing (external customer, sales data from the selling company code.
    Reward points if helpful.
    Regards
    Ravi

  • Creation of sales order- screen exit

    Hi all,
    I have a requirement like while creation of sales order need to develop one screen field in additional data B.i developed that field. and now while creation of sales order it will save in vbak table. now the problem is that screen field will be enable in that particular sales order type only otherwise it will be disable. how to do this. screen exit.

    Hi
    See SAP Note 209278 - Display of customer-specific fields in sales doc
    Check also, SAP Note 302497 - Additional cust. fields not displayed in 'Additional data B' and SAP Note 386694 - Additional data not displayed in screen 8459 and 8309
    Regards
    Eduardo

  • Auto Po creation from sales order.

    Hi ,
              I have a requirement to create a PO automatically from sales order.
    We will be creating a third party sales order, corresponding to which system creates an purchase requisition. Now the requirement is that this Purchase requisition should be converted in to PO automatically.
    For this in the item category config i have ticked the auto Po check box . Also the source of supply is unique so that  purchase requisition is automatically assigned with source of supply.
    But still the PO is not created automatically. What are all the configuration and workflow  needs to be done for this.?
    Kindly help me.
    ram.

    Hi
    From SD settings i dont think a purchase order can be directly created based on sales order thro standards
    You can trigger only purchase requestion
    In VOV6 if you mention order type NB for your schedule line category then a Purchase requestion is only created up on saving your sales order
    Item category in VOV6 should be 5 (third party)
    Account assignment category should be X
    This is third party sales settings
    In MM01 also in the purchasing tab of that material create automatic PO check box is there
    If you tick that also it generates purchase requestion only not purchase order
    In VOV7 create automatic PO check box is there
    If you tick that also it generates purchase requestion only not purchase order
    Involve your MM people also for this requirement
    In MM people can create automatically PO from PR and there are a lot of threads in MM forum regarding that
    For automatic PO creation from PR, follow the steps. taken from MM forum
    1) Material Master purchasing view tick automatic PO check box
    2) Vendor Master purchasing view tick automatic PO check box.
    3) Maintain Source list for Vendor & Material.(ME01)
    4) Maintain Purchase Info Record.(ME11)
    5) Create a Purchase Requisition.(ME51)
    6) Use T .Code: ME59 & execute for PR for vendor, you will be able to create automatic PO.
    7) Note-1:
    During creation of PR , select check box of Source Determination in the 1st screen of ME51
    Ensure that Purchase Info Record should be there.
    If you have more than one vendor then fixes only one vendor in source list.
    Regards
    Raja

  • Service order creation from sale order

    Hi Friends,
       Could you please tell me where is the setting for the automatic creation of service order from sale order.
        Iam using LEIS , TAD and CD as the sales documents and SM01 as service order document.
        Am I missing something?
        Please let me know.
        Regards,
        satish

    Hi Satish,
    The setting for creation of a service order from sales order can be found in the Requirement class configuration.
    To know how to link, check the procurement tab in the sales order, note down the requirement type associated to the line item. Requirement type is linked to requirement class. In requirement class you find the configuration.
    Standard SAP creates SM03 (refurbishment) type of service order from sales order.
    Reward points if useful.
    Regards
    Ananth

  • PO creation from sales order

    Hi 
    we have a scenario where in we are creating a manufacturing order ( This is a sales order with no delivery relevance and billing relevance ), we use this to transfer requirement fo sales order to production( production is not in SAP) via interface .
    We need to create  PO when we get the confirmed dates from legacy system . We planned to create the PO from sales order directly . How can we do this ?
    Also my dubt is when we get the confirmed dates from  legacy system in to SAP , do we need to update the PO which in turn would need to update sales order schedule lines or can we directly update schedule lines in Sales order .
    IPlease let me know in detail if possible .
    Regards
    Ramanathan

    Hi
    You can use BAPI : BAPIPO_CREATE1_   for creating PO from sales order , you can pass the SALES ORDER no into the item level field : CRM_SALES_ORDER_NO---'' YOUR SALES ORDER '' . and fill the corresponding ITEMX for the field .
    Regards
    Swapnil

  • Help is needed in Sales order User Exits

    Hi
    Please Can anybody show the solution to my problem.
    My problem is:
    Using Table having 2 columns(Customer,Route), we have to display Route(present under shipping tab in Sales Order) in Sales Order. Route has to be displayed based on the customer present in the table.

    hi,
    Please try table VBFA with fields VBELV = <sales order> and VBTYP_N = 'J' (Shipping/Delivery).
    and also try this also
    if you know delivery number for order ,then you could use FM VTTP_READ
    if you need delivery number from sales order then use VBAP-VGBEL
    pass delivery number to FM or pass the value to VTTP Table
    thanks,
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • Production order creation from sales order

    Hi PP Gurus,
    I am creating a production order automatically from sales order by using strategy group exactly similar to 82. Once i create the sales order , its showing missing parts error in prouction order and if i check missing parts overview,it says over all confirmation date is not determine.We have stock in MMBE for that material and storage location combination.
    I have also chekced the requierement class and type and found ok.
    Please help me resolving this issue.
    Thanks in advance.!
    Regards,
    Sudheer

    Hi Mario,
    Yes, the availability check will check other stock types also. My concern is why the availability check is  failing and giving missing parts even if the components are there in stock after considering the reservations.
    I checked OPJJ setting, availability check is active and we did that.
    Can you please help me in this as we are stuck up at this point.
    Regards,
    sudheer

  • Name of the structure needed for sales order user exit

    Hi,
    I am planning to write a user exit which will insert the data into my ztable the moment the new sales order is created and is saved.
    I have identified FORM USEREXIT_SAVE_DOCUMENT as the necessary user exit. But the problem is that while inserting the data into the ztable I cannot insert the data from vbak as the data will be inserted into this table after the SO is saved.
    Thus I need to identify a structure which is used to populate the vbak table so that it simultaneously inserts the data in the ztable as well. Can anyone help me with the name of the structure so that these fields i.e. vbeln, vkorg, vtweg, spart are inserted into my ztable?
    Also need to know how to convert the net value i.e. vbak-netwr in Indian Rupees as it gets stored as Dollars ....
    Thanks,
    Vinod.

    Hi,
    One of the structure being used is RV45A, there are several other str's being used as well for various calculations,
    check out program SAPMV45A for the same.
    & in order to convert vbak-netwr to rupees use the below statemetnt,
    WRITE vbak-netwr TO zvbak-netwr CURRENCY INR.
    Regards,
    Raghavendra
    Message was edited by:
            raghavendra ay

  • Ztable not updating in sales order user exit

    Hi Genius Abapers.
    We want to take text ID data of sales order into Ztable. For taking the data we have used user exit in sales order. Now the problem is if we go through debug mode then the Ztable is updating but if we remove the break point Ztable is not getting updated.
    Please give solution for this problem
    Regards
    Narayana

    Hi Gurus,
            I am basically from SD and we used commit statements in the programme and this is the code we used
    Include name --- MV45AF0B_BELEG_INITIALISIEREN
    **********************************Code Addd by paresh 8.10.2007 starts *******************************
      DATA : BEGIN OF itab_so OCCURS 0,
             vbeln LIKE vbap-vbeln,
             posnr LIKE vbap-posnr,
             spras LIKE t002t-spras,
             END OF itab_so.
      DATA : BEGIN OF itab_so1 OCCURS 0,
             vbeln LIKE vbap-vbeln,
             posnr LIKE vbap-posnr,
             spras LIKE t002t-spras,
             END OF itab_so1.
      DATA : BEGIN OF it_tabid OCCURS 0,
             tdid LIKE stxh-tdid,
             tdspras like stxh-tdspras,
             END OF it_tabid.
      DATA : is_stxh TYPE stxh.
      DATA g_header TYPE string .
      DATA wa_plain_text TYPE zplain_text.
      DATA t_lines LIKE tline OCCURS 0 WITH HEADER LINE.
      DATA g_item(16)." type i.
      data :it_ztable type table of  ZPLAIN_TEXT .
      data wa_ztable type zplain_text.
      data flag.
    *****************************Read Header text***************************************
    *loop at vbak.
       itab_so1-vbeln = vbak-vbeln.
       itab_so1-posnr = vbak-posnr.
       itab_so1-spras = vbak-wklnd.
       APPEND itab_so1.
       CLEAR itab_so1.
    ENDLOOP.
    refresh it_tabid.
    clear it_tabid.
    refresh it_ztable.
    clear it_ztable.
      LOOP AT xvbap.
        itab_so-vbeln = vbak-vbeln.
        itab_so-posnr = xvbap-posnr.
        itab_so-spras = xvbap-wklnd.
        APPEND itab_so.
        CLEAR itab_so.
      ENDLOOP.
    LOOP AT itab_so.
        SELECT tdid tdspras FROM stxh INTO TABLE it_tabid WHERE tdobject = 'VBBK' AND tdname = vbak-vbeln  .
    ENDLOOP.
    *loop at it_ztable into wa_ztable.
      LOOP AT itab_so.
        LOOP AT it_tabid.
          is_stxh-tdobject = 'VBBK'.
          is_stxh-tdname   = vbak-vbeln.
          is_stxh-tdid     = it_tabid-tdid.
          is_stxh-tdspras  = it_tabid-tdspras.
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
              id                      = is_stxh-tdid
              language                = is_stxh-tdspras
              name                    = is_stxh-tdname
              object                  = is_stxh-tdobject
            TABLES
              lines                   = t_lines
            EXCEPTIONS
              id                      = 1
              language                = 2
              name                    = 3
              not_found               = 4
              object                  = 5
              reference_check         = 6
              wrong_access_to_archive = 7
              OTHERS                  = 8.
          IF sy-subrc = 0.
            LOOP AT t_lines.
              CONCATENATE g_header t_lines-tdline INTO g_header SEPARATED BY space.
            ENDLOOP.
            wa_plain_text-application = 'SO'.
          wa_plain_text-key1 = itab_so-vbeln.
            wa_plain_text-key1 = vbak-vbeln.
            wa_plain_text-key2 = 'HDR'.
            wa_plain_text-sub_application = it_tabid-tdid.
            wa_plain_text-text = g_header.
            wa_plain_text-last_date = sy-datum.
            MODIFY zplain_text FROM wa_plain_text .
       wait up  to  60 seconds.
             commit work.
            CLEAR: wa_plain_text.
            CLEAR : g_header,t_lines.
            refresh t_lines.
          ENDIF.
      if sy-subrc <> 0.
       delete from zplain_text where key1  = vbak-vbeln    and
                                  key2  = itab_so-posnr    and
                                  SUB_APPLICATION = it_tabid-tdid.
                                   commit work.
       endif.
        ENDLOOP.
      ENDLOOP.
    *endloop.
    Please do me the needfull
    Regards
    Manam.Narayana

  • Sales Order User Exits - configurable materials !?

    I have been tasked with investigating the following issue and if it can be solved via ABAP/User Exits. Users in an already live system are entering Sales Orders ( VA01 )with multiple Configurable Material line items and have to repeatedly enter the same characteristic values in each line item ( by entering Item Details >> Configuration ). They want to enter a set of characteristic values in the first line item and then have them defaulted into any further items. I have looked at the standard user exits in particular USEREXIT_MOVE_WORKAREA_TO_SDWA. Has anybody attempted anything similar to this !? Any ideas ?
    Possible issues are:
    1. How do I find the characterictic values from the 1st line item. ie. they haven't been saved yet, are they in a temp area similar to XVBAP for normal sales order line items !?
    2. Are there are any suitable user exits in the Configuration side of things ( Function Group CEI0 !? ) to effect any changes the defaults. There are some BADIs in the code but they are not yet in use !?

    Hi Jonathan!
    I had a different requirement with sales orders and configuration, but this forced me into long debugging of behavior of all these exits.
    1) Characteristics can't be read.
    ad 1) in configuration it's possible to call function modules. Here (inside the configuration) values of characteristics are available and can be saved in global data of a Z-function module. This is later (in same transaction) available (like import/export).
    2) I would propose to use functions of characteristics (as mentioned, it's possible to execute own function modules in configuration). It's possible to default values (meaning: output of your function is only done, if characteristic is not set) based on global data of Z-function module.
    As long as a global memory is used, no interaction with other transactions has to be feared.
    You don't need user exits (but a lot of coding).
    You need to change the customizing of configuration - probably a huge task, because I guess you have a huge configuration (otherwise users wouldn't ask for maintenance help).
    Regards,
    Christian

  • Sales Orders User Exits

    Dear colleagues,
    Are there any user exits that I can invoke at the time of deleting a line item from a sales order?
    Ideally, I would like the user exit to check the status of production order and prompt the user if the associated production order can be deleted.  If the user chooses to retain the production, system should retain the production order although the associated sales order / lineitem is deleted.
    Regards,
    Pavan

    I could Figure it out.
    Thanks,
    Kannan

Maybe you are looking for

  • CI issues on Linux - CentOS + Hudson

    Hi there, I got some issues to generate the Junit reports, it gets up to "Waiting for client connection" then do nothing for a few seconds. When it gets back this is what I get in the console: runUnitTests:      [java] Loading configuration file /opt

  • Macbook 3,1 late 2007 palmrest crack

    Hi I have just recently found out that Apple has claimed that the crack is a manufacturing defect and that it was replacing them regardless of waranty. Am i too late to get mine replaced? Does anybody have a recent experience? Thanks for your anwser.

  • Old 8mm. Movies, Conversion to DVD?

    My own video cameras may not be of high enough quality to do this conversion, even using their signal out as a direct input to something like the Canopus ADVD-100. Are there any companies that do this conversion commercially?

  • How can I keep left- and right-aligned paragraphs together on the same line?

    I am currently trying to typeset a menu. Basically, I want the Dish Title to be left-aligned and the Price right-aligned - but on the same line. I can achieve the effect by typing in a shift+tab after the Dish Title text and then inserting the price,

  • VC Tabel view size limitation

    Hi, I have a VC model displaying query results in a table view. When the query is executed it is listing around 7000 records, but with VC model seeing only 500 records in the table. Is there any setting to adjust the table size to display the whole q