Digit Check calculation - for XD01/XD02 - Urgent requirment

Hi Experts,
below is my requirment.
IF have like 5 digit number 12356 (Customer number)
(here 6 is units, 5 is ten, 3 is hundred, 2 is thousand and 1 is ten thousands).
My caliculation is i have multiply this number in  2 or 1 like 2 is unit, 1 is ten,
2 is hundreds and 1 is thousands 2 is ten thousands .... and so on....
1  2  3  5   6
2  1  2  1   2 by multiply
2  2   6  5  12
now i have to add : 2 + 2 + 6 + 5 + 12 = 27
after 27 next 10 multiply number is 30
here 30 -27 = 3 is my final result
if the final added value is 32 next 10 multiply number is 40  40-32 =8 final value
if the final added value is 85 next 10 multiply number is 90  90-85 = 5 final value.
I need this logic, pls can any one help in this regards
Thanks in advance
Rams
P.S: full points will be awarded
Message was edited by:
        ramesh
Message was edited by:
        ramesh
Message was edited by:
        ramesh
Message was edited by:
        ramesh

Hi,
Try this.
REPORT  ztest_digit_calc.
DATA: num1(10) TYPE c VALUE '1235678',
      num2(10) TYPE c,
      x TYPE i,
      y TYPE i,
      num3(10) TYPE c,
       num4(10) TYPE c.
DATA: BEGIN OF t_digit,
       num TYPE i,
       num1 TYPE i,
      END OF t_digit.
DATA:lt_digit LIKE TABLE OF t_digit,
     wa_digit LIKE LINE OF lt_digit.
x = STRLEN( num1 ).
y = x.
DO x TIMES.
  x = x - 1.
  num2 = num1+x(1).
  wa_digit-num = num2.
  APPEND wa_digit TO lt_digit.
ENDDO.
clear x.
LOOP AT lt_digit INTO wa_digit.
  y = sy-tabix MOD 2.
  IF y NE 0.
    num2 = wa_digit-num * 2.
  ELSE.
    num2 = wa_digit-num * 1.
  ENDIF.
  num3 = num3 + num2.
  ENDLOOP.
  num4 = num3.
  x = num3 mod 10.
  while x NE 0.
    num3 = num3 + 1.
    x = num3 mod 10.
  endwhile.
  num3 = num3 - num4.
  write : num3.
Reward points if useful.
Regards,
Vimal

Similar Messages

  • User exit for XD01/XD02 to update KNA1 field

    Hi
    I have added a custom field using append structure in KNA1
    I need to update it during the XD01 or XD02 transaction before it is saved
    I am searching for BADIs and user exits but I am not able to update anything in KNA1
    kindly help if u were having similar requirement
    thanks
    b

    Hi Max,
    I have tried all of the following
    BADI for XD01
    CUSTOMER_ADD_DATA
    BADI_LAYER
    CUSTOMER_ADDRSCR_CHG
    GOS_SRV_SELECT
    ADDRESS_SUBSCREEN
    save button:
    ADDRESS_CHECK
    ADDR_TXJCD_CHECK
    ADDRESS_UPDATE
    exits
    EXIT_SAPMF02D_001.
    BTEs
    00001320
    00001321
    00001330
    00001340
    00001350
    00001360
    but nowhere I have found an interface for updating KNA1 fields.
    I am not able to use CUSTOMER_ADD_DATA_CS and CUSTOMER_ADD_DATA_BI . I checked it using CL_EXITHANDLER
    is there any way i can store the information I need . I just need one field against the customer number
    thanks
    b

  • Price limit for material -- very urgent requirement

    hi gurus,
    i m facing a prob., actually we want to assign a certain amount for a material and we ask our users to procure that material from any vendor, But they can not exceed that limit which we had defined  while creating the info-record and Purchase order.
    how could i do that.
    useful answer will be awarded..
    please reply soon.. its very very urgent.
    Thanks:
    piyush singh

    hi gurus,
    I m telling you my problem in more clear way:
    while creating a PO the value get updated from info-record, this value should be under certain limit so that the End-user can not exceed the material price after a certain limit in PO.
    if the End-user changes the info-record or creat the info-record with price exceeding that limit ,the syatem will pop-up a message and can't allow the end-user to save, and even if they get it saved.. then the system will not allow end-user to save the PO with that exceeding price.
    the scenario is as follows:
    we fixed a price limit some-where for material Xand ask our end-user that you can buy the material X
    from any of the vendors. they whether then go to creat new info-record or change the existing info-record.
    THEN,
    the system can only save or change the price in info-record under the defined limit, if exceeding the system will not get saved the info-record.
    OR
    If he succedeed to save the info-record with the exceeded value, Then this changed price will get pop-up while creating PO , but if the value of the PO foe material X exceed the limit which we had defined for that material X the system can't save the PO.
    Where will i set this Limit for Material X.
    Thanks:
    Piyush Singh

  • Upgrade for the W701ds urgently required

    Lenovo,
    Please build a W7xxDS series with the new Ivybridge i7 3920XM with the NVIDIA Quadro 5000M or Quadro 5010M. I'm sure there's a good demand for a machine with these specification since the W701DS production ended. A lot of CAD CAM,Aerospace and R&D organisation are hungry for such a machine.

    YES !!!!!!!  I second that sentiment!
    Please bring back an upgraded W7XX with current specs and an even higher resolution screens!
    If this had to be a special order item with premium pricing, so be it
    Some of us can do with nothing less.  This is, hands down, the finest PC I've ever owned (and I've had several hundred, back to 1976).
    W700 model 2757-CTO
    (8 GB RAM, 2 x Hitachi TravelStar 500 GB 7200 RPM Drives, Bluray R/W, NVIDIA Quadro FX3700M, WUXGA); Windows 7 Ultimate SP-1, W700 Mini-Dock

  • Net requirement calculation for Sales Order

    Dear Experts,
    I have configured a strategy comprising both( KE,040) and (LSF and 100), say the strategy is Z0.But the system is not doing net requirement calculation for the dependent requirement(always proposing Pr Req though there is stock).Checking group and checking rule, I have created like the standard PP order.Will anybody Pl. guide me regarding this?
    Regards
    Reshmi

    Hi,
    1. The MRP group or the strategy group in the MRP view of the material master record determines what requirements type is used.
    If you have not specified this information, the requirements type will be selected through the item category of the sales order item and the MRP type in the MRP view of the material master record.
    If you have maintained both an MRP group and a strategy group, the system uses the strategy group (precedence to strategy group).
    You can enter the strategy group directly in the MRP view. If you have specified a strategy group, you do not need to enter an MRP group.
    The configured Strategy group need to be copied from a standard Strategy and even if you group many Strategies(Max 7) you ned to check the req Type assigned to it .
    2. The item category is derived from the item category group in the Sales view of the material master record and from the order type of the sales document. Together with the MRP type in the MRP view of the material master record, the item category determines what requirements type is selected. The MRP group in the material master record is irrelevant here.
    The advantage of this method is that the selection of the requirements type depends on the business process (such as quotation, sales order, or repair).
    All the above Points need to checked in your case
    Pavan

  • Urgent Requirement for SAP CONSULTANTS - all modules.

    TOP MNC NOW HIRING
    Urgent Requirement for SAP CONSULTANTS - all modules.
    Experience    2-5 yrs.
    Location - Gurgaon, Hyderabad,Pune.
    Interested candidates please forward your CV ASAP!!!!!!!! !!!!!!
    send your resumes at [email protected]
    Thanks,
    Rajender

    Hi,
    1. R you able to see the photo while accessing PA30 ?
    2. There is a function module to retieve the employee photo in URI.
    you can use that URI in your Iview.
    code:
    call function 'HRWPC_RFC_EP_READ_PHOTO_URI'
    exporting
    pernr = '00001185'
    DATUM = SY-DATUM
    TCLAS = 'A'
    importing
    uri = uri
    and URI should be of the type TOAURI-URI.
    Rgds,
    Shiva Kumar

  • Search string for 3 digit check number?

    For electronic bank statement,uploading file contains 3-digit check number eg;416
    but in FCHI-Check lots we defined six-digit check numbers.
    so system is not able match the check nos. as they are different, and auto reco is not happening.
    we have gone through search strings documentation but
    we dont know what to enter in search strings configuration.
    Kindly help me what to enter for 3 digit check no?
    Edited by: KUMAR on Dec 2, 2008 1:35 PM

    You'll first need to create search strings to "find" the check numbers in the note to payee information.  Then when you set up the search string use, you'll assign a mapping prefix of "000000" to format the check numbers with the leading zeros so they are 6-digits long.
    To set up the search string, you'll need to look at the note to payee information at the text either before or after the check numbers.  Let's say, for example, that the word "CHECK" always preceeds the check numbers in the note to payee:
    CHECK 456
    or
    CHECK 1234
    Because you have some check numbers coming through the bank statement as 3 digits and some as 4 digits, I'm thinking you'll need to set up two search strings, one with search string value "CHECK ###" and the following mapping:
    C ->
    H ->
    E ->
    C ->
    K ->
       ->
    -> #
    -> #
    -> #
    And the second with search string "CHECK ####" and the following mapping:
    C ->
    H ->
    E ->
    C ->
    K ->
       ->
    -> #
    -> #
    -> #
    -> #
    In the search string use, you assign each search string to the relevant company code, house bank and account ID. You can also leave these fields blank, in which case the search strings will be relevant for all company codes, house banks and accounts IDs.  You'll also need to populate the interpretation algorithm with the same algorithm that you assigned in the Global EBS config for the external transaction for checks.  The target field should be Check-/DME Reference-/Assignment number.  Fill in the mapping prefix with 000000 - and be sure to check the Active indicator.  If you are on ECC 6.0, you will also have fields for external transaction and +- (these fields may also be available in ECC 5.0 - but I know they are not available in 4.7 or prior).  If you see these fields, you can fill them in to further limit when the search string is used - for example, only for Negative transactions or only for Negative transactions with a particular external transaction value.
    Let me know if you have any other questions.
    Regards,
    Shannon
    Edited by: Shannon Moberg on Dec 3, 2008 6:05 PM

  • URGENTLY REQUIRE A CODE FOR FOLLOWING--WOULD BE GREAT HELP

    HOW TO VALIDATE XML FILE USING SAX PARSER WITH SCHEMAS like .XSD FILES

    Mankjas wrote:
    URGENTLY REQUIRE A CODE FOR FOLLOWING--WOULD BE GREAT HELPNo, it wouldn't be a great help, as the next time you needed to do something like this you'd still be lost.
    And no one here is just simply going to give you code anyway. We'll help you correct yours, and give you advice and tips, but we are not going to do your work for you. And urgent it is not, not to us. And your insisting that it is, is rude. We definately are not going to drop everything we might be doing to "help" you, especially when your essentially demanding that we do your work for you, with no effort on your part, besides.

  • URGENT Requirement for RFC to convert photo uri to bytecode

    Dear All,
    There is an urgent requirement for converting photo uri from our portal contenet server which contains images to bytecode.
    We require this very urgently.
    Your help is highly appreciated.
    Thanks and Regards,
    Soumyadeep.

    Hi,
    1. R you able to see the photo while accessing PA30 ?
    2. There is a function module to retieve the employee photo in URI.
    you can use that URI in your Iview.
    code:
    call function 'HRWPC_RFC_EP_READ_PHOTO_URI'
    exporting
    pernr = '00001185'
    DATUM = SY-DATUM
    TCLAS = 'A'
    importing
    uri = uri
    and URI should be of the type TOAURI-URI.
    Rgds,
    Shiva Kumar

  • Urgently require guidance for face recognition system

    I urgently require some guidance for developing a face recognition system.
    please tell me all the essential packages required for developing it...

    BalusC wrote:
    Tell your boss that he have to look for another developer.I guess I'd better shelve the thread requesting the code to help build and guide a small intercontinental thermonuclear device...

  • GTX 560 TI BIOS 70.24.2E.00.6C URGENTLY REQUIRED for my msi twin frozr 2.

     GTX 560 TI BIOS 70.24.2E.00.6C  URGENTLY REQUIRED for my msi twin frozr 2.

    hi,
    My seriel no is 602-v328-16sb1102202576. i am on bios 70.24.oa

  • Per Diem Calculations for Single Day and Multiple Days

    Hi Gurus
    I have just now confronted a weird calculation of Per Diems.
    I have configured Per Diems for 1 Day say $50 per Day, irrespective of the no.of hours.
    When I create a trip for a single day, the system is calculating $50 Per DIem for one day.
    Whereas, when I create a trip for 3 days, the system is calculating only for Two days i.e, $50x2=$100 and not $150 as expected, meaning the lfirst and seond day gets calculated and the last day is not getting calculated
    Please let me know where I am missing the little configuration in order to let the system calculate for multiple days correctly ?
    This is an urgent requirement please.....Need help.
    Thank you
    RRoy

    Hi,
    As I told you earlier that there could be serval options which needs to be checked again.
    For example:
    a)  V_T702N_D
    b) Your per diem table
    I think if you have checked 24 hours in V_T702N_D , then please verify the trip duration on PR05
    If it was working earlier then below might help you...
    For Example:
    Start date/time 23-July-2011 Time 00:00
    End date/time 25-July-2011 Time 00:00
    Here above number of days are three (23,24,25) but calculation for meals shall be done for two days, because for three days per diem calculation it shall be 48:01 Hours  above is 48 Hours..
    Please try in PR05 and check the results.
    Start date/time 23-July-2011 Time 00:00
    End date/time 25-July-2011 Time 00:01
    So please check again and let know in case of problem..
    Regards,
    Muhammad Umer

  • Calculation for subcontracting item of type N (non stock) as it for type L(Stock)

    Hi Gurus,
    I have a Requirement for calculating the cost for Subcontracting  Non stock items N as it is getting calculated in standard functionality for subcontracting items of Type L.
    This will be done in CK11n ( used to calculate the standard cost estimate of the product) for header as well as component materials.
    please suggest the user exit or Badi where i can change.
    Please refer the below logic-
    BOM for the material 2000500 as Header and 1LPL0835298AB as a component and this component has an assembly with 7008508 as a component and this component is an Sub contracted item and this has an assembly with component 1LBA182151-3.
    Price calculation for the material 7008508 (Item Category as N). Since this is sub contracted item the price will picked from field EINE-NETPR.
    In EINA, pass the material (MATNR=7008508) to fetch the list of info records (INFNR) created for that material.
    Then it has to input those info records to EINE table along with Purchasing organization (EINE-EKORG=PT02).
    From the output of EINE table, it should compare the price (EINE-NETPR) of the PIR and should take the least price from those PIR`s.
    If the currency is other than PLN, then it should be converted to PLN based on conversion charges.
    For Material (MATNR=1LBA182151-3), it should pass the material number to table MBEW along with valuation area (BWKEY = WERKS).
    From the output, it should check the Price control (VPRSV) ‘V’ or ‘S’
    If ‘V’ the price will be picked from the field “VERPR”
    If ‘S’ the price will be picked from the field “STPRS”
    Also from the output, it should check the Price unit (PEINH) ‘1’ or other than ‘1’. If it is other than ‘1’ it should divide the VERPR or STPRS by PEINH. Then this is the price of the Material “1LBA182151-3”.
    The material (MATNR=1LBA182151-3) should be passed to table “MARA” and will take the Base unit of measure from that table “MEINS”.
    Br,
    Surya

    Hi Surya,
    Please put breakpoints in any of the below BADI's and check if any of them will trigger for your
    requirement:
    VALUATION_CK                            BAdI for Valuation in Product Costing
    CK_KALAMATCON2_CI                       BAdI for CI Fields for Table KALAMATCON2
    COSTINGRUN_CK                           Edit Costing Run
    COST_APPORTION_CK                       Maint Apportionment Structure Joint Production: Dist Rules
    CO_PROD_COSTING_CK                      Cost Management for Joint Products (Costing, Target Costs)
    DATA_EXTENSION_CK                       For Data Enrichment in Product Costing
    DYNPRO_EXTENSION_CK                     BAdI for Interface Enhancement in Costing
    ORDER_COSTING_CK                        Enables Header Data Changes in Preliminary Order Costing
    QUANTITY_STRUCT_CK                      Enables Quantity/Structure Changes in Costing
    SUR_STOCK_TRANSF_CK                     Overhead on Materials with Stock Transfer Between Plants
    Thanks
    Sri

  • Duty calculation for import PO for a specific material group

    Hi All,
    As per company requirement, we need to do changes in duty calculation for import PO for a specific material group.
    Current scenario :  Currently  duty calculating on MRP with abatement  35% ( We have ABTT condition @ 35% of MRP).
    For example:
    Material: ABC , Basic Price = 1000, MRP = 2000 and duty is 10%
    Duty  Amt = 2000(MRP) - 700(35% ABTT) *10%(Duty) = 130
    Cess 2 % = 2.6
    Ecess 1 % = 1.3
    Total duty =  133.9
    This duty (133.9) paid to custom vendor and loads in material cost.
    New Requirement:  For vendor payment purpose duty should be calculate as above but  for material cost should be calculated on Basic price.
    For Example:    
    Material: ABC , Basic Price = 1000, MRP = 2000 and duty is 10%
    Duty  Amt = 1000(BP) *10%(Duty) = 100
    Cess 2 % = 2
    Ecess 1 % = 1
    Total duty =  103 ( It should load in Material cost)
    New Condition Diff Duty Amt = (1300-1000)*10% = 30
    Cess 2 % = .6
    Ecess 1 % = .3
    Diff Duty Amt = 30.9 ( It should not be added in material Cost)
    Paid to custom vendor = 103 + 30.9 = 133.9
    Kindly suggest how to achieve this.
    Regards
    Jitendra

    Hi,
       Please check whether the requirement is logical or not.  Did you check the requirement with your accounts team?
       If you have different duty calculation for MIGO and MIRO, how the GL accounts will get balanced? As of my understanding, the requirement is clearly not logical.
    Regards,
    AKPT

  • Updating partner function when creating customer XD01/XD02

    Hello all, I have the following requirement to do:
    When creating a customer for a certain account group in XD01/XD02, I need to update the partner functions associated to this customer.
    I have tried, the ENHACEMENT  SAPMF02D with function EXIT_SAPMF02D_001, but when changing table content T_KNVP, this content is not taken into account and the values are not stored in DB.
    I have tried too BADI's CUSTOMER_ADD_DATA and CUSTOMER_ADD_DATA_CS, but the content of T_KNVP in CUSTOMER_ADD_DATA cannot be changed.
    I would like to avoid BTE's for now.
    Can someone give me a hand on this?
    Thanks in advance!

    Solution: BAPI CUSTOMER_UPDATE

Maybe you are looking for

  • ISSUE at the time of creating delievery.

    hi guruus, i am facing a serious issue and need your help. I have created an order of a two materials "400000065 & 400000528" both material have stock available at FG '0004' storage locatioin and the material types are "Physican Sample". when i am cr

  • Cannot Create a new ToDo...iCal freezes, and Calendars do not appear anymor

    Hi. In iCal, I have recently tried to create a new ToDo, and when I do, iCal freezes, I have to ForceQuit iCal, and the next time I open iCal, my calendars no longer appear in the left as they normally do. Someone suggested deleting the file for iCal

  • Dreamweaver CS5 WebDave often times out. Can I increase the timeout?

    I am using WebDave to interact with my server. This has worked well for the last year, but for some reason my server load has increased and I am now getting timeouts often, which means pages fail to upload. Dreamweaver is not particularly good at let

  • Referencing (?) cells to an other table

    Hello, I try to explain what i like to have: I want to have a connection from one cell in f.e. table A to one cell in table B. The value of the cell in table A is a calculated value, f.e. a summary. Now this value should appear in the cell on sheet B

  • Export CHAR set problem.

    Hi, My database character set is AL32UTF8 when i exported the data the message i got at the beginning of the export is Export done in US7ASCII character set and AL16UTF16 NCHAR character set. But i want to export the data in database character set(AL