How to access field in structure where fieldname is inside of a variable?

Hi,
Through searching number of old threads here on forums i learnt that i can get dynamic field names from a table with "assign component" syntax.
So i have my fieldname inside a field symbol <fs_fieldname>. I want to use this fieldname to access a field in another structure ls_structure.
My syntax that is not working that i need help with is:
ls_structure-<fs_fieldname> = 'HELLO'.
How can I refer to ls_structure's field where the fieldname is in the field symbol <fs_fieldname>.
thank you

Check this
      field type string,
     end of ls_structure.
data:lv_field type string.
field-symbols:<fs> type string.
lv_field = 'FIELD'.
ls_structure-field = 'Hello'.
assign lv_field to <fs>.
if sy-subrc = 0.
  concatenate 'LS_STRUCTURE-' <fs> into lv_field.
  unassign <fs>.
  assign (lv_field) to <fs>.
  if sy-subrc = 0.
    write <fs>.
    <fs> = 'Changed data'.
    skip 1.
    write ls_structure-field.
  endif.
endif.

Similar Messages

  • Newbee: How to access fields with duplicated names?

    How can i access fields where the name already exists (Like FieldName[0], FieldName[2],...) - and where else can i get answers to simple questions like this one?
    Fieldname[n].thisValue does not work.
    Thanks for help.

    xfa.resolveNode("FieldName["0"]") etc.. I think should work

  • HOW TO ACCESS pdf files? where did they go?

    i have purchased intructional PDF FILES and did view them when i downloaded them. now i want to see them again and dont know how to access them. im rather stupid when it come s to computers. was i supposed to do something after i downloaded them? place them somewhere? i dont know how to do that. are the files i paid for lost? i can find free things i downloaded but these others that i paid for arent there!

    At the moment, you can't.  A favourite complaint.  Hopefully, the situation will change in the near future, but only Apple knows when or if.

  • How to add fields to Structure in Report Painter

    Hi All,
    We have a requiremnt where we need to add 2 fields ( profit center-PRCTR & description-CEPCT-LTEXT ) to structure CCSS. This structure is attached to library 1VK.
    Is it possible to add fields directly to a structure or do I need to create a new structure and attach it to a new library.
    If any one of this is possible, how can I do this ?

    Hi ,
    u can do it in both the ways , but i am not much sure abt second option.
    Useful Tcodes are GR21.
    Regards
    Prabhu

  • How to pass parameter value as "where [fieldname] = [fieldvalue]" in sql query under query type in SSRS report?

    I am having trouble with passing dynamic string to sql query for executing SSRS reports.
    I am using oracle database and I want to pass where clause parameter as "where LAND_NR = 6" to my select query.
    For example: I want to execute Select * from employee :p_where.
    where p_where parameter holds value "where LAND_NR = 6"
    So it will treat as "Select * from employee where LAND_NR = 6" statement which will give me the list of records to display in my reports.
    But it's not taking correct sql command throwing an error as "SQLcommand not properly ended."
    How can I achieve this?

    You need to use dynamic sql
    But please keep in mind that since you're using Oracle you may be better off posting this in some Oracle forums
    This forum is specifically for SQL Server
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to access a JSON structure key that starts with a number

    I've got an odd issue here.  I'm accessing someone else's JSON structure so I am not able to change it.  The JSON structure keys are named with both characters and numbers like this:
    0
    198456
    product_id
    198456
    1
    Rashaan Houston feat Tony Loreto
    artist
    Rashaan Houston feat Tony Loreto
    So, in other words, there's a key named "0" and a key named "product_id", both of which contain the same key.  Why they did that, I don't know, but they did.
    In one of the instances, the data stored under the text-named key isn't the same as the numerical-named key.  I tried to output the data in the numerical key like this (it's an array of structures):
    #strStompyJSON.data[1].0#
    but I get the following error:
    Invalid CFML construct found on line 41 at column 31.
    ColdFusion was looking at the following text:
    .0
    When I do the following, it works fine:
    #strStompyJSON.data[1].product_id#
    So it looks as though CF doesn't like accessing a variable that starts with a number.  I am able to loop through the structure using a collection loop, and it outputs all of the keys (including the numerical ones) and their values using the following code:
    <cfloop collection="#strStompyJSON.data[1]#" item="key">
    #key#: #strStompyJSON.data[1][key]#<br />
    </cfloop>
    However, that doesn't allow me a way to access specific keys named with a number.  Is there a way that I can specifically access a key that is named with a number?
    thanks!
    Mike

    No problem--glad it worked out.
    As a follow-up to this, I'd encourage you to keep the bracket notation in mind during future development.  It is EXTREMELY useful in a lot of situations.
    For example, if you're building a structure on the fly with dynamic keys, bracket notation is extremely helpful:
         <cfset authors = structnew()>
         <cfloop list="authorlist" index="name">
              <cfset authors[name] = getbooklist(name)>
         </cfloop>
    Also, bracket notation is really nice when creating json from ColdFusion structures.  Consider this:
         <cfset author = structnew()>
         <cfset author.name = "Neil Gaiman">
         <cfset author.genre = "Fantasy">
         <cfset author.awesome = true>
         <cfset authorjson = serializejson(author)>
    By default, the serialized json produced will have all UPPER CASE keys.  Not a big deal in most cases, but if you're returning the json to something (like a JS library) that is expecting keys in a certain case, it can be a problem.  Fortunately, bracket notation allows you to specify exactly what case you want the structure's keys to be in:
         <cfset author = structnew()>
         <cfset author['name'] = "Neil Gaiman">
         <cfset author['Genre'] = "Fantasy">
         <cfset author['AWESOME'] = true>
         <cfset authorjson = serializejson(author)>

  • OA Framework,how to make field Read-Only which is used inside Switch case

    Hi all,
    Using Personalization in OA Framework, when I am trying to make field read only, which is inside Swich statement ,then that field get automatically hidden.but my purpose is to make that field read-only not hide.
    My field name is Proposed Annual Increase Amount .
    The Personalization swtich case lookslike this :-
    Field Name Shown
    Switcher: Proposed Annual Increase Amount Yes
    case_name_HrPRateAnnTotInputSs
    Message Text Input: New Annual Amount Yes
    case_name_HrPRateAnnInputSs
    Message Text Input: Annual Pay Rate Yes
    case_name_HrPRateCurrAnnSalSs
    Message Styled Text: Pay Rate
    Regards,
    Mxj2930

    Can you be a bit clear on your requirement. If you have a switcher to display a field based on some condition, the other fields will not get displayed. I did not get as to what you mean by "my purpose is to make that field read-only not hide.".
    Are you talking about the case, when the "New Annual Amount" (or) "Annual Pay Rate" fields are displayed conditionally, you want them to be read-only and not editable. If this is the case, set the read-only property of these fields to true.

  • How to access a request scope value in groovy expression of bind variable?

    I need to filter the VO query based on the username.Following is what I am doing:
    <af:commandButton text="#{translationviewBundle['LoginPage.LOGIN']}"
    id="cbLogin" partialSubmit="true"
    action="validate">
    <af:setPropertyListener to="#{requestScope.userName}"
    type="action"
    from="#{backingBeanScope.LoginUserBb._username}"/>
    </af:commandButton>
    In the bind variable(pUserName) I set the value as : adf.context.current.requestScope.get('userName')
    and the VO query :
    SELECT DISTINCT
    LANGUAGES.NAME,
    LANGUAGES.ISO_CODE LANGUAGE_CODE
    FROM
    LANGUAGES LANGUAGES, USER_LANGUAGES USER_LANGUAGES
    WHERE LANGUAGES.NAME <> 'English'
    AND LANGUAGES.LANGUAGE_CODE = USER_LANGUAGES.LANGUAGE_CODE
    AND USER_LANGUAGES.USER_ID = :pUserName
    ORDER BY NAME
    I get the following error: "Missing IN and OUT parameter at the index 1" and the query returns nothing.
    Any suggestions pls?
    Thanks,
    Swathi Patnam

    Your ADF BC layer shouldn't depend on a specific view layer, the best practice in such a case is to have an AM service method exposed to the client and have it accept a parameter.
    Something like this:
    http://blogs.oracle.com/shay/2010/07/am_service_method_-simpledem.html

  • How to access the table type field in the structure

    Hi All,
    I have a BADI CRM_MKT_ADR_SEARCH and a method CHANGE_SEARCH_RESULTS in this method I have a parameter CT_BP_CP_CHANNEL .This parameter has type CRMT_BP_CP_CHANNEL_TAB(this is table type) this has the line type CRMT_BP_CP_CHANNEL(this is structure) in this line type we have one field addrnumber.How to access this field in my method?Please help me in this regard.

    data lw_tab type CRMT_BP_CP_CHANNEL.
    loop at CRMT_BP_CP_CHANNEL_TAB into lw_tab.
       lv_field = lw_tab-addrnumber.
       <further processing>
    endloop.

  • How to access a field of a structure with a field symbol?

    Dear all,
    Currently I'm trying to access the fields of a structure (called "ls_tbl") dynamicly. The code looks as follows (of course the field symbols are defined correctly ;-):
        ASSIGN lv_f1 TO <lv_f1>.
        ASSIGN lv_f2 TO <lv_f2>.
        lv_pp = ls_tbl-(<lv_f1>).
        lv_pt = ls_tbl-(<lv_f2>).
    Unfortunatly I get the following error message:
    <<The data object "LS_TBL" does not have a component called "".>>          
    I really do not understand why ABAP is trying to interpret the field symbol name as a string. Does anybody have a clue how to access the field of ls_tbl with the help of a field symbol?
    Many thanks!!!

    Hi ,
    Please check the below sample code .
    data : begin of st_table,
                myfiledname type c value '1',
                myfiledname1 type c value '2',
           end of st_table .
    data : lv_filedname(11) type c value 'MYFILEDNAME'
    filed-symbols : <fs> type any,
                    <fs_table> type any.
    assign st_table to <fs_table>.
    Assign lv_filedname to <fs> .
    assign component <fs> of structure <fs_table> to lv_pp.
    Regards,
    Ratheesh BS

  • How to find table for structure field ???

    Hi..
    i need your expert help on this.
    i am working on printing of terms of payment description. here there are explanation fields. it is coming from structure R052. and field name is TXT 02. here as per my understanding structure is coming from multiple tables so how i can find that from which table this field is coming??
    thanks
    h shah

    Dear,
    Well I cant say this is the solution for your issue, but have a look.
    http://it.toolbox.com/wiki/index.php/Find_data_in_your_SAP_system_and_know_which_tables_do_what
    DD02L - table properties
    DD02T - table texts
    DD03L - field properties
    DD03T - field texts
    How to find data related to a structure? With GREAT difficulty, but here are some ways (which will NOT work sometimes) to find specific fields if you know the structure's fieldname.
    1) First, goto SE11, and enter your structure name. Goto the field that holds your data, and double-click on the element name. Once inside the element, do a where-used list for that element, searching tables only. Then go into each table, and see if you can find the one holding your data. There may sometimes be a huge number of tables displayed, but a lot of them will be empty.
    2) Get the name of the program behind your transaction, goto SE80, and enter the program name. 99% of the time it will be part of a module-pool and bring up the pool. Goto the dictionary structures, and search each table there for the one holding your data.
    3) Open a new session with transaction ST05, select SQL Trace, click on the Trace On button, and go back to your transaction (while leaving the session with ST05 open). Submit your transaction, and go back to the ST05 session. Click on the Trace Off button, then select the List Trace button. Continue with standard selections, and a BASIC TRACE LIST will appear. search thru the tables displayed under ObjectName.
    and have a look at below.
    You do know any transaction in which (related) data is used: 1) start the transaction 2) position the cursor on the field you want to have info about 3) press F1, then F9 4) now you see the technical information of the data element, such as table name and field name. 5) if the table mentioned is what you're looking for, you're done. It is also possible that the data element is in a structure and not in a table. Now you can either analyze the structure via trx SE11, or you can double click on the 'data element' field. In the next screen, use the 'Where used' button to find the tables in which this data element is used.
    Additional tip: if you have found the table name, you can use trx SE36 to see the relationships of this table to other tables. You can use these relationships when defining queries, designing custom ABAP programs, etc. If you're lucky, one or more standard SAP logical database exist which contain the table you found in the previous steps. Proceed as follows: 1) start trx SE36 2) use the search help for the logical database name 3) enter the name of the table in the search help 4) press enter and, if you're lucky, you'll see a list of logical databases. Select one, press enter, select the radio button 'Structure' and press the view button. Now you'll see how this table is related to other tables.
    And finally, I prefer, the simpliest way to contact the ABAP consultant for help.
    Regards,
    Syed Hussain.

  • In VB Programming code -- How to access the formula for suppressing a field

    In VB Programming code -- How to access the formula for suppressing a field
    I am using Crystal Reports 2008 v1
    Using VB code, I am attempting to modify a Crystal Report before exporting it into a PDF format and then displaying it on the Web.
    My problem is that I am unable to access the formula used to dynamically suppress a field.
    The following code is working:
    mySections = rd.ReportDefinition.Sections
    For Each mySection As CrystalDecisions.CrystalReports.Engine.Section In mySections
       ' myFieldToChange is a String set to the text of the field I need to adjust the Suppression
       iloop = 0
       For Each RecObj As CrystalDecisions.CrystalReports.Engine.ReportObject In mySection.ReportObjects
               If mySection.ReportObjects.Item(iloop).Name.ToLower = myFieldToChange Then
                   myTextObject = CType(mySection.ReportObjects.Item(iloop), CrystalDecisions.CrystalReports.Engine.TextObject)
                   myTextObject.Text = "new field text goes here"
                   mySection.SectionFormat.EnableSuppress = True
                   '  Here is where I want to change the formula for the Suppression
                End if
                iloop = iloop + 1
        Next
    Next
    I can not find any reference to the actual suppression formula in the SDK help file.
    Note, the EnableSuppress can be set to True for False, but if there is a formula for dynamic suppression, the True or False value is overwritten.  The results of the formula determine the suppression.
    Is there a way to reference this formula.  I know that I can put on in using the Crystal Report Designer software, I need to modify this formula using VB code and the SDK.

    Hello, Mark;
    If you are using the ReportDocument object you do not have access to the Conditional Suppression formula. You can get around it by using a formula field in the report for the supression and then using the FormulaField code to change it at runtime.
    If you want to change the supression condition directly at runtime you need to use RAS and the ReportClientDocument.
    Elaine

  • How to access a field of an data source w/o binding a form field to it

    Hi
      This is a query regarding ADOBE print form.
      How to access a record field (of an data source.... typical multi row records) where the record is bound to a subform.
    Data is something like
    (I have used abap parlance for understanding)
    data : begin of data_tab occurs 0,
      field1 type .....,
    field2 type .....,
    fieldm type .....,
    fieldn type .....,
    end of data_tab.
    Subform is bound to
    $.DATA_TAB.DATA[*]
    How to access field1, field2,...... etc without creating subform fields and binding them to field1, field2, .... fieldn.
    I know normal approach is to define subform fields and then bind it to $.field1, $.field2 etc
    In the calculate event of a field bound to $.fieldm I have tried the following expressions to get the value of column fieldn of the same record but none of them worked.... Note that if I bind the field using $.fieldn data is displayed properly in the print form.
    $record.data_tab.fieldn.value
    $record.data_tab.data[*].fieldn.value
    $record.data_tab.data.fieldn.value
    $record.data_tab.fieldn.value
    Otherwise I would have to define hidden fields just to use these column values in the event script even though these value are not to be displayed in the ADOBE print form.
    Regards
    Abapper

    I can't remember the exact sentence, but do a little search, as that is a common question in this forum....
    How about:
    $record.data_tab.data[1].fieldn.value
    $record.data_tab.data[2].fieldn.value
    $record.data_tab.data[2].fieldn.value
    $record.data_tab.data[N].fieldn.value
    Cheers.

  • How to find out the structure stored field  value in a standard program

    Hi Gurus,
    Please suggest me how to find out the structure field stores the value in which table.
    Exanple : i have a strutured field in T.code cj31 is BPDY-WERT1 and it is stotring value 10,000,000.00. know i need to find out in which table this value is storing .
    Please suggest me its urgent.
    Thanks in Adavance!!!
    Points will be rewarded.......
    Regards,
    Kranthi

    hi,
       Go to transaction ST05,Click activate trace with filter,Give the transactio name as cj31,Go to the transaction and navigate to the place where the particular field is present, then again go to st05 ,Deactivate the trace and display the trace.
    Now u can see how the data is fetched ,U can even go to display mode of the same transaction cj33
    Thanks
    San

  • How do I take the zoom feature off my MacBook Pro? I have already went to System Preferences and turned "zoom" off in the Universal Access. I saw where someone said to use THREE fingers to double click... ??? Double click what? And 3 fingers?

    Can someone help me?How do I take the zoom feature off my MacBook Pro? I have already went to System Preferences and turned "zoom" off in the Universal Access. I saw where someone said to use THREE fingers to double click... ??? Double click what? And 3 fingers?

    What really cheeses me off here is that Apple isn't allowing users enough customization.  With each update of iTunes (and the OS and iOS) we're forced to give up something that worked well for the way we want to use the app and make do with fewer (and lamer) options.  If Apple keeps this up, they're going to start losing customers fast.  I mean if this isn't fixed soon, I'm pretty sure I'm going to give up on iTunes, and then I'll probably go ahead and get a Galaxy when I need to replace my iPhone.
    What I don't understand about how they won't let users delete the list of available podcasts now is why?  How is this making it a better program?  I can understand that not all users are capable enough to right-click on a feed and select "Show all available episodes", so I can see why they want the complete list to be the default (and, surprise, it already was).  But to not give users the option to delete that list?  It's inconsiderate because it makes navigating feeds with a large back catalogue really frustrating.  I'm flabbergasted that no one at Apple considered all the podcast feeds that keep hundreds of episodes available when they removed this feature.  It smacks of rank incompetence.
    What improvement were they trying to make here anyway?  There was nothing wrong to my mind about how podcasts were managed in previous versions.  Whatever improvement they were trying to make here, they should have realized that many users would at least want the option to keep things the way they were.
    And reverting to a previous version is no solution.  I can't sync my iPhone with the new iOS without this update, and (while I do have some issues--specifically how you can't play podcasts in the Music app anymore) I do like the new iOS.

Maybe you are looking for

  • How to use migration assistant without creating dual user accounts

    I want to use migration assistant to transfer apps, software & files on my macbook pro to my new macbook air. How can I do this without creating two user accounts for myself on the m-book air -- my account from the m-book pro & the one that the air m

  • How to increment variable value in single select statement

    Hi guys in this select statement i have hard coded date value but i need to put variable instead of hard coded date and then i want to increment that variable value till sysdate.. i have tried using curser , type tables but they are very very slow ..

  • Issue with saving sales document.

    Hi,      I have an issue with saving the sales document. When I save any sales document ( Order, Quotation, Contract, Delivery) its successful and showing document no in the information bar. But when I try to view or change the document, it shows no

  • New iMac and Older PowerBook sync

    I have powerbook with 10.6.8 sync'd with iPhone (using MobileMe, I think). Works great.  Got a new iMac with 10.8.2. How do I make all have same contacts, calenders, etc.?  I also want to put all music files on new iMac to free up disk space on Power

  • Drag and drop images from document in pages 5.5

    Hey guys, So prior to updating my OS to Yosemite and my pages application to 5.5, i used to be able to select an image, hit the format button to the top right -> image tab and see the image file, then i could just drag and drop that file to my deskto