cancel
Showing results for 
Search instead for 
Did you mean: 

SRM7 classic - shopping cart - hide account assignment sections

Former Member
0 Kudos

Dear Friends

I am facing the following challange:

in SRM7 Classic Scenario

Web Dynpro Component: /SAPSRM/WDC_DODC_SC_I_BD

View Information: V_DODC_SC_I_BD

I added the custom checkbox

Field ID: ZZDIRECTMAT

Type of UI Element: CHECKBOX

UI Element Library: STANDARD

Web Dynpro Component: /SAPSRM/WDC_UI_SC_DOTC_BD

View Information: V_SC_DOTC_BASIC

Requirement: Deactivate or hide the Account Assigment COLUMN if the checkbox above is checked

Web Dynpro Component: /SAPSRM/WDC_UI_SC_DOFC_D1

View Information: V_SC_DOFC_D1

Requirement: Deactivate or hide the Account Assigment TAB if the checkbox above is checked

could anybody guide me to a solution?

thanks

Imi

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Imi,

If you delete the accounting data of the shopping cart when the checkbox is checked, the account assignment tab will not be visible.

This is already implemented for DIrect Materials in standard.

When you check the Direct Material checkbox the following stack is observed-

METHOD /SAPSRM/CL_PDO_BO_SC==========CP UPDATE_ITEM_INTERNAL

METHOD /SAPSRM/CL_PDO_BO_SC==========CP /SAPSRM/IF_PDO_BO_SC~UPDATE_ITEM

METHOD /SAPSRM/CL_PDO_BO_SC==========CP /SAPSRM/IF_PDO_BO_SC~CHANGE_TO_DIRECT_MATERIAL

METHOD /SAPSRM/CL_CH_WD_DODM_SC_I_BD=CP /SAPSRM/IF_CLL_DODM_SC_I_BD~CHANGE_TO_DIRECT_MATERIAL

METHOD /1BCWDY/PH5AZ8WQT1P84GS6R3OK==CP ONACTIONON_CHANGE_TO_DIRECT

In class /SAPSRM/CL_PDO_BO_SC, method /SAPSRM/IF_PDO_BO_SC~UPDATE_ITEM

line 163

Here me refers to an object of /SAPSRM/CL_PDO_BO_SC

IF iv_direct_material EQ abap_true.

CALL METHOD me->acct_reset

      EXPORTING

        iv_item_guid       = ls_item_pd-guid

        is_header          = ls_header

      IMPORTING

        co_message_handler = co_message_handler

      CHANGING

        ct_account         = lt_account.

endif.

You need to call the above method in case the checkbox is checked.

Then call the following method by passing the updated account assignment as

lt_account[]

CALL METHOD me->update_item_internal

    EXPORTING

      is_header          = ls_header

      is_item_new        = ls_item

      it_old_partner     = lt_old_partner

    IMPORTING

      es_item_updated    = ls_item_pd

    CHANGING

      ct_new_partner     = lt_partner_new

      ct_org             = lt_orgdata_new

      ct_account         = lt_account

      co_message_handler = co_message_handler

      ct_pridoc          = lt_pridoc_new.

This method will take care of hiding the account assignment tab.

Regds,

Siddharth.

Answers (2)

Answers (2)

matteo_montalto
Contributor
0 Kudos

Hi Imi,

this requirement has more to deal with ABAP WD development rather than updating the document itself.

My proposal is: create a Context attribute, bound to your ZZDIRECTMAT checkbox.

Then in WDDOMODIFYVIEW access to the column element you want to hide and set the visible property according to the value of the context attribute ZZDIRECTMAT (or eventually, remove directly the element from the table)


Hope that helps,

Matteo

suresh_murugan
Explorer
0 Kudos

Hi Imi,

What is your current version of SRM ?

There is a standard field called " Order as direct Material" in the shopping cart if you check it automatically the account assignment category tab will become invisible.

Regards,

Suresh

Former Member
0 Kudos

Hi Suresh,

Thanx for your reply.

SRM7, Extended scenario is not activated.

Standard Direct Material process is not activated as well.

I need to find a workaround.

regards

Imrich