Skip to Content
avatar image
Former Member

ACCOUNT ASSIGNMENT

Hi all,

I am populating the data in account assignment tab while creating Shopping cart.the fields COST_CTR and G_L_ACCT are populated by BADI(DOC_CHANGE_BADI), i have considered the structure BBPS_ACC_BADI for populating the BADI in this BADI i have fields like COST_CTR,ORDER_NO and WBS_ELEM_E to populate.My Query is i want to populate the description for G_L_ACCT.How can i find that GL account description field i have searched in the structures BBPS_ACC_BADI and BBP_PDS_ACC but i didn't found that field.Can anyone help me out to find the GL account description field.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 22, 2007 at 06:22 PM

    Hi Joseph,

    You have 2 things:

    1) Populate GL Acc from Fav GL Account

    2) Populate Short Text for GL Account.

    1) if you use BBP_DOC_CHANG_BADI the GL Account no is verified for existence in SRM system and as suggested by Atul you may try BBP_CREATE_PO_BACK as this triggers after the verification process.

    2) When you send the GL Account to Backend you need not send the Description again. It reads from the backend system. So you need not use RFC to get the GL Acc Details and as you have informed about your Z-Table. Just extract the value from that and populate the GL Account.

    Regards

    Rakesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Problem is solved..

      I have used FM CONVERSION_EXIT_ALPHA now i am getting GL description and populating well..

      Thanks for u help..

      I will reward u full points 😊

  • avatar image
    Former Member
    Feb 20, 2007 at 10:58 AM

    Hi Joseph,

    There can be better way to find it.

    I will suggest.

    E_ITEM-BE_CO_CODE in FM BBP_PD_SC_GETDETAIL.

    regards,Nishant

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks!

      this is the code i have written in the DOC_CHNAGE BADI for PO

      method IF_EX_BBP_DOC_CHANGE_BADI~BBP_PO_CHANGE.

      DATA : ls_ztgl_codes TYPE ztgl_codes.

      FIELD-SYMBOLS : <ls_account> TYPE BBPS_ACC_BADI,

      <ls_item> LIKE LINE OF et_item.

      data: ls_capt TYPE ztcapt,

      ls_item_it like line of it_item,

      ls_item_et like line of et_item.

      loop at it_item into ls_item_it.

      move-corresponding ls_item_it to ls_item_et.

      append ls_item_et to et_item.

      endloop.

      • ET_ITEM[] = IT_ITEM[].

      ET_ACC[] = IT_ACC[].

      ET_PARTNER[] = IT_PARTNER[].

      • ET_ORGDATA[] = IT_ORGDATA[].

      ET_HCF[] = IT_HCF[].

      ET_ICF[] = IT_ICF[].

      LOOP AT et_item ASSIGNING <ls_item>.

      LOOP AT et_acc ASSIGNING <ls_account> WHERE p_guid = <ls_item>-guid.

      IF <ls_account>-zzsrm_cap_no <> ''.

      SELECT SINGLE * FROM ztcapt INTO ls_capt WHERE capno = <ls_account>-zzsrm_cap_no.

      <ls_account>-zzsrm_stage = ls_capt-stage.

      <ls_account>-zzsrm_project = ls_capt-proj.

      ENDIF.

      if <ls_account>-ZZSRM_FAV_SEQ <> ''.

      select single * from ztgl_codes into ls_ztgl_codes

      where FAV_SEQENCE = <ls_account>-ZZSRM_FAV_SEQ

      and username = sy-uname.

      <ls_account>-ZZTERTP = ls_ztgl_codes-ZZTERTP.

      <ls_account>-ZZTERCD = ls_ztgl_codes-ZZTERCD.

      <ls_account>-ZZMKTCD = ls_ztgl_codes-ZZMKTCD.

      case ls_ztgl_codes-acc_cat.

      when 'CC'.

      <ls_account>-acc_cat = 'CC'.

      <ls_account>-COST_CTR = ls_ztgl_codes-COOBJ.

      when 'WBS'.

      <ls_account>-acc_cat = 'WBS'.

      <ls_account>-WBS_ELEM_E = ls_ztgl_codes-COOBJ.

      When 'OR'.

      <ls_account>-acc_cat = 'OR'.

      <ls_account>-ORDER_NO = ls_ztgl_codes-COOBJ .

      endcase.

      <ls_account>-G_L_ACCT = ls_ztgl_codes-G_L_ACCT.

      data : lt_account_detail type BAPI3006_2.

      • ls_account_detail like line of lt_account_detail.

      data : lv_sysid type LOGSYS.

      data : ls_header type BBP_PDS_PO_HEADER_D.

      • Check the SRM system

      IF SY-SYSID = 'UPD'.

      LV_SYSID = 'UHD_111'.

      ELSEIF SY-SYSID = 'UPX'.

      LV_SYSID = 'SAPUHD111'.

      ELSEIF SY-SYSID = 'UPQ'.

      LV_SYSID = 'SAPUHQ100'.

      ELSEIF SY-SYSID = 'UPP'.

      LV_SYSID = 'SAPUPP100'.

      ENDIF.

      CALL FUNCTION 'META_GLACCOUNT_GETDETAIL'

      EXPORTING

      companycode = <b>(WHAT TO PASS HERE AS COMPANY CODE IS NOT STORED)</b>

      glacct = <ls_account>-G_L_ACCT

      • LANGUAGE = 'EN'

      LOGICAL_SYSTEM = LV_SYSID

      IMPORTING

      • RETURN =

      ACCOUNT_DETAIL = lt_account_detail

      • TABLES

      • CONTROL_RECORD =

      .

      <ls_account>-zzshort_text = lt_account_detail-short_text.

      endif.

      ENDLOOP.

      ENDLOOP.

      endmethod.

      <b>From here i have GL Short text (<ls_account>-zzshort_text) ...Now where to pass this GL shorttext as DOC_CHANGE_BADI doesnot store GL description...

      DO u want me to implement BBP_CREATE_PO_BACK..if i implement want to write init and how to populate GL Account Description...</b>

      Please help...

      Message was edited by:

      joseph Prashanth

      Message was edited by:

      joseph Prashanth

      Message was edited by:

      joseph Prashanth

      Message was edited by:

      joseph Prashanth

  • avatar image
    Former Member
    Feb 16, 2007 at 03:56 PM

    Hi

    Can you re-phrase your question again ? It's quite confusing.

    <b>Do you want to create a back-end document in the R/3 system or handle the document Locally in SRM itself.</b>

    What is your system version ? Which type of EBP Scenario are you using ?

    <b>Incase if you are talking about R/3 document to get created form SRM Shopping cart, then the G/L Account description is not required to be sent from SRM, As the same will automtically apper in the R/3 Back-end document (Purchase order, Purchase Requisition, etc)</b>

    Actually it depends, incase you have maintained GL Accounts in SRM System itself, then you can get the details from SRM Locally.

    Hope this will help.

    Please reward suitable points.

    Regards

    - Atul

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 16, 2007 at 05:29 PM

    Hi Joseph,

    I found one way to find Description of GL account using a BAPI(Remotely enabled Function Module).

    META_GLACCOUNT_GETDETAIL

    META_GLACCOUNT_GETLIST

    These BAPI need Import Parameter as Company code,Language,Logical System.

    I feel that BADI META_GLACCOUNT_GETLIST suits your requirement.

    regards,nishant

    Please reward points if this helps

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      The Company code in this case, can be find out, based on the Current User Logged on to ITS Web, and is creating the Shopping carts in this case from the Organizational Plan of SRM system.

      <b>Either use any of the Function modules to fetch the User attributes maintained in the organization plan.</b>

      <b>BBP_READ_ATTRIBUTES

      BBP_USER_GET_ATTRIBUTES

      BBPU_GET_ATTRIBUTES_ANALOG

      BBP_GET_ATTRIBUTES_AT03 </b>

      This will depend on your SRM system version.

      Hope this will help.

      Please reward suitable points.

      Regards

      - Atul

  • avatar image
    Former Member
    Feb 16, 2007 at 06:35 PM

    Hi Joseph,

    I think that what you want is to change the G/L account description while SC it's been created/updated, and you want to know where to put that description to be taken by SC...

    I have checked the DOC_CHANGE_BADI and unfortunately i couldn't find it, the BADI table ET_ACC only contains G_L_ACCT, GL_ACC_ORIGIN but those fields contain the value keys to access the account...

    Maybe you will need to research in other BADI's to find if there's another way to populate it....

    Best regards,

    Gerardo.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 17, 2007 at 12:38 PM

    Hi

    You can create a custom field in the Account assignment tab off the shopping cart 
    and populate the data using META_GLACCOUNT_GETDETAIL (Remotely enabled Function Module) and then map the field description to this custom field inside the BBP_DOC_CHANGE_BADI implementation.

    <b>Please refer to OSS note - 672960 for further help.</b>

    Hope this will help.

    Please reward suitable points.

    Regards

    - Atul

    Add comment
    10|10000 characters needed characters exceeded