Tell me logic for this?

In VA01, one field VBAP-PRODH, its length is 18 char
suppose its having value 1040201030. here two charecters is one level. I need to check first two levels, can you please tell me how ?
ie if product heirarchy determines this JET FUEL (4) = 1030
how to check above condition tell me logic
Thanks,
Sanju

Hi Sanjana,
check this ,
REPORT zex31 .
data : prodh like VBAP-PRODH,
       ch(4).
prodh = '1040201030'.
ch = prodh+0(4).
case ch.
when '1030'.
  write : / 'JETFUEL'.
WHEN '1020'.
  WRITE : / 'ELECTRICAL PARTS'.
WHEN '1040'.
  WRITE : / 'GLASSES'.
WHEN OTHERS.
  WRITE : / 'XYZ'.
ENDCASE.
if u r requirement is something else be more clear.

Similar Messages

  • Logic for this comparision of character type operands.

    Source field name: ZDCNFG
    Target Info Objects:
    ZDVD59
    ZDVD10
    ZDVD14
    ZDVD18
    ZDVD25
    ZDVD50
    Scenario1: If ZDCNFG = 2(10). 2 is quantity and 10 in brackets is part number (DVD format). So I will have to update the quantity respective field as shown below.
    ZDVD59: 0
    ZDVD10: 2 -->updated 10 part
    ZDVD14: 0
    ZDVD18: 0
    ZDVD25: 0
    ZDVD50: 0
    Scenario2: If ZDCNFG: 2(25)3(50)
    ZDVD59: 0
    ZDVD10: 0
    ZDVD14: 0
    ZDVD18: 0
    ZDVD25: 2 --> Updated
    ZDVD50: 3 --> Updated
    Scenario3: If ZDCNFG: 2(5)3(9) ---This is exceptional case. If we have 5 and 9 then add and assign 5 to ZDVD59 rest all are 0.
    ZDVD59: 5  Sum of DVD5 and DVD9
    ZDVD10: 0
    ZDVD14: 0
    ZDVD18: 0
    ZDVD25: 0
    ZDVD50: 0
    Quantity is the value which is out side the brackets. For e.g. in 10(5), 10 is the quantity.
    Can any one give me a logic for this.
    I was trying with CA  CS etc..but no charm.
    Thanks
    Kiran

    Kiran,
    This should work
    parameters: zdcnfg(50).
    data: zdvd59(3),
    zdvd10(3),
    zdvd14(3),
    zdvd18(3),
    zdvd25(3),
    zdvd50(3),
    rcnt type i,
    roff type i,
    temp type i.
    data: static(50).
    start-of-selection.
      static = zdcnfg.
      replace all occurrences of '(5)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(5)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd59.
        enddo.
      endif.
      zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(9)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(9)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd59.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(10)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(10)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd10.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(14)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(14)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd14.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(18)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(18)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd18.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(25)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(25)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd25.
        enddo.
      endif.
        zdcnfg = static.
      clear: roff, rcnt, temp.
      replace all occurrences of '(50)' in zdcnfg with '+' replacement count rcnt.
      if rcnt ge 1.
        zdcnfg = static.
        do rcnt times.
          replace first occurrence of '(50)' in zdcnfg with '+' replacement offset roff.
          temp = roff - 1.
          add zdcnfg+temp(1) to zdvd50.
        enddo.
      endif.

  • Need the Logic for this Prg issue Pls

    Hi Friends,
    i have an urgent requirement..
    i am develop the report that is :
    Based on Selction Critirea kunnr(knvv-kunnr)
    i want Delete the
             Internet mail (SMTP) address FROM ADR6-MTP_ADDR
    AND Teletex number FROM ADR4-TTX_NUMBER..
    USING TABLES ARE KNVV , ADR6 AND ADR4.
    please how to Write the LOGIC For this Program .
    help me.. it is an urgent.. anyone.
    regards,

    Hi Alchermi,
    thanks for your reply soon.
    based on selction kunnr .. i want deete the ADR4-TTX_NUMBER..and ADR6-SMTP_ADDR From these 2 tables
    for these 2 fields..
    kunnr from knvv, selection field..
    below fields want be DELETED..
    ttx-number from adr4,
    smtp_addr from adr6.
    it is an urgent. help me .
    regards,

  • Logic for this senerio -- UDF

    Hi XI Gurus,
                          I hav to create a UDF.This is an IDOC - XI - FILE seerio. In  this senerio is I have an IDOc whose 7th segment contains a field. This field can store values in between 0 - 9. On the other hand I have a file structure in my left hand side from Messge mapping prespective , which contains 9 similar sized fields.
    Now the logic is if the field in the segment of the idoc has value say '3', then the file structure in the left hand side would have 3 in the field no 3 and all other fields 1, 2, 4, 5, 6, 7, 8, 9 would be zero.
    Can u guys suggest some logic for this???
    Thanks in advance !
    Poits would be rewarded.
    Arnab

    Hi Mohd,
    Select the Queue option for getting individual nodes
    public void test(String[] a,ResultList result,Container container){
    if (a<i> == 7) { //This is for selecting the node
    for(i=0;i<10;i++){  //This is for collecting the correct value
    ifIi==3){
    write what ever u have to done
    else{
    write the exceptional condition
    Dont to Reward points if this helps
    Regards
    Pragathi.

  • Can anyone please give me the logic for this....

    I have a database table and in it i have a field department code. now, that department code might have '00' or '   ' (blank) or anyother value. now i want to add up all the currency amounts with department code '00'  and '  ' (blank) which have same company code and currency type. I called all the entries with '00' into one internal table and enrties with '  ' (blank) to other internal table.
    can anyone give me the logic for adding all the entries at a time.
    thanks in advance.....

    HI Srinivas
    i have a solution for this question.
    Use At control break statement for this.
    Loop the internal table.
    Use at Event AT LAST. In that use SUM Statement. U will get sum of all the numeric fields.
    Or else u can use ON CHANGE OF Currency type
    then find the total amount by adding previouse value with ur current value.
    Like itab1-amount = total + itab1-amount.
    Appent this into ur internal or write it into ur report.
    Reward me if its useful.
    Regards
    Ravi

  • I have i phone 5 problems is when my phone battery left 20% then phone automatic shutter down plz tell me solution for this

    i have i phone 5 problems is when my phone battery left 20% then phone automatic shutter down plz tell me solution for this

    It seems like if you have a calibration issue with your battery percentage indicator.
    To recalibrate the indicator, charge your battery to 100% then let it drain completely until the iPhone shuts down then charge it to 100% again and do not disturb it until it reaches 100%.  This will reclaibrate your battery indicator.

  • Is there any alternative logic for this issue

    Hello all ,
    I have a  program which is executed as a background job for every 15 minutes . Now my requirement is If this batch job is successfully finished, i have to capture that time and date at which the batch job is successfully finished and update the corresponding time and date in a ZTABLE .
    In order to achieve this , i have created a separate program which will also be running in background.in this program , using the table TBTCO, i m getting the last date and  last time at which the batch job is successfully finished and modifying the ZTABLE accordingly
    Is there any alternate solution for this ?
    thanks&regards,
    G.Pavan

    Hi gpavansap,
    When you define background job in SM36, your first step should be the program which you have scheduled now.
    Create a second step in the same job with another program which would just update system date and time to the ZTABLE. No need to read TBTCO and all.
    The second step would immediately execute as soon as the first step ended successfully.
    If you don't want to create a separate program. you can have a check-box "Update ZTable Only" in the selection screen of the first program itself. If this check-box is selected, the program should only update ZTABLE and do nothing else. Create a variant of your selection screen with this check-box selected and schedule this variant as "Second Step" of your back-ground job.
    Regards
    Suresh

  • Logic for this math problem

    Before I get stinker replies for cross posting , let me tell that , i have been recommended to post this in this forum.
    My problem is such:
    I need to find a logic to implement the following :
    In the floating point number , say , 1.0.. the Integral part will remain constant(1) but the decimal part has to get incremented by 1
    1.1 +0.1
    1.2+0.1
    1.3+0.1
    1.4+0.1
    1.5 +0.1
    1.6+0.1
    1.7+0.1
    1.8+0.1
    1.9+0.1
    1.10+0.1
    1.2... But what I need here is 1.11 ,1.12
    I need my programming logic to detect there needs to be a change in the increment value from 0.1 to 0.01 when I reach 1.1
    and from 0.01 to 0.001 when i reach 1.111..so on,
    please suggest..

    you can't do it with a double,
    since double d = 1.10d; will be treated as 1.1d
    what you can do is treat the double as a String
    public void test(){
    String s1 = "1.9";
    String s2 = "1.10";
    String s3 = "1";
    String s4 = "1.1";
    System.out.println(increment(s1));
    System.out.println(increment(s2));
    System.out.println(increment(s3));
    System.out.println(increment(s4));
    public String increment(String d){
    int pos = d.indexOf(".");
    if (pos != -1){
    if (d.charAt(d.length()-1) == 0)
    return d.substring(0, d.length()-2) +
    ength()-2) + "1";
    String temp = d.substring(pos+1);
    int num = Integer.parseInt(temp);
    num++;
    return d.substring(0, pos+1) + num;
    else
    return d + ".1";
    }gives
    1.10
    1.11
    1.1
    1.2
    I leave it to you to understand the logic...it's to
    get you started..it does not check for all conditions
    of the inputI think it is a Math with algorithm problem. Your solution is good, but you are using String functions so much. There is other solution, handling with numbers only.

  • Logic for this requirement

    Hi friends,
    I get salary from different tables... like for example
    m_sal and e_sal..if the salary is null in m_sal i have to select salary from e_sal and viceversa
    can you pls tell me how to do this
    Thanks

    You would still use COALESCE
    SQL> with
      2  emp as
      3      (
      4      select 1 empno from dual union all
      5      select 2 empno from dual union all
      6      select 3 empno from dual union all
      7      select 4 empno from dual union all
      8      select 5 empno from dual union all
      9      select 6 empno from dual
    10      ),
    11  sal1 as
    12      (
    13      select 1 empno, 100 esal from dual union all
    14      select 3 empno, 200 esal from dual union all
    15      select 5 empno, 100 esal from dual union all
    16      select 6 empno, 300 esal from dual
    17      ),
    18  sal2 as
    19      (
    20      select 2 empno, 600 msal from dual union all
    21      select 4 empno, 500 msal from dual
    22      )
    23  select
    24      e.empno,
    25      coalesce
    26          (
    27              (select sal1.esal from sal1 where sal1.empno = e.empno),
    28              (select sal2.msal from sal2 where sal2.empno = e.empno)
    29          ) sal
    30  from
    31      emp e;
         EMPNO        SAL
             1        100
             2        600
             3        200
             4        500
             5        100
             6        300
    6 rows selected.

  • How to tell Firefox "Okay for THIS site to redirect"?

    Websites for huge, bureaucratic corporations sometimes try to redirect the browser to other pages. How do I tell Firefox that this is okay -- for a particular website?

    See:
    * Firefox/Tools > Options > Advanced > General : Accessibility : [ ] "Warn me when web sites try to redirect or reload the page"
    The setting in "Tools > Options > Advanced > General" is meant as an accessibility feature, as you can see by the label of that section, so that people with disabilities or people who use screen readers do not get confused and is not meant as a safety protection to stop redirecting.
    See also:
    * https://support.mozilla.com/kb/Options+window+-+Advanced+panel#General_tab
    * http://kb.mozillazine.org/accessibility.blockautorefresh
    * http://kb.mozillazine.org/Accessibility_features_of_Firefox

  • Can anyone please help me with the logic for this..

    hi all,
    os  has the value Windows 2000
    IF os CP 'WINDOWS' OR os CP 'SUN'.
         OS1 = 'X'.
      ENDIF.
    (if i test this,
    os1 doesnot have any value, (should be x)).
    This doesnot work for me.
    Any suggestions.
    Regards,
    Sukumar.

    Dear Sukumar,
    just use the F1 help on CP in ABAP code, there is a description.
    I think you need to use the asterix '*' than it will work.
    Regards
    Tibor
    Just check the example:
    Report z_example.
    data: os1, os type string.
    os = 'WINDOWS 2000'.
    IF os CP 'WINDOWS' OR os CP 'SUN' or os = space.
    OS1 = 'X'.
    ENDIF.
    write: / os1.

  • NEED LOGIC FOR THIS

    I HAVE A TABLE AND THE VALUES LIKE THIS,
    CALENDAR_DATE working_day return_date
    JUL 04 N JUL 04
    JUL 05 N JUL 05
    JUL 06 N JUL 06
    JUL 06 N JUL 07
    JUL 08 Y JUL 08
    my requirement is how can i change all the return_date for which the working_day is 'N' to JUL 08 (working_day= 'Y')

    UPDATE table_name
    SET return_date = 'JUL 08'
    ,working_day = 'Y'
    WHERE working_day = 'N';
    Is this what you wanted ?

  • Need logic for this output  itab  format

    hi guys
    i need the output itab in following format
    i have data in my present  itab
    itab-f1     itab-f2    itab-f3
    AAA         10    (means null,' ')
    AAA         20            
    BBB         10          
    BBB         20    A1
    BBB         30         
    and i want output in following way output itab
    itab-f1     itab-f2    itab-f3
    AAA     30          
    BBB         60      A1
    can anyone suggest me code for this

    You want the sum of f2 for a group of f1's?
    Is f3 going to be the same for that group?
    Try this
    sum = 0
    sort itab by f1.
    itab2 like itab.
    loop itab.
    sum = itab-f2 + sum.
    f3var = tab-f3.
    at end of f1.
    move itab-f1 to itab2-f1.
    move sum to itab2-f2.
    move f3var to itab2-f3.
    append itab2.
    sum = 0.
    endat.
    endloop.
    Edited by: Ramiro Escamilla on Feb 7, 2008 11:29 PM

  • Hi All can you please tell me solution for this error occurs

    I am trying to use Adaptive RFC model am getting following error :
    Failed to create new JCO client connection WD_RFC_METADATA_DEST: com.sap.tc.webdynpro.services.sal.sl.api.WDSystemLandscapeException: Error while obtaining JCO connection.
    This error is occuring while i am trying to create JCO connections,
    In my content administrator ,message server combo and application serber combo are showing empty why i am not understanding ?
    expecting answer asap. useful Answers will be rewarded nicely
    regarded
    jalandhar.

    Hi,
      Before using the model, u have to create JCO connection in ur application server.
    Check these links.
    Configuration of JCo
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3a/3b1b40fcdd8f5ce10000000a155106/frameset.htm
    For configuring SLD, check these.
    SLD Connection
    Configuring SLD in Sneak Preview SAP NetWeaver '04 Sneak
    Regards,
    Harini S

  • Programming logic for this scenario

    hi all,
    kindly help me with this scenario:
    i have a internal table with fields like this (among others)
    OBJEK                        ATINN         CHAR                                  CHARG            CHAR1
    000000000000000031 0000000188  Batchnumber: WEEK NO. 9  0000000052
    000000000000000031 0000000189  Visualinspection: OK            0000000052
    now wht i need to do is for SAME batch number i need to concatenate the values of CHAR into CHAR1.
    that is to say that CHAR1 shud have the value "Batchnumber: WEEK NO. 9 Visualinspection: OK"
    ive right now done it using 2 different internal tables and concatenating the values. want to know if theres an easier and simpler way.
    any pointers guys??
    pk

    solved it myself
    thanks to sujatha reddy's post in the following thread:
    Re: at end of  statement
    pk
    Edited by: prashanth kishan on Jul 11, 2008 9:19 AM

Maybe you are looking for

  • AIO Remote wont recognize my network printer deskjet 3050

    AIO remote app (IOS) did not recognize my network printer (Deskjet 3050), other apps (printer pro lite) did recognize the printer flawlessly, both the printer and the iphone are in the same network, I can print from my PC and my mac but not from AIO

  • Connecting firewire disk causes coreaudio to crash

    I have a Western Digitial "my book" firewire drive which worked perfectly under Tiger. I just upgraded to Leopard, after waiting a few months to make sure the early bugs got worked out. I guess I was premature in upgrading? Has anyone else seen the f

  • Some Hyperlinks not Working in WebHelp

    I have several hyperlinks to .gif image files. I hyperlink to the .gif file and then choose to open in an auto sizing popup. Some of the links work, and others don't. I've checked to make sure that the properties for the ones that don't work are the

  • Can I control the "open with" options in apps on the ipad?

    I have a school loop app that allows access to files stored in a remote folder, similar to dropbox. I can see the files and when I select one I have an option to choose which app to used to open a document (it might be a word doc, a pdf, a ppt, etc.)

  • List Export Format for Prospects

    Hi, I am looking for a list export format for Prospects in Siebel Marketing. An example load format was provided and I am able to load prospects successfully but I need the list export format for Prospects to be able to launch. The OBI version used i