Assigning an IT field value to a variable
Hi experts,
I have a below piece of code:
TYPES: BEGIN OF lty_hrt1222,
low TYPE om_attrval,
END OF lty_hrt1222.
DATA: lt_hrt1222 TYPE STANDARD TABLE OF lty_hrt1222.
DATA: lv_low TYPE om_attrval.
I want to assign the value lt_hrt1222-low to lv_low.
I wrote something like: lv_low = lt_hrt1222-low.
But this is not working, gives a syntax error.
Can you please let me know a possible solution.
Thanks,
Ajay.
>
ajay singh wrote:
> There would only be a single value coming in the IT.
TYPES: BEGIN OF lty_hrt1222,
low TYPE om_attrval,
END OF lty_hrt1222.
DATA: lt_hrt1222 TYPE STANDARD TABLE OF lty_hrt1222,
ls_hrt1222 TYPE lty_hrt1222.
DATA: lv_low TYPE om_attrval.
READ TABLE lt_hrt1222 INTO ls_hrt1222 INDEX 1.
low = ls_hrt1222-low.
Edited by: Suhas Saha on Apr 29, 2010 11:10 AM
Similar Messages
-
How to Assign a Field value to a Variable??
Dear All,
Kindly let me know, if <b>"HOW TO ASSIGN A FIELD VALUE TO A VARIABLE????"</b>
Situation is, we have a Field (OBJK-TASER) in which 2 tables (SER01 & SER03) are stored. And we want to access names of the Tables which are there in the field(TASER) in (OBJK) table to a variable and then passing that variable to the sql query as a table name to get data accessed dynamicaly.try this
select TASER from OBJK into table it_table.
loop at it_table.
select field1 field2 from (it_table-table) into table it_fields.
endloop -
Bind input field value to a variable fails
Business need : The user wants to re-evaluate lines by a percentage value which he fills via his BI-IP screen.
I created an INPUT FIELD in WAD and I am trying to link a variable value (initially created in BI-IP through transaction RSPLAN)
to this INPUT FIELD.
Whenever I fill the input field with a value, the value is not being transferred to the variable.
Please help how to bind an INPUT field value to a variable to be transmitted to a planning function.
I have made many trials but in vain.
Please help.Hi.
I will present my scenario (it works in my system). From this scenario you may "cut" implementation for your scenario.
Lets sat I have an input fileld item and I want to read value (in my case numeric value) and pass this value to any planning sequence.
1. Create in Bex variable (in my case it is formula variable) lets say Z_INPUT_VAR
2. In WAD, when you executin planning sequence (lets say by pressing button execute) in command EXEC_PLANNING_SEQUENCE_SIMPLE define data binding.
When you clicked data binding->variable input MANUALY your variable name (Z_INPUT_VAR) in popup window.
3. In variable type select (ITEM_INPUT) type
4. In web item select your input field item.
This way you will pass inputed value to vaariable and planning sequence.
Then in planning function you also may use VARV() to read value of Z_INPUT_VAR variable.
Regards. -
How can I assign a hard coded value to a variable of type OBJECT.
Hi,
I have to call the following method
lc_action_execute->get_ref_object(
exporting
io_appl_object = io_appl_object
importing
ev_guid_ref = lv_guid_ref.
Now I have to hard code the io_appl_object variable (of type OBJECT) to test my application for the time being. How can I assign a value to the variable? Is there any way to do that?I wouldn't use WDR_CONTEXT_ATTR_VALUE_LISTGEN. Use wdr_context_attr_value_list instead:
data l_topics type zpm_main_topic_tbl.
l_topics = wd_assist->read_all_topics( ).
data lt_valueset type wdr_context_attr_value_list.
field-symbols <wa_topic> like line of l_topics.
field-symbols <wa_vs> like line of lt_valueset.
loop at l_topics assigning <wa_topic>.
append initial line to lt_valueset assigning <wa_vs>.
<wa_vs>-value = <wa_topic>-main_topic.
<wa_vs>-text = <wa_topic>-main_topic_desc.
endloop.
data lo_nd_meeting type ref to if_wd_context_node.
* navigate from <CONTEXT> to <MEETING> via lead selection
lo_nd_meeting = wd_context->get_child_node( name = wd_this->wdctx_meeting ).
data lo_node_info type ref to if_wd_context_node_info.
lo_node_info = lo_nd_meeting->get_node_info( ).
lo_node_info->set_attribute_value_set(
name = 'MAIN_TOPIC'
value_set = lt_valueset ). -
How to assign custom tab field value to corresponding standard tab field value.
Dear friends,
I want assign a field value ( advice code , advice code description ) in a custom tab to corresponding field value in standard tab (advcode ,). in me51n.
following screen shot are given belowHi SK,
It looks both the tabs are custom ones. In that case, you can either use Export/Import statement or you can use Set/Get Parameter ID for setting value.
If one is standard subscreen, you can export value from custom subscreen and use line item level user-ext/enhancement to assign the value on standard subscreen.
Hope this helps.
Regards,
Naveen -
How to read the input field value into ABAP variable?
Hi All,
i need a read the value of an input field into an ABAP variable,and i am doing this in the following way
lstring = request->get_form_field('myFlag').
here 'myFlag' is the input field name,but this is not returning me any value into lstring.
I have gone through the SDN and tried to do this.
could you please help me out to resolve this issue.
Thanks in Advance,
PraveenaDear Praveena
In which event are you putting this code. Place it in oninputprocessing event(Page with flow logic Model of coding). Then it will surely work.
Regards
Vijay.M -
Hi..assign a core tag value to a variable in jsp scriplet
Hi
I have a <core:set var="membershipType" value="${somevar}" />I want to set the membershipType value of the above tag to a variable in scriplet <% String member =""%> How can I do that,
Any ideas
Thanks
jagEL variables are assigned to one of the 4 scopes -> Page, Request, Session, or Application. By default they go to the page scope, which corresponds to the pageContext object in scriptlets.
The result is that you need to retrieve the value out of the scope it is in using the proper getAtribute(name) method, such as:
<% String member = pageContext.getAttribute("membershipType") %>The best course of action, though, is re-designing your application so there is no need for scriptlets. -
Assigning stored procedure output value to java variable
I have one stored procedure which is having ref cursor as the output parameter.
How to assign refcursor value to my java variable?cstmt.registerOutParameter(1, OracleTypes.CURSOR);
cstmt.execute()
ResultSet rs = (ResultSet)cstmt.getObject(1);
==
Ashok -
Assigning a form field to a variable in XSL in rtf template
Hi,
I have this code:
<?xdoxslt:set_variable($_XDOCTX, 'x', 0)?>
<?if:_-Basic._Total_Jobs_=''?>0<?end if?>
<?xdoxslt:set_variable($_XDOCTX, 'x', -Basic_._Total_Jobs_ )?>
<?xdoxslt:get_variable($_XDOCTX, 'x')?>
This code is supposed to be initialising a variable and a form field if it's null, and
then assigning the form field value to the variable. But I am not getting
any value from the get_variable function.
Any ideas?
Thanks,
- JennyI figured it out. The bind variable substitution works as designed. It was just my head that wasn't working right.
-
How to access screen field value in a module pool programming?
Hi Experts,
I have create a module pool program SAPMYDLG. It contains two screens 100 and 200.
The first screen contains Employee_ID field. This field is not a dictionary field.
In the second screen 200, I want to access the value of Employee_ID field from first screen.
For this I created a global variable v_empid in TOP include.
Then in the PAI of the screen 100 I have assigned the screen field value to global variable.
v_empid = Employee_ID.
But this gives an error saying " Field Employee_ID not defined".
What am I doing wrong? How can I access the screen field value?
Thanks
GopalHi,
Employee_ID field also must u define in the top include when u define that 100 screen and 200 screen will access.
regards,
muralii -
Fetches more values into one variable
Hi, inside a cursor loop I'd like to assign, each fetch, a value to a variable, in order, at the end to have a collection of all the values fetched into the same variable.
The code is the following:
CREATE OR REPLACE procedure APPS.AAA as
v_pino varchar2(64);
CURSOR tks_opened_range IS
SELECT incident_number AS YP_TKS_OPENED_WITHIN_RANGE FROM cs.cs_incidents_all_b a, cs_incident_statuses_b b, Cs_Incident_Statuses_Tl c
WHERE b.incident_status_id = c.incident_status_id
AND a.incident_status_id = b.incident_status_id
AND (b.attribute1 <> '3' OR b.attribute1 IS NULL)
AND c.language = 'EL'
AND ((sysdate - to_date(incident_attribute_6, 'dd-mm-yyyy hh24:mi'))*1440) BETWEEN 1 AND 11111111111
AND incident_attribute_2 IN ('ΓΕΝΙΚΗ ΔΙΕΥΘΥΝΣΗ ΤΕΧΝΟΛΟΓΙΑΣ')
ORDER BY incident_number;
rec_tks_opened_range tks_opened_range%ROWTYPE;
begin
FOR rec_tks_opened_range IN tks_opened_range
LOOP
v_pino := rec_tks_opened_range.YP_TKS_OPENED_WITHIN_RANGE;
DBMS_OUTPUT.PUT_LINE('v_pino: ' || v_pino);
end loop;
end AAA;
This works with the variable v_pino!....but at the end, the value of the variable v_pino is ONLY the last fetched by the cursor.
Is there a way to declare a variable (or better a collection) or a new type in order to have all the data fetched into this variable and the end of the fetching ?
I need to know this trick because, after, I have to assign this variable to a pipelined table function.
Thanks in advance
Alex
/Great Devang !! Thanks a lot ! It works ! Now I am able to retrieve all the values I need and store them into my variable gino
I searched on the note you mentioned in your mail in order to pass an array as a variable to a table function (PIPE ROW call), but I didn't find nothing about it.
Now I explain to you my situation.
I already implemented a table function that works perfectly. I have 2 cursors declared and 2 PIPE ROW calls.
FUNCTION statistic_report_2_1 (p_resolv_time_ll varchar2, p_resolv_time_ul varchar2, p_ypiresia varchar2)
RETURN xxi_statistic_rep_2_1_tab PIPELINED
IS
-- CURSORS FOR THE FIRST SHEET - Tickets opened per group and per duration
-- Cursor for tickets opened within 1 hour --
CURSOR tks_opened_1_h IS
SELECT incident_number AS YP_TKS_OPENED_WITHIN_1_HOUR
FROM cs.cs_incidents_all_b a, cs_incident_statuses_b b, Cs_Incident_Statuses_Tl c
WHERE b.incident_status_id = c.incident_status_id
AND a.incident_status_id = b.incident_status_id
AND (b.attribute1 <> '3' OR b.attribute1 IS NULL)
AND c.language = 'EL'
AND ((sysdate - to_date(incident_attribute_6, 'dd-mm-yyyy hh24:mi'))*1440) < 60
AND incident_attribute_2 IN (SELECT * FROM TABLE(CAST(xxi_szf_discoverer.ypiresia_values(p_ypiresia) AS xxi_ypiresia_list_tab)))
ORDER BY incident_number;
rec_tks_opened_1_h tks_opened_1_h%ROWTYPE;
-- Cursor for tickets opened between 1 hour and 3 hours --
CURSOR tks_opened_1_3_h IS
SELECT incident_number AS YP_TKS_OPENED_BE_1_3_HOURS FROM cs.cs_incidents_all_b a, cs_incident_statuses_b b, Cs_Incident_Statuses_Tl c
WHERE b.incident_status_id = c.incident_status_id
AND a.incident_status_id = b.incident_status_id
AND (b.attribute1 <> '3' OR b.attribute1 IS NULL)
AND c.language = 'EL'
AND ((sysdate - to_date(incident_attribute_6, 'dd-mm-yyyy hh24:mi'))*1440) BETWEEN 60 AND 179
AND incident_attribute_2 IN (SELECT * FROM TABLE(CAST(xxi_szf_discoverer.ypiresia_values(p_ypiresia) AS xxi_ypiresia_list_tab)))
ORDER BY incident_number;
rec_tks_opened_1_3_h tks_opened_1_3_h%ROWTYPE;
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
-- FIRST SHEET OPEN CURSORS --
TICKETS NUMBER OPENED WITHIN 1 HOUR
FOR rec_tks_opened_1_h IN tks_opened_1_h
LOOP
PIPE ROW(stat_rep_2_1_type(
rec_tks_opened_1_h.YP_TKS_OPENED_WITHIN_1_HOUR
END LOOP;
-- TICKETS NUMBER OPENED BETWEEN 1 HOUR AND 3 HOURS --
FOR rec_tks_opened_1_3_h IN tks_opened_1_3_h
LOOP
PIPE ROW(stat_rep_2_1_type(
,rec_tks_opened_1_3_h.YP_TKS_OPENED_BE_1_3_HOURS));
END LOOP;
RETURN;
END statistic_report_2_1;
But, in this way and with this syntax, I obtain for each PIPE ROW call only one field filled each time, because I can’t call 2 cursors in a nested loop together (data duplication);
For example:
1st PIPE ROW call : only the first field is filled and into the second I have to put ‘’
2nd PIPE ROW call : only the second field is filled and into the first I have to put ‘’
….and I cant’ call with a single PIPE ROW call two cursor variables…..
Into a Discoverer report this data layout is really bad (you can imagine with thousand
of records).
For this reason I thought to use an array variable (gino) to pass to a single PIPE ROW call outside the cursor loop……but it doesn’t work !!!
Can you suggest me how to resolve this problem….if it possible ?
Did I have to declare other TYPE or collection ?
Thanks you so much
Alex -
Printing field values to a PDF using a template
Hi
I have a set of field values stored in variables, I need to print these fields into a
PDF file. There is a template for this PDF , and each field value should go to a
specific location wrt the template on the new PDF. Could you any one
recommend a 3rd party API that can be used to do this purpose.I used iText (http://www.lowagie.com/iText/) to do
this.
I created the template as a PDF and used AcroForms to
create named fields within specific formatting within
the PDF.
// Create a BAOS into which to write the
PDF.
ByteArrayOutputStream baos = new
ByteArrayOutputStream();
// Load the PDF template and open the form fields.
InputStream inputStream = new FileInputStream(
"template.pdf" );
PdfReader reader = new PdfReader( inputStream
PdfStamper stamp = new PdfStamper(reader,
baos);
AcroFields form = stamp.getAcroFields();
o set the text in a field:
form.setField("field_name", "field value");
// close the PDF and return the bytestream
stamp.close();
return baos;
It looks like that you are loading a PDF template from a file, and straight
away attempting to fill the form by using the name of the field. To do this shouldn�t the
template PDF be formatted in a specific way to access the specific
location of the template where the field is.
Can you tell me if the template PDF file should be formatted in a specific way
to do this using iText. I was thinking of calculating the offsets of each field
and just print the data at that location.
And I very much appreciate your help so far. -
Editable ALV- Quantity field value is getting changed while double clicking
Hi all,
I have created Editable ALV grid using Class concepts. Quantity field is editable in dat. but after changing value and if im double clicking on that field, value is getting changed. eg: 45 is changing to .045. How can i resolve this problem.
Could u plz help.Hi Anu,
One question from my side.
U have displayed the ALV.In that grid u have quantity field.U have changed the value of that field to 45.
When u press enter the value has been changed to .045.Is this u r problem.
U can do onething anu.
Declare one varaible with the local field.
Pass u r quantity field value into that variable.
While displaying thriugh SET_TABLE_FIRST_DISPLAY in your internal table pass this variable.
It will solve u r problem.I think.
Let me if yu have any problem
IF u want u can refer to the program BCALV_EDIT* in se38.
There also u have needful info
Thanks, -
Is it possible to store a field name in a variable, then assign it a value?
Good day, everyone!
I am working on a program in which there are many different amount fields in which an amount may be assigned. For reusability purposes, I was wondering if it would be possible to write a routine that identifies the target amount field, stores it in a variable that is passed back to the calling program, and then assigns a value to it. There may be different structures having the same field name; what I'm trying to do is avoid having to code a huge IF or CASE statement for each structure. For example:
Structures S1, S2, and S3 have some fields identically named. Call one of them F1.
What I'd like to do is call a routine that identifies "F1" as my target field to populate. Then, upon return, I can assign it to the desired structure. Kinda like this:
S1-fieldname = 24.17. (but fieldname isn't a true field in the structure -- it would hold the value of the true field, "F1").
I realize this might not even be possible, but given how talented the folks are on this forum, I thought I should at least pose the question.
As always, points given for all helpful answers, and thank you!!
DaveOk. I gave that a shot, but what happens is that my ASSIGN COMPONENT statement doesn't work. It gets a sy-subrc of 4, and <column> remains unassigned. The program then abends on the line to assign <a1>-trbtr's value to the field because of <column> being unassigned.
DATA:
w_setname TYPE setleaf-setname,
w_column_name(20) TYPE c.
ASSIGN COMPONENT w_column_name OF STRUCTURE wa_expense_ng_report
TO <column>.
<column> = <a1>-trbtr.
Any thoughts on what I might be doing wrong? -
Assigning javascript varibel value to java variable
Hi all
I want to find screen resolution in one jsp page.That can be done in javascript.
(though 'screen.width and screen.height')
But is there any way to assign that value to java variable.
Any body has the idea?
Help me.No, why ? becuase jsp is SERVER side
There are workarounds, You can store your javascript values in hidden fields and submit your page with them to your JSP and then use them like that
Maybe you are looking for
-
Hello, I am currently having a huge problem where my computer is stuck on "Windows failed to start. A recent hardware or software change might be the case. To fix the problem:..." (SEE IMAGE) I have tried finding solutions online but none have worked
-
Sync problem with photo library
Hello, I am not sure to post this question here, but since it happens with my apple tv i hope to be in the good section. Most of the time when i start iTunes fresh and i want to sync my apple tv, which start at starting up iTunes, i get a error that
-
Help.... Aperture keeps quitting on me....
Okay, here's the quick scoop. When I open Aperture it says "trying to recover 1 of 4 media files" and then suddenly quits. I tried several times to open and I'm having the same issue. Has this happened to anyone else? Do I have any other access to my
-
Concurrent access issue with JPA for a Select query?
Hi All, I have been trying to understand why this code, public <T> List<T> findManyNativeSql(String queryString, Class<T> resultClass) Query aQuery = getEntityManager().createNativeQuery(queryString,resultClass); // Throwing the following
-
CURRENCY VALUATION - BANK ACCOUNTS
I wanted to know how you manage currency valuation with regards to daily reporting of Foreign Currency Bank Accounts in Local Currency I am on Version 4.6C and do valuations monthly so that we are able to value our Foreign Currency Bank Accounts at t