Customer Code Creation

Hi,
     My client has a set of customers who buys both PRODUCTS & SERVICES from my client. However, my client has set separate credit limits, one for PRODUCTS & one for SERVICES for such customers. Given this scenario, is it necessary to create 2 customer codes for each such customer or is there a way out using one customer code for such customers? Plz suggest.
It should be noted that there is a single Business Area for my client.
Thanks in anticipation,
Ryan

Hi Prashant,
                   Thnx for the lead, thou I am yet to reach the destination. When I enter the invoice for the customer, the credit needs to be checked. In which field do I incorporate this risk category thing to differentiate between products and services?
Thnx,
Ryan

Similar Messages

  • Issue in OTR creation with Numeric Range of Customer Code

    Dear All,
    I am facing error while creating OTR with reference to Sales order in SAP TM system. The Error message “Business partner internal ID 0000710420 does not exist” appears when I Use Customer Code as Numeric, whereas if I create customer with Alpha-Numeric, then there is no issue.
    I have debugged the same and found the error is in Class “/SCMTMS/CL_TRQ_ICPY_TRQ_REQSRV” under Method “PREPARE_MD”. In this method, the system is converting the Business partner Code (Field: EXT_BP_ID) of Customer to 60 Character for Numeric Customer Code. Due to which system is not getting the KEY (Field: INT_BP_KEY) of the Business partner as shown in below screenshot:
    Whereas for Alphanumeric Customer Code, system is not converting the Business partner Code to 60 Char and hence not giving error. Below is the screenshot:
    Kindly advice how to resolve the issue.
    Regards,
    Vibhu Gupta

    Dear Marcelo,
    Yes same number range is maintained in both systems and infact BP is creating in TM system. But while creating OTR, TM system is calling a functional module in method I mentioned above, which will cusion the Business partner ID to make it 60 Character internally while creating OTR, due to which system is able to fetch its Key and hence give error message.
    This is happening only when Business Partner Number range is Numeric. If I use Alpha Numeric, then system do not cusion the business partner code and hence do not give error.
    Regards,
    Vibhu Gupta

  • How can I have any new pernr creation dynamically trigger custom code

    I would like to develop a custom process that is triggered whenever a new pernr is created. So basically when pa40 is used to hire an employee, is there a way for this new hire event to trigger my custom code. I would like to grab the new pernr, look up the CP object just created, and save this CP data in a custom infotype. I looked into the possibility of using dynamic actions, and the user exit zxpadu02 option. The options I mentioned may work, but I was hoping to find a more solid solution where the moment a pernr and its CP are created, my custom code can execute.

    The major issue with the user-exit approach is the fact that screen navigation varies during the pa40 process depending on action and country grouping. When the user-exit executes during infotype 0000 processing, the new pernr and CP object have not yet been created. If we use a different infotype (IT0002 for example) to trigger our custom code in the bapi, we may get unexpected results due to user unpredictability. If they decide to exit the hiring screens early for some reason.

  • Blocking User from accessing wrong customer code in VA01

    Hi SAP SD GURU,
    my finance user uses rebate recipent in sales order creation for rebate settlement.
    my operation user uses one-time customer code in sales order for sales.
    Both type of customer codes can be used in sales order creation under different order type.
    The problem arises when operation staff uses rebate recipent code to create sales order and then billing.
    My finance User want this to stop.
    How can I block the operation User from continuing the sales entry when they select the rebate recipent in a sales order entry?
    Is there any available setting in the customer master that allow me to do so?
    Is there any setting in the SPRO that can control this?

    Hi Colin,
    Well you need to control these through the user profile & roles
    you can do this in SU01 which a Basis person can help you out with .....
    now as said User X wants authorisation to va01  ( Rebate)
                      User Y wants Authorisation to va01 ( One time)
    since here we are not restricting any user for VA01 auth , the Basis person can define the role only till the transaction level not beyond that in standard SAP transaction and here you want to restrict user to not use different customer code
    as per my knowledge i dont think that is possible but still have a check with the Basis team
    Hope this helps
    Cheers

  • Error in Process code creation

    Hi All,
    I need to create a process code and i need to attach  a custom function module for that process code.
    So i have  created custom FM.
    afterward in WE42 ,
    I gave custom process code name ,description and FM .
    when i tried to save the same its giving following message.
    For entry, access 'Function module for ALE-EDI inbound processing'
    when i tried to give some entries its not accepting...
    Please provide me the steps for process code creation.
    Reg,
    Hem.

    hi
    good
    Definition
    Another name for a specific process, for example function module or workflow. IDocs are read or written in this process.
    Use
    In the partner profiles, the processing is never addressed directly but rather always using a process code. You can therefore replace an old process with a new one for any number of partners by assigning the existing process code to the new process.
    Two types of process code are used in conjunction with the partner profiles:
    1) Outbound Process Code - if you are using outbound processing under Message Control, the IDoc is generated in the IDoc Interface. The process code names the relevant function module.
    2)Inbound Process Code - names the function module or workflow which reads the IDoc data and transfers the data to the application document.
    There are process codes for exception handling:
    1) System Process Code - names the workflow which is triggered in inbound or outbound processing when an exception occurs.
    2) Status Process Code - names the exception workflow which is triggered when an incorrect status is returned by the external system.
    These two types are configured centrally and not on a partner-specific basis and therefore do not have to be maintained when a new process is defined. They were introduced for the sake of completeness, so that each process in the IDoc Interface is addressed using a process code.
    reward point if helpful.
    thanks
    mrutyun^

  • Customer master creation time

    Hi
    where can i find customer master creation time ?
    regards

    In XD02/XD03 transaction code
    Extras->Administrative data(Shift + F8)

  • Regarding Custom IDOC Creation

    Hi All,
    I Am New to ABAP , Any one Please Give me the Step -By Step Procedure to create Custom IDOC.
    I Have this Link with me.
    Step by step custom IDOC creation
    But I Don't Know that What should i Give field names and Data elements
    How to create Field names And Data elements
    Regards
    Vamsi

    Hi,
    U need a custom IDOC when the elements in the standard IDOC is not there according to requirement. ex. in IDOC cremas04 u want the Country code should be there.
    Then U go for custom iDOC and create a Y/Z i.e custom idoc and add one structure and add the required fiellds.
    Check this link for Step by Step guide
    http://www.erpgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    CHeck this link for a IDOC ...The steps are mentioned in details about creating custom idoc..
    http://www.allsaplinks.com/idocbasicsunderstanding.html
    http://www.allsaplinks.com/idoc.html
    http://www.allsaplinks.com/idoc_sample.html
    Please check this link.
    http://help.sap.com/saphelp_46c/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    Regards

  • How to Generate a Custom Message for A Custom Code.

    Hello,
    Can anyone guide me on this -
    Application : 11.5.10.2
    We have a cutom Trigger through which we want to display a custom message.
    We have re-generated the .msb, but it seems that something is missing.
    Following are the Steps We have followed to generate a custom message.
    1. Responsibility "Application Developer"
    2. Go to Applications
    3. Select Message
    4. Define a new custom message.
    5. Save
    6. Run Request " Generate Message"
    Now when the trigger gets fired , we are not able to see our Custom message.
    How do we call this messge in the custom code.
    Pl. help on this , also can i get some reference note id's on this.
    Thanks in advance.
    Regards,
    Jenny

    CREATE OR REPLACE TRIGGER KPC_RCV_TRANSACTIONS_INTERFACE
         AFTER INSERT OR UPDATE ON APPS.RCV_TRANSACTIONS_INTERFACE
         REFERENCING NEW AS NEW OLD AS OLD
         FOR EACH ROW
    ---     This Trigger Validates following things
    ---     1.     Creation date is not modified and is greater than system date.
    ---     2.     RTV should not be possible before ERS is generated.
    ---     3.     Inspection should not be possible through Deliver Transactions Responsibility
    ---     4.     Delivery of Material should not be possible through Inspection Responsibility
    ---     5.     Item is Excisable and Excise Invoice No Or Excise Invoice Date is Missing
    ---     6.     Only Inspected and Accepted material is Delivered to Subinventory
    ---     7.     Check for Existance of 57F4 for Subcon Job Receipts
    ---     8.     Check Taxes are not Missing
    ---     9.     Check Taxes are Correct
    ---     Declaring The Variables
    DECLARE
         v_grade                    number          :=     0;
         v_employee_id               number          :=     0;
         v_responsibility          varchar2(100)     :=     'Z';
         v_closed_taxes_count          number          :=     0;
         v_taxes_count               number          :=     0;
         v_invoiced_status_code          varchar2(01)     :=     'N';
         v_57f4_id               number          :=     0;
         l_date_ok               varchar2(01)     :=     'N';
         l_gate_date_ok               varchar2(01)     :=     'N';
         l_cenvatable_flag          varchar2(01)     :=     'N';
         l_excise_ok               varchar2(01)     :=     'N';
         l_rtv_ok               varchar2(01)     :=     'N';
         l_inspection_ok               varchar2(01)     :=     'N';
         l_delivery_ok               varchar2(01)     :=     'N';
         l_rej_delivery_ok          varchar2(01)     :=     'N';
    BEGIN     
    --      Get Looged in Responsibility Name
         begin
              SELECT      upper(responsibility_name)
                   INTO v_responsibility
              FROM      apps.fnd_responsibility_vl
              WHERE      responsibility_id = apps.fnd_global.resp_id;
         EXCEPTION
              WHEN      NO_DATA_FOUND THEN
                   v_responsibility := 'Z';
              WHEN      OTHERS THEN
                   v_responsibility := 'Z';
         END;
    ---     Modifications Done by SMT to Bypass checking for following Users
         if     (apps.fnd_global.user_id     <     1091)     then
              return;
         end     if;
    ---     if     (apps.fnd_global.user_id     in     (1090,1111,1112,1126,1540,1591,1570,1881))     then
    ---          return;
    ---     end     if;
    ----     Collect the Information Required from Other Tables
    ---     Check whether item is cenvatable
         l_cenvatable_flag     :=     'N';
         begin
              select     'Y'
              into     l_cenvatable_flag
              from     apps.ja_in_po_line_location_taxes     jipll
              where     upper(jipll.tax_type)          in     ('EXCISE','CVD')
              and     jipll.po_header_id          =     :new.po_header_id
              and     jipll.po_line_id          =     :new.po_line_id
              and     jipll.line_location_id          =     :New.po_line_location_id;
         EXCEPTION
              WHEN      NO_DATA_FOUND THEN
                   l_cenvatable_flag     :=     'N';
              WHEN      OTHERS THEN
                   l_cenvatable_flag     :=     'N';
         end;
    ---     Check whether Taxes are closed
         v_closed_taxes_count     :=     0;
         begin
              select     count(distinct jit.tax_id)
              into     v_closed_taxes_count
              from     apps.ja_in_tax_codes               jit,
                   apps.ja_in_po_line_location_taxes     jipl     
              where     nvl(jit.end_date,sysdate)<     sysdate               
              and     jit.tax_id          =     jipl.tax_id
              and     po_header_id          =     :new.po_header_id
              and     po_line_id          =     :new.po_line_id
              and     line_location_id     =     :new.po_line_location_id;
         EXCEPTION
              WHEN      NO_DATA_FOUND THEN
                   v_closed_taxes_count     :=     0;
              WHEN      OTHERS THEN
                   v_closed_taxes_count     :=     0;
         end;
    ---     Check Existance of Taxes
         v_closed_taxes_count     :=     0;
         begin
              select     count(distinct jit.tax_id)
              into     v_taxes_count
              from     apps.ja_in_tax_codes               jit,
                   apps.ja_in_po_line_location_taxes     jipl     
              where     nvl(jit.end_date,sysdate)<     sysdate               
              and     jit.tax_id          =     jipl.tax_id
              and     po_header_id          =     :new.po_header_id
              and     po_line_id          =     :new.po_line_id
              and     line_location_id     =     :new.po_line_location_id;
         EXCEPTION
              WHEN      NO_DATA_FOUND THEN
                   v_taxes_count     :=     0;
              WHEN      OTHERS THEN
                   v_taxes_count     :=     0;
         end;
    ---     Modifications Done by SMT to Get Invoice Status Code of the Original Transaction
         v_invoiced_status_code     :=     'N';
         BEGIN
              SELECT      'Y'
              INTO      v_invoiced_status_code
              FROM      apps.ap_invoices_all          ap,
                   apps.rcv_shipment_headers     rcv
              WHERE      ap.invoice_num               like     '%'||rcv.receipt_num||'%'
              AND     ap.org_id               =     rcv.ship_to_org_id
              AND     rcv.shipment_header_id          =     :NEW.shipment_header_id;
         EXCEPTION
              WHEN      NO_DATA_FOUND THEN
                   v_invoiced_status_code          :=     'N';
              WHEN      OTHERS THEN
                   v_invoiced_status_code          :=     'N';
         END;
    ---     RAISE_APPLICATION_ERROR(-200151,'Incorrect Transaction Date...');     
    ---     Check the transaction_date is correct or not
         l_gate_date_ok          :=     'Y';
         IF     ((:new.ship_head_attribute6     is     null)                                        or
              (to_date(:new.ship_head_attribute7,'DD-MON-YYYY')     <     (sysdate-3))                    or
              (to_date(:new.ship_head_attribute7,'DD-MON-YYYY')     >     sysdate))                    then
              l_gate_date_ok     :=     'N';
         END      IF;
    ---     Check the transaction_date is correct or not
         l_date_ok          :=     'Y';
         IF     (to_date(:new.transaction_date,'DD-MON-YYYY')     <     to_char(sysdate,'DD-MON-YYYY'))     then
              l_date_ok     :=     'N';
         END      IF;
    ---     Check whether Excise Invoice No and Excise Date is present
         l_excise_ok          :=     'Y';     
         if     (l_cenvatable_flag               =     'Y'               and
              :new.ship_head_attribute1          is     null               and
              upper(:new.destination_type_code)     =     'RECEIVING')          then
              l_excise_ok          :=     'N';
         end     if;
         if     (l_cenvatable_flag               =     'Y'               and
              :new.ship_head_attribute2          is     null               and
              upper(:new.destination_type_code)     =     'RECEIVING')          then
              l_excise_ok          :=     'N';
         end     if;
    ---     Check whether Inspection transaction is being made in correct Responsibility
         l_inspection_ok               :=     'Y';
         if     (upper(:new.destination_type_code) = 'RECEIVING')               then
              if     (v_responsibility like '%RECEIPT%QA%')                    then
                   l_inspection_ok     :=     'Y';
              else
                   l_inspection_ok     :=     'N';
              end     if;
         else     l_inspection_ok          :=     'Y';
         end     if;
    ---     Check whether Delivery transaction is being made in correct Responsibility
         l_delivery_ok               :=     'Y';
         if     (upper(:new.destination_type_code) in ('INVENTORY','SHOP FLOOR'))          then
              if     (v_responsibility not like ('%RECEIPT%QA%'))     then
                   l_delivery_ok     :=     'Y';
              else
                   l_delivery_ok     :=     'N';
              end     if;
         else     l_delivery_ok          :=     'Y';
         end     if;
    ---     Check whether RTV is made prior to generating the ERS Invoice
         l_rtv_ok               :=     'Y';
         if     (upper(:new.transaction_type) in ('REJECT','RETURN TO VENDOR'))          then
              if     (v_invoiced_status_code = 'INVOICED')                    then
                   l_rtv_ok     :=     'Y';
              else
                   l_rtv_ok     :=     'N';
              end     if;
         else     l_rtv_ok          :=     'Y';
         end     if;
    ---     Check Error and Display Proper error message
    ---     Transaction Date Error
         if     (nvl(l_date_ok,'N') != 'Y')          then
              apps.fnd_message.set_name('FND','Wrong GRR Date');
              apps.fnd_message.raise_error;
         end     if;
    ---     Gate Entry Date Error
         if     (nvl(l_gate_date_ok,'N') != 'Y')          then
              apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Wrong Gate Entry Date');
              apps.fnd_message.raise_error;
         end     if;
    ---     Return CENVAT Error
         if     (nvl(l_excise_ok,'N') != 'Y')          then
              apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Enter Excise Invoice No');
              apps.fnd_message.raise_error;
         end     if;
    ---     Return Closed Taxex Error
         if     (nvl(v_closed_taxes_count,1) != 0)     then
              apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Taxes Wrong');
              apps.fnd_message.raise_error;
         end     if;
    ---     Return Taxes Missing Error
         if     (nvl(v_taxes_count,0) = 0)     then
              apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Taxes Missing');
              apps.fnd_message.raise_error;
         end     if;
    ---     Return from trigger, if Transaction Type = 'RECEIVE'
         if     (upper(:new.transaction_type) = 'RECEIVE')     then
              return;
         end     if;
    ---     Return Inspection Error
         if     (nvl(l_inspection_ok,'N') != 'Y')     then
              apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Inspection Not Allowed');
              apps.fnd_message.raise_error;
         end     if;
    ---     Return Material Delivery Error
         if     (nvl(l_delivery_ok,'N') != 'Y')          then
              apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Delivery not Allowed');
              apps.fnd_message.raise_error;
         end     if;
         return;
    END KPC_RCV_TRANSACTIONS_INTERFACE;

  • Create lead via reference to campaign using custom code

    I'm looking for an easy way via custom code to create a lead transaction and include a reference to a campaign object in my system.  I'm having no luck with the XIF doc flow segment for the lead creation and would like to look for other methods to update this link.
    Any suggestiosn on how to code this would be great.  Yes I know that I could do ELM, but then I would need to rewrite my entire program, my leads create properly minus the campaign link.
    As always help will be acknowledge and correct answers given here, will be put in the CRM wiki for future reference.
    Thank you,
    Stephen

    Okay this actually will work via XIF adapter, the trick was proper settings of the related type attribute.  When SAP inserts new doc flow for relations to campaigns it is done via "space" option.  The LV_GUID needs to be GUID of the campaign in question.
      LS_DOC_FLOW-RELATION_TYPE   = 'VONA'.
      LS_DOC_FLOW-RELOBJ_ROLETYPE = 'VORGAENGER'.  "Role A
      LS_DOC_FLOW-RELOBJ_OBJKEY   = LV_GUID.
      LS_DOC_FLOW-RELOBJ_TYPE     = 'BUS2010020'.
      LS_DOC_FLOW-OBJECT_TASK     = 'I'.
      LS_DOC_FLOW-RELATION_TYPE_ATTR = space.
      LS_DOC_FLOW-INPUT_FIELDS-RELOBJ_ROLETYPE = 'X'.
      LS_DOC_FLOW-INPUT_FIELDS-RELATION_TYPE   = 'X'.
      LS_DOC_FLOW-INPUT_FIELDS-RELOBJ_OBJKEY   = 'X'.
      LS_DOC_FLOW-INPUT_FIELDS-RELOBJ_TYPE     = 'X'.
      LS_DOC_FLOW-INPUT_FIELDS-RELATION_TYPE_ATTR = 'X'.
      INSERT LS_DOC_FLOW INTO TABLE LT_DOC_FLOW_XIF_DATA.
    Yep this will need to end up in the wiki once my I'm finished up with the full program/conversion.  I guess I will keep my title as "pied piper"  of the XIF adapter for now.
    Take care,
    Stephen

  • What is the standard API for Customer Contact creation in R12

    Hi All,
    What is the standard API for Customer Contact creation in R12. my requirement is I need to create contact against Customer(Person/Organization).
    I need to develop pl/sql package for create Contact using the following fields
    First name , Last name , Email, Phone no, Ph ext,Mobile no,Contact no,Job title, Job title code,Country,Address1,Address2,Address3,Address4,
    City,State,Postalcode.
    Please help me.
    Thanks,
    K.Murugesan

    Hi All,
    Please update if you have any solution.
    Thanks
    Maanasa

  • CUSTOM VIP CREATION ERROR

    Hi all, i have tried to define a new VIP on my ORACLE 11gR2 RAC cluster, in order to manage third-party component by using ORACLE Clusterware.
    I have used the info written on the ORACLE manual "Oracle Clusterware Administration and Deployment Guide E10717-04" at page 5-15.
    I have executed the command "/u01/app/grid/bin/appvipcfg create -network=1 -ip=xx.xxx.xxx.140 -vipname=appsVIP -user=root", as the manual says, from root user.
    My environment is AIX 6.1.
    Unfortunately, i get an error (reported following) but i am not able to solve it.
    Please, may you help me?
    Thanks
    Marco
    CUSTOM VIP CREATION ERROR
    [nodo01][]>/u01/app/grid/bin/appvipcfg create -network=1 -ip=xx.xxx.xxx.140 -vipname=appsVIP -user=root
    Production Copyright 2007, 2008, Oracle.All rights reserved
    2010-05-31 18:39:54: Creating Resource Type
    2010-05-31 18:39:54: Executing cmd: /u01/app/grid/bin/crsctl add type app.appvip.type -basetype cluster_resource -file
    /u01/app/grid/crs/template/appvip.type
    2010-05-31 18:39:55: Create the Resource
    2010-05-31 18:39:55: Executing cmd: /u01/app/grid/bin/crsctl add resource appsVIP -type app.appvip.type -attr
    USR_ORA_VIP=xx.xxx.xxx.,START_DEPENDENCIES=hard(ora.net1.network)
    pullup(ora.net1.network),STOP_DEPENDENCIES=hard(ora.net1.network),ACL='owner:root:rwx,pgrp:root:r-x,other::r--,user:root:r-x'
    CRS-0247: User name or group name is invalid
    CRS-4000: Command Add failed, or completed with errors.
    Command return code of 1 (256) from command: /u01/app/grid/bin/crsctl add resource appsVIP -type app.appvip.type -attr
    USR_ORA_VIP=xx.xxx.xxx.,START_DEPENDENCIES=hard(ora.net1.network)
    pullup(ora.net1.network),STOP_DEPENDENCIES=hard(ora.net1.network),ACL='owner:root:rwx,pgrp:root:r-x,other::r--,user:root:r-x'
    2010-05-31 18:39:56: ###### Begin Error Stack Trace ######
    2010-05-31 18:39:56: Package File Line Calling
    2010-05-31 18:39:56: --------------- -------------------- ---- ----------
    2010-05-31 18:39:56: 1: crsconfig_lib crsconfig_lib.pm 7474 crsconfig_lib::error
    2010-05-31 18:39:56: 2: main appvipcfg.pl 241 crsconfig_lib::system_cmd
    2010-05-31 18:39:56: 3: main appvipcfg.pl 93 main::config
    2010-05-31 18:39:56: 4: main appvipcfg.pl 74 main::process_arguments
    2010-05-31 18:39:56: ####### End Error Stack Trace #####
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hi,
    On Solaris 10 and Oracle Grid Infrastructure 11.2.0.2 did the following. Posting this as it might be useful to someone else. Installed Grid Infrastructure as oracle.
    As root:
    # ${GRID_HOME}/bin/appvipcfg create -network=1 -ip=<vip_address> -vipname=<vip_name> -user=root
    In the above command, if you are wondering what -network=1 is, got useful info from "Oracle GoldenGate high availability using Oracle Clusterware" white paper at http://www.oracle.com/technetwork/middleware/goldengate/overview/ha-goldengate-whitepaper-128197.pdf
    As per the white paper, if you do
    crsctl status resource -p | egrep -i 'network|subnet' | egrep -i 'name|subnet'
    output will look something like this:
    NAME=ora.net1.network
    USR_ORA_SUBNET=10.2.0.0
    net1 in NAME indicates this is network 1, and second line indicates the subnet on which the vip will be created.
    # ${GRID_HOME}/bin/crsctl setperm resource <vip_name> -u user:oracle:r-x
    I did the following as oracle:
    Oracle_Prompt> ${GRID_HOME}/bin/crsctl start resource <vip_name>
    If you want to relocate this vip to other node in the cluster:
    Oracle_Prompt> ${GRID_HOME}/bin/crsctl relocate resource <vip_name> -s <source_node> -n <target_node>
    Hope this helps.
    Thanks,
    Moorthy.
    帖子经 Moorthy Rekapalli编辑过

  • SSRS custom code for count in Report Footer

    Hi All,
    Please help me with the custom code used for below requirement
    Debtor Name     current    30+days   60+days    90+days
    aaa                       7000        0.00          0.00          10.00
    bbb                       5000        0.00         20.99         3.00
    ccc                        1000       0.00          0.00           0.00
    Expected result in report footer :                  
                                              0                1            
       2
    if  the value of  30+ , 60+ and 90+ columns  >=1 then i have to display the count in Report footer,for that i have tried using a custom code like below :
    Shared Dim OD As Integer=0
    Public Shared Function Test(ByVal OP As Decimal) As Integer
            If OP >= 1 Then
                OD = OD + 1
            Else
                OD = OD
            End If
            Return OD
       End Function
    and using below code to display
    Code.Test(Overdue)  
    but when i use this code in report footer is not displaying correct value.Please guide me where i am going wrong.
    Please let me know if you need any other details.
    Thanks in advance,
    Samhith.

    Hi Samhith,
    Per my understanding you what to count the rows which values >=1 and display them at the bottom of the table, you are trying to use the custom code to do this but failed, right?
    I have tested in my local environment and find the custom code is not correctly, and I have an alternative method which is more easy and can work in both table  and matrix.
    As Vaibhav Chaudhari also mentioned that we can use the CountDistinct function, but more correctly, we can use the count() function and the RunningValue() function, because CountDistict will not count the duplicated values if they >=1.
    Please find the expression as below:
    =Count(IIf(Fields!Yourfield.Value>=1 , Fields!Yourfield.Value, Nothing))
    OR:
    =RunningValue(IIf(Fields!Yourfield.Value>=1 , 1, Nothing),Sum,"DataSetName")
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu

  • How to execute custom code only when a specific node is selected in infoset

    Hi,
    We have written a piece of custom code under a node (P1045). Not all users will have access to this Infotype as it is related to Appraisals. So, when users (w/no access to 1045) try to run a Query for other info types data, they are getting error message 'Can not access 1045'. Custom code is getting generated whenever user runs a query. Tried to control custom code with simple IF condition by giving user name. Still generating 1045 code.
    All users use same infoset, where a group of users has access to 1045 and another group does not have access to 1045.
    Appreciate your inputs to get this resolved.
    Thanks,
    Swapna.

    Why don't you try another aproach, instead of adding the infotype to the infoset, create a new table as an alias (with the fields you want to show in regards to infotype 1045) and fill it in the node depending on the authorization check for that infotype in the code ?
    I think that adding the infotype as a node will always get the data from the infotype regardless, that is why it's showing the error.

  • Can I use Partial class to enhance a typed dataset without losing the custom code?

    Hi All,
    I wanted to see if I could use a Partial class for one of the datatable classes to add custom code so that when the dataset is regenerated I don't lose my code.
    Partial public
    Class
    WA_MMTP_TrackerDataSet1
     'Code for dataset
     Partial Public Class PATIENTSTableAdapter
            <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
             Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"),  _
             Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)>  _
            Public Overloads Overridable Function FillbyClinicianId(ByVal dataTable As WA_MMTP_TrackerDataSet1.PATIENTSDataTable, ClinicianId As Integer, sql As string) As Integer
                 Dim dd As System.Data.SqlClient.SqlCommand
                dd = new System.Data.SqlClient.SqlCommand
                dd.CommandText = Sql
                dd.Connection = OpenConnection() '  UsersTableAdapter1.Connection
                Me.Adapter.SelectCommand = dd 'Me.CommandCollection(0)
                If (Me.ClearBeforeFill = true) Then
                    dataTable.Clear
                End If
                Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
                Return returnValue
            End Function
    'Other code for datatable
    end class
    end class
    I'd like to take the function FillbyClinicianId and put it in a separate partial class like so and remove the function by the same name from the original file (dataset file):
    Partial Public Class PATIENTSTableAdapter
            <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
             Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"),  _
             Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)>  _
            Public Overloads Overridable Function FillbyClinicianId(ByVal dataTable As WA_MMTP_TrackerDataSet1.PATIENTSDataTable, ClinicianId As Integer, sql As string) As Integer
                 Dim dd As System.Data.SqlClient.SqlCommand
                dd = new System.Data.SqlClient.SqlCommand
                dd.CommandText = Sql
                dd.Connection = OpenConnection() '  UsersTableAdapter1.Connection
                Me.Adapter.SelectCommand = dd 'Me.CommandCollection(0)
                If (Me.ClearBeforeFill = true) Then
                    dataTable.Clear
                End If
                Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
                Return returnValue
            End Function
    end class
    But when I try this, the compiler gives the following errors:
    Error 91 'Adapter' is not a member of 'AttendTrackerFull.WA_MMTP_TrackerDataSet1.PATIENTSTableAdapter'. 
    Error 92 'ClearBeforeFill' is not a member of 'AttendTrackerFull.WA_MMTP_TrackerDataSet1.PATIENTSTableAdapter'. 
    I guess I'm a little confused. once code is moved into the custom partial class it seems to lose any knowledge of the main class file and any references in the class. Am I doing it wrong? or is it a restriction of the .Net since it is in another
    file. If its because its in another file, my next question would it be better to take the partial class I created to contain my custom code, should I just move my partial class to the bottom of the dataset.designer.vb file? But if I do this, wont it still
    erase my custom code. Any suggestions?
    Thanks
    Michael

    Thanks for the reply.
    They are compile time errors, but the error shows up even before compiling, so I guess it would be designer time exception also.
    What I did the other day was to create a new class file (didn't add a namespace statement to class) then added the code in prev message. This morning I added a new module and added the prev code in it incased in the namespace
    namespace ADO.NET.DataSet1TableAdapters statement. But I still have the same errors messages. I tried
    to set the Custom tool.namespace property of the dataset to WA_MMTPDataset and then did the following in a module:
    namespace WA_MMTPDataset
    Module Module4
    Partial Public Class PATIENTSTableAdapter
    <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
    Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
    Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _
    Public Overloads Overridable Function FillbyClinicianId(ByVal dataTable As WA_MMTP_TrackerDataSet1.PATIENTSDataTable, ClinicianId As Integer, sql As string) As Integer
    Dim dd As System.Data.SqlClient.SqlCommand
    dd = new System.Data.SqlClient.SqlCommand
    dd.CommandText = Sql
    dd.Connection = OpenConnection() ' UsersTableAdapter1.Connection
    Me.Adapter.SelectCommand = dd 'Me.CommandCollection(0)
    If (Me.ClearBeforeFill = true) Then
    dataTable.Clear
    End If
    Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
    Return returnValue
    End Function
    End Class
    Partial Public Class UsersTableAdapter
    <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
    Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
    Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _
    Public Overloads Overridable Function FillbyClinicianId(ByVal dataTable As WA_MMTP_TrackerDataSet1.UsersDataTable, ClinicianId As Integer, sql As string) As Integer
    Dim dd3 As System.Data.SqlClient.SqlCommand
    dd3 = new System.Data.SqlClient.SqlCommand
    dd3.CommandText = Sql
    dd3.Connection = OpenConnection()
    Me.Adapter.SelectCommand = dd3 'Me.CommandCollection(0)
    If (Me.ClearBeforeFill = true) Then
    dataTable.Clear
    End If
    Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
    Return returnValue
    End Function
    End Class
    End Module
    End Namespace
    But I'm still getting the same errors.

  • How to control or manipulate a report parameter through SSRS Custom Code

    Hi,
    In reporting services 2005 or 2008, is it possible to control the parameters inside the custom code of a report?
    for example:
    Let's say I have a parameter that displays the following value:
    Red
    Green
    Blue
    In typical scenario I can select one of the values or I can select all of the values then click the View Report button in reporting services.
    I know that this approach is much easier to do if I have an external application like ASP.Net and from there I'll just add report viewer and control the parameters to be passed and then generate the report.
    In the report I added text box that will serve as a hyperlink to refresh report:
    In the Text Box Properties\Action tab. Is it possible to control the selection of values through a custom code(SSRS Custom Code) then the report will be automatically refreshed?
    thanks,
    Joefer

    Not sure about doing a multiple selection. But you can pop up an input box to get the input on the fly.
    Add the below custom code and expression for the above parameter
    Public function Getparamvalue() AS STRING
    Dim x as STRING
    x = InputBox("Enter Red / Blue / Green")
    Return(x)
    End function
    =Code.Getparamvalue()

Maybe you are looking for