Value should increase by comparing 2 fields.

Hi,
I have a requirement,
This is nothing but Material and Serial no Combination. If same material and Serial number get repeats
no of repairs value should increase
For eg, 
       Prt no   Material no     Serial no   No of repairs
      #A0005    XYZ                ABC          1
      #A0006    XYZ                DCE          1
      #A0007   PQR                ABC          1
      #A0008   XYZ                 ABC          2
By default the repair value will be 1.
I have Material No and Serial no in my final table T_final.
I want to put a condition where it will let us know the if the Materail number is repated with Serial number so that it should add 1 and append the Number of repairs field.
Any suggestions will be appreciated.
Regards,
Kittu
Edited by: Kittu on Jun 11, 2009 9:27 AM

Hi Kittu,
take one more internal table by taking Material no and Serial no
LOOP AT itab1.
  itab2-material no = itab1-material no.
  itab2-serial no = itab1-serial no.
  APPEND itab2.
  CLEAR itab2.
ENDLOOP.
IF NOT itab2[] IS INITIAL.
  SORT itab2 BY material no serial no.
  DELETE ADJACENT DUPLICATES FROM itab2 COMPARING material no serial no.
ENDIF.
LOOP AT itab2.
  CLEAR v_num.
  LOOP AT itab1 WHERE matrial NO = ITAB2-MATERIAL-NO AND
  serial no = itab2-serial no.
    v_num = v_num + 1.
    itab1-no of repairs = v_num.
    MODIFY itab1 INDEX sy-tabix.
  ENDLOOP.
ENDLOOP.
endloop.
Regards,
Kumar Bandanadham
Edited by: Velangini Showry Maria Kumar Bandanadham on Jun 11, 2009 9:47 AM

Similar Messages

  • Which value should I send for the field "business partner type " in DTW

    I need your help. I am trying to create a new business partner using DTW. Please let me know wich possible values should I send to DTW for the field "Business Partner Type" (this label appears on sap-bo when enteringa new BP).
    The database field name is OCRD.cmpprivate, so I tried to find the related field in the input file and I found "CompanyPrivate" is this the corresponding field for the "business partner type"?
    I have been trying with the following values but the DTW fails with the error "invalid item name in enum BoCardCompanyTypes":
    tYES
    tNO
    cCompany
    cPerson
    I
    C
    cI
    cC
    Thank you for your help
    Jorge Manzo

    Please note: I use DTW Version 88.1.7; API Version 8.81.319
    To set  CmpPrivate (it is exactly BoCardCompanyTypes) use following:
    cCompany - Card represent a company.
    cPrivate - Card represent a private person.
    To set CardType see Godon's replay.
    A lot of info you can find in "SAP Business One SDK - Help Center" docs.
    Thanks,
    Grzegorz

  • Negative values should not be allowed for fields

    Hello Gurus,
    I have a table and right now the feilds f1 and f2 are allowing negative values to be stored as they are of type char4, now that i dont want those feilds to allow negative values. i am using these feilds in the feild catalog in the ALV as a result when the coloumn is editable, the user may enter negative values, which i dont wnat to allow it now. what will be hte best possible solution.
    thanks in advance

    Hello,
    You can set this in the domain itself.
    Please check this SAP documentation:
    Output with sign: If fields that refer to this domain can contain negative values, the Sign flag must be set. When the field contents are output to the screen, the first output location is reserved for a sign. If the flag is not set but the field contains negative values, problems could occur when outputting to the screen. Entries can only made in this field for data types DEC, FLTP, QUAN and CURR.
    BR,
    SUhas

  • Advanced comparison of form values in a transaction. Use "Compare Transaction Fields"?

    I have a form for textbook requests which has, among other fields, these:
    Campus Enrollment
    Current number of textbooks on campus
    Number requested in this instance
    I want to disallow form submissions where the {currentnumber}+{requestednumber}>{campusenrollment}
    In other words, if I say I have 500 students, and claim that I have 50 books already, then my max current request is 450.
    I have been experimenting with the "Compare Transaction Fields", but am not sure what I am doing.
    Any suggestions?

    Hi,
    I´m not certain if the "Compare Transaction Fields" behaviour allows such advanced calculations at all, but if it does, your formula -- at least according to my basic understanding of math :-) -- certainly needs to first add "currentnumber" to "requestednumber" and make this a "group", and then compare the grouped value to "campusenrollment" :
    ({currentnumber} + {requestednumber}) > {campusenrollment}
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • F4 Help on one field should populate data on another field

    Dear All....
    I am using the FM - F4IF_INT_TABLE_VALUE_REQUEST for F4 help on one field of the selection screen. Based on the selected value, a values corresponding to it should appear on another field.
    My Code -
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_svn.
      SELECT qmnum serialnr
        INTO TABLE t_qmel
        FROM qmel
        WHERE qmart  = 'ZD'.
      SORT t_qmel BY qmnum.
    Display the f4 Help Values for SVN
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield     = 'QMNUM'
          dynpprog     = sy-repid
          dynpnr       = sy-dynnr
          dynprofield  = 'P_SVN'
          window_title = text-015
          value_org    = 'S'
        TABLES
          value_tab    = t_qmel
          return_tab   = t_retval.
      READ TABLE t_retval INTO w_retval_wa INDEX 1.
      IF sy-subrc = 0.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = w_retval_wa-fieldval
          IMPORTING
            output = w_qmel_wa-qmnum.
        w_retval_wa-fieldval = w_qmel_wa-qmnum.
        READ TABLE t_qmel INTO w_qmel_wa WITH KEY qmnum = w_retval_wa-fieldval
                                         BINARY SEARCH.
        IF sy-subrc = 0.
          p_esn = w_qmel_wa-serialnr.
        ENDIF.
      ENDIF.
    But this is however not working.
    Please let me know where I am going wrong.
    I have serached SDN thoroghly but could not get my solution.
    Please guide me....
    Regards,
    Pankaj Agarwal.

    *&  AT SELECTION SCREEN ON VALUE-REQUEST FOR FIELD
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ebeln.
      PERFORM f4_hlp_ebeln.
    *&      Form  F4_HLP_EBELN
          text
    -->  p1        text
    <--  p2        text
    FORM f4_hlp_ebeln .
      TYPES: BEGIN OF ty_ebeln,
               ebeln TYPE ebeln ,
            END OF ty_ebeln.
      DATA: lt_ebeln TYPE TABLE OF ty_ebeln.
      CLEAR: lt_ebeln[].
      SELECT ebeln
           FROM zmt_po_mic_ded
             INTO TABLE lt_ebeln.
      IF sy-subrc = 0.
        SORT lt_ebeln[] BY ebeln.
        DELETE ADJACENT DUPLICATES FROM lt_ebeln COMPARING ALL FIELDS.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
            retfield         = 'EBELN'
            dynpprog         = sy-repid
            dynpnr           = sy-dynnr
            dynprofield      = 'P_EBELN'
            value_org        = 'S'
            callback_program = sy-repid
          TABLES
            value_tab        = lt_ebeln[]
          EXCEPTIONS
            parameter_error  = 1
            no_values_found  = 2
            OTHERS           = 3.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
    ENDFORM.                    " F4_HLP_EBELN
    DATA: t_dynfields TYPE TABLE OF dynpread,
          t_valhlp    TYPE TABLE OF ty_valhlp.
    DATA: w_dynfields TYPE dynpread.
    CLEAR: t_dynfields[], t_valhlp[].
      DATA: l_ebeln TYPE ebeln.
      w_dynfields-fieldname = 'P_EBELN'.
      w_dynfields-fieldvalue = p_ebeln.
      APPEND w_dynfields TO t_dynfields.
      CLEAR w_dynfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
          translate_to_upper   = c_x
        TABLES
          dynpfields           = t_dynfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      READ TABLE t_dynfields INTO w_dynfields INDEX 1.
      IF sy-subrc = 0.
        l_ebeln = w_dynfields-fieldvalue.
        SELECT ebeln
               ebelp
               FROM ekpo
               INTO TABLE t_valhlp
               WHERE ebeln = l_ebeln.
        IF sy-subrc = 0.
          SORT t_valhlp[] BY ebeln ebelp.
    here we get the value of ebelp depending on the selection of EBELN ***
        endif.
      ENDIF.

  • I would like to compare two field and then is it's true then the output will be the 2nd one

    Hello All,
    I am doing a mappong where i need to compare two field and then if there are equal the 2nd one should be the output and 2nd value will be using multiple segment.
    It's for shipment.
    Regards
    Rituparna

    Not sure if i understand correctly. But you are trying to compare one field with multiple occurrences of another field.
    You can make use of the node function "Use One as Many" and repeat the first value as many times as the second value.
    Please refer to below wiki.
    Explain node functions - Process Integration - SCN Wiki

  • Display value instead of key in input field with LOV?

    Sorry, this is so basic I'm sure it must be easy but somehow I can't find it in the documentation. The LOCATION table contains a foreign key referencing the CLIMATE table. As well as its primary key, CLIMATE has a column called NAME holding the name of the climate (e.g. temperate, tropical, etc.). The user must be able to update the climate value for the location he is working on. So I have a list of values which looks up possible climate names, the user selects the name he wants and the value gets set in the LOCATION table. That works, but the problem is that the input item displays the key value of the CLIMATE record, and I need it to display the value of NAME instead. Of course I can have another field showing the name, but that is messy, the user doesn't understand the key value and shouldn't have to see it. So how do I make one input field display the NAME, while actually updating the key value from the LOV choice?
    Thanks

    Thank you, Joseba. It does help to some extent. Now I have a non-updatable field with the climate name in it, and below that is the magnifying-glass icon that invokes the list of values. I guess that's not bad, and I can put a label next to the magnifying class saying "Click to select climate". So it's better, but still looks very odd compared to updating fields that are in the LOCATION table itself, where it's an updatable field and the maginfying glass is right next to it. Really the user should not have to behave differently just because the database chooses to hold the value that he wants to alter as a reference to another table.
    Is there at least a way to put the list of values magnifying-glass next to the field that displays teh value, rather than underneath it? They are all inside a thing called "af:panelFormLayout", and I tried setting MaxColumns to 2 in its properties, but it still won't let me move the list-of-values field alongside the other one.
    Thanks.

  • Want the data store values to be displayed in input field of form

    Hi,
    I wanted to know wether is there possibility of displaying the data in a input field instead of expression field.
    In our model i have used a form which has material type,plant and Vendor connected to data service1 in turn gives the out put in chart and i also have the second input form which has To(0CALMONTH) combo box which is connected to Data service2 and gives the data in table.
    But what i wanted is to i also want to use the input fields of first form to second Data service2 and get the data based on on inputs of form1 and form2i.e also To field.
    We can connect the port from form1 to DS2 but problem is we need to click the submit of form1 and form2 and it doesnt gives the output according the input of form1 and form2 as it gives the output of that form when we click that submit button.
    I have followed help.sap for data tore procdure.
    So i have used a datstore where i will store the values of form1 and call it in expression field which i will add and hide it in form2(hide because user should not see that input fields).
    Formula used in data store for expression field.
    IF(CONTAINS(STORE@matltype,@Material_Type),STORE@matltype,STORE@matltype &(IF(LEN(STORE@matltype)>0,'; ',''))&@Material_Type)
    But whats happening is the value is getting concatenated when i goon change the values in input field, so i wanted to get the values to be replaced as soon as i change input field of form1(if  use replace function its not working) and also it would be more preferrable if we use input field instead of expression field.
    I would also like to know is there any alternate solution for the above requirement instead of datastore.
    Thank You
    K.Srinivas

    Hi,
          I have Form1 connected to Data service1 displays the data in a Chart and i have another Form2 connected to Dataservice2 displays the data in table.
    In form1 there are Material Type,plant, and Vendor and form2 i have To (0CALMONTH)SO now i want also Form1 inputs for Table which gets teh data from Dataservice2.
    What i have said earlier is connecting Form1 to Dataservice doesnt fetch the data correectly,its because if i click submit in form1 i get the data of those 3 inputs and i need to click the submit button in form2 after giving input which shows the data accordingly where it doesnt fulfill the requirement.
    So i wanted some solution for that.For that reason i have used the data store and the procedure i have followed the help.sap as i said in my above mesage.
    If Data store is also suggestable than i want to display the data in Text input Field  instead of Expression field which should replace the previous values as soon as values change in data store.
    Hope i have tried to be clear if still it is not i am ready to explain again.
    Thank You
    K.Srinivas

  • How to give not null value in a rule for a field

    hi,
    i want to create a rule through rule designer where i want a field say "country" should not be left blank. when i go to the rule designer and select country through attribute value i get 2 conditions "=" and "!=" what shoud i give the value as so that the country field is not null.
    TIA

    I don't think you can have null value in the rule designer , rather you can created one more UDF and populate this UDF with something based on the nulllness/not-null of the country field and use this new UDF in the rule .
    Hope this helps .
    Thanks
    Suren

  • How to compare two fields from the same table in the select statement

    Hi, friends
    I try to compare tow fields from the same table, but no result,
    For example, this
    data: cptotchek tyep i.
    select count(*) into cptotchek
    from aufk where erdat = aufk-idat2 .
    The result is  cptotchek = 0, but there are the records in aufk , where,  aufk-erdat = aufk-idat2.
    Please, help me, i don't use the loop statement for optimize my program.
    Regards

    Hi  ,
           it will not return  any value   when you are using   column of same table 
           such as Date Field   , Because  while Using Aggregate Function  it will not check with self column
    .      For that you have to take data in one internal table and then you can work on it  .
         And if you are worried about Performance  it will not affect  , untill you are selecting only required data  .
    you can try this way  .
    data: cptotchek type i.
    types : begin of  w_aufk.
            include structure aufk  .
          types : end of  w_aufk .
    data : it_aufk type standard table of w_aufk with header line  .
    select * into corresponding fields of table it_aufk
    from aufk  .
    loop at it_aufk .
    if it_aufk-erdat  = it_aufk-idat2 .
    write : / it_aufk-erdat , it_aufk-idat2 .
    else .
    delete it_aufk .
    endif  .
    endloop.
    Regards
    Deepak.

  • Mapping of source message to IDOC.. What values should be assigned?

    Hi guys, again
    I have SOAP->XI->IDoc scenario, but my IDocs arrive only with 1 segment... The IDoc is not standard, and has a lot of fields, but I want to fill only a few of them in some segments. Lets say, that I have 4 segments, with occurence 0..999999, each value has occurence 0..1 like following..
    seg1-val1
        -val2
        -val3
    seg2-val1
        -val2
        -val3
    seg3-val1
        -val2
        -val3
    seg4-val1
        -val2
        -val3
    and I have source message like
    <seg1>
      <val1>..</val1
    </seg1>
    <seg1>
      <val1>..</val1>
    </seg1>
    I think, I have to map seg1 tag to seg1 segment, and val1 tag to val1 field..
    But! DO I HAVE TO MAP also seg1 tag to seg2, seg and seg4 segment? (to create logical "table"), or it is not necessary...
    Next question: what value should be assignet to @SEGMENT attribute of segments? also (IDOC segment?) Should it be some constant?
    Thank you guys!

    All you need to map is <b>seg1</b> source to <b>seg1</b> target and <b>val1</b> source to <b>val1</b> target . But remember that, if your source has seg2,seg3,seg4 and you want to use them then map them accordingly otherwise no need to map.
    @SEGMENT is counter for the number segments you are passing for each type of record. Use a java function to populate or just populate a constant 1.
    regards
    Shravan

  • The dropdown menu in the banner should be behind the text fields.

    Hi Andy,
    In our Application we have three Menus...The problem we are facing in that when ever we move the cursor, a drop down list will appear.. which is covering the text fields...
    The dropdown menu in the banner should be behind the text fields.
    Can u pls help me in this...
    anoo..

    Hi Anoo,
    (You can actually ask questions to everyone, not just me!)
    Normally, dropdown menus are supposed to be on top of all other items, so the user can pick an option from the menu. In fact, usually the problem is that select lists in IE appear on top of menus, not the other way around!
    What you may have to look in to is adding a z-index value to items. Have a look at: http://msdn.microsoft.com/en-us/library/ms531188(VS.85).aspx
    z-indexes determine the order in which items appear when two or more occupy the same space on the page. The higher the number the nearer to the top that item is. You can use negative or positive numbers. So, if item A has a z-index of 1 and item B has a z-index of 2, then item B will appear on top of item A.
    A z-index can be set as a style on your menus:
    &lt;........ style="z-index:-1".....&gt;Andy

  • How to compare two fields in condition editor in receiver determination

    Hello,
    Is it possible to compare to fields frrom the source in the condition editor of Receiver Determination?
    Because on the right hand operand we can specify only constants right and not the source field.
    For eg: If field1 != field2 then Reciever =  Receiver1
    Thanks,
    Loveena

    In standard receiver determination while defining the condition, you can only specify an element from the message payload using expression editor to create an expression for the left operand and you must specify a fixed value in the right operand, against which the value of the element will be compared at runtime. You can use only these (=,, ,EX) operators. So the functionalities are limited.
    so you have to use Enhanced Receiver Determination, In this Instead of creating the receivers in the receiver determination manually, you assign an Interface mapping to the receiver determination and this returns a list of receivers at runtime.
    refer this wiki for more details
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=133562771

  • What value should be passed to the ColumnSize parameter for SQLBindParameter() for a nvarchar(n) column?

    I have a table with a field "f1" which type is nvarchar(1000). Now I want to update a record through binding variable method. Before I bind the parameter, I call SQLDescribeCol to get the length of f1 - 1000.
    The data for updating f1 is prepared and is coverted to UTF16, so the buffer length is 2*(character length). When I call SQLBindParameter() to bind the variable for f1, what length value should be passed to ColumnSize parameter? Some said the Columnsize
    should be in byte. In MSDN, I can't find any posts or examples for my cases. MSDN also mentioned that the limit for this argument is 4000.
    I try 1000 and 2000, both works. Which one is the exactly correct one? I use SQL Server 2008 and native client 10.0.
    Thanks in advance.
    Liu Peng

    Hello,
    Thank you for your question. I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Elvis Long
    TechNet Community Support

  • LOV return value to submit multi LOV/Text field order by value!

    I have nested LOV and return value reflected to another LOV/Text field by order wise.
    My problem,
    The return value LOV or Text field should be dispay with one by one values order by (Dynamic).here i using the query in each LOV source.
      select DMS_DD_ENG_DESC dis, DMS_DD_ID ret from DMS_DEPT_DETAILS
    where DMS_DD_DT_REF_ID=:P3_DETAILS
    Workspace          :RAM_R&D
    User Name/Password :aramani/apex
    App                http://apex.oracle.com/pls/apex/f?p=36167:3I should do the dynamic action for this case?
    anyone can help me plz.
    Thanx,
    Ram

    Hi Ram,
    I changed your application and i think it is working the way you want.
    I don't know if it exactly what you need but take a look and let me know.
    Regards,
    Kees Vlek
    <tt>Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66</tt>
    If the question is answered please change it to answered and mark the appropriate post as correct/helpfull.

Maybe you are looking for

  • Digital audio adapter for analog phones

    I would like to use the Toslink output and use a digital-to-analog headphone amp for my studio-quality headphones. I can find a digital to analog converter for quite a large sum of money - for me - at around $500. 1. Does anybody have any ideas for a

  • Question on Quorum

    Hi Experts, Couple of questions on Windows Clusters. I am not a cluster expert and look for some help to understand the concepts 1. In Win 2003 cluster, we have quorum disk and "Disk only quorum model". IF this quorum model is used, and if quorum dis

  • Best approach for building dialogs based on Java Beans

    I have a large amount of Java Beans with several properties each. These represent all the "data" in our system. We will now build a new GUI for the system and I intend to reuse the beans as far as possible. My idea is to automatically generate the co

  • Is it Possible to create custom Object type in configuration Tab

    Hi , We have object type for table in Development Tab in SOLAR02 , is it possible to create a custom object type to represent the table object type in Configuration Tab. Please let me know the steps , if it is possible. Best Regards, Saravana

  • Saving so that windows user can have access?

    I have my project all ready and those with quick time...loads up perfectly. However those who have windows have a long wait or pile will not come up. Do you know how i can save my final cut express project so that window users can have access to it?