G_SET_TREE_GENERATE Appending items to hierarchy

Hello,
I'm searching for a way to append some items to an existing hierarchy in controlling.
Using G_SET_TREE_GENERATE will delete all existing items in the hierarchy I want to update, whereas I want to add something.
If it's an unknown leaf it should be created, otherwise items should be added to the existing leaf.
Is there another possibility than inserting directly into table SETLEAF?
Regards
Mathias

Ralf
GL will be picked based on the setting "Determ of GL for Prod categories...".
If there is default prod category set then system picks the corresponding GL maintained in above config.
If there is no default prod category set then no GL will be picked as default because system checks prod category for GL account.
Default settings for items in shopping cart screen are only to allow users maintain their default values like Prod category, co code, location if there are multiple values available. (ie if user is responsible for multiple entities.) You cannot maintain defualt GL in that screen as GL will be determined by the prod category defaulted.
Hope I answered your question. If not please let me know.
PS : Reward points if helpful.
Regards
Jagadish

Similar Messages

  • SAP Report Painter - SAP tables for report items and hierarchy

    Hello,
    can you pls. help me with an information about the list of SAP tables for Report Painter, particularly the tables where the report items/positions and report hierarchy are stored?
    for example, for the Report Writer report items and report hierarchy can be found in T8* tables.
    What are these tables for Report Painter?
    thank you in advance for any info.
    Regards,
    Jasminka
    Edited by: Jasminka Vlahovic on Dec 29, 2010 8:53 PM

    Hi  Jasminika ,
    Could you please share with me those tables names where report items  and hierarchy are saved
    Regards
    Neeraj

  • Appending Items to Forms and their IDs

    Can anyone here share how to catch the ID of the appended item to a form and store it in an array. After which I store it in an array, i will call the delete() function through out the elements of an array to clear the contents of a form.
    I'm trying to do a deleteAll() implementation in MIDP 1.0.

    Thanks.
    I somehow sorted the issue... The thing is (or was) that the "SCREEN" option doesnt work in forms.
    But now i got a new set of problems...
    a]
    If i select printer, the system sends the print to the default printer of the SERVER!!!.
    1) How do i send the print to the user's client machine?
    2) How do i allow the user to select the printer? Local or Network. Since D2KWUTIL is not there I cannot use SELECT_PRINTER. How do i give my client this option?
    b]
    The print to file option works fine...but again stores the file on the server. How do i get it to work for the client?
    Thanks,
    Hema

  • Append Items to Closed PO

    Hi
    Our Client has a request to be able to append Items to Closed PO.
    Kedalene Chong

    Hi,
    I don't think we can add additional fields to the existing TAB but we have an option of adding custom fields to the Custom tab that can be added to the ITEM level.
    You can use BADI MRM_ITEM_CUSTFIELDS for adding custom fields at item level.
    If you have any queries you can revert.
    Regards,
    Deepak.

  • Main item and Hierarchy level items in SAP EWM

    We use ERP SAP AFS and EWM 9.1
    ERP sales order 20000 - 5PCS ( Different grid values chosen and delivery is distrubuted to EWM)
    Outbound delivery order contains main item and corresponding SKU displayed with Grid values like Color, Cup and Size. (Hierarchy Level)
    20000
    20000-0001A30
    20000-0001A32
    20000-0001C34
    20000-0001B36
    20000-0001D38
    We create Warehouse tasks for SKU items ( Items 60,70,80,90,100) for picking.
    I need to process VAS activites for this.
    Price labeling and putting on plastic bag for all SKU's ( 2 VAS activity).
    I have maintained packaging specification and tried to process it.
    But here I get an error in VAS order. Because WR Qty from ODO to VAS order is not copied. It is getting deleted at the time of VAS order creation.
    Then I tried to maintain the packaging specification for item 20000 (main item) and process the VAS order. Here VAS order got created and WR Qty also displayed.
    But Picking Warehouse tasks are created for SKU items not for main items. In this case I am not able to process it also.
    Packaging specification for main item or SKU item I should consider? If it is for SKU , need to have lot of master data. Is there any link i can make maintaining packspec for main item and process the warehouse tasks for SKU.
    Which way i have to go now?
    Any suggestion please
    Please ask me if you need more inputs

    Hi Jobi,
    I agree to Juergen, you'll need individual pack specs per subitem in order to process VAS on this level. Did you think of using batches and depending characteristics for the grid values? This is how EWM for Fashion works. Then you could define only VAS pack spec for multiple grid values.
    Best regards,
    Christian
    Remark: did you consider EWM for Fashion for your implementation?

  • Urgent: How to append Item text

    HI Friends,
    I am using SAVE_TEXT Fm to Update the Item text in ME22n.
    Currently i need to append few text to the already existing text using SAVE_TEXT is it possible . If it is possible please give some text.
    Is there any FM which can both append and update Item text please help me with that.
    Reward is sure.
    Thanks,
    Sanjeet

    First read text using read_text FM ,keep the data in internal table,now delete the text using delete_text FM.
    Now you have data in internal table and append your text to this internal table,now use save_text fm to update everything.
    Thanks
    seshu

  • Financial Statement Item - 0GLACCEXT hierarchy in Query

    Hi,
    I have loaded the Financial Statement Item hierarchy(0GLACCEXT_T011_HIER ) in to BI from R/3. I have made it as an infoprovider & included it in the multiprovider along with the GL Line items cube (other I/Os are also there). Next what all do I need to do for that to appear in the reports? That hierarchy selection in the query I have done but unable to expand the hierarchy!
    Thanks,
    Shreesh.

    Hello Padel,
    Be sure you take care of I_PACKAGESIZE parameter.
    If volume of data is less than I_PACKAGESIZE, it's OK. If volume of data is greater than I_PACKAGESIZE, You won't see any data. In this case, your function module has to produce data packets of size I_PACKAGESIZE.
    Hope it helps.

  • Sort items in hierarchy

    Oracle BI 11g
    Hi!
    I have time-hierarchy: Total - Year - Month - Week - Date
    In each level of hierarchy i have 2 keys - ID and Name (for example, year_id, year_name, month_id, month_name, etc.)
    IDs are the primary keys for each level and Names are columns for display (for example, month_name = Jan, Feb, March....)
    But when I add hierarchy in Analyis, I see that months are sorted in alphabetic order - April, December, February, January etc. But I want to order them by MonthID - Jan, Feb, March, .... How can I do this?

    Hi,
    In BMM layer click on month column under time dim table and select sort order column as month number so that months get sorted.
    Regards,
    Srikanth

  • Building Tree hierarchy Using nested loops and class cl_gui_column_tree

    Hello gurus,
    I want to create a tree report using custom container and class cl_gui_column_tree. I have read and understood the standard demo report which SAP has provided i.e. SAPCOLUMN_TREE_CONTROL_DEMO. But in this report all the levels nodes are created as constants and hardcoded. I want to create hierarchy using nested loops. For this i took one example of a hierarchy of VBAK-VBELN->VBAP-POSNR Like One sales order has many line items and each line item can have number of line items in billing plan.
    I have done some coding for it.
    FORM build_tree USING node_table TYPE treev_ntab
                                           item_table TYPE zitem_table.              " i created the zitem_table table type of mtreeitm in SE11.
      DATA: node TYPE treev_node,
                 item TYPE mtreeitm.
      node-node_key = root.
      CLEAR node-relatkey.
      CLEAR node-relatship.
      node-hidden = ' '.
      node-disabled = ' '.
      CLEAR node-n_image.
      CLEAR node-exp_image.
      node-isfolder = 'X'.
      node-expander = 'X'.
      APPEND node TO node_table.
      item-node_key = root.
      item-item_name = colm1.
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = 'Root'.
      APPEND item TO item_table.
      item-node_key = root.
      item-item_name = colm2.
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = 'Amount'.
      APPEND item TO item_table.
      LOOP AT it_vbeln INTO wa_vbeln.
        node-node_key = wa_vbeln-vbeln.
        node-relatkey = root.
        node-relatship = cl_gui_column_tree=>relat_last_child.
        node-hidden = ' '.
        node-disabled = ' '.
        CLEAR node-n_image.
        CLEAR node-exp_image.
        node-isfolder = 'X'.
        node-expander = 'X'.
        APPEND node TO node_table.
        item-node_key = wa_vbeln-vbeln.
        item-item_name = colm1.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_vbeln-vbeln.
        APPEND item TO item_table.
        item-node_key = wa_vbeln-vbeln.
        item-item_name = colm2.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_vbeln-netwr.
        APPEND item TO item_table.
        LOOP AT it_posnr INTO wa_posnr.
        node-node_key = wa_posnr-posnr.
        node-relatkey = wa_vbeln-vbeln.
        node-relatship = cl_gui_column_tree=>relat_last_child.
        node-hidden = ' '.
        node-disabled = ' '.
        CLEAR node-n_image.
        CLEAR node-exp_image.
        node-isfolder = ' '.
        node-expander = ' '.
        APPEND node TO node_table.
        item-node_key = wa_posnr-posnr.
        item-item_name = colm1.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_posnr-posnr.
        APPEND item TO item_table.
        item-node_key = wa_posnr-posnr.
        item-item_name = colm2.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_posnr-netpr.
        APPEND item TO item_table.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.
    Now this program compiles fine and runs till there is only one level. That is root->vbeln. But when i add one more loop of it_posnr it gives me runtime error of message type 'X'. The problem i found was uniqueness of item-item_name as all the sales order have posnr = 0010. What could be done? I tried giving item_name unique hierarchy level using counters just like stufe field in prps eg. 10.10.10, 10.10.20,10.20.10,10.20.20,20.10.10 etc.. etc.. but still i am getting runtime error when i add one more hierarchy using nested loop. Plz guide.
    Edited by: Yayati6260 on Jul 14, 2011 7:25 AM

    Hello all,
    Thanks the issue is solved. The node key was not getting a unique identification as nodekey. I resolved the issue by generating unique identification for each level. Thanks all,
    Regards
    Yayati Ekbote

  • Error while loading the Hierarchy to 0GLACCEXT

    Dear all ,
    I am trying to load a hierarchy ZEM 1 that is manually created in R/3. when I am executing the Infopackage its showing an Error that
    1.Record 8 :Node characteristic 0GL_ACCOUNT is not entered as hierarchy characteristic for 0GLACCEXT
    2.Too many error records - update terminated
    and what is the the concept of 0BAL_DPEND to be added as attribute to OGLACCEXT.
    Thanks

    Hi Dash ,
    I am providing the long test for the error ...Also can you tell me how I should use 0BAL_DPEND field as an attribute of Hieararchy of 0GLACCEXT. Coz i am supposed to do this
    <u>Hierarchy for Characteristic 0GLACCEXT with Attribute 0BAL_DEPEND
    The hierarchy for characteristic 0GLACCEXT is used as the financial statement version in BW queries. To technically enable the particular exception aggregation for contra items, the hierarchy table of characteristic 0GLACCEXT contains the attribute Balance-Dependency of a Hierarchy Node (technical name 0BAL_DEPEND).</u>
    The Long Error Message
    Diagnosis
        The nodes NODEID = [00000194, 00001627 ] have the same node names
        NODENAME = '10000000950090 '. This is not allowed because neither node
        is a leaf and both nodes are assigned to the same characteristic
        0GL_ACCOUNT .
        Note that a maximum of 50 characters is available for message variables.
        The node name NODENAME = '10000000950090 ' might not be displayed in its
        full length.
    System Response
    Procedure
        Try to localize the problem. If the hierarchy is loaded from an SAP
        source system, you can check whether the extracted data is correct by
    executing transaction RSA3 in the source system. If necessary, check if
    the data is modified with a user exit. If the hierarchy is loaded from a
    file, check the contents of this file. The problem might also be due to
    an error in the transfer rules or in the transformation.
    You can identify the two duplicate nodes from the values for the node ID
    NODEID = [00000194, 00001627 ].
    The problem can be caused by identical nodes delivered more than once
    from the source. It is also possible that incorrect values for
    parameters such as the node name NODENAME or validity period [DATEFROM,
    DATETO] are the cause of the problem.
    First check if the value for node name NODENAME = '10000000950090 ' is
    correct. The node name consists of the characteristic value for the
    hierarchy basic characteristic and the characteristic values of all the
    characteristics compounded to this characteristic. Errors creating the
    node name often result in duplicate nodes. This problem also occurs if
    the node names of all nodes are initial.
    If the structure of the hierarchy is defined as time-dependent, the time
    validity of a node can be restricted with the fields DATEFROM and
    DATETO. Duplicate nodes generally do not occur if the validity intervals
    of two nodes do not overlap in time. In this case check if the fields
    DATEFROM and DATETO are correctly filled.
    In this case the duplicate nodes are not leaves. If you want to reuse an
    existing subtree at another location in the hierarchy, you can refer to
    this subtree with a link node. Possibly one of the two duplicate nodes
    were incorrectly not marked as link nodes.
    please Suggest What to do

  • BAPI FOR Deleting a Schedule Line Item from EKES and EKET tables

    Dear All,
    I would like to for deleting one of the line item from EKES (Po Confirmation ) and the respective line item from the EKET(PO Schedule Line Item Table).
    Assume that am allowing the user to select the lineitem from zprogram screen and collecting the PO and Its LIne Item details in an internal table.
    Can i Use
    <b>BAPI_PO_Change</b> , if so , can anybody tell me the steps to follow to use this bapi for deleting the PO lineItems, since i m going to try BAPI for First time.
    pls help me out
    Message was edited by: Raja K.P

    Hi raja ,
    loop at iekko1.
        w_index = sy-tabix.
        item-po_item   = itemx-po_item   = iekko1-ebelp.
        item-quantity  = iekko1-mng01.
        itemx-quantity = iekko1-mng01.
        if iekko1-wamng = iekko1-wemng.
        itemx-no_more_gr = item-no_more_gr = 'X'.
        else.
        itemx-no_more_gr = item-no_more_gr = ''.
        endif.
        append item.
        append itemx.
          clear return[].
          call function 'BAPI_PO_CHANGE'
               exporting
                    purchaseorder = iekko1-ebeln
               tables
                    return        = return
                    poitem        = item
                    poitemx       = itemx.
          if return[] is initial.
          commit work and wait.
          call function 'DEQUEUE_ALL'.
    search for deletion fields which u have to mark 'X'.
    before calling  this BAPi u have to lock the PO by using ENQUEUE.
    <b>
    FU BAPI_PO_CHANGE
    Text
    Change purchase order
    Functionality
    Function module BAPI_PO_CHANGE enables you to change purchase orders. The Change method uses the technology behind the online transaction ME22N.
    Alternatively, the IDoc type PORDCH1 is available. The data from this IDoc populates the interface parameters of the function module BAPI_PO_CHANGE.
    Functionality in Detail
    Authorization
    When you create (activity 02) an Enjoy purchase order, the following authorization objects are checked:
    M_BEST_BSA (document type in PO)
    M_BEST_EKG (purchasing group in PO)
    M_BEST_EKO (purchasing organization in PO)
    M_BEST_WRK (plant in PO)
    Controlling adoption of field values via X bar
    For most tables, you can use your own parameters in the associated X bar (e.g. PoItemX) to determine whether fields are to be set initial, values inserted via the interface, or default values adopted from Customizing or master records, etc. (for example, it is not mandatory to adopt the material group from an underlying requisition - you can change it with the BAPI).
    Transfer
    Purchase order number
    The PurchaseOrder field uniquely identifies a purchase order. This field must be populated in order to carry out the Change method.
    Header data
    The header data of the Enjoy purchase order is transferred in table PoHeader.
    Item data
    The item data of the Enjoy purchase order is stored in the tables PoItem (general item data). Changes regarding quantity and delivery date are to be made in the table PoSchedule.
    Use the table PoAccount to change the account assignment information.
    Services and limits
    Changes to existing items cannot be carried out with the Change method. It is only possible to create new items.
    Conditions
    Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. A new price determination process can be initiated via the parameter CALCTYPE in the table PoItem.
    Vendor and delivery address
    The vendor address in the table PoAddrVendor and the delivery address in the table PoAddrDelivery can only be replaced by another address number that already exists in the system (table ADRC). Changes to address details can only be made using the method BAPI_ADDRESSORG_CHANGE.
    Partner roles
    You can change all partners except the partner role "vendor" via the table PoPartner.
    Export/import data
    Export/import data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items. Changes to the export/import data of existing items are not possible.
    Texts
    Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText. Texts can only be replaced completely.
    Version Management
    You can make use of the Version Management facility via the table AllVersions.
    Return
    If the PO was changed successfully, the header and item tables are populated with the information from the PO.
    Return messages
    Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. If a PO has been successfully created, the PO number is also placed in the return table with the appropriate message.
    Restrictions
    With this function module, it is not possible to:
    Create subcontracting components (you can only use existing ones)
    Create configurations (you can only use existing ones)
    Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))
    Attach documents to the purchase order
    Change foreign trade data
    Change service data
    Change or reexplode BOMs
    A firewall prevents the manipulation of data that is not changeable in Purchasing according to the business logic of the purchase order (e.g. PO number, vendor, etc.).
    PO items with an invoicing plan cannot be created or changed using the BAPIs
    In this connection, please refer to current information in Note 197958.
    To change addresses with numbers from Business Address Services (cantral address management), please use the function module BAPI_ADDRESSORG_CHANGE.
    To change variant configurations, please use the function module BAPI_UI_CHANGE. More information is available in the BAPI Explorer under the Logistics General node.
    In the case of changes that are to be made via the BAPI_PO_CHANGE, a firewall first checks whether the relevant fields are changeable. This approach follows that of the online transaction. Here it is not possible to change the vendor or the document type, for example.
    Example
    Example of changes made to a purchase order with:
    1. Change in header data
    2. Change in item
    3. Change in delivery schedule
    4. Change in account assignment
    5. Change in conditions
    6. Change in partners
    Parameter: PURCHASEORDER 4500049596
    Parameter: POHEADER
    PMNTTRMS = 0002
    PUR_GROUP = 002
    Parameter: POHEADERX
    PMNTTRMS = X
    PUR_GROUP = X
    Parameter: POITEM
    PO_ITEM = 00001
    CONF_CTRL = 0001
    Parameter: POITEMX
    PO_ITEM = 00001
    PO_ITEMX = X
    CONF_CTRL =  X
    Parameter: POSCHEDULE
    PO_ITEM = 00001
    SCHED_LINE = 0001
    QUANTITY = 10.000
    PO_ITEM = 00001
    SCHED_LINE = 0003
    DELETE_IND =  X
    Parameter: POSCHEDULEX
    PO_ITEM =  00001
    SCHED_LINE =  0001
    PO_ITEMX =  X
    SCHED_LINEX =  X
    QUANTITY =  X
    PO_ITEM =  00001
    SCHED_LINE =  0003
    PO_ITEMX =  X
    SCHED_LINEX =  X
    DELETE_IND = X
    Parameter: POACCOUNT
    PO_ITEM = 00001
    SERIAL_NO = 01
    GL_ACCOUNT = 0000400020
    Parameter: POACCOUNTX
    PO_ITEM = 00001
    SERIAL_NO = 01
    PO_ITEMX = X
    SERIAL_NOX = X
    GL_ACCOUNT = X
    Parameter: POCOND
    ITM_NUMBER = 000001
    COND_TYPE = RA02
    COND_VALUE = 2.110000000
    CURRENCY = %
    CHANGE_ID = U
    Parameter: POCONDX
    ITM_NUMBER = 000001
    COND_ST_NO = 001
    ITM_NUMBERX = X
    COND_ST_NOX = X
    COND_TYPE = X
    COND_VALUE = X
    CURRENCY = X
    CHANGE_ID = X
    Parameter: POPARTNER
    PARTNERDESC =  GS
    LANGU =  EN
    BUSPARTNO = 0000001000
    Help in the Case of Problems
    1. Note 197958 lists answers to frequently asked questions (FAQs). (Note 499626 contains answers to FAQs relating to External Services Management.)
    2. If you have detected an error in the function of a BAPI, kindly create a reproducible example in the test data directory in the Function Builder (transaction code SE37). Note 375886 tells you how to do this.
    3. If the problem persists, please create a Customer Problem Message for the componente MM-PUR-PO-BAPI, and document the reproducible example where necessary.
    Customer Enhancements
    The following user exits (function modules) are available for the BAPI BAPI_PO_CREATE1:
    EXIT_SAPL2012_001 (at start of BAPI)
    EXIT_SAPL2012_003 (at end of BAPI)
    The following user exits (function modules) are available for the BAPI BAPI BAPI_PO_CHANGE:
    EXIT_SAPL2012_002 (at start of BAPI)
    EXIT_SAPL2012_004 (at end of BAPI)
    These exits belong to the enhancement SAPL2012 (see also transaction codes SMOD and CMOD).
    There is also the option of populating customer-specific fields for header, item, or account assignment data via the parameter EXTENSIONIN.
    Further Information
    1. Note 197958 contains up-to-date information on the purchase order BAPIs.
    2. If you test the BAPIs BAPI_PO_CREATE1 or BAPI_PO_CHANGE in the Function Builder (transaction code SE37), no database updates will be carried out. If you need this function, please take a look at Note 420646.
    3. The BAPI BAPI_PO_GETDETAIL serves to read the details of a purchase order. The BAPI cannot read all details (e.g. conditions). However, you can use the BAPI BAPI_PO_CHANGE for this purpose if only the document number is populated and the initiator has change authorizations for purchase orders.
    4. Frequently used BAPIs for purchase orders are BAPI_PO_CREATE, BAPI_PO_CREATE1, BAPI_PO_CHANGE, BAPI_PO_GETDETAIL, BAPI_PO_GETITEMS, BAPI_PO_GETITEMSREL, and BAPI_PO_GETRELINFO.
    5. For more information on purchase orders, refer to the SAP library (under MM Purchasing -> Purchase Orders) or the Help for the Enjoy Purchase Order, or choose the path Tools -> ABAP Workbench -> Overview -> BAPI Explorer from the SAP menu.
    Parameters
    PURCHASEORDER
    POHEADER
    POHEADERX
    POADDRVENDOR
    TESTRUN
    MEMORY_UNCOMPLETE
    MEMORY_COMPLETE
    POEXPIMPHEADER
    POEXPIMPHEADERX
    VERSIONS
    NO_MESSAGING
    NO_MESSAGE_REQ
    NO_AUTHORITY
    NO_PRICE_FROM_PO
    EXPHEADER
    EXPPOEXPIMPHEADER
    RETURN
    POITEM
    POITEMX
    POADDRDELIVERY
    POSCHEDULE
    POSCHEDULEX
    POACCOUNT
    POACCOUNTPROFITSEGMENT
    POACCOUNTX
    POCONDHEADER
    POCONDHEADERX
    POCOND
    POCONDX
    POLIMITS
    POCONTRACTLIMITS
    POSERVICES
    POSRVACCESSVALUES
    POSERVICESTEXT
    EXTENSIONIN
    EXTENSIONOUT
    POEXPIMPITEM
    POEXPIMPITEMX
    POTEXTHEADER
    POTEXTITEM
    ALLVERSIONS
    POPARTNER
    Exceptions
    Function Group
    2012
    </b>
    regards
    prabhu
    Message was edited by: Prabhu Peram

  • Adding a batch to a line item in an Order with B1WS

    Hi,
    I am trying to create code which can update a batch in a line item in an order.  The updating works great, if the batch is already attached to the line item.  However, I am unable to add a batch if one doesn't already exist.
    Can you please have a look at this code and let me know what is wrong?
    I've tried various things, though am still unable to get it to work.
    Thank you very much!
    Mike
    using System;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using orderWebRef;
    using System.Text;
    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            // B1BATCH performs batch operations on SAP via DISERVER and B1WS
            // The inputs are:
            // o = Order Number (this is the DocEntry value, NOT the DocNum value)
            // b = Batch Number
            // q = Quantity
            // i = Item Code
            // p = Project
            // debug = 1 or true if you want to see output messages
            // For some security, we will encode some values at the client,
            // and verify them here for consistency.
            // The "Secret Formula" is these variables, which will be passed to the URL
            // 1 = Order Number * 2 (encoded at the client)
            // 2 = Batch Number * 2 (encoded at the client)
            // To decode, we do this:
            // Correct decoding if ((1 = (o/2)) AND (2 = (b/2))
            string o = "";
            string b = "";
            string q = "";
            string i = "";
            string p = "";
            string v1 = "";
            string v2 = "";
            int orderNumber = 0; // This is the DocEntry value, NOT the DocNum value
            int batchNumber = 0;
            int quantity = 0;
            int v1int = 0;
            int v2int = 0;
            bool debugMode = false;
            bool allVarsPresent = true;
            bool allVarsValid = true;
            try
                o = Request.QueryString["o"].ToString();
            catch
                allVarsPresent = false;
            try
                b = Request.QueryString["b"].ToString();
            catch
                allVarsPresent = false;
            try
                q = Request.QueryString["q"].ToString();
            catch
                allVarsPresent = false;
            try
                i = Request.QueryString["i"].ToString().ToUpper();
            catch
                allVarsPresent = false;
            try
                p = Request.QueryString["p"].ToString().ToUpper();
            catch
                allVarsPresent = false;
            try
                v1 = Request.QueryString["1"].ToString();
            catch
                allVarsPresent = false;
            try
                v2 = Request.QueryString["2"].ToString();
            catch
                allVarsPresent = false;
            try
                string debug = Request.QueryString["debug"].ToString();
                if ((debug == "1") || (debug.ToLower() == "true"))
                    debugMode = true;
            catch
                debugMode = false;
            if (!allVarsPresent)
                WriteDebugMessage(debugMode, "All required variables are not in the request.");
                return;
            else
                // All variables are present, now check that they are valid.
                // First, check the v1 and v2 variables are correct
                // Then check that the order exists
                // Then check that the batch exists and has the appropraite quantity available
                try
                    orderNumber = Convert.ToInt32(o);
                    batchNumber = Convert.ToInt32(b);
                    quantity = Convert.ToInt32(q);
                    v1int = Convert.ToInt32(v1);
                    v2int = Convert.ToInt32(v2);
                    if ((v1int / 2) != orderNumber)
                        allVarsValid = false;
                    if ((v2int / 2) != batchNumber)
                        allVarsValid = false;
                catch
                    WriteDebugMessage(debugMode, "Error in processing variables.");
                    return;
                if (!allVarsValid)
                    WriteDebugMessage(debugMode, "Error in validating checksum.");
                    return;
                // All variables are present and valid!
                WriteDebugMessage(debugMode, "All variables are present and valid.");
            try
                loginWebRef.LoginService ls = new loginWebRef.LoginService();
                string sessionID = ls.Login("DBSERVER", "DBNAME", loginWebRef.LoginDatabaseType.dst_MSSQL2005, true, "sa", "PASSWORD", "manager", "managerPass", loginWebRef.LoginLanguage.ln_English, true, "LICENSE:30000");
                WriteDebugMessage(debugMode, "<BR><BR>SessionId: " + sessionID + "<BR><BR>");
                orderWebRef.MsgHeader msgHeader = new orderWebRef.MsgHeader();
                msgHeader.SessionID = sessionID;
                msgHeader.ServiceName = MsgHeaderServiceName.OrdersService;
                msgHeader.ServiceNameSpecified = true;
                orderWebRef.OrdersService order = new OrdersService();
                order.MsgHeaderValue = msgHeader;
                DocumentParams param = new DocumentParams();
                param.DocEntry = orderNumber;
                param.DocEntrySpecified = true;
                orderWebRef.Document document = new orderWebRef.Document();
                document = order.GetByParams(param);
                StringBuilder orderSb = new StringBuilder();
                orderSb.Append("Order " + document.DocNum.ToString() + "<BR><BR>");
                foreach (DocumentDocumentLine docLine in document.DocumentLines)
                    if ((docLine.ProjectCode == p) && (docLine.ItemCode == i))
                        orderSb.Append("Line Num:      " + docLine.LineNum + "<BR>");
                        orderSb.Append("Item Code:     " + docLine.ItemCode + "<BR>");
                        orderSb.Append("Project Code:  " + docLine.ProjectCode + "<BR>");
                        orderSb.Append("Description:   " + docLine.ItemDescription + "<BR>");
                        // Find the batch if it exists and update the quantity
                        // Add the batch if it doesn't exist
                        bool batchExistsInLineItem = false;
                        int batchCount = 0;
                        foreach (DocumentDocumentLineBatchNumber batch in docLine.BatchNumbers)
                            batchCount++;
                            if (batch.BatchNumber == b)
                                batchExistsInLineItem = true;
                                orderSb.Append("<BR>");
                                orderSb.Append("+++++ Batch exists in line item.  Updating.<BR><BR>");
                                orderSb.Append("+++++ Batch Line:   " + batchCount.ToString() + "<BR>");
                                orderSb.Append("+++++ Batch Num:    " + batchNumber + "<BR>");
                                orderSb.Append("+++++ Quantity:     " + quantity + "<BR>");
                                batch.Quantity = quantity;
                        if (!batchExistsInLineItem)
                            docLine.BatchNumbers = new DocumentDocumentLineBatchNumber[1];
                            DocumentDocumentLineBatchNumber batch = new DocumentDocumentLineBatchNumber();
                            batch.BatchNumber = b;
                            batch.Quantity = quantity;
                            docLine.BatchNumbers[0] = batch;
                            orderSb.Append("<BR>");
                            orderSb.Append("+++++ Batch does not exist in line item.  Adding.<BR><BR>");
                            orderSb.Append("+++++ Batch Line:   " + batchCount.ToString() + "<BR>");
                            orderSb.Append("+++++ Batch Num:    " + batchNumber + "<BR>");
                            orderSb.Append("+++++ Quantity:     " + quantity + "<BR>");
                try
                    order.Update(document);
                catch (Exception ex)
                    WriteDebugMessage(debugMode, "SAP Exception:  " + ex.Message.ToString());
                    return;
                WriteDebugMessage(debugMode, orderSb.ToString());
            catch (Exception ex)
                WriteDebugMessage(debugMode, "Error in processing the request.  Exception:<BR><BR>" + ex.Message);
                return;
        private void WriteDebugMessage(bool debugMode, string exitMessage)
            if (debugMode)
                Response.Write(exitMessage);

    Hi Everyone,
    I found the answer, you can find the code here: [B1WS Batch Manipulations with Orders|http://paste-it.net/public/dbbcea0/]
    Cheers,
    Mike

  • Item Category in V/03

    1)How the new field ITEM CATEGORY in Condition Table will be used in SD SALES?
    2) How the new field PROFIT CENTER in condition Filed will be used in SD SALES?
    Can anyone pour some light on this topic with Example?

    First u need to append Item category (PSTYV) and Profit center in KOMPAZ structure then u are able to create a new condition table. and also u need to Supply the new field you defined by including the following source code line in USEREXIT_PRICING_PREPARE_TKOMP:
    MOVE xxxx-PSTYV TO TKOMP-ZZPSTYV.
    Check the OSS note 21040.
    Thanks
    Dhirajjjjjj
    Edited by: Dhiraj Bhaskar on Mar 7, 2011 11:58 AM

  • How many levels of hierarchy is supported in AII?

    hi,
      i heard that the mobile UI supports only two levels of hierarchy...
    otherwise is it possible to have Container-Pallet-Case-Item such hierarchy?
    thanks,
    vinoth

    Vinod,
    I believe multi-level tagging can only be done in stages. If you are not using a UI then a PML notification from a device controller can acheive packing hierarchies 2 at a time. So if you want to pack an item in a case and then the case in the pallet. You will have to first build the case to item hierarchy and then case to pallet hierarchy. I dont think the sequence matters and I beleive you can accomplish the same thing using a handheld- it would just be extremely tedious.
    The hierachy will built via the PML notification based on pack levels (filter values) or the SSCC tag in the PML. Hope this helps

  • Selection of Hierarchy for FS

    Hello there,
       I am attempting to run Business Content Query: 0FIGL_VC1_Q0002 which is based on Virtual InfoCube: 0FIGL_VC1
      I could successfully run Query: 0FIGL_VC1_Q0001(a separate query on this cube) and did receive the desired results.
      However, when I run the Query: 0FIGL_VC1_Q0002 it does NOT give me any application(transaction)data
      Hence, this query(0FIGL_VC1_Q0002) is actually based on the SAP supplied financial statement version Financial Statement (technical name INT)
      However, I`d like to use my Financial Statement Item <b>Hierarchy </b>which is loaded to InfoSource : 0GLACCEXT
      More specifically, let's look into SAP Standard Query Design of 0FIGL_VC1_Q0002
      It consists of list of Key Figures in the ROW.
    <i>Right-Click</i> on <b>Result</b>
       Edit Selection
       Under Financial Item Hierarchy, there is Hierarchy INT,
    how can I change it to mine ?
       At the moment, I don`t seem to see any other hierarchy selection?
    Message was edited with apologies by: John Mcluskey

    John,
    If in the BEx Query Designer in the FS item properties you clicked on a icon to the right from the hierarchy name field and couldn't see the other hierarchies, it means that you didn't upload hierarchy for 0GLACCEXT!
    You wrote that loaded hierarchy to infosource!? The hierarchy should be loaded to 0GLACCEXT infoobject. Besides, you need to load texts for this IO.
    Please describe what you've done in this regard so far. The more details the better.
    Best regards,
    Eugene

Maybe you are looking for