Adding "servicess for object" toolbar to handling unit Maintenance

Hi gurus,
Is there a way to add "sevices for object" toolbar to handling units in transaction HU02
Best Regards,
Itzik eshed.

Use Tcode SNRO.
Provide your object type HU_VEKP
Then click on change button, it will take you to No. Range Object: Change screen.
Then click on Number range in menu bar to maintain the number range.
Hope it can assist you.
Thanks & Regards
JP

Similar Messages

  • Attachment list in Services for Object toolbar

    Does anybody know if there is any user exit or BADI that I can use to filter certain file attachments in Attachment list of Services for Object toolbar.
    For example, in transaction XK03 (Vendor display), Services for Object toolbar, you can see the Attachment list and it will display list of pc file attachments, however, we have a requirement to display only those that met certain criteria, is there any BADI or user exit for this?
    Thanks in advance for your help.

    you can use BADI
    GOS_SRV_SELECT
    for this.
    Regards
    Raja

  • Steps For Goods Receipt For Work Order Using Handling Units

    Hello MM gurus,
    I'm new to HU Management.  Can you please share with me the steps for executing a "Goods Receipt For Work Order" using Handling Units?
    I created a HU (1000000026), and then using transaction COWBHUWE I tried using that HU to create a goods receipt, but I keep getting the message below:
    Handling unit 1000000026 is not provided for goods receipt
    Message no. VHURM046
    Do you have to assign/plan HUs to Process Orders first? I think the problem is that I'm not understanding the process or the requirements for a goods receipt for work order using HU.

    Hello Manish Kumar,
    I've been doing Handling Units testing in our sandbox environment and I've been trying to Pack a Finished Product for a Process Order using
    1-Transaction code HU02 to create the Handling Unit
    2-Transaction COWBHUE after creating the HU to enter the production order number and the HU number and propose it, but the it doesn't work. When I propose it, nothing happens.
    3.-I also tried COWBPACK, but for some reason, when I go into COWBPACK, key in the Process Order, and then press enter, I get the following message:
    You do not have authorization to create handling units for plant BP08
    Message no. VHUPD500
    Do you know how to solve this issue?

  • User exit/BADI for Deleting the Empty Handling unit

    Hi All,
    Can anyone give me the suitable User exit/BADI for the below scenario.
    While creating the TO (Transfer order) for a delivery using the transaction code LT12, the system will automatically generate HU (Handling unit) number. If the materials are not found in the storage bin for the selected HU, we have to delete the Handling Unit from the delivery document.
    Thanks in advance.
    Thanks
    Ramesh.

    Find below couple of  User Exits for Transfer Order.
    MWMTO001 - EXIT_SAPLL03T_001 (Enhancements for end of transfer order generation)
    MWMTO002 - EXIT_SAPLL03T_002 (User Exit at End of TO Confirmation (in Update Task))
    The Exits gives you access to LTAK and LTAP.....
    Hope this is helpful to you.
    Vinodh Balakrishnan

  • Determine costs for packing when using handling units

    Hi Experts,
    How can I track the costs for packing process and packing material when I am using Handling Units to represent the packing ?
    Is there any idea?
    The only way I see for tracking the costs is to create a packing operation when creating the FP (and do not use HU).
    Thanks,
    Artashes

    Thanks for the answer Mario, but let me ask more precise question.
    I have a finished product AAA which is not packed. Now I have a requirement to pack it.
    So before hearing about HU, I would add a new operation step to AAA recipe, new resource and a packing material to AAA's BOM.
    For this option I don't have questions.
    But now I want to use HU. so I create packaging instructions, and do the transactions
    - COWBPACK - Work Order - Finished Product  - to pack materials in process order
    - COWBHUWE - Goods Receipt for Work Order  - to do a GR for process order.
    And where can I consider the labour and packing material expenses here? I even don't have a resource which is doing a packing. so I can't do scheduling...maybe I don't understand the usage of HU?
    Thanks and Regards,
    Artashes

  • Driver program for Pallet label or Handling unit

    Hi Friends,
      Could any one give me The standard driver program for Pallet label for Handling unit

    Hi Jyotiswaran,
    It can be without HU managed. You need to use SU (storage unit) managed storage types.
    When you do GR for inbound delivery and create a TO for stock putaway, by using the palletisation data in WM view 2 system generates the storage units. The same can be treated as the pallet number.
    Regards,
    Sudhir

  • ALV Report for Handling Units

    Hi,
    In SAP, the standard report exists for the selection of handling units (HUMO). The requirement is that in addition to standard output the report should also display  for KMAT materials the serial number associated with the respective HU, catalog number and special stock category.
    -Depending upon the selection criterion, the HU assigned with the material will be identified for the materials.
    -The HU contains the catalog number in the contents field of status tab and will be displayed in output.
    -The serial number assigned with the HU will be picked up from the HU and will be displyed in the output.
    1. The program will first find out the HUs for the material. From the HU, catalog number and serial number will be traced.
    2.The output should be in ALV format.
    3.The output will display HU number, KMAT number, catalog number, serial number, quantity, special stock indicator, plant, Storage location, Warehouse number, and bin-location.
    Can Any body tell me what are the table involved in this ALV report to display HU number, KMAT number, Special Stock Indicator, Warehoure Number and Bin Location.
    Thanks,
    Bala.

    Hi ,
          For Handling unit tables are VEKP,VEPO also use object LE_HU in transaction SARA .
    For Warehouse number check out table t300,t320 or view v_T320
    For Bin location table T303,T303T or view V_T303
    For special stock determination T434P
    FOR KMAT - table MAST ,STKO ,STPO.
    Please reward if useful.

  • Handling unit

    can anybody explain handling units
    -what is it's use
    -how material are kept in W/H
    i have gone thru help.sap but unable to understand concept
    Nikhil
    Edited by: nniikkhhiill on Feb 8, 2010 11:22 AM

    Hi
    Handling Unit Management  
    Purpose
    You can use Handling Unit Management (HUM) to reflect packing-based logistics structures in the SAP System. Using this method, you track the movements of entire handling units and the materials they contain rather than tracking each material individually.
    When you base logistics processes on handling units, goods movements processing is made easier, which in turn optimizes all logistics operations. This simplified processing includes the existing packing function in shipping and warehouse processing in the Warehouse Management system, which is expanded here.
    Features
    In the system, the handling unit (HU) expands on the shipping unit. Handling units can be nested, which means that you can create new handling units from several handling units as often as you like. At the material item level, HUs contain the complete material identification, the quantity, and, in the case of serial numbers, the respective object list. Handling units have unique, scannable identification numbers that can be developed according to standards such as EAN 128 or SSCC.
    Handling units contain all inventory management information of the materials they contain that are maintained in Inventory Management. There are also status messages that you can call up at any time that indicate whether a handling unit is only planned or if the ship-to party has been notified of the arrival of this handling unit, or whether it is in the warehouse or has already been posted to goods issue. The integrated history function also records each business process in the life cycle of each handling unit, meaning that you can track the handling unitu2019s path and development at any time.
    In HU-managed storage locations, all goods movements are executed through the specification of the respective HUs, and Inventory Management is performed through the handling units. If you are not working with HU-managed storage locations, you can use handling units (without stock information) as before in the delivery and in the shipment.
    In HU-managed storage locations, materials can be managed in HUs only. Mixed stock (stock made up of packed and non-packed materials within the same storage location) is not supported. HUs can also be managed in interim storage types. Unpacking a material from an HU means that the stock of the material is posted to a storage location that is not HU-managed.
    If you call up normal material movements in connection with an HU-managed storage location, a delivery is created, rather than a direct material posting, which has been the procedure up to this point.
    Handling units are unique at client level in at least one system. Using an indicator at client level (see Unique Identification of Handling Units), you can control whether you are going to work with the HU functions. Since the handling unit is a physical unit, the central logistics processes are controlled through the input of the handling unit identification. These processes include putaway, picking, and stock transfers, as well as goods receipts and goods issues.
    A handling unitu2019s mobility can be limited if quality checks are active. Changes in the stock category caused by a quality inspection are made using a posting change in the handling unit.
    There is also a report available that you can use to find and display handling units using different selection criteria such as material, packing instruction, or storage location.
    Although the handling unit is basically a unit that remains constant in the system, you can change it by repacking the materials it contains. All the packing functions, such as packing, repacking, and unpacking, are completely supported by the handling unit function. In this way, handling units can be created in production, during goods receipt, or in the packing areas of the warehouse. If you have automatic packing, the handling unit is created from the packing proposals defined in the system (from the packing instructions, for example).
    Pl.go thorugh link
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/19/7f6d36f74c7505e10000009b38f839/frameset.htm
    Edited by: Sanjay  Shah on Feb 8, 2010 11:32 AM

  • SAP Handling Unit Managment

    Hi folks,
    I very urgently need some documents about SAP HUM.
    Can any one help me.
    Laxmanan

    SAP HU - SAP Handling Unit Management (HUM)
    The SAP HU is used for tracking the handling units used by the materials.  Some common handling units are packagings materials like cartons, pallets etc.
    In the SAP system, the handling unit (HU) expands on the shipping unit. Handling units can be nested and you can also create new handling units from several handling units as often as you like. At the material item level, HUs contain the complete material identification, the quantity, and, in the case of serial numbers, the respective object list. Handling units have unique,
    scannable identification numbers that can be developed according to standards such as EAN 128 or SSCC.
    Handling units contain all inventory management information of the materials they contain that are maintained in Inventory Management. There are also status messages that you can call up at any time that indicate whether a handling unit is only planned or if the ship-to party has been notified of the arrival of this handling unit, or whether it is in the warehouse or has already been posted to goods issue. The integrated history function also records each business process in
    the life cycle of each handling unit, meaning that you can track the handling unit’s path and development at any time.
    Refer to : Logistics -> Central Functions -> Handling Unit Management
    In HU-managed storage locations, all goods movements are executed through the specification of the respective HUs, and Inventory Management is performed through the handling units. If you are working without HU-managed storage locations, you can work with handling units (without stock information) as before in the delivery and in the shipment.
    In HU-managed storage locations, materials can be managed in HUs only. Mixed stock made up of packed and non-packed materials within the same storage location are not supported. HUs can also be managed in interim storage types. Unpacking a material from a HU means that the stock of the material is posted to a storage location that is not HU-managed.
    If you call up normal material movements in connection with an HU-managed storage location, a delivery is created, rather than a direct material posting, which has been the procedure up to now.
    Please note that if you want to use 311 to move the material already in stock, but in a non HUM Storage Location and you want to transfer those materials into a HUM Storage Location 304.  If this is the case you can use the transaction VLMOVE with the destination plant and storage location. Before that you have to create the HU with the transaction code HU02 Storage location: where the material is and the status: in stock.
    Handling units are unique at client level in at least one system. Using an indicator at client level, you can control whether you are going to work with the HU functions. Since the handling unit is a physical unit, the central logistics processes are controlled through the input of the handling unit identification. These processes include putaway, picking, and stock transfers, as well as goods receipts and goods issues.
    A handling unit’s mobility can be limited if quality checks are active. Changes in the stock category caused by a quality inspection are made using a posting change in the handling unit.
    There is also a report available that you can use to find and display handling units using different selection criteria such as material, packing instruction, or storage location.
    Although the handling unit is basically a unit that remains constant in the system, you can change it by repacking the materials it contains. All the packing functions, such as packing, repacking, and unpacking, are completely supported by the handling unit functionality. In this way, handling units can be created in production, during goods receipt, or in the packing areas of the warehouse. If you have automatic packing, the handling unit is created from the packaging proposals defined in the system (from the packing instructions, for example).
    Regards,
    Rajesh Banka
    Reward points if helpful.

  • Handling Unit number

    Hi Gurus,
                 How handling unit number selection happens in delivery document?
    Does system determines this number automatically? If so from which table?
    Thank you
    ANil

    Hi Anil,
    Handling Unit Management
    The SAP HU is used for tracking the handling units used by the materials.  Some common handling units are packagings materials like cartons, pallets etc.
    In the SAP system, the handling unit (HU) expands on the shipping unit. Handling units can be nested and you can also create new handling units from several handling units as often as you like. At the material item level, HUs contain the complete material identification, the quantity, and, in the case of serial numbers, the respective object list. Handling units have unique,
    scannable identification numbers that can be developed according to standards such as EAN 128 or SSCC.
    Handling units contain all inventory management information of the materials they contain that are maintained in Inventory Management. There are also status messages that you can call up at any time that indicate whether a handling unit is only planned or if the ship-to party has been notified of the arrival of this handling unit, or whether it is in the warehouse or has already been posted to goods issue. The integrated history function also records each business process in
    the life cycle of each handling unit, meaning that you can track the handling unit's path and development at any time.
    Refer to : Logistics -> Central Functions -> Handling Unit Management
    In HU-managed storage locations, all goods movements are executed through the specification of the respective HUs, and Inventory Management is performed through the handling units. If you are working without HU-managed storage locations, you can work with handling units (without stock information) as before in the delivery and in the shipment.
    In HU-managed storage locations, materials can be managed in HUs only. Mixed stock made up of packed and non-packed materials within the same storage location are not supported. HUs can also be managed in interim storage types. Unpacking a material from a HU means that the stock of the material is posted to a storage location that is not HU-managed.
    If you call up normal material movements in connection with an HU-managed storage location, a delivery is created, rather than a direct material posting, which has been the procedure up to now.
    Please note that if you want to use 311 to move the material already in stock, but in a non HUM Storage Location and you want to transfer those materials into a HUM Storage Location 304.  If this is the case you can use the transaction VLMOVE with the destination plant and storage location. Before that you have to create the HU with the transaction code HU02 Storage location: where the material is and the status: in stock.
    Handling units are unique at client level in at least one system. Using an indicator at client level, you can control whether you are going to work with the HU functions. Since the handling unit is a physical unit, the central logistics processes are controlled through the input of the handling unit identification. These processes include putaway, picking, and stock transfers, as well as goods receipts and goods issues.
    A handling unit's mobility can be limited if quality checks are active. Changes in the stock category caused by a quality inspection are made using a posting change in the handling unit.
    There is also a report available that you can use to find and display handling units using different selection criteria such as material, packing instruction, or storage location.
    Although the handling unit is basically a unit that remains constant in the system, you can change it by repacking the materials it contains. All the packing functions, such as packing, repacking, and unpacking, are completely supported by the handling unit functionality. In this way, handling units can be created in production, during goods receipt, or in the packing areas of the warehouse. If you have automatic packing, the handling unit is created from the packaging proposals defined in the system (from the packing instructions, for example).
    Please Reward If Really Helpful,
    Thanks and Regards,
    Sateesh.Kandula

  • Configuration of external handling unit number range

    Hello everyone,
    I am working on a project that includes receiving of handling units from outside of our SAP system in EAN128 format, and am running into some challenges in setting up an appropriate external handling unit number range.  The process will involve creation of an inbound delivery from an advance ship notice, with the delivery to then be packed based upon handling unit information in the ASN.  I have set up an external number range interval in the number range object that is being used for generation of internal handling unit numbers, with the external interval being outside the range of the existing internal intervals.  When the ASN is posted, the inbound delivery is created but cannot be packed (status 52), and I get a message stating "The check digit of SSCC 10000001000001648 is incorrect. 5 is correct" (just using this number as an example).  In this case, the HU number actually had a leading zero, and changing the sample HU to start with a 5 results in the same message but stating that 0 is correct, which is kind of maddening.  The bottom line is that I have not configured an external number range before for handling units and am clearly missing something here.  Has somebody set this up successfully and can share your experience, or can point me to some good documentation?  I am searching OSS, the Business Process Expert Community, and the overall web in general and am not finding any relevant information.

    Per your info,
    in std, You cant maintain HU number ranges with respect to year.
    Still if you want to maintain, You have to use Userexit for Number ranges.
    Generally, all sales documents number ranges are not year specific . ONly FI documents are year specific.
    Why you want to have Year specific number ranges for HU's? - It is nothing to do with Year.
    Convince your client, This year dependant HU number ranges doesnt carry any value addition. Still client insists, only way to achieve this is "USEREXIT_NUMBER_RANGE"
    hope it helps

  • Provide information about handling units

    Plz provide information about handling units. Explain all the paths and information about HU.

    Hi,
    Purpose
    You can use Handling Unit Management (HUM) to reflect packing-based logistics structures in the SAP System. Using this method, you track the movements of entire handling units and the materials they contain rather than tracking each material individually.
    When you base logistics processes on handling units, goods movements processing is made easier, which in turn optimizes all logistics operations. This simplified processing includes the existing packing function in shipping and warehouse processing in the Warehouse Management system, which is expanded here.
    Features
    In the system, the handling unit (HU) expands on the shipping unit. Handling units can be nested, which means that you can create new handling units from several handling units as often as you like. At the material item level, HUs contain the complete material identification, the quantity, and, in the case of serial numbers, the respective object list. Handling units have unique, scannable identification numbers that can be developed according to standards such as EAN 128 or SSCC.
    Handling units contain all inventory management information of the materials they contain that are maintained in Inventory Management. There are also status messages that you can call up at any time that indicate whether a handling unit is only planned or if the ship-to party has been notified of the arrival of this handling unit, or whether it is in the warehouse or has already been posted to goods issue. The integrated history function also records each business process in the life cycle of each handling unit, meaning that you can track the handling unit’s path and development at any time.
    In HU-managed storage locations, all goods movements are executed through the specification of the respective HUs, and Inventory Management is performed through the handling units. If you are not working with HU-managed storage locations, you can use handling units (without stock information) as before in the delivery and in the shipment.
    In HU-managed storage locations, materials can be managed in HUs only. Mixed stock (stock made up of packed and non-packed materials within the same storage location) is not supported. HUs can also be managed in interim storage types. Unpacking a material from an HU means that the stock of the material is posted to a storage location that is not HU-managed.
    If you call up normal material movements in connection with an HU-managed storage location, a delivery is created, rather than a direct material posting, which has been the procedure up to this point.
    Handling units are unique at client level in at least one system. Using an indicator at client level (see Unique Identification of Handling Units), you can control whether you are going to work with the HU functions. Since the handling unit is a physical unit, the central logistics processes are controlled through the input of the handling unit identification. These processes include putaway, picking, and stock transfers, as well as goods receipts and goods issues.
    A handling unit’s mobility can be limited if quality checks are active. Changes in the stock category caused by a quality inspection are made using a posting change in the handling unit.
    There is also a report available that you can use to find and display handling units using different selection criteria such as material, packing instruction, or storage location.
    Although the handling unit is basically a unit that remains constant in the system, you can change it by repacking the materials it contains. All the packing functions, such as packing, repacking, and unpacking, are completely supported by the handling unit function. In this way, handling units can be created in production, during goods receipt, or in the packing areas of the warehouse. If you have automatic packing, the handling unit is created from the packing proposals defined in the system (from the packing instructions, for example).
    Regards
    Adarsh Mathur

  • Batch management & Handling unit management?

    Dear Expert,
    could you explain Batch management & Handling unit management?
    thanks
    saravanakumar.

    <b>HU:</b>
    The SAP HU is used for tracking the handling units used by the materials.  Some common handling units are packagings materials like cartons, pallets etc.
    In the SAP system, the handling unit (HU) expands on the shipping unit. Handling units can be nested and you can also create new handling units from several handling units as often as you like. At the material item level, HUs contain the complete material identification, the quantity, and, in the case of serial numbers, the respective object list. Handling units have unique,
    scannable identification numbers that can be developed according to standards such as EAN 128 or SSCC.
    Handling units contain all inventory management information of the materials they contain that are maintained in Inventory Management. There are also status messages that you can call up at any time that indicate whether a handling unit is only planned or if the ship-to party has been notified of the arrival of this handling unit, or whether it is in the warehouse or has already been posted to goods issue. The integrated history function also records each business process in
    the life cycle of each handling unit, meaning that you can track the handling unit’s path and development at any time.
    Refer to : Logistics -> Central Functions -> Handling Unit Management
    In HU-managed storage locations, all goods movements are executed through the specification of the respective HUs, and Inventory Management is performed through the handling units. If you are working without HU-managed storage locations, you can work with handling units (without stock information) as before in the delivery and in the shipment.
    In HU-managed storage locations, materials can be managed in HUs only. Mixed stock made up of packed and non-packed materials within the same storage location are not supported. HUs can also be managed in interim storage types. Unpacking a material from a HU means that the stock of the material is posted to a storage location that is not HU-managed.
    If you call up normal material movements in connection with an HU-managed storage location, a delivery is created, rather than a direct material posting, which has been the procedure up to now.
    Please note that if you want to use 311 to move the material already in stock, but in a non HUM Storage Location and you want to transfer those materials into a HUM Storage Location 304.  If this is the case you can use the transaction VLMOVE with the destination plant and storage location. Before that you have to create the HU with the transaction code HU02 Storage location: where the material is and the status: in stock.
    Handling units are unique at client level in at least one system. Using an indicator at client level, you can control whether you are going to work with the HU functions. Since the handling unit is a physical unit, the central logistics processes are controlled through the input of the handling unit identification. These processes include putaway, picking, and stock transfers, as well as goods receipts and goods issues.
    A handling unit’s mobility can be limited if quality checks are active. Changes in the stock category caused by a quality inspection are made using a posting change in the handling unit.
    There is also a report available that you can use to find and display handling units using different selection criteria such as material, packing instruction, or storage location.
    Although the handling unit is basically a unit that remains constant in the system, you can change it by repacking the materials it contains. All the packing functions, such as packing, repacking, and unpacking, are completely supported by the handling unit functionality. In this way, handling units can be created in production, during goods receipt, or in the packing areas of the warehouse. If you have automatic packing, the handling unit is created from the packaging proposals defined in the system (from the packing instructions, for example).
    For more help follow the link
    http://www.sap-img.com/shop/sap-handling-unit-management-configurations.htm
    Batch:
    In various industries – particularly the process industry – you have to work with homogenous partial quantities of a material or product throughout the logistics quantity and value chain.
    There are various reasons for this:
    Legal requirements (for example, the guidelines set out by GMP (Good Manufacturing Practice) or regulations on hazardous material
    Defect tracing, callback activities, and regression requirement
    The need for differentiated quantity-and value-based Inventory Management (for example, due to heterogeneous yield/result qualities or varying constituents in Production.
    Differences in usage and the monitoring thereof in materials planning in SD and Production.
    Production or procedural requirements (for example, settlement of material quantities on the basis of different batch specifications).
    For more help you have to refer the SAP help

  • External Handling Unit (Barcode) Information is Missing

    Hello Folks,
    I got a requirement where a warehouse will send us an EDI 945 file to confirm the shipment completion. But, it send us the file without SSCC labels for those shipped items of the order. This 945 is being translated into a SHPCON IDOC(DELVRY03) which doesn't contain the E1EDL37(Handling unit header). This IDOC is failing in status 51 with the error message: External Handling Unit (Barcode) Information is Missing.
    What should be done to get this IDOC posted sucessfully even if it doesn't contain the SSCC label? Is there any setting that should be changed for this customer to not to look for SSCC labels(External Handling unit).
    Thanks for your help,
    Siva

    This could be because of custom code. Check the exits in inbound FM and you should find out the root cause. Standard SAP doesn't check for customer level SSCC checks. If it gets the HU's from 3PL, it'll pack it such way. If it doesn't, it'll pack is the usual way.

  • Attachments to Notifications - using "Services for Object"

    Hi All,
    I have sucessfully created a VC application (7.0 sp13) to create a General Notification in R/3
    using the BAPI -  IQS4_CREATE_NOTIFICATION
    Our users in R/3 4.7 use the button in the Top Left Hand corner of the Screen "Services for Object"
    to attach MS Word documents to Notifcations. Using the Create Attachment option from the Services for Object toolbar that pops up when the button is clicked.
    Has anyone else tried this or have any advice on how this can be done in VC - if you can recommend a BAPI that I can try or will this be a custom ABAP BAPI.
    Thanks in advance for any advice you can offer.
    - Robert

    FUNCTION z_pm_attachment_and_url.
    *"*"Interface local:
    *"  IMPORTING
    *"     VALUE(I_QMNUM) TYPE  QMNUM OPTIONAL
    *"     VALUE(I_AUFNR) TYPE  AUFNR OPTIONAL
    *"     VALUE(I_URL) TYPE  SO_URL OPTIONAL
    *"     VALUE(I_FILE) TYPE  ZPMCT002 OPTIONAL
    *"     VALUE(I_FILENAME) TYPE  STRING OPTIONAL
    *"  TABLES
    *"      T_RETURN STRUCTURE  BAPIRET2
    * Objetos locais
      DATA:
        vl_url         TYPE so_url,
        vl_path        TYPE string,                             "#EC NEEDED
        vl_loopc       TYPE sy-loopc,
        vl_lines       TYPE sy-loopc,
        vl_filename    TYPE string,
        vl_filelength  TYPE i,
        it_url         TYPE STANDARD TABLE OF sood-objdes,
        it_obj_cont    TYPE STANDARD TABLE OF solix,
        wa_obj         TYPE borident,
        wa_obj_cont    TYPE soli,
        wa_obj_data    TYPE sood1,
        wa_folder_id   TYPE soodk,
        wa_document_id TYPE sofmk.
      DEFINE valida_retorno.
        loop at t_return into t_return.
          if t_return-type eq zgtpm_e.
            exit.
          endif.
        endloop.
        if t_return-type eq zgtpm_e.
          exit.
        endif.
      END-OF-DEFINITION.
    * === Valida parâmetros de entrada
      IF i_qmnum IS INITIAL AND i_aufnr IS INITIAL.
    *   Nenhum objeto informado: Informe Nota ou Ordem de Manutenção
        PERFORM mensagem_retorno_tab
        USING
          'ZPM_PORTAL' zgtpm_e '055' '' '' '' ''
        CHANGING
          t_return[].
        EXIT.
      ELSEIF NOT i_qmnum IS INITIAL AND NOT i_aufnr IS INITIAL.
    *   Informe apenas um objeto: Nota ou Ordem de Manutenção
        PERFORM mensagem_retorno_tab
        USING
          'ZPM_PORTAL' zgtpm_e '054' '' '' '' ''
        CHANGING
          t_return[].
        EXIT.
      ENDIF.
      IF  i_url IS INITIAL
      AND i_filename IS INITIAL.
    *   Informe Anexo e/ou URL
        PERFORM mensagem_retorno_tab
        USING
          'ZPM_PORTAL' zgtpm_e '060' '' '' '' ''
        CHANGING
          t_return[].
        EXIT.
      ENDIF.
    * === Define Categoria de objeto
      IF NOT i_qmnum IS INITIAL.
        wa_obj-objkey  = i_qmnum.
        wa_obj-objtype = 'BUS2038'. " Nota PM
      ENDIF.
      IF NOT i_aufnr IS INITIAL.
        wa_obj-objkey  = i_aufnr.
        wa_obj-objtype = 'BUS2007'. " Ordem de manutenção
      ENDIF.
    * === Anexo
      IF NOT i_filename IS INITIAL.
    *   Conteúdo do arquivo
        IF NOT i_file[] IS INITIAL.
          it_obj_cont[] = i_file[].
          DESCRIBE TABLE it_obj_cont LINES vl_lines.
          READ TABLE it_obj_cont INTO wa_obj_cont INDEX vl_lines.
          vl_filelength =
            ( 255 * ( vl_lines - 1 ) ) + STRLEN( wa_obj_cont ).
        ELSE.
          CALL FUNCTION 'GUI_UPLOAD'
               EXPORTING
                    filename                = i_filename
                    filetype                = 'BIN'
               IMPORTING
                    filelength              = vl_filelength
               TABLES
                    data_tab                = it_obj_cont
               EXCEPTIONS
                    file_open_error         = 1
                    file_read_error         = 2
                    no_batch                = 3
                    gui_refuse_filetransfer = 4
                    invalid_type            = 5
                    no_authority            = 6
                    unknown_error           = 7
                    bad_data_format         = 8
                    header_not_allowed      = 9
                    separator_not_allowed   = 10
                    header_too_long         = 11
                    unknown_dp_error        = 12
                    access_denied           = 13
                    dp_out_of_memory        = 14
                    disk_full               = 15
                    dp_timeout              = 16
                    OTHERS                  = 17.
          IF sy-subrc <> 0.
            PERFORM mensagem_retorno_tab
            USING
             sy-msgid sy-msgty sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
            CHANGING
              t_return[].
            EXIT.
          ENDIF.
        ENDIF.
    *   Pasta de Destino
        PERFORM get_folder CHANGING wa_folder_id t_return[].
        valida_retorno.
    *   SAPoffice: definição do objeto, modificar atributos
        wa_obj_data-objla  = sy-langu.      " Idioma
        wa_obj_data-objsns = 'O'.           " Objeto confidencial
        wa_obj_data-objlen = vl_filelength. " Tamanho conteúdo documento
        wa_obj_data-ownnam = sy-uname.      " Nome proprietário
        CALL METHOD cl_report_viewer=>split_path_filename
        EXPORTING
          i_filename = i_filename
        IMPORTING
          e_path     = vl_path
          e_filename = vl_filename.
        SPLIT vl_filename AT '.' INTO
          wa_obj_data-objdes    " Descrição breve do conteúdo
          wa_obj_data-file_ext. " Extensão de file de uma aplicação PC
        CONDENSE wa_obj_data-file_ext NO-GAPS.
    *   Insere Objeto (Anexo)
        PERFORM object_insert
        USING
          'EXT' " Anexo
          wa_obj_data
          wa_folder_id
          it_obj_cont
        CHANGING
          wa_document_id
          t_return[].
        valida_retorno.
    *   Relacionamento Objeto PM x Anexo
        PERFORM relation_create
        USING
          'ATTA'
          wa_obj
          wa_document_id
        CHANGING
          t_return[].
        valida_retorno.
      ENDIF.
    * === URL
      IF NOT i_url IS INITIAL.
    *   Inicializa estruturas comuns a Anexo e URL
        CLEAR:
          it_obj_cont,
          wa_obj_cont,
          wa_obj_data,
          wa_folder_id,
          wa_document_id.
    *   Conteúdo da URL
        MOVE i_url TO vl_url.
        WHILE NOT vl_url IS INITIAL.
          CONCATENATE '&KEY&' vl_url(250) INTO wa_obj_cont.
          APPEND wa_obj_cont TO it_obj_cont.
          SHIFT vl_url LEFT BY 250 PLACES.
        ENDWHILE.
    *   Pasta de Destino
        PERFORM get_folder CHANGING wa_folder_id t_return[].
        valida_retorno.
    *   SAPoffice: definição do objeto, modificar atributos
        wa_obj_data-objla  = sy-langu. " Idioma
        wa_obj_data-objsns = 'O'.      " Objeto confidencial
        wa_obj_data-ownnam = sy-uname. " Nome proprietário
        SPLIT i_url AT '/' INTO TABLE it_url.
        DESCRIBE TABLE it_url LINES vl_loopc.
        READ TABLE it_url INDEX vl_loopc
        INTO wa_obj_data-objdes. " Descrição breve do conteúdo
    *   Insere Objeto (URL)
        PERFORM object_insert
        USING
          'URL'  " Link Inter/Intranet
          wa_obj_data
          wa_folder_id
          it_obj_cont
        CHANGING
          wa_document_id
          t_return[].
        valida_retorno.
    *   Relacionamento Objeto PM x URL
        PERFORM relation_create
        USING
          'URL'
          wa_obj
          wa_document_id
        CHANGING
          t_return[].
        valida_retorno.
      ENDIF.
    * === Libera objetos locais
      FREE:
        vl_url,
        vl_path,
        vl_loopc,
        vl_lines,
        vl_filename,
        vl_filelength,
        it_url,
        it_obj_cont,
        wa_obj,
        wa_obj_cont,
        wa_obj_data,
        wa_folder_id,
        wa_document_id.
    ENDFUNCTION.
    ***INCLUDE LZGPM0010F01 .
    *&      Form  mensagem_retorno_tab
      FORM mensagem_retorno_tab
      USING
        p_msgid TYPE symsgid
        p_msgty TYPE symsgty
        p_msgno TYPE symsgno
        p_msgv1 TYPE any
        p_msgv2 TYPE any
        p_msgv3 TYPE any
        p_msgv4 TYPE any
      CHANGING
        t_return TYPE ty_return.
        DATA:
          vl_msgty  TYPE symsgty,
          wa_return LIKE LINE OF t_return.
        IF p_msgty IS INITIAL.
          MOVE zgtpm_e TO vl_msgty.
        ELSE.
          MOVE p_msgty TO vl_msgty.
        ENDIF.
        IF p_msgno IS INITIAL.
          EXIT.
        ENDIF.
        MOVE p_msgid  TO wa_return-id.
        MOVE vl_msgty TO wa_return-type.
        MOVE p_msgno  TO wa_return-number.
        MOVE p_msgv1  TO wa_return-message_v1.
        MOVE p_msgv2  TO wa_return-message_v2.
        MOVE p_msgv3  TO wa_return-message_v3.
        MOVE p_msgv4  TO wa_return-message_v4.
        MESSAGE ID p_msgid TYPE vl_msgty NUMBER p_msgno
        WITH p_msgv1 p_msgv2 p_msgv3 p_msgv4
        INTO wa_return-message.
        APPEND wa_return TO t_return.
        FREE: vl_msgty, wa_return.
      ENDFORM.                    " mensagem_retorno_tab
    *&      Form  get_folder
      FORM get_folder
      CHANGING
        w_folder_id TYPE soodk
        t_return TYPE ty_return.
        CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
             EXPORTING
                  region    = 'B'  " ?
             IMPORTING
                  folder_id = w_folder_id
             EXCEPTIONS
                  OTHERS    = 1.
        IF sy-subrc <> 0.
          PERFORM mensagem_retorno_tab
          USING
           sy-msgid sy-msgty sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
          CHANGING
            t_return[].
        ENDIF.
      ENDFORM.                    " get_folder
    *&      Form  object_insert
      FORM object_insert USING
        p_objtp     TYPE so_obj_tp
        w_obj_data  TYPE sood1
        w_folder_id TYPE soodk
        t_obj_cont  TYPE zpmct002
      CHANGING
        w_document_id TYPE sofmk
        t_return      TYPE ty_return.
    *   Objetos locais
        DATA:
          it_objcont  TYPE STANDARD TABLE OF soli,
          it_obj_head TYPE STANDARD TABLE OF soli,
          wa_obj_id   TYPE soodk,
          wa_obj_cont LIKE LINE OF t_obj_cont.
    *   RAW to CHAR
        LOOP AT t_obj_cont INTO wa_obj_cont.
          APPEND wa_obj_cont TO it_objcont.
          CLEAR wa_obj_cont.
        ENDLOOP.
    *   Insere objeto
        CALL FUNCTION 'SO_OBJECT_INSERT'
             EXPORTING
                  folder_id                  = w_folder_id
                  object_type                = p_objtp
                  object_hd_change           = w_obj_data
                  owner                      = sy-uname
             IMPORTING
                  object_id                  = wa_obj_id
             TABLES
                  objhead                    = it_obj_head
                  objcont                    = it_objcont
             EXCEPTIONS
                  active_user_not_exist      = 1
                  communication_failure      = 2
                  component_not_available    = 3
                  dl_name_exist              = 4
                  folder_not_exist           = 5
                  folder_no_authorization    = 6
                  object_type_not_exist      = 7
                  operation_no_authorization = 8
                  owner_not_exist            = 9
                  parameter_error            = 10
                  substitute_not_active      = 11
                  substitute_not_defined     = 12
                  system_failure             = 13
                  x_error                    = 14
                  OTHERS                     = 15.
        IF sy-subrc = 0.
          w_document_id-foltp = w_folder_id-objtp.
          w_document_id-folyr = w_folder_id-objyr.
          w_document_id-folno = w_folder_id-objno.
          w_document_id-doctp = wa_obj_id-objtp.
          w_document_id-docyr = wa_obj_id-objyr.
          w_document_id-docno = wa_obj_id-objno.
        ELSE.
          PERFORM mensagem_retorno_tab
          USING
           sy-msgid sy-msgty sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
          CHANGING
            t_return[].
        ENDIF.
    *   Libera objetos locais
        FREE:it_objcont, it_obj_head, wa_obj_id, wa_obj_cont.
      ENDFORM.                    " object_insert
    *&      Form  relation_create
      FORM relation_create
      USING
        p_relationtype TYPE binreltyp
        w_obj          TYPE borident
        w_document_id  TYPE sofmk
      CHANGING
        t_return TYPE ty_return.
        DATA wa_doc TYPE borident.
        wa_doc-objtype = 'MESSAGE'.
        CASE p_relationtype.
          WHEN 'ATTA'.
            wa_doc-objkey  = w_document_id(34).
          WHEN 'URL'.
            wa_doc-objkey  = w_document_id.
          WHEN OTHERS.
        ENDCASE.
        CALL FUNCTION 'BINARY_RELATION_CREATE'
             EXPORTING
                  obj_rolea      = w_obj
                  obj_roleb      = wa_doc
                  relationtype   = p_relationtype
             EXCEPTIONS
                  no_model       = 1
                  internal_error = 2
                  unknown        = 3
                  OTHERS         = 4.
        IF sy-subrc = 0.
          COMMIT WORK AND WAIT.
          CASE p_relationtype.
            WHEN 'ATTA'.
    *         O anexo foi criado com êxito
              PERFORM mensagem_retorno_tab
              USING
                'SGOS_MSG' zgtpm_s '043' '' '' '' ''
              CHANGING
                t_return[].
            WHEN 'URL'.
    *         A URL foi criada com êxito
              PERFORM mensagem_retorno_tab
              USING
                'ZPM_PORTAL' zgtpm_s '059' '' '' '' ''
              CHANGING
                t_return[].
            WHEN OTHERS.
          ENDCASE.
        ELSE.
          PERFORM mensagem_retorno_tab
          USING
           sy-msgid sy-msgty sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
          CHANGING
            t_return[].
        ENDIF.
        FREE wa_doc.
      ENDFORM.                    " relation_create
    Edited by: Fabrício Alves Vieira on Apr 8, 2008 3:08 PM

Maybe you are looking for