Change the Value of column of the internal table at run time
Hello Experts,
With the below code i am able to determine the value hold
by internal table at run time for a sepcific column but i am not getting the way
of how to update the internal if one of the value is changed,
lr_desc_table ?= cl_abap_typedescr=>describe_by_data( itab ).
lr_desc_struc ?= lr_desc_table->get_table_line_type( ).
loop at itab assigning <fs_data>.
loop at lr_desc_struc->components ASSIGNING <fs_comp_wa>.
assign component <fs_comp_wa>-name of structure <fs_data> to <fs_field>.
lv_excel_row = <fs_field>.
CALL FUNCTION 'SCP_REPLACE_STRANGE_CHARS'
EXPORTING
INTEXT = lv_excel_row
IMPORTING
OUTTEXT = lv_excel_row.
assign lv_excel_row to <fs_field>. "this is not changing the value actually hold in internal table
endloop.
endloop.
Hi,
Resolved this issue with the code mentioned below.
Code:
loop at lt_export_items assigning <fs_data>.
ls_data = <fs_data>.
loop at lr_desc_struc->components ASSIGNING <fs_comp_wa>.
assign component <fs_comp_wa>-name of structure <fs_data> to <fs_field>.
lv_excel_row = <fs_field>.
CALL FUNCTION 'SCP_REPLACE_STRANGE_CHARS'
EXPORTING
INTEXT = lv_excel_row
IMPORTING
OUTTEXT = lv_excel_row.
concatenate 'ls_data-' <fs_comp_wa>-name into lv_var.
assign (lv_var) to <fs_var>.
<fs_var> = lv_excel_row.
endloop.
modify lt_export_items from ls_data .
clear:ls_data.
endloop.
Take care,
Sanju
Similar Messages
-
How to find the number of columns in an internal table DYNAMICALLY ?
Hi,
How to find the number of columns in an internal table DYNAMICALLY ?
Thanks and Regards,
saleem.Hi,
you can find the number of columns and their order using
the <b>'REUSE_ALV_FIELDCATALOG_MERGE'</b>
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = sy-repid
changing
ct_fieldcat = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 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
now describe your fieldcat . and find no of columns.
and their order also..
regards
vijay -
SUBMIT and return the value of that report into internal table
Dear all,
I have a requirement. I want to submit a report and return the value of that report into my internal table.
How to do this.
Pl. guide.Hi Vidhya,
Below links from SAP help will resolve your issue.
http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3bde358411d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3bd1358411d1829f0000e829fbfe/content.htm
Edited by: Harsh Bhalla on Jan 2, 2010 11:54 AM -
Changing the order of fields in an internal table
Hi all,
I'm using field symbol as internal table. this table has got a standard database structure.
I want to make the 3rd column of this internal table as 1st colums keeping rest of the columns as it is.
Is there any way to do this?
Thanks,
Anil.Hi
Instead of directly taking the type as a standard structure , declare the FS internal table as type of types structure.
Data: fs_scarr like type_s_scarr.
FIELD-SYMBOLS <scarr2> TYPE fs_scarr
In the types put the third column as first one and use into corresponding in select query
or else
while displaying the internal table change the order of the columns
Loop at itab into fs_itab.
write : col3
col2
col4
endloop.
Thanks,
Viquar Iqbal -
How to get the value of column from previous row to current row?
Hi All,
I am facing a critical problem in SQL query (for reporting purpose (COGNOS)). please reply to my query.
REQUIREMENT: i want to retrive value of a column (this is not a table column, this will be calculated based expression) from previous row to current row.
EXAMPLE:
TABLE NAME: i have to join multiple tables. so, i am not mentioning table names here.
DISPLAY COLUMNS in the report: item, loc, sku, beginval (not table column), endval (not table column, this will calculated based on some expressions), etc. Here, first time the value of BEGINVAL will be taken from some x column name of x table. ENDVAL will calculated based on the expression. For the next row onwards, BEGINVAL will become the value of ENDVAL and the value of ENDVAL will be calculated based on the expression and this expression uses the value of BEGINVAL.
my report will look like below.
ITEM LOC SKU BEGINVAL ENDVAL
1 HYD 1-HYD 10 10+1+2 (13)
2 HYD 2-HYD 13 13+1+2 (16)
3 SEC 3-SEC 16 16+1+2 (19)
4 SEC 4-SEC 19 19+1+2 (22)
etc....
in the above output, BEGINVAL and ENDVAL columns are not part of any table. they are alias column names.if you observe intially BEGINVAL will be assigned to some value, but from subsequent rows, BEGINVAL will become the ENDVAL of previous row.
Please help me on how to write this query?Hi, please find the detail description of the problom.
DDL (table scripts)
ITEM
CREATE TABLE ITEM
ITEM VARCHAR2(50 CHAR) NOT NULL,
DESCR VARCHAR2(50 CHAR) DEFAULT ' ' NOT NULL,
UOM VARCHAR2(50 CHAR)
SKU
CREATE TABLE SKU
ITEM VARCHAR2(50 CHAR) NOT NULL,
LOC VARCHAR2(50 CHAR) NOT NULL,
OH float
SKUPROJSTATIC
CREATE TABLE SKUPROJSTATIC
ITEM VARCHAR2(50 CHAR) NOT NULL,
LOC VARCHAR2(50 CHAR) NOT NULL,
STARTDATE DATE
VehicleLoad
CREATE TABLE VEHICLELOAD
LOADID VARCHAR2(50 CHAR) NOT NULL,
DESCR VARCHAR2(50 CHAR) DEFAULT ' ' NOT NULL,
SHIPDATE DATE DEFAULT TO_DATE('01/01/1970','MM/DD/YYYY') NOT NULL,
ARRIVDATE DATE
VEHICLELOADLINE
CREATE TABLE VEHICLELOADLINE
LOADID VARCHAR2(50 CHAR) NOT NULL,
ITEM VARCHAR2(50 CHAR) NOT NULL,
QTY float(126)
DML scripts
I can't provide the the DML scripts, because its very huge data.
Main QUERY is below.
below is the query which i have to write and execute.
select
i.item,
i.descr,
i.unitsperpallet,
sp.loc,
sp.startdate,
'Crucial_IND',
LAG (EndBal,1,0) OVER (ORDER BY STARTDATE) BeginBal,
SP.FCSTCUSTORDERS CustOrders,
SP.COMMITINTRANSOUT,
SP.RECARRIV,
SP.TOTINTRANSIN,
(BeginBal - sp.FCSTCUSTORDERS - sp.COMMITINTRANSOUT + sp.TOTINTRANSIN ) EndBal,
'CuttingQty',
VLL.QTY,
vl.source,
vl.arrivdate,
vl.shipdate,
vl.loadid,
s.oh
from item i, skuprojstatic sp, sku s, VehicleLoad vl, VehicleLoadLine vll
where sp.item = i.item
and s.item=i.item
and sp.item =s.item (+)
and sp.loc = s.loc (+)
and vll.item = s.item
and vll.loadid = vl.loadid
and to_char(sp.startdate ,'mm/dd/yyyy') = to_char(vl.arrivdate,'mm/dd/yyyy')
and sp.loc = vl.dest (+)
order by sp.startdate
problem description: in the above query, BeginBal and EndBal is what i am looking for. when i execute this query, oracle throwing an error saying that alias names can't be used as expressions. For the first row, the BeginBal should be the value sku.OH and for the subsequent rows, this value will be the previous row value of EndBal. -
How do I change the order of columns in the responses table?
How do i change the order of columns in the responses table in FormsCentral? The default setting puts them in reverse order!
Hi,
The issue with the default ordering of columns in the response table is something that we hope to address in the next update to FormsCentral. In the meantime, you can reorder the columns by selecting them then click/drag using the gray area above the column name. As shown below, an orange marker will show you where the columns will be placed when you release the mouse button.
Sorry for the inconvenience.
Regards,
Brian -
Regarding alv function of summing up the values of columns.
hi friends:
could you please tell me how to sum up the values of columns.
for example, there are columns of room rent, expense of cell phone call,
expense of taxi fee.
thank you very muchhi For calculating one more coloum . try this logic
write this piece of code in wddoinit
data : lt_column type salv_wd_t_column_ref,
ls_column type salv_wd_s_column_ref,
lo_aggr_rule TYPE REF TO cl_salv_wd_aggr_rule.
* display columns in correct order
lr_column_settings ?= wd_this->lr_config.
lt_column = lr_column_settings->get_columns( ).
loop at lt_column into ls_column.
case ls_column-id.
when 'ROOM_RENT'.
* aggregate field
call method lr_config->if_salv_wd_field_settings~get_field
exporting
fieldname = 'ROOM_RENT'
receiving
value = lr_room_rent_total.
* create aggregate rule as total
call method lr_field_amnt->if_salv_wd_aggr~create_aggr_rule
exporting
aggregation_type = if_salv_wd_c_aggregation=>aggrtype_total
receiving
value = lv_aggr_rule.
when 'CALL'.
* aggregate field
call method lr_config->if_salv_wd_field_settings~get_field
exporting
fieldname = 'CALL'
receiving
value = lr_call_AVG.
* create aggregate rule as total
call method lr_field_amnt->if_salv_wd_aggr~create_aggr_rule
exporting
aggregation_type = if_salv_wd_c_aggregation=>AGGRTYPE_AVERAGE
receiving
value = lv_aggr_rule.
endcase.
endloop.
Regards
Chinnaiya -
Every time my lg g pad 8.3 lte tablet is turned off it reverts the saving email attachment back to internal storage. Every time I turn on, I change it back to save to SD card. It stays that way until it is turned off for more than a minute. If I do a restart, it holds the setting, but loses it when it is shut down for any period of time. Does anyone else have this issue? The setting holds for photos taken with camera storing to SD card. Only the email attachment setting does not hold.
I believe that system has a hall sensor on it to detect when the lid is closed so it can put the system to sleep and/or disable the monitor so it can be used with an external monitor only. If the sensor is marginal or has a bad cable, it may intermittently cut the monitor on and off, and may likewise put the system to sleep. One way to check would be to plug in an external monitor and if the laptop's screen cuts off or doesn't show up, start using the trackpad and press on a non-typing key like the shift key. If the external display suddenly pops and becomes active while the laptop display remains black, it's probably a problem with the sensor or the cable/connection. You might be able to fool the sensor into kicking on and off by moving a magnet over it. It's located on the left had side of the base with the unit opened up, and right over the audio output plug.
I know of some people that put a small magnet right over the hall sensor's location so the laptop display turns off and they use the system with an external monitor, keyboard, and mouse. If fooling with magnets, make sure they're small and don't get them close to the hard drive because a strong magnet can wipe them out.
I don't know if this will help you much, but it might. -
Copy a certain row of data into the next row in a same internal table ??
HI, guys.
May i know how to copy a certain row of data into the next row in a same internal table ?? Bcz I plan to update a certain colum of data in the row just now into another value..
For example:-
*at first...
ebeln1 ebelp1 xblnr1
ebeln2 ebelp2 xblnr2
ebeln3 ebelp3 xblnr3
*after that, become...
ebeln1 ebelp1 xblnr1
ebeln2 ebelp2 xblnr2
ebeln2 ebelp2 xblnr4
ebeln2 ebelp2 xblnr5
ebeln3 ebelp3 xblnr3
Thanks in advance.hi,
If you have this kind of requirement then you must be having 2 internal tables ,one existing data and 2nd from which you have to insert the records into 1st table.
so in this case,
loop at itab1.
v_index = sy-tabix.
loop at itab2 into wa where pri_key = itab1-pri_key.
v_index = v_index + 1.
insert wa into itab index v_index.
endloop.
endloop.
Using this code ,your data records similar to your 1st tables primary key records will get inserted into table. -
How to change the numbers of items in a ring control in run time ?
Hi !
I would like change the numbers of items in a ring control in run time, but I can´t.
Thanks.Hello blaze,
did you try the "Strings And Values []" property of the ring?
LabView7.1 help says:
Array of clusters containing the strings from which you can select in the ring control
and the numeric values for each item. Use the Strings [] property if you do not need to
assign specific numeric values to each item.
Best regards,
GerdW
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
Store the vital info from the absence quota record in an internal table
Hi experts,
I want to detrmine if the Absence records (PA2001 rec) deduction from date (PA2001-BEGDA) and absence to date (PA2001-ENDDA) are permissible for the validity period of the Absence Quota record (the PA2006 rec). If the quotas deduction from date, PA2006-DESTA, is greater than the PA2001-BEGDA, we then need to identify this absence quota record for change and change the deduction from date, PA2006-DESTA, to be the same as PA2001-BEGDA. Store the vital info from the absence quota record in an internal table and record the new date that the deduction from date that needs to be changed to. The changes will be made via a BDC session.
Please help me out...
Thanks,
VickyThis looks possible if we code it in 'dynamic action' table, but the BDC may not read it during run time.
Do you still have this issue?
Thanks
Narasimha -
How to make the value axis (Y) on the right?
the value axis(Y) of the stacked column chart is on the left default. how to make it on the right?
thanks.e,
Numbers Charts do not have the option to move the value axis to the right side. You can turn off the display of Value Labels, using the Chart Inspector, and make your own value labels from a text box or small table column and place them to the right of the chart.
Regards,
Jerry -
Is there an easy way to filter a 2-d array based on the values of two of the fields?
Is there an easy way to filter a 2-d array based on the values of one of the fields. In my attached VI the output array has the following format:
TimeStamp Ident Frame Type Bytes Data
10:57:07.621 3AD00016 CAN Data Frame 8 0000000000000000
10:57:07.622 3AD00017 CAN Data Frame 8 000005E000000000
10:57:07.624 3AD00018 CAN Data Frame 8 0000000003300000
10:57:07.625 2DC00000 CAN Data Frame 8 0000000000000000
10:57:07.626 3AD00019 CAN Data Frame 4 0000030000000000
I would like to delete any rows that do not have an "Ident" between the values of 3AD00000 and 3AD0001E. So for the above data the fourth row would be deleted. The only way I can see to do it is to form a 1-d array. Is there a better approach?
Thank you.
Solved!
Go to Solution.
Attachments:
CMM_SN_MULTI.vi 20 KBHi chuck72352,
after you have sorted your data, you can use the InRange Function. Combined with a "search 1D Array" you'll get the range you really want.
Mike
Attachments:
ArraySubset.PNG 25 KB -
Spilt the number of records in a internal table
Hi all,
I have a requirement where i must spilt the number of records in my internal table itab .Say if i have 2000 records , i must spilt it taking the first 990 records and doing some posting using Bapi and again take the next 990 records and do the posting .Can some one help me out.
Good answers will be rewarded with points.Hi,
You can use these instructions using two internal tables, but please be aware to not forget any line.
REFRESH my_table2.
APPEND LINES OF my_table FROM 1 TO 990 TO my_table2.
CALL FUNCTION 'BAPI'....
(with my_table2)
REFRESH my_table2.
APPEND LINES OF my_table FROM 991 TO my_table2.
CALL FUNCTION 'BAPI'....
(with my_table2)
Regards,
Mathieu -
Knowing the primary key columns of the given table
Hi,
How can I get the primary key columns of the given table?
Regards,
Sachin R.K.You can find the constraint_name from all_constraints/user_constraints for constraint_type = 'P' (which is the primary key constraint).
And then see which columns are in for the constriant_name
in all_cons_columns/user_cons_columns view.
Below is the example
select acc.column_name from
all_cons_columns acc, all_constraints ac
where acc.constraint_name = ac.constraint_name
and acc.table_name = 'DEPT' AND acc.owner = 'SCOTT'
and ac.constraint_type = 'P'
Hope this helps
Srinivasa Medam
Maybe you are looking for
-
Here is a summary of the permissions system the way I understand it. I hope it helps save anyone out there some of the time and trouble I've had to endure to understand Permissions. I) POSIX: Get info The 'Get Info' window is a user-friendly way to v
-
HR master data change export with Interface-Toolbox PU12
Hello out there ! I implemented a HR master data change export with PU12 at one of my customers. It works fine - with one little problem: It is only possible to export one period (actual or selected). Is there any possibility to export more than one
-
Can't get music to play on ipad2 everything is grayed out
Can't get music to play.... It is downloaded but it's all grayed out.
-
Can I write ActiveX components in Java?
Hi, Is there any API to write ActiveX components in Java? If yes, pls. send me the link. Thanks and Regards Tushar
-
Host of ibook (1.33 ghz) problems.
hi, i'm having serious problems with my ibook at the moment, not certain that some of them may have started after installing 10.4.4 but here they are: Ibook boot's by first displaying some old (system 9 looking) menu which displays a hard drive icon