Sunday, February 24, 2013

Restricting values in drop down

To restrict values in drop down -
We have to use get_att_v method and use ddlb_reason attribute in context node class. And this drop down is generally in the header so we have to add this attribute in the CN00 class.
A private variable with ddlb_reason is created which is used to pass on the drop down values.
http://scn.sap.com/message/10042735
Now lets say we have field1 when a specific value is selected in field1's drop down it should display restricted values in field2 drop down. For this write a logic in the get_v method of field1 to populate into ddlb_reason field (which should be displayed as a static attribute). This attribute can be accessed in the get_v method of field2 and be displayed.

To create and F4 help -
This can be done in any context node. And all this needs is rv_valuehelp_descriptor. This has a standard code. And is implemented in the GET_V_attr method.
You need to have the attribute technical name, attribute name, search help name, search id type. Search ID type can be from DDIC - HELP_ID_KIND_NAME
                           Reference structure field - HELP_ID_KIND_COMP
                           Reference data element  - HELP_ID_KIND_DTEL
http://wiki.sdn.sap.com/wiki/display/CRM/How+to+provide+F4+Help



CRM basics

BSPWDV_EHSET_ASG is the table where we can assign an enhancement set to a client. Only one enhancement set can be active for a client at a time. You will only have one entry in this table. To have more than one set active at a point play with the BADI COMPONENT_LOADING.

To assign a role to a user id - got to transaction SU3 - and mention CRM_UI_PROFILE in parameter tab and give your desired role and save. Looks like at a time only one role can be added in SU3.

CRMC_UI_PROFILE is the transaction where you can view all the business roles in a system.

To restrict a value in the F4 help in web, use the Get_V_ method. The RV_VALUEHELP_DESCRIPTOR will be used for this purpose.

GET_ATTR - Is used to get data of an attribute from the BOL layer to display it on UI.
SET_ATTR - Is used to set data of an attribute from UI to BOL layer.
GET_M_ATTR - This gives the meta data of an attribute, like the name of the field, the description of the field, language, key field etc.
GET_I_ATTR- This method is used to enable or disable a field.
GET_V_ATTR- This method defines the content of drop down values, F4 help.
GET_P_ATTR - This defines the property of an attribute whethers it drop down, textbox, F4, checkbox etc. Property of an attribute can be picklist, input, checkbox, link, radio.

In BSPWDVC_CMP_EXT in SM34 holds all the enhancements that are done under your custom enhancement set. You can remove all most all your enhanced controllers/enhancements in this view or SE80.


Adding a new field in WEB UI

Follow the below steps to add a new field in the form view or a search view.

Show configurable area -
Create a new field -
Select an object -
Select an object part -
Maintain field attributes -
Generate and close -
Add the field in configuration mode, you can also add the same field in search criteria. To traverse through the list or to arrange the position of the new field, use the up down button in the config button in BSP_WD_CMPWB transaction.

Generate the getter and setter methods of the field. Enable the get_v and get_i methods - Get_v method for rv_value_descriptor and get_i method for enabling the field.


Method as event handler

You can create an event handler method by right clicking on the event handler method. Or by adding a method in the IMPL class and add the below attributes as its parameters.
HTMLB_EVENT is type ref to CL_HTMLB_EVENT and this class uses the interface IF_HTMLB_DATA (input data from HTMLB ).
The parameters of this class are  -
event_class = CL_HTMLB_EVENT_SELECTION
event_server_name = is the event that is clicked on
event_name = dropdownlistbox
event_type= select
Once you add this,  go to DO_HANDLE_EVENT method and check if the below code has been addedd in this method.
  *     Added by wizard
      WHEN 'event_name'.                                    "#EC NOTEXT
        EH_ONeventhtmlb_event    htmlb_event
                    htmlb_event_ex htmlb_event_ex ).
If this is added, whatever code you write in the method EH_ONevent will successfully be triggered.


Debit and credit notes

Debit and credit notes : A debit note is given by a purchaser to a seller when the purchaser returns the items back to the seller and a credit note is then given to the purchaser by the seller.
A transaction that reduces the amt recievable from the customer is a credit memo and the one which reduces the amt payable to a vendor is a debit memo.
It is basaically a sales doc which is used in complaints processing to request a credit memo for a customer. A credit memo can be used so that it can be assigned to the relevant open invoices and carry out clearing with them.
Dunning program : WHy are we taking about one here. If a credit memo is assigned to an invoice and if it completely not able to offset the credit memo against the invoice then it is submitted as a debit memo to a vendor who is to reimburse the amt.after this a multilvele dunning program can be used.
A dunning program lets you dun customers who are making late payments
F150 is the tcode for dunning program and it basically outputs to give dunning forms.
To do the same process in CRM that is to create debi/credit memo in ECC we need to create complaints.But to create a complaint basing on an Invoic reference u have to use a badi CRM_COPY_BADI_EXTERN (check spro) this badi helps you give invoice references but only the ones in crm for the ones in ECC got to write some code with a remote function module which fetches data from ECC.

CRMXIF_PARTNER_SAVE

CRMXIF_PARTNER_SAVE  - Is a CRM online interface for business partners for external systems.
This interface has been implemented as in XIF interface.
Whats is an XIF interface ?
XIF - External Interface Adapter.  Crm middleware & SAP netweaver interchange adapters convert the data to xml and selects the data that is to be transferred further.When a CRM system is connected to an external system, data ditribution(data flow) can happen via SAP crm middleware or SAP netweaver interchange.
The business partner interface functions as an inbound and outbound interface and is capable of mass data processing. So this basically looks like the function module of an IDOC with message type as
CRMXIF_PARTNER_SAVE and idoc type as
CRMXIF_PARTNER_SAVE01.