How to search for a field and its value in an internal table

Hi,
I want to search for a field(which i dont know whether it exists or not) in an internal table and on finding that field, I have to update the value of that field. How do I do it? I think its similar to how SEARCH works but i wanted to know the internal table eqivalent of it.

Hi Sujay,
this code will help ful to u, just gi through it,
TABLES : KNA1,VBAK,VBAP.
***********INTERNAL TABLE DECLARATIONS****************
DATA : IT_KNA1 TYPE TABLE OF KNA1,
       WA_KNA1 TYPE KNA1.
DATA : IT_VBAK TYPE TABLE OF VBAK,
       WA_VBAK TYPE VBAK.
DATA : IT_VBAP TYPE TABLE OF VBAP,
       WA_VBAP TYPE VBAP.
START-OF-SELECTION.
  SELECT * FROM KNA1
  INTO TABLE IT_KNA1
  WHERE KUNNR = P_CUST.
  IF NOT IT_KNA1 IS INITIAL.
    SELECT * FROM VBAK
    INTO TABLE IT_VBAK
    FOR ALL ENTRIES IN IT_KNA1
    WHERE KUNNR = IT_KNA1-KUNNR.
    IF NOT IT_VBAK IS INITIAL.
      SELECT * FROM VBAP
      INTO TABLE IT_VBAP
      FOR ALL ENTRIES IN IT_VBAK
      WHERE VBELN = IT_VBAK-VBELN.
    ELSE.
      WRITE : / 'Customer',P_CUST,'does not exist ......'.
    ENDIF.
  ELSE.
    WRITE: / 'sales order does not exist for',P_CUST.
  ENDIF.
Rewards points plz if useful
Ganesh.

Similar Messages

  • Display data to edit based on fields and its value defined in internal tabl

    I need to display data in a internal table for editing in a screen.
    you have a internal table with field name , data types and its value. I need to display data in a screen ( sceen painter not in a report) row by row in vrtical format.
    The internal table's structure not fix. you can have any number of fields in the internal table.
    Can you please send me code if it is available with you or send me any senario in SAP if any ...so that i can debug to extract the code..
    have to display data vertically as below in editable format,
    for example,
    Airline
    Flight Number
    Flight date
    Flight price
    Airline Currency
    Plane Type
    Maximum capacity
    Occupied econ.
    Total
    No of fields will change.
    also F4 help needs to be attached with each field.
    I think it can be done through step loop. can anybody give sample code or tell me where to find in SAP or somewhere else?
    it will be great help to me..
    Sanjeev

    Hi
    just check out this program DEMO_DYNPRO_STEP_LOOP.

  • How to search for a fields ?

    Hello,
    I know it's an easy question but I've not find, how to search for a fields in Database on CR XI R2 ?
    Thanks in advance

    Hi Alexandre
    Do you want to see which database fields you have inserted in Crystal Reports and in which section you have inserted what fields?
    If yes then
    -open formula editor
    -In the right side pane expand Formatting Formulas.
    -Expand all the sections one by one and it will show you database fields,formulas and all the objects used in the sections.
    Hope this will clarify your doubts.
    Regards
    Asha.

  • How to search for a file and copy it to somewhere else in terminal

    So basically how can I search for a file on my computer named "testingtesting.txt" and copy it to my desktop using terminal? I have very little experience in terminal, so I was going to try and use the mdfind command, then store that output as a variable, and use that variable as the source for the cp command, but I feel like there is probably a much simpler method. So basically how could I find a file named "testingtesting.txt", copy it, and paste it to my desktop using terminal.

    Is there any particular reason that you must use Terminal?
    You could just download the free EasyFind from the App Store and find the file quickly. Do whatever you wish with it.
    Good luck,
    Clinton

  • How to search for a field in a table

    Hello,
        I have technical name of a field. How can I check in which table it is contained in. Also, what is the difference between a table and a structure where data is stored.
    I want table name of PO text field which is contained in Info Record Text.
    How to check table contents.
    Regards,
    Priyanka

    Hi Priyanka,
    If you know the technical name of the field, use T CODE SE15.
    Select Database Fields.
    You can then enter the field name in the Field and execute. System will list all tables containing the field, then you can shortlist the table you are looking for by reviewing the table descriptions.
    Hope this helps !

  • How can i remove a key and its value from properties file

    hi all,
    i want remove a particular key and associated value from the
    properties file. is their any standard way of doing?
    thanks inadvance
    daya

    hi,
    thanks
    i am able to remove the key,
    one more question how can avoid storing date and time
    in properties file.
    thanks
    daya

  • How to search for known folder and business areain Discoverer Administrator

    Hi ,
    I am new to Discoverer. I am supporting a report developed by someone else. I can see that the report is based on some folder in Discoverer Desktop. I would like to know details behind the folder. I tried logging through Disco Administrator but I could not locate this folder.
    Is there any search capability in Discoverer Admin to locate folder of business area?
    Trupti

    Hi,
    Yes, you can go to the administrator "Tools -> Manage folders" (CTRL+M) and search by the second tab ("By Folder").
    Tamir

  • How to create DOM with node and its value

    <Order>
    <Manifest>
    <Item>
    <ID>101</ID>
    <NAME>Name one</NAME>
    <PRICE>$29.99</PRICE>
    </Item>
    </Manifest>
    </Order>
    i can write the code to create a DOM for this one.
    but how can i write the code to get the DOM as shown below
    <Order>
    <Manifest>
    <Item name="xxx">
    <ID>101</ID>
    <PRICE>$29.99</PRICE>
    </Item>
    </Manifest>
    </Order>

    Your question appears to be how to get an attribute applied to an element. Is that right?
    If so, use the setAttribute() method of the Element interface.

  • How do I create a product or item database so I can search fr the product and its files with hte pro

    How do I create a product or item database so I can search for the product and its files with the products name or four digit code

    Ok so I made some progress on this. I have figured out, that I can add a chained "add to cart" to certain items, then when they click the button for Buy now, it will add both items to the cart. However, this would require me to manually build each product page and generate a custom button for each one with both product IDs in it.
    Can anyone offer help on how to put some JS in that would append a second function to the onclick function that BC Generates dynamically?
    For the products that require a set up fee, I would assume I would add in to either the product templates or in to the item description some JS that would find the onclick of the buynow button and append a second function to also add to cart the setup fee product. The end result being code that looks like this:
    <input type="submit" class="productSubmitInput" onclick="AddToCart(188536,6314368,'',4,'','',true);AddToCart(188536,6314367,'',4,'','',tr ue);return false;" value="Buy Now" name="AddToCart_Submit" />
    Except of course, the product ID on the first AddToCart would be the main product with the second one being the one appended.
    Does any of that make sense? lol

  • Assigning value to Field - Symbol ( which is type of internal table field )

    Hi All,
      I am facing problem to assign the value to a field symbol. My requirement is creating a dynamic internal table and populate values into that internal table, so that i can display the values .
      I am having a structure with fields like status , Plant1 name , Plant2 name.....Plant n .
      So i declared an internal table it_tab with this structure.
      I am having one more table which having number of records for Plant1 ,Plant 2 ,....Plant n based on some condition.
      I need to count the number of records for Plant1 and i need to put in the internal table it_tab.
      For this i created field-symbol .
    Here, t_deployment table will have the plants 1,2,3...and
         t_devobject will have some records for these plants.
    LOOP AT T_DEPLOYMENT. 
    clear w_count.
    LOOP AT T_DEVOBJECT WHERE ZDEPLOYMENT = T_DEPLOYMENT-DOMVALUE_L AND
                              ZADSTATUS = '10'.
    w_count = w_count + 1.
    ENDLOOP.
    concatenate 'it_tab-' t_deployment-domvalue_l into var_bet_name.
    assign var_bet_name to <bet_var_name>.
    now my internal table field i.e. it_tab-plant1 came into <bet_var_name> . But i want to assign a value for it.
    at last what i need is it_tab-plant1 = w_count.
    whaterver the w_count has value that needs to assign to it_tab-plant1. But i don't want to assign directly it it_tab-plant1. I want to assign dynamically. Because tommorrow some more plants added to t_deployments , i don't want to make changes to my program. It should take care....w/o changing the program.
    I tried the following statement.
    (<bet_var_name>) = w_count. But its not working.
    Please let me know how i can get this.
    Thanks in Advance.
    Pavan.

    Hi pavan,
    As ur requirement is creating a dynamic internal table,
    try the following way,
    remember the fieldcat should be of type LVC not SLIS.
    BUILD LT_LVCFIELDCAT in a way that, the value from the internal table becomes the fieldname
    ex:-
    loop at it_models INTO WA_MODELS.
        LS_LVCFIELDCAT-FIELDNAME = WA_models-MODEL.
        LS_LVCFIELDCAT-SELTEXT = WA_models-MODEL.
    append ls_lvcfieldcat to lt_lvcfieldcat.
    endloop.
    DATA: DREF TYPE REF TO DATA,WA_REF TYPE REF TO DATA.
    FIELD-SYMBOLS: <TEMP_TAB> TYPE TABLE, <TEMP_WA> TYPE ANY.
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = LT_LVCFIELDCAT
        IMPORTING
          EP_TABLE        = DREF.
      ASSIGN dref->*  TO <TEMP_TAB>.
    now basing on the fieldcatalog <temp_tab> is build.
    NOW FILL <TEMP_TAB>.
    WHILE FILLING, ASSIGN COMPONENT IDX/NAME.....
    this statement will be very usefull.
    i hope this will be help full.
    pls reward the points if it helps u.
    regards
    Hyma

  • How to search for a certain cross reference using its name in FM 11?

    How to search for a certain cross reference using its name in FM 11?

    Well, thank you. I am only using Find dialog box. By "name", I'd like to give an example. The background is FM 11 structured. I have an element "xref" which is used to make cross reference. Now In Chapter 1, there is a sentence like "This is an ODU for ...". I made a cross ref of the word "ODU" to its full name "outdoor unit" in Chapter 2 (in the same book). After this, the word "ODU" in the sentence in Chapter 1 will no longer be a plain text. So I no longer can use the find dialog box to search for "ODU" because it is already an xref rather than text. I am not if it's clear.

  • When I am searching for any particular song or album from my shared ITUNES folder, the search is conducted  in the apple store and not on the shared library. How to search for the song in the shared library

    I am using IPAD Mini.When I am searching for any particular song or album from my shared ITUNES folder, the search is conducted  in the apple store and not on the shared library. How to search for the song in the shared library

    Search for shared library is impossible, as far as I know.  Searches supported - are local and internet.

  • AMs and PMs - how to search for small-caps?

    In my book I'm proofreading I have a mixture of (because I was undecided when I was putting it together):
    i 7.00 a.m.
    i 7.00 am
    i 7.00am
    I ran these three options past about twenty people this morning, 6 voted for the first, 8 voted for the second, 3 voted for the third, and 1 person and myself voted for the option I can't show properly here: small-caps: 7.00 AM. Then of course there was the wag who told me: "Why don't you just say '7 o'clock in the morning' "? And the complete ratbag who suggested, in the interests of avoiding confusion: "7.00 am o'clock in the morning before lunch at 0700 hours."
    Before I make them all the same format, which will very likely be small-caps, I want to make sure I can easily search for them so I can replace with an alternative style if I change my mind again later on.
    QUES: How do I search for "AM" and "PM" (spaces before and after) if they are formatted in small-caps? I can't use paragraph styles because the AMs and PMs appear in a variety of styles already.

    Thanks for all the hints. I'm going to try some of them to see how they work. I should make it clear though (my original post may have been unclear about this) that I was asking how to search for AM in small caps AFTER I had changed all time-formats to that form.
    As for why I asked for input: I treat my book a bit like a democracy and give people a chance to vote on certain aspects and make comments just in case they have a good idea that I hadn't thought of; but yes, I'm the boss, and in terms of votes mine counts for 95%. In this case, someone suggested using a colon -- which I have taken on board. So I will be using the time format 7:30 AM to see how it looks. But if I don't like it, I want to be able to find all the small-cap AMs and change them to something else in one go.
    My interest in time-formats has stirred some interest locally. My partner proof reads a walking club magazine and she received the latest edition lat night. She has never concerned about time formats before, but after my foray into different options, she came up with the following variety (the club has lots of reports that include times when walking trips start and end), even though she thought she had done a thorough job of proof reading:
    9 am
    9.00am
    9:00 am
    9:00am
    9.am
    9 AM
    9.00a.m.
    9.00 a.m.

  • I have iPhone 4, it was working just fine..no I have a problem: it keeps searching for the network and then says no network..it was open to clean from inside..how can I fix the problem

    I have iPhone 4, it was working just fine..no I have a problem: it keeps searching for the network and then says no network..it was open to clean from inside..how can I fix the problem

    Tap Settings > General > Reset > Reset Network Settings
    If that doesn't help, try here >  iOS: Troubleshooting Wi-Fi networks and connections

  • How to search for a Movie?

    I'm looking for the movie "Roots" which lasts probably 12 or 14 hours. I found 'Episode One' in a list with a billion songs called 'roots', but can't find the whole movie for purchase. How do I search for a movie without all the songs included in the list, and is it possible that iTunes doesn't sell the whole movie "Roots" in one fell swoop?

    If you are referring to the show based on Alex Haley's book, it wasn't a movie, it was a TV miniseries and so is multiple episodes and must be purchased as such or as a Season. If you do a Power Search for TV Shows and use Roots in the Show field, you'll find all the episodes. Here's the link to the original series:
    http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTVSeason?id=255117456&s=14 3441
    and here's Roots: The Next Generation:
    http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTVSeason?id=266395382&s=14 3441
    Regards.

Maybe you are looking for