Call HEADER value into ITEM level in mapping

HI,
my structure is as below:
H
I
I
I
P
H
I
I
P
P
H
I
I
I
I
I
P
I have created a sequence in DB and retriving the value from DB using lookup for the header level(H) for feild ID.by using the code:
   //write your code here
   //write your code here
String Query = " ";
Channel channel = null;
DataBaseAccessor accessor = null;
DataBaseResult resultSet = null;
try{
                //container.getTrace().addWarning("Obtaining channel");
                channel = LookupService.getChannel( businessSystem, communicationChannel);
                //container.getTrace().addWarning("Channel OK");
                //Get a system accessor for the channel. As the call is being made to an DB, an DatabaseAccessor is obtained.
                accessor = LookupService.getDataBaseAccessor(channel);
                //container.getTrace().addWarning("Accessor OK");
                //Execute Query and get the values in resultset
                resultSet = accessor.execute(" SELECT ID.NEXTVAL FROM DUAL");
                //container.getTrace().addWarning("SELECT OK");
                //String[] cols = resultSet.getMetaData().getColumnNames();
                //for (int i=0; i<cols.length; i++){
                //            container.getTrace().addWarning("Column name: " + cols<i>);
                for(Iterator rows = resultSet.getRows();rows.hasNext();){
                                //container.getTrace().addWarning("Result has rows");
                                Map rowMap = (Map)rows.next();
                                //container.getTrace().addWarning("Trying to get NEXTVAL");
                                //Object obj = rowMap.get("NEXTVAL");
                                //container.getTrace().addWarning("Data received " + obj);
                                //return obj.toString();
                                return rowMap.get("NEXTVAL").toString();
                                //return ((String)rowMap.get("NEXTVAL"));
                //container.getTrace().addWarning("Result has no rows");
                throw new RuntimeException("Cannot obtain next service repair ID");
                //return "-1";
} catch(Exception ex){
                container.getTrace().addWarning("Exception " + ex.getMessage());
                throw new RuntimeException("Cannot obtain next service repair ID", ex);
                //return "-1";
finally {
                try {
                                if (accessor!=null) accessor.close();
                catch(Exception e){
                                container.getTrace().addWarning("Cannot close DataBaseAccessor for service " + businessSystem +
                                                                                " and comm channel " + communicationChannel + " in getNextID user defined funcion");
now my requirement is i have my to call the same value of ID feild into ID of I.to represent perticular I is related to so and so Header(H).
Please suggest me how i can call the value to which is passing to ID(targetfeild) of H and map to ID(targetfeild) of I.
please provide me UDF code....
thanks in advance,
Naveen.

Use standard function UseOneAsMany (found under NodeFunctions) to populate the Header-value for each of the corresponding Item-segments.
Input 1 - your header-fields as resulted from DB-lookup
Input 2 - Item-segment
Input 3 - Item-segment
Make sure to set the context for Input 1 so that there are equal number of contexts in Input 1 as 2 & 3.
-Kenneth

Similar Messages

  • Crm_order_maintain ,changing pricing condition value at item level

    Hi,
    I am trying to change the pricing condition value at item level while creating sales order through CRM_ORDER_MAINTAIN.
    I am not able to change the condition value.
    Code is below.
          wa_inputfields-ref_guid   = wa_orderi-guid.
          wa_inputfields-ref_kind   = 'B'.
          wa_inputfields-objectname = 'PRIDOC'.
          wa_fieldname-fieldname    = 'KBETR'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          wa_fieldname-fieldname    = 'KMEIN'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          wa_fieldname-fieldname    = 'KPEIN'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          wa_fieldname-fieldname    = 'KSCHL'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          wa_fieldname-fieldname    = 'WAERS'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          INSERT wa_inputfields INTO TABLE it_inputfields.
    wa_pricing_add-KSCHL  = 'ZP06'.
    wa_pricing_add-WAERS  = 'USD'.
    wa_pricing_add-KBETR = '10'.
    wa_pricing_add-KPEIN = '1'.
    wa_pricing_add-KMEIN = 'ST'.
    INSERT wa_pricing_add INTO table it_pricing_add .
    wa_pricing-REF_GUID     = wa_orderi-guid.
    wa_pricing-REF_KIND      = 'B'.
    wa_pricing-PRICING_TYPE  = 'A'.
    wa_pricing-COND_ADD = it_pricing_add.
    wa_pricing-PRICING_PROCEDURE = 'ZVDSP'.
    append wa_pricing to it_pricing.
    Can you tell me how to overwrite the condition value while creating sales order using crm_order_maintain.?
    Regards,
    Indhra.E

    Hello Indhra,
    Check the CT_INPUT_FIELDS table, in the OBJECTNAME field you will find all the tables that are filled during the function call. Check those tables mentioned in the OBJECTNAME to look for any pricing related data.
    When your order is in change mode and you activate debug <b>just before you make the change</b>, the CRM_ORDER_MAINTAIN FM call contains <b>data only relevant for the change you just made</b>. In other words, you need to fill exactly the same tables as CRMD_ORDER does.
    E.g. You just change the pricing procedure and you see in debug that 5 tables are filled, you must do exactly the same in your code! It's quite anoying but you're using a low-level API FM that can handle ANY transaction type in CRM!
    Check it, it works!!
    <b>Reward points if useful!</b>
    Regards,
    Joost

  • Error after Adding Header Zfields to Item Level Screens?

    Hi,
    When I add SLA Z fields from Node BTAdminI to the  SRQM_SLAPRO/SLASrvCtrView,. Contract related SLA data is not appearing and all fields are appearing in the mode of grade out in WEB UI.
    Few of the fields are showing  BTAdminI not bound as value.
    In the same scenario for the few of the fields I am getting below mentioned error
    BSP exception: Error converting to data object from ZZAFLD00002U
    Same error I am getting after I added Zfields (From BTADMINH) to Item Level Screen too.
    My doubt is Cant I add Header Zfields to Item Level Screens? Or/And Item Zfields to Item Header Screens
    What can be possible what is not possible. Please get some clarity on this issue.
    Thanks
    Chand

    Hi All,
    I am new to IC WEB.
    i am facing a problem while ading Zfield in Contact Screen using AET Tool.
    i am getting the error as
    BSP exception: Error converting to data object from ZZAFLD00001K
    Please help me....
    Thanks in Advance,
    Swaraj
    Edited by: swaraj sap on Oct 6, 2009 7:08 PM

  • Multiple Shipto values at item level

    Hi Friends,
    I'm facing some problem when I try to change the ship to value at item levels of VA02. The problem is,
    In VA01, while creating a sales order, the configuration is done in such a way that after giving an item at item level, a sub-item will be generated automatically based on that main item. Now in VA02, for that newly created sales order, if I go to the details of the main item, and if I change the value of the shipto in Partner's tab, then it'll ask for redetermining the value and also for completing the delivery. After completing the delivery, if I save and go to display mode, the shipto value of the subitem level also should update. But it is not updating with the value of main item. Can any of you please suggest me the solution for my problem.
    Many thanks in advance.
    Thanks & Regards,
    Raghuveer K.

    Hi Soumyadip,
    Many thanks for your response.
    I did the same thing. I checked it in both the userexits <b>uderexit_save_document</b> and uderexit_save_document_prepare. Even then it is not working. When I checked it by keeping a watchpoint, it is calling a function module RV_DELETE_POSITION_PARTNER. There it is deleting the subitem values. Since this is a standard prog, we don't have authorizations to avoid it. So how to overcome this issue.
    Please suggest me.
    Thanks & Regards,
    Raghuveer K.

  • Mapping Header Values to Item Nodes

    Using the graphical mapping editor, I need to map values from a source header level node to a target item level node for each item in the source structure.
    eg.
    <b>Source</b>
    <HEADER>
      <H1>HeaderValue1</H1>
    </HEADER>
    <ITEM>
      <I1>Item1Value</I1>
    </ITEM>
    <ITEM>
      <I1>Item2Value</I1>
    </ITEM>
    <b>Target</b>
    <ITEM>
      <H1>HeaderValue1</H1>
      <I1>Item1Value</I1>
    </ITEM>
    <ITEM>
      <H1>HeaderValue1</H1>
      <I1>Item2Value</I1>
    </ITEM>
    If I map the source <ITEM> node to the target <ITEM> node and the <H1> and <I1> nodes as shown above, the <H1> node only appears on the first item. I need the <H1> node to appear for all target <ITEM> nodes.
    Any assistance would be appreciated.
    Thanks.

    Hi Briggs,
    This Mapping will Solve Ur Problem
    Source Structure:
    MT1  1..1
    Header 1..1
      H1 1..1
    Item 0..unbound
      L1 1..1
    Target Structure:
    MT2
    Item 0..unbound
      H1 1..1
      L1 1..1
    Mapping that solve Your Problem is :
    Item(source)-->Item(dest)
    H1(Source)>copy value (property=0)>H1(dest)
    L1(source)-->L1(source)

  • Workflow - Header vs. Item level

    Hello,
    I am looking for some documentation / list of pros and cons of implementing header level workflow vs. item level. I understand that item level is more difficult to implement, but what are the benefits.
    We are looking at two types of approval, financial approval and commodity based approval and I would like to understand more before making a decision.
    Many thanks,
    AR

    Hi,
    For your  requirement,you can go for N step HEader level SC  Approval Workflow.I have worked on a similar reqt and the agent determintation can be made flexible based on runtime values thorugh the BADi BBP_WFL_APPROV_BADI.
    Advantages of header level WF is that its very flexible.Disadvantage is that some techincal problems require application of OSS notes e.g graphical Preview inconsistent.
    I have not worked on Item level WF so cant comment on that.For more info  ,pls refer the foll links:
    http://help.sap.com/saphelp_srm50/helpdata/en/17/40a86c773d6c41801d78af1a34b90f/content.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/a3/a6a34098022a54e10000000a1550b0/content.htm
    Useful Workflow  links ->
    SRM Business Workflow
    http://help.sap.com/saphelp_srm50/helpdata/en/8b/4fa9585db211d2b404006094b92d37/frameset.htm
    Setting Up SAP Business Workflow
    http://help.sap.com/saphelp_srm50/helpdata/en/ee/277e3c281f1817e10000000a114084/frameset.htm
    Related links:
    Re: SRM workflow doubts....
    Triggering SRM workflow from a  web-based form (HTML)
    Workflow debugging
    Re: Triggering an alert
    BR,
    Disha.
    <b>Pls reward points for useful answers.</b>

  • Display Header data to item level in me21n

    Dear Friends ,
    I have the  requirement that Incoterm field in me21n at header level while creating purchase order needs to get reflected at item level too. Currently it is blank (at item level).
    Is it the development or Customisation?
    Can anybody please explain me how to go abt it?

    If you enter an Incoterm on header level, this is valid for all items that do not explicitly have an Incoterm.
    If you then enter an Incoterm on item level, this overwrites the Incoterm entered on header level.
    So it's not clear why this requirement has come up.
    http://help.sap.com/saphelp_srm50/helpdata/en/0c/b91b3f7f9e3642e10000000a114084/content.htm

  • Copy Header texte into Item text, trasactions FB60-FB50-FB70

    Hi,
    using the transactions FB50, FB60 and FB70 I need to copy automatically the Header text into the Items text.
    Can someone tell me how to do that?
    Thank you and best regards,
    Giorgia

    In the enjoy transaction like FB60-FB50-FB70, header and line items fields are quite mixed up. When you are mentioning Header text, please confirm that you meant "Header text" field in the "Details" tab screen and not the "Text" field in the basic data tab screen.
    Normally when you want to copy the "text" field content in the Basic Data screen to all the G/L line items text fields, you do it through "editing option" in the FB60-FB50-FB70 transaction screen itself. Here in the General entry options you activate the check box "Copy text for GL account enter".
    But if you want to copy really the header text in the Details screen to Vendor and Gl items for example, then you have to create substitution rule
    Thanks
    Ranjit

  • How to add Pricing Agreement in Value Contract Item level

    Hi Exports,
                In my requirement i need to Add Product category ID at item level in  a Sales Contract. we done with this through CRM_ORDER_MAINTAIN
                we are able to add this
    For This Item we need to add Pricing Agreement  as Below ( Added at in UI level but we need  this through CRM_ORDER_MAINTAIN ) we tried through  PRICE_AGREEMENTS_CRM and  PRIDOC but its not working. We observers Pricing Agreement details  In CRM_ORDER_READ at
    PRICE_AGREEMENTS_CRM and  PRIDOC. we debug the Transaction but  didn't find any clue.  Can any once please help me to how to Proceed.
    Can we add only pricing through BOL, because we are creating sales order and item through  CRM_ORDER_MAINTAIN and ORDER_SAVE, We don't want disturb this.
    Thanks,
    Sateesh U

    What are you exactly asking for, I don't understand your question...
    Transaction screen, adding a tab / customer fields
    Business Object / BAPI, modifying BAPI signature, extension
    NB : The quality of an answer depends significantly on the quality of the question ...
    Regards,
    Raymond

  • XML Unbounded values into one field - Message Mapping

    Dear All,
    I am trying to convert an unbounded multifield XML structure to a 0.1 field so that the maltiple values are mapped into a single fields in semi-colon seperated fasion.
    The source:
    <MT_dates>
       <date>05-10-2011</date>
       <date>10-11-2011</date>
       <date>10-12-2011</date>
       <date>10-13-2011</date>
    </MT_dates>
    date field is 0.. unbounded
    target
    <MT_dates>
       <dates>05,10,2011;10,11,2011;10,12,2011;10,13,2011</date>
    </MT_dates>
    dates field is 0 .. 1
    can anybody please help?
    Regards,
    Haik

    chk this:
    input will be : var1
    execution type All values of a context
    int a = var1.length;
    String b="";
    for(int i=0;i<a;i++)
    b =b +var1<i> + ";";
    int c=b.length();
    String output =b.substring(0,c-1) 
    result.addValue(output);
    date-UDF--dates

  • Help: How to call go_block from an item level trigger?

    I am working on a form it needs to call go_block('blk_name') after a text item filled in data.
    I tried post_item and when_validate trigger, it gave me error:
    Illegal restricted procedure GO_BLOCK in POST_ITEM trigger, etc.
    Any suggestions?
    Thank you in advance.
    Jimmy

    Thanks Francois.
    I read Re: problems with GO_BLOCK from  post-text, when-validate-  triggers
    The form that I am working on requires that user put in an ID through a control item. Once the form see the ID changes, it conducts a query through a stored procedure to get the customer information need. User can make as many changes as s/he wants. Will timer_expires work?
    Thank you again.
    Jimmy

  • Printing of Condition value at both header and Item level

    Dear Sap Gurus,
    Please any body tell me how to print the condition value at both header and at item level in PO print out. ie.  I am using RA00 at both item and header level and i want to print this value at both header and item level.
    Thanks and Regards,
    Patil

    Hi,
    Please check with abaper is he calling the function like mention below or not
    CALL FUNCTION 'PRICING'
        EXPORTING
          calculation_type = 'B'   
    or  (calculation types = as in condition type)
          comm_head_i      = komk
          comm_item_i      = komp
          preliminary      = ' '
          no_calculation   = ' '
        IMPORTING
          comm_head_e      = komk
          comm_item_e      = komp
        TABLES
          tkomv            = i_komv.
    regards
    Edited by: bvdv on Jul 8, 2009 7:35 PM

  • MIRO - Message Trigerring at Header and Item Level..

    Hi Gurus - In MIRO the message INVS is triggering at both the header and the item level when creating the invoice. We want the output only at the header level. How do we get the output only at the header level?
    Please provide your valuable solutions.
    Thanks,
    Sree

    Hi Lakshmi,
    Where do we maintain this entry to reflect this change.

  • Adding New ZZFIELD at sales order item level

    Hi,
    I have added the new "ZZFIELD" field in the "Additional data B" Section, but the client has requested that the new field ZZFIELD to appear in the first screen "SAPMV45A 4900". I have noticed that there is a field catalog when I click the configuration in the right upper corner of the "All items section".
    How do I accomplish this?
    Thanks in advance.
    Abel.

    hi,
    can you please check this,
    it would helpful.
    Basics of modification in pricing* The following communication structures are relevant in pricing:
    - KOMK (pricing communication header)
    - KOMP (pricing communication item)
    - KOMG (allowed fields for condition structures)
    For technical reasons, the communication structure KOMG is used, which
    combines KOMK and KOMP, and which contains all fields which can
    generally be used for pricing. When entering new fields in KOMK or KOMG,
    the fields are automatically included in KOMG.
    Fields for pricing are integrated into the following INCLUDES:
    - header data in KOMKAZ (INCLUDE in KOMK or in KOMG)
    - item data in KOMPAZ (INCLUDE in KOMP or in KOMG)
    The routines for assigning values to the new fields in order
    processing are found in member MV45AFZZ. Use the following user exits:
    - USEREXIT_PRICING_PREPARE_TKOMK (header fields)
    - USEREXIT_PRICING_PREPARE_TKOMP (item fields)
    The routines for assigning values to the new fields in billing
    are found in member RV60AFZZ. Use the following user exits:
    - USEREXIT_PRICING_PREPARE_TKOMK (header fields)
    - USEREXIT_PRICING_PREPARE_TKOMP (item fields)
    Examples for using new fields in pricing
    Example 1
    In the first example, parts of a document field are to be used in
    pricing. You want to use the first three digits of the product hierarchy
    (PRODH) for pricing, for example. Proceed as follows:
    1. Check the data elements in the standard system.
    2. Since there is no such data element you have to create the new
    data element ZZPRODH1. Also create a domain with the length u201C3u2033 and the
    data type u201CCHARu201D for the new data element.
    Remember that new data fields must start with the letters u201CZZu201D or u201CYYu201D,
    since SAP reserved these letters to protect them from being overwritten
    during a release upgrade.
    3. Check whether the product hierarchy (PRODH) is found at header
    or at item level.
    In table VBAP, document field PRODH is defined as an item field.
    4. Integrate the field name ZZPRODH in the communication structure
    KOMP using the INCLUDE KOMPAZ and allocate the data element PRODH to it.
    5. Activate the structure.
    6. Check in which table the field PRODH exists.
    The field is in table VBAP (sales document: item data).
    7. Assign a value to the new field in the FORM routines for sales
    order processing and billing using the appropriate user exits:
    In sales order processing the user exit is found in member MV45AFZZ. The
    complete statement is:
    FORM USEREXIT_PRICING_PREPARE_TKOMP.
    MOVE VBAP-PRODH(3) TO TKOMP-ZZPRODH.
    ENDFORM.
    The routines for assigning a value to the new fields in billing are
    found in member RV60AFZZ. The statement is as follows:
    FORM USEREXIT_PRICING_PREPARE_TKOMK
    MOVE VBRP-PRODH(3) TO TKOMP-ZZPRODH.
    ENDFORM.
    8. Allocate the specifications A, V and 001 to the field ZZPRODH in
    table T681F.
    Example 2
    In the second example, you want to use a partner function for pricing
    which was created in Customizing for partner maintenance.
    Assume that the partner function was created for a sales representative
    of the partner type PE. Z1 is defined as a mandatory function for the
    customer master record, therefore automatically set in the document and
    available in the internal partner table XVBPA.
    To use the new partner function for pricing, proceed in the same way as
    for the previous examples.
    1. Create a new data element, in this example, the data element
    ZZVRTZ1 with the domain PERNR.
    2. Include the field ZZVRTZ in KOMK using KOMKAZ and allocate the
    data element ZZVRTZ1 to it.
    For order processing, assigning a value to the field is carried out in
    the user exit for member MV45AFZZ. The entries in the user exits are
    protected during a release upgrade. The statement is as follows:
    FORM USEREXIT_PRICING_PREPARE_TKOMK.
    PERFORM XVBPA_LESEN (SAPFV45K) USING u2018Z1u2032 VBAP-POSNR SY_TABIX.
    MOVE XVBPA-PERNR TO TKOMK-ZZVRTZ
    Thanks andregards
    Durga.K

  • Fields in sales order item level for pricing

    01.02.2011
    Hi friends,
    I have a requirement wherein i need at least 3 additional fields at the item level in the Sales Order for pricing determination i.e i want this field to be used in the condition table. Since these fields should have list of values also, I find the fields Material group1, material group2 and material group3 ideal ones. I wont be using this field in the material master but inputting some data in these fields through development at the sales order level. How can i get these fields in the catalog?  Please suggest.
    Regards,
    Uday

    The following communication structures are relevant in pricing:
    KOMK (pricing communication header)
    KOMP (pricing communication item)
    KOMG (allowed fields for condition structures)
    For technical reasons, communication structure KOMG is used. It combines the fields from KOMK and KOMP that are relevant for pricing in the standard system and are offered in the field catalog of condition tables. If you want to use a new field in the field catalog, you must add the field to KOMP or KOMK in the following INCLUDES:
    header data in INCLUDE KOMKAZ in KOMK
    item data in INCLUDE KOMPAZ in KOMP
    When you use INCLUDES, the field is automatically added to KOMG and the field catalog.
    The routines for assigning values to the new fields in order processing are found in member MV45AFZZ. Use the following user exits:
    USEREXIT_PRICING_PREPARE_TKOMK (header fields)
    USEREXIT_PRICING_PREPARE_TKOMP (item fields)
    The routines for assigning values to the new fields in billing are found in member RV60AFZZ. Use the following user exits:
    USEREXIT_PRICING_PREPARE_TKOMK (header fields)
    USEREXIT_PRICING_PREPARE_TKOMP (item fields)
    Examples for using new fields in pricing
    Example 1
    In the first example, parts of a document field are to be used in pricing. You want to use the first three digits of the product hierarchy (PRODH) for pricing, for example. Proceed as follows:
    1. Check the data elements in the standard system.
    2. Since there is no such data element you have to create the new data element ZZPRODH1. Also create a domain with the length "3" and the data type "CHAR" for the new data element.
    Remember that new data fields must start with the letters "ZZ" or "YY", since SAP reserved these letters to protect them from being overwritten during a release upgrade.
    3. Check whether the product hierarchy (PRODH) is found at header or at item level.
    In table VBAP, document field PRODH is defined as an item field.
    4. Integrate the field name ZZPRODH in the communication structure KOMP using the INCLUDE KOMPAZ and allocate the data element PRODH to it.
    5. Activate the structure.
    6. Check in which table the field PRODH exists.
    The field is in table VBAP (sales document: item data).
    7. Assign a value to the new field in the FORM routines for sales order processing and billing using the appropriate user exits:
    In sales order processing the user exit is found in member MV45AFZZ. The complete statement is:
    FORM USEREXIT_PRICING_PREPARE_TKOMP.
    MOVE VBAP-PRODH(3) TO TKOMP-ZZPRODH.
    ENDFORM.
    The routines for assigning a value to the new fields in billing are found in member RV60AFZZ. The statement is as follows:
    FORM USEREXIT_PRICING_PREPARE_TKOMK
    MOVE XVBRP-PRODH(3) TO TKOMP-ZZPRODH.
    ENDFORM.

Maybe you are looking for

  • Problem with error code 401

    Hi I had a problem yesterday with my receiver determination... I had an XICACHE update error along with SAP:AdditionalText>Error when reading HTTP destination: INTEGRATION_DIRECTORY_HMI.</SAP:AdditionalText>   <SAP:ApplicationFaultMessage namespace="

  • Cannot install Windows 8.1 on Macbook Pro Retina Display

    Hello, I am installing Windows 8.1 on my 15" Macbook with Retina Diaplay (I bought this in Easter) using the bootcamp. The Windows 8.1 cannot be installed and said that the boot information cannot be changed and the Macbook hanged. After switch off,

  • Resizing an image button

    When inserting an image button in a Captivate project, I'm not able to resize it like I can with a text button. Is it possible to resize an image button?

  • Change Pointer problem

    Hi All I am working on COND_A idoc. I activated change pointer for this idoc.I added my own zsegment in this via extension of this idoc.I am filling this Zsegment in customer-exit while creation of Idoc .I am not created any zfield for this in any st

  • Settings for co-product and by-product

    Hi Gurus, Can you please tell me what are the settings i need to maintained for co-product and by-product. Regards Rajib