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

Account assignment depending on SC fields

Hi all,

we have the requirement to implenent an own account assignment in shopping carts depending on SC fields like PARTNER or PRICE. The accounting is intended as an initialization that can be overwritten later by the requisitioner.

I shall use BAdI BBP_DETERMINE_ACCT. But its import parameter ITEM_DATA seems tiny and does not contain any useable SC fields. BAdI BBP_DOC_CHANGE_BADI is not an option because it runs more than once. The initialization must only run at the time the accounting is first determined. And more, note 1912511 says one must not use that BAdI for custom account assigning.

How do I get SC details in BAdI BBP_DETERMINE_ACCT?

kind regards

José

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Jan 09, 2014 at 01:04 PM

    Hi,

    If you need some extra data from BAdI BBP_DETERMINE_ACCT may be you can use this:

    http://scn.sap.com/thread/3338751

    Check the answer by Konstantin Anikeev to get the data from the selected SC item.


    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi José,

      I've never used the badi BBP_DETERMINE_ACCT, so I don't know how it works or when is being triggered, I guess the badi is triggered when you select a line. There is a field LINE within the parameter ITEM_DATA, I don't know if you can use it to read the table you exported to memory, comparing with the field NUMBER_INT.

      If the badi is being triggered when you select a line you can use the code in the link I put in my previous answer, in this way you can retrieve the data from the selected item in the SC.

      Anyway, if you want to use badi BBP_DOC_CHANGE_BADI and you want to execute some code only the first time the line is added, as inicialization, you can use this code as reference to know if the line has just been added.

      http://scn.sap.com/thread/1908996

      Regards,
      Ricardo.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 14, 2014 at 07:05 AM

    Hi Jose,

    It seems to be working with session memory Id.. Sample code we using..

    ------------------------------------------------------------

    * this BADI gets the default G/L account based on company, plant, Icode,

    * and account assignment category

    *** Import the GL Acct from class ZCL_IM__CP_EBP_UOM_OUT, method IF_EX_BBP_DOC_CHANGE_BADI~BBP_PO_CHANGE

    data: gv_gl_acct TYPE BBP_PDS_ACC-G_L_ACCT,

    lv_gl_acct TYPE BBP_PDS_ACC-G_L_ACCT.

    import gv_gl_acct to lv_gl_acct from MEMORY id 'GV_GL_ACCT'.

    if item_data-catalogid is INITIAL.

    CLEAR wa_acct.

    READ TABLE acct_data INTO wa_acct with key line = item_data-line.

    if sy-subrc eq 0.

    wa_acct-g_l_acct = lv_gl_acct.

    MODIFY acct_data FROM wa_acct

    TRANSPORTING g_l_acct WHERE line = item_data-line.

    CLEAR wa_acct.

    endif.

    ENDIF.

    ------------------------------------------------------------------------------------


    BR

    Srrimaan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 14, 2014 at 08:24 AM

    Hi Jose,

    The sample code I posted is from BBP_DETERMINE_ACCT. but looks we referring PO change to fill values to Memory Id..

    BR
    Srrimaan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2015 at 01:09 PM

    Hi Jose,

    did you manage to find a way to resolve this? Thanks

    Add a comment
    10|10000 characters needed characters exceeded

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.