Logic fo this

Hi,
Please help me on this i need logic.
If Check box is selected.
Get BUKRS, check from Table VBRK using W_VRKPA-VBELN.
Read data from Table BSID. Match W_VRKPA-KUNDE to BSID-KUNNR, BUKRS to BSID-BUKRS, W_VRKPA-VBELN to BSID-XBLNR.
If data is available from BSID, continue with further logic, else continue with the loop. No need to store the data from BSID.
Thanks

ghi,
try sth like this:
loop at W_VRKPA.
select single * from vbrk
    where vbeln = W_VRKPA-VBELN.
select single * from bsid
          where bukrs = bukrs
          and    kunnr = W_VRKPA-KUNDE
          and    xblnr =  W_VRKPA-VBELN .
if sy-subrc = 0.
  perform process_123.
else.
  continue.
endif.
endloop.
A.

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.

  • What is Apple's logic behind this?

    I open a file (any kind will do) and make some changes. After I'm done, I hit CMD + W to close the file and the program correctly asks if I want to save my changes, close without saving, or cancel closing the file. The Save button is highlighted on the button and outside the button. If I hit the tab button, the outside highlight moves to the different buttons, but the button highlight remains on the Save option, so when I hit enter, it thinks I'm saying to Save.
    Can anyone explain the logic behind this? I just don't get why Apple thinks this is an efficient/right way to do things. Thanks for any helpful answers.

    Hi--
    To actually select the button that has focus (the outside highlight), hit the space bar.
    I suspect the rationale is something like this: they don't want to override the usual functionality of the buttons, but just offer a second or third way to select buttons.
    Many, if not most apps, particularly in the situation you describe, already have pretty solid keyboard shortcuts for the three buttons. Of course, "enter" for "Save", "esc" for "Cancel", and "command"-"d" almost always works for "Don't Save". From observation, of those people who use keyboard shortcuts in dialogs, this is by far the most common way they do it. I don't think I've ever seen anyone use the tab key in dialog boxes (and I think it's off by default except for navigating between text boxes).
    charlie

  • What to know the logic of this program :RV60SBAT

    i need to change this program based on my requirement , but i don't know the logic of this program ,there are some puzzles about the logic of the program. the requirement is that: when create the batchjob, the number of the batchjob is fixed , and the steps of the batchjob is also need to fixed, but the per step that contain the number of the customer is dynamicly. how to do it .i need to fix the step of the batchjob ,how to do it ?
    it is very emergency . who can give me some useful suggestion?
    Thanks in advance.

    Hello, Ming.
    I'm not sure whether this will solve your problem, but check OSS note 652219. It describes an adjustment to the SDBILLDL program so that you can schedule it directly in background instead of it being "spawned" by the RV60SBAT program. That way, it can be a "fixed" scheduled job.
    Hope this helps!
    Cheers,
    Des.

  • Why did Apple design the iPad to permanently disable without ANY means to recover data just by virtue of someone trying to enter the wrong password? What is the logic behind this design decision?

    Daughter unknowingly attempts to access iPad by entering wrong passwords. This leads to the iPad being disabled. It contains home videos that have not been backed up. This is a common scenario that Apple has made no effort to solve. Why does this continue to be a problem? It is outrageous that a device should permanently disable like this for NO GOOD REASON. Apple - Please address this issue in iOS 8.2. This should not happen. It makes no logical sense for the iPad to do this. No sense whatsoever.

    See where it says Backup ? Turn it on, that's all it takes.

  • 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.

  • 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.

  • 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

  • Please suggest logic to this

    create table testlog(lnum number, col1 number, col2 number, col3 number)
    insert into testlog values (1234,1,1,1)
    insert into testlog values (1233,2,8,1)
    insert into testlog values (5233,2,8,4)
    I am about to add a new column to this table, ctr, which should keep track of number of times a lnum is modified...
    alter table testlog add (ctr number)
    can anyone please suggest a way to do this ? I am sure I have to go for a before update trigger, but how do I keep track of the lnum ?
    lnum is the primary key and so is unique
    should I create a procedure and call that in a trigger ?
    CREATE OR REPLACE TRIGGER trig_testlog
    BEFORE
    UPDATE
    ON testlog
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    IF UPDATING ('col1')
    THEN
    -- call a procedure which takes lnum
    as input parameter and in that, we have
    logic to increment ctr column to 1
    each time the loan is modified. But how
    to keep track of ctr for each lnum ? The table
    has lakhs of rows.
    END IF;
    IF UPDATING ('col2')
    THEN
    -- call a procedure which takes lnum
    as input parameter and in that, we have
    logic to increment ctr column to 1
    each time the loan is modified. But how
    to keep track of ctr for each lnum ? The table
    has lakhs of rows.
    END IF;
    IF UPDATING ('col2')
    THEN
    -- call a procedure which takes lnum
    as input parameter and in that, we have
    logic to increment ctr column to 1
    each time the loan is modified. But how
    to keep track of ctr for each lnum ? The table
    has lakhs of rows.
    END IF;
    END;
    /

    Hi,
    Is this you require??
    After creating table and inserting values I altered the column as you posted.
    Then,
    SQL>  select * from testlog;
          LNUM       COL1       COL2       COL3        CTR
          1234          1          1          1
          1233          2          8          1
          5233          2          8          4
    SQL> create or replace trigger trig_testlog BEFORE UPDATE ON testlog
      2  REFERENCING NEW AS NEW OLD AS OLD
      3  FOR EACH ROW
      4  BEGIN
      5  If :new.ctr is null then
      6   :new.ctr:=1;
      7  else
      8   :new.ctr:=:old.ctr+1;
      9  end if;
    10  End;
    11  /
    Trigger created.
    SQL> update testlog
      2  set col2=9
      3  where lnum=1234;
    1 row updated.
    SQL> select * from testlog;
          LNUM       COL1       COL2       COL3        CTR
          1234          1          9          1          1
          1233          2          8          1
          5233          2          8          4
    SQL> update testlog
      2  set col3=9
      3  where lnum=1234;
    1 row updated.
    SQL> select * from testlog;
          LNUM       COL1       COL2       COL3        CTR
          1234          1          9          9          2
          1233          2          8          1
          5233          2          8          4
    SQL>
    SQL> update testlog
      2  set col1=19
      3  where lnum=1233;
    1 row updated.
    SQL> select * from testlog;
          LNUM       COL1       COL2       COL3        CTR
          1234          1          9          9          2
          1233         19          8          1          1
          5233          2          8          4Let us know if I failed to understand your requirement.
    Twinkle

  • Logic for this..

    Hi,
    Can someone help me in implementing this simple logic in ABAP.
    Set of values : (10,20,30,40,50)
    If the value is not in this interval then it is updated to next higher value.
    Ex: If the value is 25 , it will be updated to 30.
    Tushar.

    Another Sample....
    REPORT  zramki.
    PARAMETERS: p_val TYPE i.
    DATA:
      result TYPE i,
      BEGIN OF it_num OCCURS 0,
        val TYPE i,
      END OF it_num.
    START-OF-SELECTION.
      it_num-val    = 10. APPEND it_num.
      it_num-val    = 20. APPEND it_num.
      it_num-val    = 30. APPEND it_num.
      it_num-val    = 40. APPEND it_num.
      it_num-val    = 50. APPEND it_num.
      SORT it_num.
      CLEAR result.
      LOOP AT it_num.
        IF it_num-val < p_val.
          CONTINUE.
        ENDIF.
        result = it_num-val.
        EXIT.
      ENDLOOP.
      WRITE:/ 'Value =', p_val.
      IF result IS INITIAL.
        WRITE: / 'Input value higher than largest list value: ',
                 it_num-val.
      ELSE.
        WRITE: / 'Result = ', result.
      ENDIF.
    Cheers,
    Ramki Maley.

  • Automate the Creation of, or Import Track Groups-Can Logic do this?

    As someone contemplating jumping ship from DP after 10 years, I was wondering if Logic can automate the process of creating or adding track groups that I use regularly. For example, if I demo a song with a drum loop and then want to add live drums, I always create the same 12 tracks with the same pan, eq information when micing a drum kit. Can I create something called "drum set-up" and import it into an existing project instead of having to create (the same) 12 tracks, set all the pan info, add eqs, gates, etc...
    Thanks for your expertise! Looking forward to delving into the new work environment.

    I've often wished for a feature like this, but sadly Logic doesn't have it...
    So what I do is have a folder on my basic template, and inside that folder are 12 tracks grouped together (so I can record enable'em in one click), with all appropriate plugins and settings ready to go.
    That way all my songs are 'ready' for live drums, and by keeping them in a folder they don't take up to much space in my arrange page. I also sometimes use "Hide Tracks" to keep the drum folder out of the way until I may need it.
    Other than that, you can fairly quickly create 12 new tracks with the little "+" icon in the arrange page. Then each track needs a click to load your fave channel strip preset for kick/snare/tom/overhead etc.
    The only downer about that, in my mind, is that the channel strip presets don't include input settings and send/aux assignments. But at least you can drag-select all the tracks in the mixer and quickly give them all the same sends, so it's not too huge a pain.
    Still, I've often wished for a "load channel strip(S)" button so I could import a dozen tracks in one go... Maybe Logic 10 will include this feature. (I've already given up wishing for stuff in 9).

  • 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 ?

Maybe you are looking for

  • Performance problem with query on bkpf table

    hi good morning all , i ahave a performance problem with a below query on bkpf table . SELECT bukrs            belnr            gjahr       FROM bkpf       INTO TABLE ist_bkpf_temp       WHERE budat IN s_budat. is ther any possibility to improve the

  • Update mac 5.5 to 6 - wrong serial

    I just got the install dvds and wanted to update master collection from 5.5. to CS 6. MAC os X lion german I entered serial nummber printed on the box. OK I am asked to enter old serial number, because installer can not find CS 5.5. I enter the seria

  • Cheat Sheet with all the handy shortcut (i.e. "funtion") keys

    As I read about various photoshop processes, various F-keys are frequently mentioned to access features and perform functions quickly. Is there a "cheat sheet" available with all these function keys available, either for download or purchase. Of cour

  • Error while running rtf

    Please help me where and how to identify the error in RTF. ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template

  • 8i Apache sessions on NT 4.0

    When you use your browser's Back or Refresh buttons, the 8i Apache server may or may not create a new session rather than simply moving backwords in the history file or refreshing the current page. If you are trying to use session variable this becom