How to update/modify the ALV internal table once it is displayed
Hi All,
I have a alv grid report using fm reuse_alv_grid_dispaly. My requirement is to create sales order using bapi (up to here it is working fine) and once the SO is created update the function module tables field with the created sales order.
Example:
My alv grid display before creating SO:
Customer Material SalesOrder
1000001 material1
My alv grid display after creating SO:
Customer Material SalesOrder
1000001 material1 3025642
How can I achieve this functionality. Because the field catalog is already displayed, how can I modify/update it by adding the sales order number to it. Experts, suggest me.
Thanks.
FORM callback_ucomm USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
CASE ucomm.
WHEN 'CRE'.
* Logic to create sales order here...
* Show the Sales order column
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
IMPORTING
et_fieldcat = gt_fieldcat
EXCEPTIONS
no_infos = 1
program_error = 2
OTHERS = 3.
if sy-subrc eq 0.
read table gt_fieldcat into gs_fieldcat with key fieldname = 'VBELN'.
if sy-subrc eq 0.
gs_fieldcat-no_out = space.
gs_fieldcat-tech = space.
modify gt_fieldcat from gs_fieldcat index sy-tabix transporting no_out tech.
endif.
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
EXPORTING
it_fieldcat = gt_fieldcat[].
endif.
ENDFORM.
Similar Messages
-
Problem in modifying the main internal table gt_data
Hello i have written code for modifying the main internal table. i have read data from ausp table and put into the internal table gt_ausp. now i want to modify my main table GT-DATA with gt_ausp. i am not able to do this.
LOOP AT gt_data INTO ls_list.
lt_temp-objek = ls_list-matnr.
APPEND lt_temp. " 특성값 발췌용도로 저장
APPEND ls_list TO lt_work. " 핵심작업용도로 저장
ENDLOOP.
DESCRIBE TABLE lt_temp.
IF sy-tfill EQ 0.
pv_flg = 'X'.
EXIT.
ENDIF.
Get 제품인증(플랜트별).....
DESCRIBE TABLE lt_cetino_tp.
플랜트 자재번호
카타로그-인증 코드그룹-인증 인증코드
Certi. No.
Get 자재별 특성값..........
오브젝트 특성이름 내부특성 내부카운터 특성값
SELECT aobjek batnam aatinn aatzhl a~atwrt
INTO CORRESPONDING FIELDS OF TABLE lt_ausp_tp
FROM ausp AS a INNER JOIN cabn AS b
ON aatinn = batinn
FOR ALL ENTRIES IN lt_temp
WHERE a~objek EQ lt_temp-objek " 오브젝트키(자재번호)
AND a~klart EQ '001' " 클래스유형
AND a~atzhl EQ '001' " 특성값카운터(최종건만 존재)
자재특성 변경시 변경됨
AND b~adzhl EQ '0000'.
IF sy-subrc EQ 0.
DELETE ADJACENT DUPLICATES FROM lt_ausp_tp.
lt_ausp[] = lt_ausp_tp[].
lt_ausp_tp2[] = lt_ausp_tp[].
DELETE ADJACENT DUPLICATES FROM lt_ausp_tp2.
Get 특성내역
내부특성 " 내부카운터
특성값 특성값내역
SELECT aatinn " aatzhl
aatwrt batwtb
INTO CORRESPONDING FIELDS OF TABLE lt_cawn
FROM cawn AS a INNER JOIN cawnt AS b
ON aatinn = batinn AND
aatzhl = batzhl AND
aadzhl = badzhl
FOR ALL ENTRIES IN lt_ausp_tp2
WHERE a~atinn EQ lt_ausp_tp2-atinn " 내부특성
AND b~spras EQ sy-langu.
ENDIF.
SORT lt_work BY matnr .
BREAK-POINT.
LOOP AT lt_work INTO ls_list.
특성내역
READ TABLE lt_ausp WITH TABLE KEY objek = ls_list-matnr
atnam = 'SECTION_WIDTH'.
수출자재가 아닌 것은 제외
LS_LIST-SECTION_WIDTH = LT_AUSP-ATWRT.
MODIFY TABLE GT_DATA FROM LS_LIST TRANSPORTING SECTION_WIDTH.Hi,
Question before: why dont you just use the std.API for reading the classification data?
e.g. "BAPI_OBJCL_GETDETAIL"
Second: a DELETE DELETE ADJACENT DUPLICATES works only only sorted tables.
Doing this after a select will only succeed randomly depending on the buffers of your data based below.
( 90% chance if it is an oracle system)
To your question:
Just replace your LOOP AT gt_data into ls_list
by a LOOP AT gt_data ASSIGNING <current_list_record>.
then you can access the fields directly:
<current_list_record>-SECTION_WIDTH = LT_AUSP-ATWRT.
Cause of your issue:
"MODIFY" needs a key to to find the record to be updated.
If your gt_data ist referencing a DDIC table type with a key or a local type with a key
it has no chance to do it.
Hope that helps.
br, -
I need insert /update/modify ztable from internal table or work area
I have one simple problem.
TYPES: BEGIN OF t_account,
acc_no LIKE zztaccountheader-acc_no,
cust_id LIKE zztaccountheader-cust_id,
acc_type LIKE zztaccountheader-acc_type,
od_option LIKE zztaccountheader-od_option,
od_limit LIKE zztaccountheader-od_limit,
od_issue_date LIKE zztaccountheader-od_issue_date,
END OF t_account.
data: lwa_account TYPE t_account,
li_account TYPE STANDARD TABLE OF t_account,
bu scerrin i am inputing data :
i want modify updare or insert record into ztable by work area i put following thing
MOVE : zztaccountheader-acc_no TO lwa_account-acc_no,
zztcustomer-cust_id TO lwa_account-cust_id,
zztaccountheader-acc_type TO lwa_account-acc_type,
zztaccountheader-od_option TO lwa_account-od_option,
zztaccountheader-od_limit TO lwa_account-od_limit,
zztaccountheader-od_issue_date TO lwa_account-od_issue_date.
INSERT zztaccountheader CLIENT SPECIFIED FROM lwa_account .
CLEAR lwa_account.
ENDIF.
i am etting error
The type of the database table and work area (or internal table)
"LWA_ACCOUNT" are not Unicode convertible.
please solve ithi,
decalre like this.
tables : zztaccountheader.
data : t_account like zztaccountheader occurs 0 with header line.
data: lwa_account TYPE t_account,
li_account TYPE STANDARD TABLE OF t_account,
MOVE : zztaccountheader-acc_no TO lwa_account-acc_no,
zztcustomer-cust_id TO lwa_account-cust_id,
zztaccountheader-acc_type TO lwa_account-acc_type,
zztaccountheader-od_option TO lwa_account-od_option,
zztaccountheader-od_limit TO lwa_account-od_limit,
zztaccountheader-od_issue_date TO lwa_account-od_issue_date.
INSERT zztaccountheader CLIENT SPECIFIED FROM lwa_account .
CLEAR lwa_account.
ENDIF.
rgss
anver
if hlped mark points -
Unable to modify the final internal table with month field
hi everybody
I am having one material which has a qty in different months lets say that jan feb mar apr may june..... now i have caluculated the total of the material monthly wise and i have to display in the output. if the material of the first month displayed and then again the same material comes in the loop and that matrial is going to be checked by the month wise and has to diaplyed in the corresponding month fied in the output. so i am using the index in the loop using the AT new command for the matnr and appending the final output structure and now if the same matrial comes again with different month the final output internal table should modify. but the statement is executing but the value is not coming in the final output structure.
the syntax which i am using is
MODIFY GT_OUTPUT FROM WA_OUTPUT INDEX lv_index TRANSPORTING MATNR.
OUTPUT FORMAT IS
MATERIAL NO : JANQTY : FEBQTY : MARQTY : ...... :DECQTY.
THANKS IN ADVANCEmy issue is....
lets say that i am having three materials now
381, 391, 401. and the material 381 has used in jan month 5 times and feb month 6 times like that. each material is used in different months. now i have calculated all the matrerials qty monthly wise and i have to display the material one time only the qty's in jan feb mar and so on....
material no 383
jan 31064
feb 67312
mar 65107
apr 31222
material no 391
jan 74677
feb 8952
mar 75501
so my output should be like this
OUTPUT FORMAT IS
MATERIAL NO : JANQTY : FEBQTY : MARQTY
381 31064 67312 65107
391 74677 8952 75501
now i have written the code like this
LOOP AT GT_OUTPUT1 INTO WA_OUTPUT1.
WA_OUTPUT-MATNR = WA_OUTPUT1-MATNR.
WA_OUTPUT-MJAHR = WA_OUTPUT1-MJAHR.
at NEW matnr.
l_matnr = 'X'.
lv_index = sy-tabix.
endat.
IF L_MATNR = 'X'.
PERFORM CASE_STATEMENT.
append wa_OUTPUT to gt_OUTPUT.
clear : wa_OUTPUT, l_matnr, WA_OUTPUT1, WA_ZQCALWT.
ELSE.
PERFORM CASE_STATEMENT.
MODIFY GT_OUTPUT FROM WA_OUTPUT. " INDEX lv_index TRANSPORTING MAR. " EQ WA_OUTPUT1-MATNR.
clear : wa_OUTPUT, l_matnr, WA_OUTPUT1, WA_ZQCALWT.
ENDIF.
endloop. -
How to update all the rows of table using stored procedures
Hi,
I want to update all the rows of a table of a specific column
sp_a male
sp_b female
sp_c male
sp_d female
in above table
gender of all the columns has to be interchanged.Sir table is like this detail(name varchar(10),gender varchar(10))
Where Details are like this
Name Gender
sp_a
male
sp_b
female
sp_c
male
sp_d
female
I want to create a stored procedure which automtically updates gender from male to female and female to male
for all the rows . i.e., all the rows are updated for column gender by just running a stored procedure.
So after execution of stored proc the above table looks
Name Gender
sp_a
female
sp_b
male
sp_c
female
sp_d
male -
How to get the final internal table after the ALV is modified?
Dear experts,
My WebDynpro application allows users to delete row, sort the column. After all this modification, I need to get the final internal table of ALV to generate a csv.file. Are there any methods to get the final interal table content of ALV?
Many thanks!
meerHi Friend ,
Please see this link for wiki of WDA Alv Hierarchy : [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f&overridelayout=true]
Regards, -
How to Organize the columns in the dynamic internal table?
Hello Folks!
How to Organize the columns in the dynamic internal table? i tried passing the parameter COL_POS to the fieldcatalog, Which is not working.Organize in What order ? What is your way to output ?
If you use ALV, you need to create fresh FIELD CATALOG for your dynamic table and then assign the column position.
Regards,
Diwakar -
How can we modify the maximum no. of columns in pivot table ?
hi all,
How can we modify the maximum no. of columns in pivot table ?
do i need to change the nqconfig.ini or instanceconfig file or else?
thnx..A little search on the forum :
In the instanceconfig.xml add a <PivotView> element under <ServerInstance> if one does
not exist already.
Within the <PivotView> element add an entry that looks like:
<MaxCells>nnnnnn</MaxCells>
where nnnnnn is your desired limit for the maximum total number of cells allowed
in a pivot.
Warning: an excessively large number will cause more memory consumption and
slower browser performance.The details here :
Oracle BI EE (10.1.3.2): Maximum total number of cells in Pivot Table excee -
How can i modify the check constraint in the table
How can i modify the check constraint in the table. This table containts check constraint, condition is code_value between 1 and 4. codevalue is column name.
Please suggest me.Go to tahiti.oracle.com, pick version browse reference manual and see the alter table statement
Also read the goal of this forum.
Your question is more appropriate to Database general forum
General Database Discussions
Gints Plivna
http://www.gplivna.eu -
How can I modify the "right click" menu of a table control?
Hello,
How can I modify the "right click menu" of a table control. I would like to be able to remove the ability to add or delete columns and maybe other selections. I want to keep the ability to
add or delete rowsHi Andy,
Dialog & User Interface VIs -> Menu functions
Never used them, eh? -
Need to update Ztable from final internal table
Hi,
ITAB = Final internal table has 9 fields : 1 2 3 4 5 6 7 8 9
Ztable = Ztable has 6 fields ex : 1 3 4 6 7 8
Structure of both Itab and Ztable are different.
I have data in the Final Internal table and needs to update data into a ztable.
If condition is true...
Modify ztable from itab
endif.
Any suggestions how I can update Ztable from the INternal table
Regards,
KittuHello,
First keep the loop to the final internal table then move all the records to the work area after moving to workarea then create another workarea for the Ztable then move only the field values which are there in Ztable then use modify keyword.
example
move:
y_wa_final_itab-kdauf to y_wa_zhr_item-vbeln,
y_wa_final_itab-kdpos to y_wa_zhr_item-posnr,
y_wa_final_itab-receiptno to y_wa_zhr_item-receiptno
modify zhr_item from y_wa_zhr_item -
How to read data from an internal table into a real table?
Hello experts,
I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created. I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider. I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created. Please see code below.
TABLES MULTITAB.
DATA:
query_name TYPE RSZCOMPID,
s_cubename TYPE RSINFOPROV,
t_cell_data TYPE RRWS_T_CELL,
t_axis_data TYPE RRWS_THX_AXIS_DATA,
t_axis_info TYPE RRWS_THX_AXIS_INFO,
wa_t_cell_data like line of t_cell_data,
wa_t_axis_data like line of t_axis_data,
w_corp_tab like line of t_cell_data.
s_cubename = 'CORP_MPO1'.
query_name = 'Z_corp_test'.
CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
EXPORTING
i_infoprovider = s_cubename
i_query = query_name
i_t_parameter = query_string_tab
IMPORTING
e_cell_data = t_cell_data
e_axis_data = t_axis_data
e_axis_info = t_axis_info.
If anyone has any information to help me, I would greatly appreciate it. Thanks.Hi,
<li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
<li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
LOOP AT t_cell_data INTO wa_t_cell_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
LOOP AT t_axis_data INTO wa_t_axis_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
Thanks
Venkat.O -
How to select data from an internal table
material norm date last modified
B2-SP HEAT 50.000 20090420
BF COKE 575.000 20090419
GROSS COKE 200.000 20090419
B2-SP HEAT 100.000 20090419
TWT 33.000 20090330
B7-SP HEAT 2.000 20090310
B1-SP HEAT 1.000 20090309
B7-SP HEAT 615.000 20090308
B2-SP HEAT 585.000 20090308
B1-SP HEAT 100.000 20090308
B3-SP HEAT 610.000 20090308
BF COKE 68.500 20090308
GROSS COKE 72.600 20090308
B8-SP HEAT 600.000 20090308
B9-SP HEAT 625.000 20090308
BX-SP HEAT 615.000 20090308
B9-SP HEAT 58.000 20090307
B1-SP HEAT 100.000 20090307
B6-SP HEAT 350.000 20090306
B2-SP HEAT 888.000 20090306
Like above there r numerous data in a table :
how will i select data into another internal table where material above is not repeated with latest modified date.please help.Hi Sonu,
The main task is to move the contents of the one internal table to another with some condition.
First sort and delete the duplicate entries from the First Internal table like below :
sort it_tab by material ascending date_modified descending.
delete adjacent duplicates from it_tab.
Then move that Internal table contents to another internal table.
Define another internal table with the same structure as you have first internal table and then
Second Step :
it_itab1 = it_itab.
If you are using seperate Header line and Body then you can do like below :
it_itab1[] = it_itab[].
This will fix the issue.
Please let me know if you need any further explonation.
Regards,
Kittu
Edited by: Kittu on Apr 24, 2009 12:21 PM -
How to check duplicate entries in internal table??
Dear Friends,
How to check duplicate entries in internal table??
Exp: In my internal table if I am having the same records more then ones then I need to print the error message, here I am using steploop for selecting the values from screen, and the values are coming into my internal table if user enter the same value more then ones I need to print the error message.
Thanks,
SridharHi,
After storing the data into internal table say ITAb, move the data into another internal table.
t_dup[] = itab[].
LOOP AT itab.
count1 = count1 + 1.
itab-count1 = count1.
MODIFY itab.
ENDLOOP.
LOOP AT t_dup.
count2 = count2 + 1.
t_dup-count2 = count2.
MODIFY t_dup.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM itab.
LOOP AT t_dup.
record_dup = 'N'.
READ TABLE itab WITH KEY count1 = t_dup-count2.
IF sy-subrc = 0.
record_dup = 'Y'.
ENDIF.
IF record_dup NE 'Y'.
t_dup-message = 'DUPLICATE ENTRY'.
t_dup-flag = 1.
MODIFY t_dup.
ENDIF.
ENDLOOP.
Use this sample code.
Reward pts if it is helpfull.
Regards
Srimanta -
Add field value to the existing internal table.
how to add a field value to the existing internal table.
DATA: BEGIN OF ITAB occurs 0,
EBELN TYPE EKPO-EBELN,
EBELP TYPE EKPO-EBELP,
AEDAT TYPE EKPO-AEDAT,
amount(10) type c,
END OF ITAB.
select * from ekpo
into corresponding fields of table itab.
itab-amount = '2400'.
loop at itab where ebeln eq 70 .
write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,itab-amount.
endloop.
here output is not showing the amount field value.
please tell me how to solve this problem urgent
thanks in advance.Hi Sekhar,
First let me know wheather you are assigning some value to the amount field externally to all records? if this is wright means check the below code.
DATA: BEGIN OF ITAB occurs 0,
EBELN TYPE EKPO-EBELN,
EBELP TYPE EKPO-EBELP,
AEDAT TYPE EKPO-AEDAT,
END OF ITAB.
select * from ekpo
into corresponding fields of table itab.
v_amount = '2400'.
loop at itab where ebeln eq 70 .
write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,v_amount.
endloop.
or if you want to modify perticular records in itab then use below code.
DATA: BEGIN OF ITAB occurs 0,
EBELN TYPE EKPO-EBELN,
EBELP TYPE EKPO-EBELP,
AEDAT TYPE EKPO-AEDAT,
amount(10) type c,
END OF ITAB.
select * from ekpo
into corresponding fields of table itab.
loop at itab.
itab-amount = '2400'.
modify itab index sy-tabix (or perticular line number).
endloop.
loop at itab where ebeln eq 70 .
write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,itab-amount.
endloop.
Thanks,
Suma.
Maybe you are looking for
-
How can I install adobe flash player on my iPod mini.
How can i install adobe flash player on my Ipad mini?
-
Can't get the columns of a SYNONYM in Oracle9i
I create a synonym named "MYPROC_NICK", which refers to a stored procedure "MYPROC". I use dbmd.getProcedureColumns(null, "WBIA", "MYPROC_NICK", "%") to get the columns, it always returns an empty resultset. Do you know how to resolve this issue.
-
Can I plug mic directly into computer to record on GB?
Hi, I'm having trouble getting audio out after recording with my Duet Apogee interface. Is it necessary to use an interface with GB or can I just go direct with the mic? Thanks in advance for any input. Happy Sunday! Kate
-
A Report for top spent with Given Sitecode and Year
Customer Code Name Spent2011 xyzaa Jon 700.00 nmcb Stuart 400.00 bncx Prakash 300.00 nmsd Srinu 200.00 opkls Kumar 90.00 Table above as retrieved data For Site 01 Rank the customers by top spent for 2011 or 2012 or 2013 or 2014 E
-
HT1338 How do I update my ipad version 4.3.2?
I have an ipad, my first Apple product ever. It says it is Model MB294LL, Version 4.3.2 (8H7). I've been trying to figure out if I can update it as so many of the apps won't work on this version. I can't seem to find the link to do this and I do not