Modify in internal table
loop at mdcw.
READ TABLE mdeqp WITH KEY zs_equnr = mdcw-zs_equnr.
z_index = sy-tabix.
mdeqp-zs_venddat = mdcw-zs_venddat.
mdeqp-zs_vbegdat = mdcw-zs_vbegdat.
mdeqp-zs_invoice = mdcw-zs_invoice .
mdeqp-zs_vbeln = mdcw-zs_vbeln.
IF sy-subrc = 0.
MODIFY mdeqp INDEX z_index.
ENDIF.
ENDLOOP.
<b>LOOP AT mdeqp.</b>
endloop.
when i'm before the loop i have in the header <b>zs_vbeln='20900000'</b>
when i enter into the loop
zs_vbeln=' '
do you have a suggestion?
hi,
Before using READ TABLE, clear the header and after reading, make a sy-subrc check.
loop at mdcw.
CLEAR : MDEQP.
READ TABLE mdeqp WITH KEY zs_equnr = mdcw-zs_equnr.
IF SY-SUBRC = 0.
z_index = sy-tabix.
mdeqp-zs_venddat = mdcw-zs_venddat.
mdeqp-zs_vbegdat = mdcw-zs_vbegdat.
mdeqp-zs_invoice = mdcw-zs_invoice .
mdeqp-zs_vbeln = mdcw-zs_vbeln.
MODIFY mdeqp INDEX z_index.
ENDIF.
ENDLOOP.
Earlier code makes modifications in records though sy-subrc <> 0 .
Dont forget to reward points if this helps you.
Regards,
Sailaja.
Similar Messages
-
Modify dynamic internal table from dynamic work area using index...
ASSIGN w_text TO <fs>.
ASSIGN w_temp TO <fs1>.
lint_tab_iw49[] = <tab>.
lint_tab_iw49_t[] = <tab>.
DELETE ADJACENT DUPLICATES FROM lint_tab_iw49 COMPARING aufnr.
LOOP AT lint_tab_iw49 INTO lws_tab_iw49.
READ TABLE lint_object_tab1 INTO lws_object_tab1
WITH KEY aufnr = lws_tab_iw49-aufnr.
IF sy-subrc EQ 0.
Collect operations in rows of an internal table.
w_idx = 1.
WHILE w_idx < 51.
w_nn = w_idx.
CONCATENATE 'lws_object_tab1-ZZOPERN' w_nn INTO w_xx.
ASSIGN (w_xx) TO <fs>.
CONCATENATE w_text <fs> INTO w_text SEPARATED BY ','.
w_idx = w_idx + 1.
ENDWHILE.
Split operations into an internal table to get operations in rows.
SPLIT w_text AT ',' INTO TABLE lint_vornr.
DELETE lint_vornr WHERE vornr = ' '.
DESCRIBE TABLE lint_vornr LINES w_lines.
Collect costs in rows of an internal table
CLEAR: w_idx, w_nn, w_xx, w_text.
w_idx = 1.
WHILE w_idx < 51.
w_nn = w_idx.
CONCATENATE 'lws_object_tab1-ZZCOST' w_nn INTO w_xx.
ASSIGN (w_xx) TO <fs>.
<fs1> = <fs>.
CONCATENATE w_text <fs1> INTO w_text SEPARATED BY ','.
w_idx = w_idx + 1.
ENDWHILE.
Split costs into an internal table to get costs in rows.
SPLIT w_text AT ',' INTO TABLE lint_escost.
DELETE lint_escost WHERE cost = ' '.
DESCRIBE TABLE lint_escost LINES w_lines_cost.
Append lines of lint_escost from 1 to w_lines to lint_escost1.
Collect currencies in rows of an internal table
CLEAR: w_idx, w_nn, w_xx, w_text.
w_idx = 1.
WHILE w_idx < 51.
w_nn = w_idx.
CONCATENATE 'lws_object_tab1-ZZCURR' w_nn INTO w_xx.
ASSIGN (w_xx) TO <fs>.
<fs1> = <fs>.
CONCATENATE w_text <fs1> INTO w_text SEPARATED BY ','.
w_idx = w_idx + 1.
ENDWHILE.
Split costs into an internal table to get costs in rows.
SPLIT w_text AT ',' INTO TABLE lint_curr.
DELETE lint_curr WHERE curr = ' '.
DESCRIBE TABLE lint_curr LINES w_lines_curr.
Append lines of lint_curr from 1 to w_lines to lint_curr1.
ENDIF.
PERFORM update_object_tab_for_iw49n.
ENDLOOP.
ENDIF.
ENDFORM. " modify_object_tab
*& Form update_object_tab_for_IW49N
text
--> p1 text
<-- p2 text
FORM update_object_tab_for_iw49n .
DATA: lws_temp TYPE string VALUE 'where aufnr = lws_tab_iw49-aufnr',
lw_index TYPE sy-index.
READ TABLE <tab> TRANSPORTING NO FIELDS WITH KEY ('AUFNR') =
lws_tab_iw49-aufnr.
IF sy-subrc EQ 0.
lw_index = sy-tabix.
LOOP AT <tab> INTO <wa1> FROM lw_index.
IF <wa1>-aufnr NE lws_tab_iw49-aufnr.
EXIT.
ELSE.
CLEAR lw_index.
lw_index = sy-tabix.
lw_index = 1.
WHILE lw_index LE w_lines.
READ TABLE lint_escost INTO lws_escost INDEX lw_index.
IF sy-subrc EQ 0.
lw_index = lw_index + 1.
<wa1>-zzcost1 = lws_escost-cost.
ENDIF.
READ TABLE lint_curr1 INTO lws_curr INDEX lw_index.
IF sy-subrc EQ 0.
<wa1>-zzcurr1 = lws_curr-curr.
ENDIF.
MODIFY <tab> FROM <wa1> "TRANSPORTING ('ZZCOST1') ('ZZCURR1')
INDEX sy-tabix.
IF sy-subrc EQ 0.
ENDIF.
lw_index = lw_index + 1.
ENDWHILE.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " update_object
Hi,
With referene to the code snippet above I want to modify <tab> from <wa1> on specific indices or with specific where condition.
Is it achievable... How?
Many thanks in advance.
Thanks & Regards,
ShreyaYou might have to split the code in to two parts to keep the formatting intact.
-
Regarding the modify of internal table
do 40 times varying lga from p0008-lga01 next p0008-lga02
varying bet from p0008-bet01 next p0008-bet02.
*data: bet01 type p decimals 2.
if lga is initial.
exit.
endif.
INDEX = SY-INDEX.
amt1 = bet .
*bet01 = 20 / 100.
bet = ( bet * 50 ) / 100 .
CONCATENATE ch INDEX INTO BETXX.
assign betxx to <F2>.
assign (betxx) to <F1>.
<F2> = bet.
<u>modify p0008 index INDEX transporting F1</u>
write:/ <F2>.
enddo.
*endif.
ENDCASE.
endform.
can sombody tell me how to modify the p0008 table at the place vr im having the bet01 bet02 and so on fields.
vn im using this modify statement im getting an error as
Unable to interpret "INDEX". Possible causes of error: IncorrectHi Madhvi,
When you are posting a thread, please make sure others do not find it difficult to understand. Please don't use abbreviations like "vr" and "vn".
If you need prompt responses, please ensure you describe your requirements in
a proper manner.
You are getting error because of using wrong syntax. the correct syntax is -
MODIFY <itab> FROM <wa> [INDEX <idx>] [TRANSPORTING <f1> <f 2> ... ].
The work area <wa> specified in the FROM addition replaces the existing line in <itab>. The work area must be convertible into the line type of the internal table.
If you use the INDEX option, the contents of the work area overwrites the contents of the line with index <idx>. If the operation is successful, SY-SUBRC is set to 0. If the internal table contains fewer lines than <idx>, no line is changed and SY-SUBRC is set to 4.
Without the INDEX addition, you can only use the above statement within a LOOP. In this case, you change the current loop line <idx> is implicitly set to SY-TABIX.
When you change lines in sorted tables, remember that you must not change the contents of key fields, and that a runtime error occurs if you try to replace the contents of a key field with another value. However, you can assign the same value.
The TRANSPORTING addition allows you to specify the fields that you want to change explicitly in a list.
Regards
Indrajit. -
Regarding the modifying an internal table
hi,
i am having an internal table,i have to modify one field and the remaining fields should remain same in the internal table while displaying the internal table.
can any body send the solution for this issue.
thanks in advancehi,
you can see the following logic regarding modify statement with in loop or without loop.
DATA : BEGIN OF itab OCCURS 0,
no(10) TYPE n,
name(10) TYPE c,
city(20) TYPE c,
END OF itab.
itab-no = 001.
itab-name = 'vijay'.
itab-city = 'dharmavaram'.
APPEND itab.
itab-no = 002.
itab-name = 'krishna'.
itab-city = 'dharmavaram'.
APPEND itab.
itab-no = 003.
itab-name = 'vijay'.
itab-city = 'dharmavaram'.
APPEND itab.
itab-name = 'ram1'.
MODIFY itab INDEX 3 TRANSPORTING name.
LOOP AT itab.
IF sy-tabix = 2.
itab-no = '0012'.
itab-name = 'krishna.v'.
MODIFY itab INDEX 2 TRANSPORTING no name.
CLEAR itab.
ENDIF.
ENDLOOP.
LOOP AT itab.
WRITE :/ itab-no,itab-name,itab-city.
ENDLOOP.
Hope this example will be usage for you.
Reward with points if it is useful.
Regards,
Vijay -
Update/modify an internal table
hello
i m writing a program in which i m adding a new field to a table type, after adding i want to select those SO no which has the date='06/08/2009', but in the o/p screen i m seeing that the beside the SO no those two date values in the date field is coming , but i can t modify my screen to only these two SO.
LOOP AT i_vbkds INTO w_vbkds.
READ TABLE postab INTO wa_postab WITH KEY vbeln = w_vbkds-zvbeln.
IF sy-subrc = 0.
i_index = sy-tabix.
postab-fkdate = w_vbkds-zdate.
postab-vbeln = w_vbkds-zvbeln.
MODIFY postab INDEX i_index TRANSPORTING fkdate.
if sy-subrc = 0.
endif.
ENDIF.
CLEAR : w_vbkds.
ENDLOOP.
ENDIF.
in this internal table vbkds only 2 datsa is shown but i can modify the same in postab(table which is uysed in display)
please help
Edited by: Rob Burbank on Nov 13, 2009 9:19 AMhi all
thnx 4 ur reply...
i have also written transporting with vbeln but i removed it coz i was facing the same error.
vbeln fkdate
234 09082009
252 06082009
211 06082009
421
now when i give the search critera for fkdate = '06/08/2009' then i wat to show
vbeln fkdate
252 06082009
211 06082009
but for me rest of the things are also following with the fkdate value as ' '(when i check those SO fkdate is nt blank)
still in the selection criteria all comes..
postab is the final table to ALV, there are other fields also in POSTAB.
please help now -
Modify Syntax on Internal table of type ANY TABLE
Hi,
I have declared one internal table which is of type ANY TABLE.
In the Loop statement, I am trying to Modify that Internal table from WA.
Then I am getting one Error message
"You cannot use explicit or implicit index operations on tables with types "HASHED TABLE" or "ANY TABLE". "C_T_DATA" has the type "ANY TABLE".
Above code I have placed in method of a corresponding Class.
Can u please advise me on this..How to modify the Intenal table .
Thanks and Regards,
K.Krishna Chaitanya.Hi Krishna,
the modify statement is obsolete.
You can always LOOP AT [itab] ASSIGNING <field-symbol>.
This makes the loop never slower, depending on the table structure faster or much faster.
If you know the table structure at run time, you can use a field-symbol of that type. If not, you can use a field-symbol TYPE any. Then you have to assign the components to field-symbol to modify them, i.e.
field-symbols:
<table_line> type any,
<matnr> type mara-matnr.
loop at itab assigning <table_line>.
assign component 'MATNR' of structure <table_line> to <matnr>.
clear <matnr>.
endloop.
This technique (available more than ten years) works incredibly fast. My estimate is that if SAP would change all the old standard programs that way and use it consequently in the new ones, the whole system would be 20 % faster because myriads of unnecessary copy operations of LOOP INTO would not happen.
Regards,
Clemens. -
Internal table is not modifying
Hi
my internal table is not modifying..
the code is like this:
SELECT matnr ebeln lifnr
FROM eord
INTO CORRESPONDING FIELDS OF
TABLE it_eord_lfa1_tab
WHERE lifnr IN s_lifnr
AND matnr IN s_matnr.
AND werks IN s_werks
IF sy-subrc EQ 0.
LOOP AT it_eord_lfa1_tab INTO wa_eord_lfa1_tab .
CLEAR l_name1.
SELECT SINGLE name1
FROM lfa1 INTO l_name1
WHERE lifnr = wa_eord_lfa1_tab-lifnr.
wa_zresult_tab1-ebeln = wa_eord_lfa1_tab-ebeln.
wa_zresult_tab1-lifnr = wa_eord_lfa1_tab-lifnr.
wa_zresult_tab1-name1 = l_name1.
MODIFY it_zresult_tab1 FROM wa_zresult_tab1
transporting ebeln lifnr name1.
it_zresult_tab1 contians already some records I would like to modify the record with tranporting values...
Please help me..LOOP AT it_eord_lfa1_tab INTO wa_eord_lfa1_tab .
CLEAR l_name1.
SELECT SINGLE name1
FROM lfa1 INTO l_name1
WHERE lifnr = wa_eord_lfa1_tab-lifnr.
if sy-subrc = 0.
<b>these 2 below values seems to be already in the internal table, again why you are transporting ?
wa_zresult_tab1-ebeln = wa_eord_lfa1_tab-ebeln.
wa_zresult_tab1-lifnr = wa_eord_lfa1_tab-lifnr.</b>
wa_zresult_tab1-name1 = l_name1.
<b>wa_eord_lfa1_tab-name1 = L_NAME1</b>
MODIFY it_zresult_tab1 FROM wa_eord_lfa1_tab
INDEX SY-TABIX
transporting ebeln lifnr name1 .
ENDLOOP.
here i am not getting why you are using another workarea to modify the internal table as you already have an work area <b>wa_eord_lfa1_tab</b>. and i think its no need to modify EBELN and LIFNR as they are already been in the table.
so the best way is if SY-SUBRC = 0 for that SELECT FROM LFA1 just pass L_NAME1 to wa_eord_lfa1_tab-name1 and MODIFY the internal table only with NAME1. others not required.
Regards
Srikanth
Message was edited by: Srikanth Kidambi -
Internal Table in VA02 Partners
Hi Experts,
Is there anyone knows what is/are the internal tables I need to modify in order to update the Partners in Item Data of the Regular Item and Free goods of a certain order number for the transaction VA02?
I tried to modify the internal table 'XVBPA' inside the exit USEREXIT_READ_DOCUMENT of Include MV45AFZZ, it only changes the Patner number (KUNNR) and but it did not change the description (NAME1).
Thanks in advance...Hi Deva,
1) Create TYPES in Types tab of Global definitions.
for example: -
TYPES: Begin of ty_mara,
matnr type mara-matnr,
mtart type mara-mtart,
End of ty_mara.
2) Go to "Global Data " Tab in Global definitions.
<u>Variable Name Type Assighnment Associated Type</u>
declare table as - IT_MARA TYPE TABLE OF TY_MARA.
Hope This will work.
Reward Points If Helpful
Regards
Avi... -
What type of internal table should I use based from my scenario...
Hello Experts,
I am currently having a dillema here because I am trying to optimize a certain
part of a report where in the internal table contains around 300,000 lines of
records. The original internal table is of type standard table. So what the original
programmer did was to delete certain records in a given condition then sort it
by fields 1 and 2 in ascending order. Now, it then loops through that internal table
but gives run time error because it exceeded the limit in our prod server which is only 10 mins.
Now what I did was to try modifying the internal table to make it of type sorted. This is to eliminate
the sort statement. I dont know if what I am doing is right. Help would be greatly appreciated and
rewarded. Thanks a lot guys and take care!Hi,
types: begin of t_itab,
field1 like pa0001-pernr,
field2 like pa0001-ename,
end of t_itab.
data: ls_itab type t_itab,
lt_itab type hashed table of t_itab with unique key field1 field2.
select pernr ename into table lt_itab from pa0001.
loop at lt_itab.
<<<<< your logic
endloop.
aRs -
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 -
Capturing check box value into internal table
Hi all,
I am displaying the output including check box through following internal table.
The checkbox is displayed before every record.
<b>LOOP AT it_qals.
WRITE:/ it_qals-t_val AS CHECKBOX,
5 it_qals-werk,
12 it_qals-prueflos,
30 it_qals-matnr,
50 it_qals-charg,
62 it_qals-lagortchrg.
hide: it_qals .
ENDLOOP.</b>
I selected some of the records through check the checkboxes. when i click the <b>PUSHBUTTON TRANSFER</b>, those selected records only should transfer. i don't know how to modify the internal table with latest checkbox values. Initially checkbox values are blank.
Is there any solution except Function Module.
i would appreciate an earlier reply.
Regards
PrabhuHello,
Create one more table and transfer your entries into new table.
I have attached my code for you.
Regards,
Naimesh
REPORT ZTEST_NP NO STANDARD PAGE HEADING.
TABLES: MARA, MAKT.
DATA: BEGIN OF IT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MAKTX LIKE MAKT-MAKTX,
SEL,
END OF IT_MARA.
DATA: IT_MARA1 LIKE IT_MARA OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
SET PF-STATUS 'ZTEST'.
PERFORM GET_DATA.
PERFORM WRITE_DATA.
TOP-OF-PAGE.
PERFORM HEADER.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'SELECT'.
PERFORM GET_DATA_SELECTED.
PERFORM WRITE_DATA_SELE.
WHEN 'SELALL'.
PERFORM SELECT_ALL.
SY-LSIND = 0.
PERFORM HEADER.
PERFORM WRITE_DATA.
WHEN 'DESEL'.
PERFORM DESELECT_ALL.
SY-LSIND = 0.
PERFORM HEADER.
PERFORM WRITE_DATA.
ENDCASE.
*& Form GET_DATA
FORM GET_DATA.
SELECT MATNR
INTO TABLE IT_MARA
FROM MARA
WHERE MATNR LIKE 'IN10020%'.
LOOP AT IT_MARA.
SELECT SINGLE MAKTX
INTO IT_MARA-MAKTX
FROM MAKT
WHERE MATNR = IT_MARA-MATNR
AND SPRAS = SY-LANGU.
MODIFY IT_MARA.
CLEAR IT_MARA.
ENDLOOP.
ENDFORM. " GET_DATA
*& Form WRITE_DATA
FORM WRITE_DATA.
ULINE /(50).
LOOP AT IT_MARA.
WRITE: / '|' NO-GAP, IT_MARA-SEL AS CHECKBOX NO-GAP,
'|' NO-GAP, (10) IT_MARA-MATNR NO-GAP,
'|' NO-GAP, (35) IT_MARA-MAKTX NO-GAP,
'|' NO-GAP.
ENDLOOP.
ULINE /(50).
ENDFORM. " WRITE_DATA
*& Form HEADER
FORM HEADER.
ULINE /(50).
WRITE: / '|' NO-GAP, (1) ' ' NO-GAP,
'|' NO-GAP, (10) 'Material' NO-GAP,
'|' NO-GAP, (35) 'Description' NO-GAP,
'|' NO-GAP.
ENDFORM. " HEADER
*& Form GET_DATA_SELECTED
FORM GET_DATA_SELECTED.
DATA: L_CNT TYPE I.
DO.
L_CNT = L_CNT + 1.
READ LINE L_CNT FIELD VALUE IT_MARA-MATNR INTO IT_MARA1-MATNR
IT_MARA-MAKTX INTO IT_MARA1-MAKTX
IT_MARA-SEL INTO IT_MARA1-SEL.
IF SY-SUBRC = 0.
IF IT_MARA1-SEL = 'X'.
APPEND IT_MARA1.
CLEAR IT_MARA1.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDFORM. " GET_DATA_SELECTED
*& Form WRITE_DATA_SELE
FORM WRITE_DATA_SELE.
PERFORM HEADER.
ULINE /(50).
LOOP AT IT_MARA1.
WRITE: / '|' NO-GAP, IT_MARA1-SEL AS CHECKBOX,
'|' NO-GAP, (10) IT_MARA1-MATNR NO-GAP,
'|' NO-GAP, (35) IT_MARA1-MAKTX NO-GAP,
'|' NO-GAP.
ENDLOOP.
ULINE /(50).
ENDFORM. " WRITE_DATA_SELE
*& Form SELECT_ALL
FORM SELECT_ALL.
LOOP AT IT_MARA.
IT_MARA-SEL = 'X'.
MODIFY IT_MARA.
CLEAR IT_MARA.
ENDLOOP.
ENDFORM. " SELECT_ALL
*& Form DESELECT_ALL
FORM DESELECT_ALL.
LOOP AT IT_MARA.
IT_MARA-SEL = ' '.
MODIFY IT_MARA.
CLEAR IT_MARA.
ENDLOOP.
ENDFORM. " DESELECT_ALL -
How receive all the changes in a displayed table using internal table in WD
The same thing can be done in ordinaty Dyn Pro as
PAI
Loop at <It>
Module get_details [ Accessing the screen structure and modify the internal table with the current index of the table control]
endloopFirst say who your draw your data in Table..
or before drawing the data create a session and than
dont use java Script you can use jsp <% %>
............ -
Hi all,
I have a requirement regarding data processing in a internal table,
internal table consists of filelds Vendor,Material and Scheduling Dates and Total Qty.
Here i need to fill the field Total Quantity, individual addition of quanties of that material for a particular vendor .
Let us consider intitially my internal table consists of data like this with these fields.
Vendor , Material , qty(individual), Total qty , Schedule dates
v1 , m1 , 10
v1 , m1 , 10
v1 , m1 , 20
v1 , m2 , 5
v1 , m2 , 10
v2 , m2 , 20
v2 , m2 , 15
v2 , m3 , 20
v2 , m3 , 10
Initiall the total qty field is empty i need to fill tht field for the last item for a particular material Like M1
for vendor v1 and total qty of m2 for vendor v1, total qty of m1 for v2, total qty of m2 for v2 and so on.
Requied output should be like this.
Vendor , Material , qty(individual) Total qty Schedule dates
v1 , m1 , 10 , 0
v1 , m1 , 10 , 0
v1 , m1 , 20 , 40(101020)
v1 , m2 , 5 , 0
v1 , m2 , 10 , 15(5+10)
v2 , m2 , 20 , 0
v2 , m2 , 15 , 35(20+15)
v2 , m3 , 20 , 0
v2 , m3 , 10 , 30(20+10)
Here i made one thing , i calculated the total qty of material for particular vendor.
Like
Vendor Material Total Qty
v1 , m1 , 40
v1 , m2 , 15
v2 , m2 , 35
v2 , m3 , 30
Finally i need the logic by using Control Events(At New , At End of ) to adjust that total qty of a material for a particular vendor by Modifying the internal table.
i hope my problem is clear , pls let me know if any clarifications needed. and
code for the same .
Thannks in advance,
Niranjan.Hi,
Solution is here.
sort itab by vendor material.
field-symbols: <itab> like line of itab.
loop at itab assigning <itab>.
on change of vendor.
clear flag.
endon.
add <itab>-quanity to lw_quantiy.
*--here pdate internal table end of each similar kind of record
at end of.
flag = 'x'.
<itab>-totalqty = lw_quantiy.
clear lw_quantiy
endat.
*--rest of record update zero by checking flag
if flag is initial.
<itab>-totalqty = 0.
endif.
endloop.
close this thread if you got solution.
Regards,
Peranandam -
Grouping records in an internal table
Dear all,
Pls follow the code and suggest me to get the specified format.
Consider that i have created a view to populate the reqd data and collect those in an internal table and do a calculation for one field and modify the internal table.
when i pass this internal table to the function reuse_alv_grid , it throws out a report. But if i need to group the records of the internal table based on three fields, can i do that , if so , how should i do that, if not what method shud i adopt to get the grouped listing in ALV.
kindly give your views.
Code goes here..........
select distinct edatu j_3akvgr6 mvgr4 matnr bismt vbeln auart bstkd bstkd_e ihrez_e
bstdk_e bstdk bezei vrvez brgew ntgew volum werks kwmeng j_3asize posnr
INTO CORRESPONDING FIELDS OF TABLE itabdelshd
from ZVDELISHED
where J_3AKVGR6 IN CUSTOMER AND AUART IN ORDTYP
AND BISMT IN STYLE AND MATNR in FGMtrl AND bstdk_e IN PLNDATE
AND J_3ASIZE IN GRIDVAL and werks in plant and mvgr4 in ppmon and
bstkd in cpono and vbeln in Sales.
LOOP AT itabdelshd INTO wadelshd.
select sum( wmeng ) as tqty into wasumqty-tqty
from vbep where edatu = wadelshd-edatu and vbeln = wadelshd-vbeln
and j_3asize = wadelshd-j_3asize.
select sum( lfimg ) as dqty into wasumqty-dqty
from lips where vbelv = wadelshd-vbeln and j_3asize = wadelshd-j_3asize
wadelshd-PLND_QTY = wasumqty-tqty - wasumqty-dqty.
wadelshd-PLND_QTY = wadelshd-wmeng - wadelshd-lfimg.
wadelshd-COLOR = wadelshd-j_3asize(4).
MODIFY itabdelshd FROM wadelshd.
ENDLOOP.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.Dear Jorge,
It is working out, But i need to do the sum for the grouped data, for instance , if the below data is grouped data seen in the alv,
sales ord | color line.Item| Ord.qty | Pld.Qty | Date "
| 0001000551 | 002V | 100 | 6,800.000 | 1,200.000 | 25.09.2006"
| 0001000551 | 002V | 100 | 6,800.000 | 2,500.000 | 25.09.2006"
| 0001000551 | 002V | 100 | 6,800.000 | 3,100.000 | 25.09.2006"
| 0001000551 | 003K | 200 | 3,200.000 | 700.000 | 25.09.2006"
| 0001000551 | 003K | 200 | 3,200.000 | 1,200.000 | 25.09.2006"
| 0001000551 | 003K | 200 | 3,200.000 | 1,300.000 | 25.09.2006"
and if want to sum the the planed qty based on the line.Item Grouping, meaning, can i get the report in the below form.
sales ord | color line.Item| Ord.qty | Pld.Qty | Date "
| 0001000551 | 002V | 100 | 6,800.000 | 6,800.000 | 25.09.2006"
| 0001000551 | 003K | 200 | 6,800.000 | 3,200.000 | 25.09.2006"
what should i do to get this form. -
Problem in processing internal table
Hi All,
Im facing some problem with an internal table with header.
This is Xvbkd with heaer line.
Header 100 0000000049 000010 EXW China
1 100 0000000049 000000 CIF HK
2 100 0000000049 000010 CIF HK
3 100 0000000049 000020 CIF HK
Now I want modify the internal table of 2nd record. The data above has modified in the header.but not reflected in the body.
Here is my code:
SELECT SINGLE inco1 inco2
INTO (knvv-inco1, knvv-inco2)
FROM knvv
WHERE kunnr EQ w_shipto
AND vkorg EQ vbak-vkorg
AND vtweg EQ vbak-vtweg
AND spart EQ vbak-spart.
IF sy-subrc EQ 0 AND
knvv-inco1 NE space or
knvv-inco2 NE space.
MOVE: knvv-inco1 TO wa_xvbkd-inco1,
knvv-inco2 TO wa_xvbkd-inco2.
READ table xvbkd with key vbeln = xvbap-vbeln
posnr = xvbap-posnr.
IF sy-subrc = 0.
xvbkd-inco1 = wa_xvbkd-inco1.
xvbkd-inco2 = wa_xvbkd-inco2.
modify table xvbkd from wa_xvbkd transporting inco1 inco2.
endif.
ENDIF.
Requirement: is the 2nd record(item 10) in above internal table has to reflect the change with EXW and China.
Pls help me with ur valuable suggestions.
Regards,
Priyatry,
SELECT SINGLE inco1 inco2
INTO (knvv-inco1, knvv-inco2)
FROM knvv
WHERE kunnr EQ w_shipto
AND vkorg EQ vbak-vkorg
AND vtweg EQ vbak-vtweg
AND spart EQ vbak-spart.
IF sy-subrc EQ 0 AND
knvv-inco1 NE space or
knvv-inco2 NE space.
MOVE: knvv-inco1 TO xvbkd-inco1,
knvv-inco2 TO xvbkd-inco2.
READ table xvbkd with key vbeln = xvbap-vbeln
posnr = xvbap-posnr.
IF sy-subrc = 0.
modify xvbkd index sy-tabix.
endif.
ENDIF.
Regards,
John
Edited by: jvanpelt on Jul 16, 2010 9:36 AM
Maybe you are looking for
-
What the heck is Accessorize Test?
Okay. something weird. Something called Accessorize Test has occured to my Ipod. out of the blue, I turned it on, and it went to Accessorize Test. I'm not sure how to fix this, I tried everything the help pages sugguest, but restarting doesn't do any
-
I purchased app 101books ...horrible and sad...links do not work, lies on description, highway robbery
-
PO Print Output Message Automatically Without Maintaing Condition Record
Hi Team, User have the Requirement When Any New Vendor Create in SAP System Automatically Printout When they Create PO Without Maintaining Condition Record throgh T-Code MN04.It Possible throgh Config Side or Need to Take help of ABAP Team. Please he
-
LIST PRICING AGREEMENTS WITH CUSTOMER
Hi all, I have this situation. My customer is in Food Industry. He has a lot of customers with a lot of condition type/record for each customer/ customer-material/customer hierarchy ... (prices, discounts, rebates ...). Every year he makes an offer t
-
How to add custom Template transaction types ( for Quote ) ?
How to add custom template in transaction types? Note : I have gone through below note. But not getting appropriate solution for this. 982142.1 (OM Sales Order Template Not Available In Layout Template LOV For Print&Preview) 444687.1 (OM Quote Templa