Assign a value to a table-field  within a field symbol

Hi gurus,
probably a small question but I don't get it :-(.
To explain my problem I give you a simplyfied example:
I want to fill a workarea of a table in a dynamic way that is defined as followed:
The TABLE1: has 3 fields:
FIELD1
FIELD2
FIELD3
data: i type i,
        c type c,
        fieldname type text30,
        workarea type table1.
field symbol: <f1> type text30.
while i le 3.
move i to c.
    concatenate 'workarea-FIELD'  c  into fieldname.   "ex.  fieldname = 'workarea-FIELD1'
    assign (fieldname) to <f1>.                                  " <f1> = workarea-FIELD1.
Now I want to fill this <f1> with a value
in a way like  (<f1>) = '12345MyValue'.
In the end I want a dynamic assignment of 
workarea-FIELD1 = '12345MyValue'.
workarea-FIELD2 = '12345MyValue'.
workarea-FIELD3 = '12345MyValue'.
endwhile.
Any hint is appreciated :-).
Regards,
Stefan

Hi *,
I got the solution by my self...it's so easy I am already ashamed I posted my question... but there are days in live of a programmer...
assign (fieldname) to <f1>.                       " <f1> = workarea-FIELD1.
<f1> = '12345MyValue'.
modify table from workarea.
Have fun.
regards,
Georg

Similar Messages

  • Assigning Default value to a Infotype Field

    Hi,
    My requirement is to assign default value to the loan amount field of the loans infotype(0045).
    I am using the PBAS0001 user exit program ZXPADU01 and taking the basic pay amount for the employee from infotype 8 and assigning it to pa0045-dabrt(loan amount)field in infotype 45. But the problem is the loan amount field in 45 infotype is of the type currency(13 characters) and if i assign a value 2000 to the field its displaying as 20,000,000.00. That is the value is being multiplied by 10000 and is displayed. When i tried to divided the value by 10000 and pass it, for odd numbers its not working.Can Some one provide the solution for this problem.

    Try using simple Formula at field level insted of field routine.
    there is IF( <condition>, <result when true>, <result when false> ) option avaialble in formula
    Regards
    Sudeep

  • How do you assign a value to the APEX field APP_USER

    Application Express 4.0.2.00.07
    Hi
    Is there a special function/procedure to assign a value to the APP_USER field
    or a simple APP_USER := :P1_LOGIN_NAME would do
    Z

    Hello Zac,
    >> or a simple APP_USER := :P1_LOGIN_NAME would do
    The APEX engine is already doing it for you after a successful login – setting the value of APP_USER as the user login name. You can use it as a substitution string or with the bind variable notation (:APP_USER).
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • Select * from table into table field-symbol

    Hello,
    I am trying to do a dynamic select into a dynamically defined internal table (field-symbol), but it doesn't work like I expected.
    if I try this code :
    data : p_tabname type string value 'PA9006',
          dref type ref to data .
    FIELD-symbols: <struc> TYPE ANY.
    CREATE DATA dref TYPE table of (p_tabname).
    ASSIGN dref->* TO <struc>.
    SELECT * INTO  TABLE <struc> FROM (p_tabname)  .
    I get the following error :
    <struc> is not an internal table.
    Is there any way I can make this work?
    Points will be assigned for each usefull answer.

    Hi Dries
    Just change your declaration of <struc> to as below it would work,
    field-symbols : <struc> type standard table.
    Reward points if useful.
    ~Ranganath

  • Coloring of Particular Cells in a dynamic internal table(field symbols)

    Hi,
         I have a requirement to introduce color into some particular cells in a dynamic internal table(Field symbol) based on some conditions.I know that color can be introduced at cell level in the case of static internal table.But, can anybody tell me whether it is possible to introduce color to particular cells in the dynamic internal table(Field Symbol) .Please suggest me on this issue.
    Thanks in advance,
    Rajesh

    Hi,
    This is the sample coding for the colour cell report.
    Kindly go through it. It will helps u.
    REPORT YMS_COLOURTEST .
    DATA: BEGIN OF TP OCCURS 10, ID, NR(8), TEXT(255), END OF TP.
    DATA: LENGTH TYPE I VALUE 8, " Length of list
    TESTSTRING(15) TYPE C VALUE '012345678901234',
    WIDTH TYPE I. " Width of list
    DATA: TXT_REPORT LIKE DOKHL-OBJECT.
    START-OF-SELECTION.
    PERFORM HEADING.
    PERFORM OUTPUT_BODY.
    FORM HEADING.
    FORMAT INTENSIFIED OFF. " Remove any INTENSIFIED
    ULINE AT (WIDTH). " Upper frame border
    FORMAT COLOR COL_HEADING INTENSIFIED." Title color
    WRITE: / SY-VLINE. " Left border
    WRITE: 'No |Colour |intensified |intensified off|',
    'inverse' NO-GAP.
    WRITE: AT WIDTH SY-VLINE. " Right border
    ULINE AT (WIDTH). " Line below titles
    FORMAT COLOR OFF.
    ENDFORM.
    FORM OUTPUT_BODY.
    DO LENGTH TIMES.
    PERFORM WRITE_LINE USING SY-INDEX.
    ENDDO.
    ENDFORM.
    FORM WRITE_LINE USING COUNT TYPE I.
    DATA: HELP(14) TYPE C,
    COUNT1 TYPE I.
    COUNT1 = SY-INDEX - 1.
    WRITE: / SY-VLINE NO-GAP.
    WRITE: (4) COUNT1 COLOR COL_KEY INTENSIFIED NO-GAP.
    WRITE: SY-VLINE NO-GAP.
    CASE COUNT1.
    WHEN '0'.
    HELP = 'COL_BACKGROUND'.
    WHEN '1'.
    HELP = 'COL_HEADING'.
    WHEN '2'.
    HELP = 'COL_NORMAL'.
    WHEN '3'.
    HELP = 'COL_TOTAL'.
    WHEN '4'.
    HELP = 'COL_KEY'.
    WHEN '5'.
    HELP = 'COL_POSITIVE'.
    WHEN '6'.
    HELP = 'COL_NEGATIVE'.
    WHEN '7'.
    HELP = 'COL_GROUP'.
    ENDCASE.
    WRITE: HELP COLOR COL_KEY INTENSIFIED NO-GAP.
    WRITE: SY-VLINE NO-GAP.
    WRITE: TESTSTRING COLOR = COUNT1 INTENSIFIED NO-GAP.
    WRITE: SY-VLINE NO-GAP.
    WRITE: TESTSTRING COLOR = COUNT1 INTENSIFIED OFF NO-GAP.
    WRITE: SY-VLINE NO-GAP.
    WRITE: TESTSTRING COLOR = COUNT1 INVERSE NO-GAP.
    WRITE AT WIDTH SY-VLINE NO-GAP.
    ENDFORM.
    Thanks,
    Shankar

  • How could I assigning object values to internal table?

    CREATE DATA dref TYPE TABLE OF (table).
        ASSIGN dref->* TO <intab>.
        SELECT * FROM (table) INTO CORRESPONDING FIELDS OF TABLE <intab>.
    I have create a internal table intab1.
    obviously, the expressing "intab1 = <intab> " is wrong.
    then,how should intab1 get the value of <intab>?

    Hi
    If you need only to transfer all data: <b>INTAB1[] = <INTAB>[]</b>. But INTAB1 has to be as <INTAB>.
    If the structure of INTAB1 is different, you have to use the field-symbols:
    LOOP AT <INTAB> ASSIGNING <WA>.
      ASSIGN COMPONENT SY-INDEX OF STRUCTRE <WA> TO <VAL_F>.
      IF SY-SUBRC <> 0. EXIT. ENDIF.
      ASSIGN COMPONENT SY-INDEX OF STRUCTRE INTAB1 TO <VAL_T>.
      IF SY-SUBRC <> 0. EXIT. ENDIF.
      <VAL_T> = <VAL_F>.
    ENDLOOP.
    So how to transfer the data depends on the structures of INTAB1 and <INTAB>.
    Max

  • How to assign the Value to the Particular field-Text field

    Hi all,
    My requirement is to call the Web service with input from the ADF page.
    Steps I have done:
    1. I have created a Web service data control based on the WSDL file.
    2. Just drag and drop the Process, It is automatically created the form with the Input fields and then the Process button
    3. When I entered the values and then process button it will pass the values corretly.the web service is invoked correctly with the values entered.
    4. But when I try to assign the value from the some other field that is not working.
    I am assigning the Value to the field by go to the properties of the Particular field value =”CREATE”
    When I do like this that value is showing in the screen. But it will not pass the value to the web service.
    I think the value is only displaying in the screen. Not stored at bindings level. Kindly guide me in this.
    Thanks in Advance
    C.Karukkuvel

    If you want to have the value that is returned displayed in a field that has binding to another item and not the WS result item then the way to do this would be to override the method that is invoked with the button that calls the web service - you then take the result and assign it to the item you want.
    See the way it is done here:
    http://blogs.oracle.com/shay/2009/07/java_class_data_control_and_ad.html
    While this sample uses a simple method it would be basically the same for a Web service.

  • Assigning a value to a number field through a button

    11gxe , apex 4.x ,
    hi all ,
    i am trying to assign value to a number field through a button ,
    i created a button , then a dynamic action for this button , when it is clicked ,
    the dynamic action is based on Pl\Sql code , and the code is
    begin
    :p2_assign := 455 ; -- where the page is "p2" and the number field is "assign"
    end ;
    but it does not work , why ?

    I can see the toolbar now from the last link you provided me with ,
    but you showed me the way to use the static assigning , and assigning with sql , and i want to do it with "Pl\Sql"
    in order to know why my way of writing the code does not work , although it is written properly , and should work .
    every input item is a variable , and i am doing so
    begin 
    :p2_assign := 455 ; -- where the page is "p2" and the number field is "assign" 
    end ;
    to assign a value to a variable ,
    and
    doing this
    begin 
    select 455 into :p2_no from dual ; 
    end ;  
    to select a value into a variable , then
    why does not it work ??
    and how to do it with pl\sql ?
    thanks

  • Default value for a table field?

    Hi,
    I have a table which contains the fields USER_NAME and DATE_CHANGED_AT.
    here's what i want to do:
    When we use se16 to enter data into the table, i want these fields to have default values .
    user_name should contain the currently logged in user.
    date_changed_at should contain todays date.
    The aim is to eventually have these fields contain the person who last changed the row and the date when it was changed.
    It doesnt matter if se16 doesnt contain it and we have a way of defaulting these values thru the table creation process.
    something similar to the mandt field. When we create the table data, MANDT field is pre-populated.
    Any thoughts?
    Regards
    Vandana

    Entering data using SE16 is not a good practice .
    YOu have to use table maintenance generator to maintable the table entries.
    This also provides with options to write your own code to meet requirements like this.
    EVENTS in table maintenance generator
    Regards,
    Ravi

  • Put value into internal table field

    Hello Gurus,
    I have one field which I stored into one variable through cncatenate statment in variable VAR1.
    and I have another variable VAR2 have some amount.
    now I want to put this amount to the field which is present into the VAR1.
    ex: VAR1 = 't_display-co1'
          VAR2 = 200
    now I wnat to put this 200 into t_display-co1
    o/p  t_display-co1 = 200.
    How should I do this?
    Please Help.....
           CONCATENATE 'w_display-' col_name into var1.
           ASSIGN VAR1 to <fs>.
    Thanks in adv.

    Check this sample
    data: begin of t_display,
          col1(10) type c,
          end of t_display.
    FIELD-SYMBOLS: <fs> type any.
    data: var2 type i,
          var1 type string.
    var2 = 200.
    var1 = 't_display-col1'.
    assign (var1) to <fs> CASTING TYPE c.
    if sy-subrc = 0.
      <fs> = var2.
    endif.
    Vikranth

  • How to get values from dynamically populated field symbol

    Hi all,
    I am having a field symbol <fs_table> type standard table, which is getting populated dynamically.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = i_fieldcat[]
        IMPORTING
          ep_table        = is_eptab.
      ASSIGN is_eptab->* TO <fs_table> .
    After the ALV display i am making some changes in the ALV and getting a new internal table <fst_table>,which is having changed values.
    Now the problem is that i am not able to get the changed values from <fst_table>  as it is not of any structure type and cant associate it with any field like we do in normal internal table and work areas like, wa-fieldname.
    All the fields are dynamic.
    Regards,
    Anant

    Hello Anant
    You have to access to access the fields of your dynamic outtab dynamically as well.
    DATA: ls_fcat   TYPE lvc_s_fcat.
    FIELD-SYMBOLS:
      <ls_struc>   TYPE any,
      <ld_fld>       TYPE any.
    LOOP AT <fs_table> ASSIGNING <ls_struc>.
      LOOP AT i_fieldcat INTO ls_fcat.
        ASSIGN COMPONENT ls_fcat-fieldname OF STRUCTURE <ls_struc> TO <ld_fld>.
        ...  " do processing
      ENDLOOP.
    ENDLOOP.
    Regards
      Uwe

  • How to assign money value to CRM money field in Script component?

    Hi All,
    Can anyone please help me with below issue?
    I have a money value (eg. 25.00) in the SQL table (Source) of type string which I am reading it in script component and want to push that same to MS CRM(destination) currency field.
    I have used Money class but still it is throwing the exception "System.InvalidCastException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #444AFC47"
    Used this lines of code. Please let me know if I am doing anything wrong and help with resolution.
                    if (!Row.Amount_IsNull)
                        Money Amount = new Money();
                        Amount.Value = Convert.ToDecimal(Row.Amount);
                        newTbldetails["new_amount"] = Amount.Value;
    Note: new_amount is the attribute in MS CRM (destination) with type Currency.
    Thanks,
    Sri

    This below code worked. There was a mistake in the assignment.
                    if (!Row.Amount_IsNull)
                        Money Amount = new Money();
                        Amount.Value = Convert.ToDecimal(Row.Amount);
                        newTbldetails["new_amount"] =
    Amount;
    Thanks,
    Sri

  • How to define a standard value for a table field

    Hi All,
    I have a date field in a database table, for that while maintaining if we don't give any value it should get the present date.  How can we do this.
    Thanks,
    bsv.

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • How to maintain default values for custom table fields --  Urgent

    Hi all,
    I've a requirement wherein i need to create a Z table (with maintainence view) in which i'll have date and time as two of its field which should have current date and current time as default value. Can somebody suggest as how am i to maintain the date and time fields defaulting to current date and current time.
    Incase if someone is unable to intrepret what i'm trying to say, please query me, i'll elaborate it further.
    Please give in your quick inputs which is highly valuable to me and also will be highly appreciated.
    Thanks in advance,
    Vaishnavi Varadarajan

    We have a following custom table which contains the fields “Date on which record was created” and “Name of the person who created the object”. We would like to have these to be filled up with SY-DATUM and SY-UNAME respectively.
    Using the events, we can achieve this.
    Please refer the following link:
    http://abapliveinfo.blogspot.com/2007/12/events-in-table-maintenance-in-sap.html
    Also,
    Write a form routine in table maintanance generator.
    1. SE11 > utilities > table maintenance generator
    2. environment > modification > event
    define the event and form routine to make use of the tigger. in the form routine define an object for the class and call the relevant method.
    Or u can do it as:
    Table maintenance generator is basically used to do table operations like (insert, delete, modify...).
    if you create table maintenance for your table it will build a module pool program, by using you do the above operations.
    below is the procedure to create table maintenance generator.
    1) Create one function group.
    2) after activating your Ztable, choose 'Utilities'----> 'Table maintenance genrator'.
    3) then give the authorization group and function group created abobe in the next screen.
    4) Then choose the "create" button in your application tool bar, which will creates the module pool program.
    5) then create one Tcode by chosing "Transaction with parameters( parameter transaction)".
    6) in transaction field give "SM30", select the check box "Skip initial screen".
    7) in the below of that screen you can find the "Default values" frame.
    8) there under the "name of screen field" select the "View name' and 'update".
    9) in value column against to "view name" give you table name, and against to "Update" put 'X' in capital letters.
    save it then you can straight away use this newly created Tcode to maintain your table.
    Note:- 1) make the modification while saving the data into your table using this newly generated program to carry out your validation (even though it looks like standard program; no need to enter the access key).
    2) if you do any changes to your table and press the activate button automatically the table maintenace generator will be goes off, you need to create this again.
    cheers,

  • How to assign a value(populate) a custom field in a PCUI page ?

    Hi
    I am working in SAP CRM on its web interface PCUI.
    I have created a custom field "ZZ_NEWFIELD" through EEWB in Business Partner. It is visible in accounts transaction header (crmm_account).
    Now if I create an opportunity for this business partner, I want to fetch the value of "ZZ_NEWFIELD" from BP Master and display it in opportunity(header) transaction.
    Can someone tell me how to go about it ? I am novice to BSP applications.
    Regards
    Vishal

    Thanks Francisco for your reply.
    I have already posted it in the CRM forum as well but thought to place it here also.
    As for the weblog you menioned, it just details the method of extending the field and placing it in the IView. I have done it already.
    The problem I am facing is to how to populate this field ? I know the source field from where it has to get the data but I dont know the method/code to enable the value in new field placed in the Opportunity header.

Maybe you are looking for