Skip to Content
author's profile photo Former Member
Former Member

ref_guid is blank for extension data

Hi,

I have added a new drop down box at item level in b2b order creation page.

I am sending this extension data from my java action class "Z_CustomBasketDispatcherAction" which extends MaintainBasketDispatcherAction.

I implemented "CRM_ISA_BASKET_ITEMS" and in method "CHANGEITEMS_BEFORE_ORDER", I am

fetching this extension data but here while debugging what I can see is "it_extension-ref_guid" is blank for every item.

So now when I click on the "update" button a message comes on b2b web ui "Authorization check could not be performed" and when I try to create this order its giving error like below :

com.sap.jco.runtime.exception.[104]

The current application triggered a termination with a short dump.

Can anyone please help me with this.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 25, 2009 at 04:41 AM

    Hi Arshi,

    As your requirement is during the order creation, use the class MaintainBaskerSendAction when u click on order button and MaintainBasketRefreshAction when click on update button and add the extension data like this below code:

     
    

    *****************************************************************************/

    //start of code

    package com.sap.isa.action.custom.order;

    import java.util.ArrayList;

    import javax.servlet.http.HttpServletRequest;

    import com.sap.isa.backend.boi.isacore.order.HeaderData;

    import com.sap.isa.businessobject.SalesDocument;

    import com.sap.isa.businessobject.item.ItemList;

    import com.sap.isa.businessobject.item.ItemSalesDoc;

    import com.sap.isa.core.UserSessionData;

    import com.sap.isa.core.util.RequestParser;

    import com.sap.isa.isacore.action.order.MaintainBasketBaseAction;

    import com.sap.isa.isacore.action.order.MaintainBasketSendAction;

    /**

    *

    */

    public class

    Z_MaintainBasketSendAction

    extends

    MaintainBasketSendAction

    {

    /**

    */

    public void customerExitParseRequest(

    RequestParser parser,

    UserSessionData userSessionData,

    SalesDocument salesDocument

    ){

    HttpServletRequest l_request = parser.getRequest();

    if(salesDocument != null) {

    log.debug("Z_MaintainBasketSendAction****** ");

    ItemList itemsdata = salesDocument.getItems();

    if(l_request.getAttribute(MaintainBasketBaseAction.RC_BASKET) != null){

    log.debug("RC_BASKET Not Null....");

    SalesDocument l_doc = (SalesDocument)l_request.getAttribute(

    MaintainBasketBaseAction.RC_BASKET

    );

    itemsdata = l_doc.getItems();

    log.debug("Got the reference....");

    }

    ItemSalesDoc[] l_items = itemsdata.toArray();

    String[] extItems = request.getParameterValues("Z_CustomBasketItems");

    for(int i=0; i < l_items.length;i++)

    {

    ItemSalesDoc l_item = l_items[l_k];

    l_item.addExtensionData("ZEXTITEM", extItems<i>);

    }

    }

    */

    l_request.setAttribute(MaintainBasketBaseAction.RK_ITEMS, itemsdata);

    }

    }

    //----


    }

    //----


    //

    // End of file

    //

    //----


     
    

    try the other action class for update MaintainBasketRefreshAction in the same way and i hope your problem of not getting the ref_guid in the extensin table will be solved.

    Hey when i try to display it as code it is not working so align the code yourself. And do let me knw whether you problem is solved or not.

    Regards,

    Lakshman.

    Edited by: lakshman reddy G on May 25, 2009 6:41 AM

    Edited by: lakshman reddy G on May 25, 2009 6:42 AM

    Edited by: lakshman reddy G on May 25, 2009 6:44 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2009 at 07:08 AM

    Hi Lakshman,

    Thanks for your help but still no luck.

    ref_guid for it_extension is still blank and I am still getting that same short dump while trying to save order.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2009 at 02:56 PM

    Hi Lakshman,

    On further analysis the short dump I got to know that "business process type" is missing at the time of order creation and that's why the dump is coming.

    Please refer to the code below, I have now changed the code by hard coding a few values but the logic is the same.Same code is there for order creation also.

    package com.sap.isa.isacore.action.order;

    import javax.servlet.http.HttpServletRequest;

    import com.sap.isa.businessobject.SalesDocument;

    import com.sap.isa.businessobject.item.ItemList;

    import com.sap.isa.businessobject.item.ItemSalesDoc;

    import com.sap.isa.core.UserSessionData;

    import com.sap.isa.core.util.RequestParser;

    import com.sap.isa.isacore.action.order.MaintainBasketBaseAction;

    import com.sap.isa.isacore.action.order.MaintainBasketRefreshAction;

    /**

    *

    *

    *

    */

    public class Z_MaintainBasketRefreshAction

    extends MaintainBasketRefreshAction {

    /**

    *

    */

    public void customerExitParseRequest(

    RequestParser parser,

    UserSessionData userSessionData,

    SalesDocument salesDocument) {

    HttpServletRequest request = parser.getRequest();

    if (salesDocument != null) {

    log.debug("Z_MaintainBasketRefreshAction****** ");

    ItemList itemsdata = salesDocument.getItems();

    if (request.getAttribute(MaintainBasketBaseAction.RC_BASKET)

    != null) {

    log.debug("RC_BASKET Not Null....");

    SalesDocument l_doc =

    (SalesDocument) request.getAttribute(

    MaintainBasketBaseAction.RC_BASKET);

    itemsdata = l_doc.getItems();

    log.debug("Got the reference....");

    }

    ItemSalesDoc[] l_items = itemsdata.toArray();

    // String[] extItems_new =

    // request.getParameterValues("markfor[]");

    // String[] extItems_old =

    // request.getParameterValues("oldmarkfor[]");

    RequestParser.Parameter extensionItems =

    parser.getParameter("markfor[]");

    RequestParser.Parameter extensionOldItems =

    parser.getParameter("oldmarkfor[]");

    RequestParser.Parameter onChangeMarkfor =

    parser.getParameter("onChangeMarkfor[]");

    for (int i = 0; i < l_items.length; i++) {

    ItemSalesDoc l_item = l_items<i>;

    String extItems_new = "0020000001";

    String extItems_old = "0020000005";

    l_item.addExtensionData("Z_MARKFOR_ITEM", extItems_new);

    l_item.addExtensionData("Z_MARKFOR_OLD_ITEM", extItems_old);

    }

    request.setAttribute(MaintainBasketBaseAction.RK_ITEMS, itemsdata);

    }

    }

    }

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2009 at 05:16 AM

    Hi Lakshman/Eswar,

    Somehow now we are able to solve it.

    ref guid is still blank from ct extension but we are populating it from crm badi itself and this way the problem has got solved.Thank you once again.

    Regards,

    Arshi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      It is impossible to get the ref_guid for the first time in this BADI. We had run into this same issue and no matter what you do the ref_guid will be blank . We went to SAP and they said the same thing, this BADI doesn't work unless you get the items added to the cart. So for the first time it will never work and from second iteration onwards if the quantity doesn't change then this won't even trigger. That is why it is always recommended to default the quantity on the order cart to 1 and let user enter the product and change the quantity if he likes. This BADI is useless for custom modifications before the item guid is created.

      Thanks,

      Kumar

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.