Problem in filling the final internal table
Hi,
I am working on a code in which i have to fill up the final internal table which will store the values coming form different internal tables.Here's the code which i am trying to do but it is not giving the execat functionality.In this code ITOUTPUT is the final itab which is storing the values of all other internal tables.
Here's the code:-
loop at itab1.
select single maktx into v_item from makt where matnr = itab1-matnr.
ITOUTPUT-banfn = ITab1-banfn.
ITOUTPUT-badat = ITab1-badat.
ITOUTPUT-meins = ITab1-meins.
ITOUTPUT-menge = ITab1-menge.
ITOUTPUT-lfdat = ITab1-lfdat.
IF ITAB1-MEINS = 'KG'.
V_TOTREQ = V_TOTREQ + ITAB1-MENGE.
ELSEIF ITAB1-MEINS = 'TO'.
V_TOTREQ = V_TOTREQ + ( ITAB1-MENGE * 1000 ).
ELSEIF ITAB1-MEINS = 'G'.
V_TOTREQ = V_TOTREQ + ( ITAB1-MENGE / 1000 ).
ENDIF.
v_tpo = 0.
v_por = 0.
LOOP AT ITPO WHERE BANFN = ITAB1-BANFN AND bnfpo = ITAB1-bnfpo.
if v_por <> '0'.
write : / ' '.
endif.
ITOUTPUT-ebeln = ITPO-ebeln.
ITOUTPUT-aedat = ITPO-aedat.
ITOUTPUT-lifnr = ITPO-lifnr.
ITOUTPUT-menge = ITPO-menge.
ITOUTPUT-EINDT = ITPO-EINDT.
IF ITAB1-MEINS = 'KG'.
V_TOTPO = V_TOTPO + ITPO-MENGE.
ELSEIF ITPO-MEINS = 'TO'.
V_TOTPO = V_TOTPO + ( ITPO-MENGE * 1000 ).
ELSEIF ITPO-MEINS = 'G'.
V_TOTPO = V_TOTPO + ( ITPO-MENGE / 1000 ).
ENDIF.
v_tpo = v_tpo + itpo-menge.
v_tgr = 0.
v_por = 1.
v_grr = 0.
loop at itmrn where ebeln = itpo-ebeln and ebelp = itpo-ebelp.
if v_grr <> '0'.
write : / ' '.
endif.
select single budat from mkpf into v_grdate where MBLNR = itmrn-MBLNR.
write: 143 Itmrn-menge,v_grdate .
itoutput-PMENGE = itmrn-menge.
v_tgr = v_tgr + itmrn-menge.
v_grr = 1.
endloop.
p_po = itpo-menge - v_tgr.
write: 173 p_po.
ENDLOOP.
p_req = itab1-menge - v_tpo.
write : 195 p_req.
endloop.
loop at itoutput.
write:/ itoutput-banfn,12 itoutput-badat,24 v_item,50 itoutput-meins,53 itoutput-menge,itoutput-lfdat,
89 ITPO-ebeln,100 ITPO-aedat,111 ITPO-lifnr,(10) itpo-menge, ITPO-eindt.
MODIFY itoutput.
endloop.
Hi,
Ok,i ha d checked my code by using your logic and giving the run time error ......
i had debugged my code (orignal onementioned in above thread with little modification) in which i am able to see that finaloutput (intrenal table) is getting filled properly and the problem arises when the cursor comes to the write statement ... it is repeating some of the values when output is displayed where as before displaying output this iternal table is having the correct data. i am using the following code :-
append itoutput.
ENDLOOP.
p_req = itab1-menge - v_tpo.
write : 195 p_req.
append itoutput. ,<--- added this
clear itoutput. <--- added this
endloop.
loop at itoutput.
write:/ itoutput-banfn,12 itoutput-badat,24 v_item,50 itoutput-meins,53 itoutput-menge,itoutput-lfdat,
89 ITPO-ebeln,100 ITPO-aedat,111 ITPO-lifnr,(10) itpo-menge, ITPO-eindt.
MODIFY itoutput. <------ not removed
endloop.
Similar Messages
-
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, -
Getting the final internal table of a transaction VA05
Hi,
Can anyone help me in getting the final internal table of a transaction VA05 when called from a program. I need to use to this internal table for further processing.
Thanks in advance,
Vinay.Hi,
Not quite sure what you are after but the following may help.
For a start VA05 uses FM RV_SALES_DOCUMENT_VIEW_3 to select it's data. Your program could simply call this. However, if you are doing a CALL TRANSACTION from your program to VA05 and you want to get the results back then you could utilise some 'old style' userexits available in VA05.
Two choices here:
1. At the end of FM RV_SALES_DOCUMENT_VIEW_3 there is a form END_MODIFICATION or
2. When VA05 calls RV_SALES_DOCUMENT_VIEW_3 it performs a user sort MV75AFZ1(MV75AFZ1)
Both of these belong to package VMOD which means you can modify them by simply registering the object in OSS (these are 'old style' exits before SMOD/CMOD and are prevelant in SD)
From either of these you could EXPORT to memory for when control is returned back to your program.
Thanks,
Pete -
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, -
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. -
Problem in moving to final interanl table
Hi all,
i have one problem when moving all the fileds in final internal table
t_eina is the final internal table
i want to itab-matnr and maktx in t_eina or anyother final internal please correct the code according to htis requriment.if any one is intrested
tables: ztab2,mara,mvke,MARAV,eina.
DATA: BEGIN OF T_ztab2 OCCURS 0,
MTART LIKE ztab2-MTART,
dwerks like ztab2-dwerks,
END OF T_ztab2.
DATA: BEGIN OF T_mara OCCURS 0,
matnr like MARAV-matnr,
maktx like MARAV-maktx,
MTART LIKE ztab2-MTART,
dwerks like ztab2-dwerks,
prat1 like mvke-prat1,
lifnr like eina-lifnr,
END OF T_mara.
DATA: BEGIN OF itab OCCURS 0,
matnr like MARAV-matnr,
maktx like MARAV-maktx,
MTART LIKE ztab2-MTART,
dwerks like ztab2-dwerks,
prat1 like mvke-prat1,
lifnr like eina-lifnr,
END OF itab.
Data : begin of t_eina occurs 0,
matnr like eina-matnr,
lifnr like eina-lifnr,
Mtart like mara-mtart,
dwerk like mvke-dwerk,
maktx like marav-maktx,
end of t_eina.
*data: begin of itab occurs 0,
matnr like marav-matnr,
mtart like marav-mtart,
maktx like marav-maktx,
end of itab.
*DATA ITAB LIKE STANDARD TABLE OF MARAV WITH HEADER LINE .
select * from ztab2 into corresponding fields of table t_ztab2 .
select amatnr amaktx amtart ddwerk d~prat1 into table t_mara
from MARAV as a inner join mvke as d on amatnr eq dmatnr
for all entries in t_ztab2 where a~mtart eq t_ztab2-mtart
and d~dwerk = t_ztab2-dwerks.
select amatnr amaktx amtart ddwerk d~prat1 into table itab
from MARAV as a inner join mvke as d on amatnr eq dmatnr
where a~mtart = 'Z030'.
SORT T_MARA BY MATNR.
Select matnr LIFNR from EINA into corresponding fields of table t_EINA
for all entries in t_MARA Where matnr = t_MARA-matnr.
*select * from marav into corresponding fields of table ITAB where mtart = 'Z030'.
SORT T_EINA BY MATNR.
loop at t_EINA.
Read table t_MARA with key matnr = t_EINA-matnr.
move t_mara-mtart to t_eina-mtart.
move t_mara-matnr to t_eina-matnr.
move t_mara-dwerks to t_eina-dwerk.
move t_mara-maktx to t_eina-maktx.
modify t_eina transporting mtart matnr dwerk maktx.
endloop.
<u></u>instead of modifying just use append t_eina.
-
Final Internal Table used in MIGO Transaction
Hi Experts,
I need to know the final internal table used in the MIGO transaction. Why I want to know this is, I need all the records which are there in the table control (GODYNPRO) of the MIGO transaction. I have used the BADI BADI MB_MIGO_BADI to read the values. But since it is a table control the values are getting changed when the user scrolls down the table control. How can I get all the values shown in this table control. Is there any global internal table in the SAPLMIGO program?
BR.Hi ABAP,
Check the BADI MB_MIGO_BADI the example class CL_EXM_IM_MB_MIGO_BADI
In attributes tab variable GT_EXTDATA contains all migo positions.
Read the internal table to check items.
in this method the internal table is filled.
Therefore define your internal table in the class attributes.
I hope you help. -
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 -
Final internal table for me2j ?
Dear ABAPers,
I added extra field in MEREP_OUTTAB_ACCOUNTING structure.(Append-wrbtr)
now i need final internal table which is used to populate the me2j report?
so tell me the final internal table of me2j .
please help me!
Regards,
Praphull
Moderator Message: Duplicate Post.
Edited by: kishan P on Dec 26, 2011 3:28 PMDear Madhu,
thanks for guidence!
its showing popup tht this BADI ( ME_CHANGE_OUTTAB_CUS ) is only use for "SAP Internal use".
Regards,
Praphull -
Problem in moving the data into final internal table
Hello all,
I am stuck in apeculair situation.
I have a internal table having header record and a internal table having its line items.
Header record :: 90006103 A 20080110 ALBERTA 3456
Detail record :: 90006103 D2 2219CR1710441
90006103 D2 2219M11710443
90006103 D2 2219M21710442
90006103 A 20080115 ALBERTA 3456
90006103 D2 2219CR1710441
90006103 D2 2219M11710443
90006103 D2 2219M21710442
I collected the header record in one internal table and another internal table having all the line items.But the problem is when i am moving the values to the final inernal table i am getting the same payment date
20080110 (Date field in first record of header internal table) for all the line items .
But my requirement is that date should be 20080110 for the first 3 line items of first header record and similarly date should be 20080115 for all the line items of the next header record.
Kindly suggest.
Regards,
Arunassumption: some mistake in ur posting that, How belnr and date r same for both header records, so i guess, either one is different.
try with AT NEW - ENDAT.
AT NEW belnr.
here use looping, READing of ur itabs.---> so, u need to build couple of itabs to move forth and back.
ENDAT.
pls. note that, when u use this AT NEW all the CHAR fileds of itab wuld show as STARS **.....so, this is the necessity behind building new itabs.
thanq
Edited by: SAP ABAPer on Dec 30, 2008 6:24 PM -
Problem in move the data to final internal table.
hi,
iam having 3 internal table.
1. g_t_vbrk (having data for vbrk table)
2. g_t_vbak (having data for vbak table)
3. g_t_likp (having data for likp table.)
actually i have written the loop like below .
LOOP AT g_t_vbrk.
READ TABLE g_t_vbfa WITH KEY vbeln = g_t_vbrk-vbeln.
IF sy-subrc = 0.
MOVE : g_t_vbrk-vbeln TO g_t_output_raw_header_data-vbeln,
g_t_vbrk-taxk1 TO g_t_output_raw_header_data-taxk1,
g_t_vbrk-taxk4 TO g_t_output_raw_header_data-taxk4,
g_t_vbrk-fkart TO g_t_output_raw_header_data-fkart,
g_t_vbrk-inco1 TO g_t_output_raw_header_data-inco1,
g_t_vbrk-inco2 TO g_t_output_raw_header_data-inco2,
g_t_vbrk-zterm TO g_t_output_raw_header_data-zterm,
g_t_vbrk-kunag TO g_t_output_raw_header_data-kunag.
READ TABLE g_t_vbak WITH KEY vbeln = g_t_vbfa-vbelv.
IF sy-subrc = 0.
MOVE : g_t_vbak-vkorg TO g_t_output_raw_header_data-vkorg,
g_t_vbak-auart TO g_t_output_raw_header_data-auart,
g_t_vbak-spart TO g_t_output_raw_header_data-spart,
g_t_vbak-vtweg TO g_t_output_raw_header_data-vtweg.
ENDIF.
APPEND g_t_output_raw_header_data.
endloop.
my question is i want to move likp table lfdat field to that final internal table with same loop.
i want to write move statement with same loop.
pls help with coding wise.
thanks
santhoshHi
In the loop.
SELECT VBELN FROM VBFA
INTO V_VBELN
WHERE VBELV = G_I_VBRK-VBELN
AND VBTYP_N = 'M'
AND VBTYP_V = 'J'.
Now READ from your LIKP internal table.
READ TABLE G_I_LIKP WITH KEY VBELN = V_VBELN.
Write your MOVE statements here.
Regards
Surya. -
Moving the fields to final internal table
hi experts,
i have a single field in an internal table and i want to move it to final internal table.
i tried this code but its not working.
IF NOT it_ymmessr IS INITIAL.
LOOP AT it_ymmessr into it_final..
move it_ymmessr-srvpos to it_final-srvpos.
ENDLOOP.
ENDIF.
there is dat in the it_ymmessr.
i have five to six similar internal tables with 1 to 3 records and i have to move them to final internal table.
regards,
vinayHi,
IF NOT it_ymmessr IS INITIAL.
LOOP AT it_ymmessr into it_final..
<b>Have one more firld which is the common field for both the tables into it_ymmessr so that u can fill the record correctly.</b>
READ TABLE it_ymmessr WITH key XXXX = it_final-XXXX.
IF sy-subrc = 0.
it_final-srvpos = it_ymmessr-srvpos.
<b>MODIFY it_final.</b>
ENDIF.
CLAER it_final.
ENDLOOP.
ENDIF. -
To eliminate the duplicate entries while looping into final internal table
Hi friends,
IAam facing the follwoing problem.
Get Shipment for the Delivery number
SELECT tknum
vbeln
INTO TABLE lt_vttp
FROM vttp
FOR ALL ENTRIES IN lt_vbfa
WHERE vbeln = lt_vbfa-vbelv.
IF sy-subrc EQ 0.
SELECT vbeln kunnr
FROM likp
INTO TABLE lt_likp
FOR ALL ENTRIES IN lt_vttp
WHERE vbeln = lt_vttp-vbeln.
endif.
now iam my internal table lt_vttp i have following values
shipment delivery
1000 2000
1000 2001
in my internal table lt_likp i have the follwoing values
delivery shipto
2000 ABC
2001 ABC
now iam looping those values in a final internal table.
LOOP AT lt_likp INTO ls_likp.
CHECK sy-subrc EQ 0.
READ TABLE lt_vttp INTO ls_vttp WITH KEY vbeln = ls_likp-vbeln BINARY SEARCH.
CHECK sy-subrc EQ 0.
SELECT SINGLE * FROM vttk INTO ls_vttk
WHERE tknum = ls_vttp-tknum.
CHECK sy-subrc EQ 0.
APPEND ls_vttk TO lt_vttk.
endloop.
Now my problem is if the shipment is same and the shipto is same then need to eliminate the duplicate records.
in internal table iam getting 2records with same shipment and shipto combination.
but instead if both the shipment and shipto are same then i should elimate the duplicate entries.
and for the same shipment if i have differnt shipto then i neeed those 2 value.
can any body tell me how can i get that.
Regards
Priyanka.Hi Priyanka,
In your code you are using seelct statement inside the loop which will affect the performance.
So, declare a another internal table which contains your both shipment and shipto elements with other required fields, say the name is lt_new.
sort lt_new by shipment shipto.
delete adjacent duplicates from lt_new comparing shipment shipto.
"then use for all entries to choose values from VTTK.
Hope this helps you.
Regards,
Manoj Kumar P -
Need to move the data to final internal Table
Hi all,
TYPES: BEGIN OF TY_MARA,
MATNR TYPE MATNR, " Material Number
ZZBASE_CODE TYPE ZBASE_CODE, " Base Code
END OF TY_MARA,
BEGIN OF TY_MAKT,
MAKTX TYPE MAKTX, " Material Description
END OF TY_MAKT,
BEGIN OF TY_MARC,
WERKS TYPE WERKS_D, " Plant
END OF TY_MARC,
BEGIN OF TY_QMAT,
ART TYPE QPART, " Inspection Type
END OF TY_QMAT,
BEGIN OF TY_MAPL,
MATNR TYPE MATNR, " Material
PLNTY TYPE PLNTY, " Task List Type
END OF TY_MAPL,
BEGIN OF TY_PLKO,
VERWE TYPE PLN_VERWE, " Task list usage
END OF TY_PLKO,
BEGIN OF TY_FINAL,
MATNR TYPE MATNR, " Material Number
MAKTX TYPE MAKTX, " Material Description
ZZBASE_CODE TYPE ZBASE_CODE, " Base Code
WERKS TYPE WERKS_D, " Plant
CLASS TYPE KLASSE_D, " Class Number
ART TYPE QPART, " Inspection Type
VERWE TYPE PLN_VERWE, " Task list usage
END OF TY_FINAL.
DATA: I_MARA TYPE STANDARD TABLE OF TY_MARA ,
I_MAKT TYPE STANDARD TABLE OF TY_MAKT ,
I_MARC TYPE STANDARD TABLE OF TY_MARC ,
I_QMAT TYPE STANDARD TABLE OF TY_QMAT ,
I_MAPL TYPE STANDARD TABLE OF TY_MAPL ,
I_PLKO TYPE STANDARD TABLE OF TY_PLKO ,
I_KLAH TYPE STANDARD TABLE OF TY_KLAH ,
I_FINAL TYPE STANDARD TABLE OF TY_FINAL ,
WA_MARA TYPE TY_MARA,
WA_MAKT TYPE TY_MAKT,
WA_MARC TYPE TY_MARC,
WA_QMAT TYPE TY_QMAT,
WA_MAPL TYPE TY_MAPL,
WA_PLKO TYPE TY_PLKO,
WA_KLAH TYPE TY_KLAH,
WA_FINAL TYPE TY_FINAL.
data: v_mtart type mara-mtart,
v_matnr type mara-matnr,
v_zzbase_code type mara-zzbase_code,
v_werks type t001w-werks,
v_beskz type marc-beskz.
selection-screen skip 1.
selection-screen begin of block b1 with frame title text-001.
select-options: s_mtart for v_mtart default 'halb' to 'zraw',
s_matnr for v_matnr,
s_zzbase for v_zzbase_code,
s_werks for v_werks obligatory,
s_beskz for v_beskz.
selection-screen end of block b1.
start-of-selection.
select matnr
zzbase_code
from mara into table i_mara
where mtart in s_mtart "Material Type
and matnr in s_matnr "Material
and zzbase_code in s_zzbase."Base Code
select maktx
from makt into table i_makt for all entries in i_mara
where matnr = i_mara-matnr.
select werks
from marc into table i_marc for all entries in i_mara
where matnr = i_mara-matnr
and werks in s_werks "plant
and beskz in s_beskz."Procurement Type
select art
from qmat into table i_qmat for all entries in i_mara
where matnr = i_mara-matnr
and werks in s_werks.
select matnr
plnty from mapl into table i_mapl for all entries in i_mara
where matnr = i_mara-matnr.
select verwe
from plko into table i_plko for all entries in i_mapl
where plnty = i_mapl-plnty.
this is my logic . i need to move this to final internal table i_final. how can do it. will anybody tell me with coding.
Thanks,Hi,
Include matnr field in all your type declaration and plnty in the ty_plko, type declaration.
loop at the internal table i_mara.
read the other tables with read statement.
assign the the required fields to the work area wa_final. Append it to i_final.
start-of-selection.
select matnr zzbase_code
from mara into table i_mara
where mtart in s_mtart "Material Type and matnr in s_matnr "Material and zzbase_code in s_zzbase. "Base Code
select matnr maktx
from makt into table i_makt
for all entries in i_mara where matnr = i_mara-matnr.
select matnr werks
from marc into table i_marc
for all entries in i_mara where matnr = i_mara-matnr and werks in s_werks "plant and beskz in s_beskz."Procurement Type
select matnr art
from qmat into table i_qmat
for all entries in i_mara where matnr = i_mara-matnr and werks in s_werks.
select matnr plnty
from mapl into table i_mapl
for all entries in i_mara where matnr = i_mara-matnr.
select plnty verwe
from plko into table i_plko
for all entries in i_mapl where plnty = i_mapl-plnty.
Loop at i_mara into wa_mara.
read table i_makt into wa_makt with key matnr = wa_mara-matnr.
(do this for all the internal tables.)
read table i_plko into wa_plko with key plnty = wa_mapl-plnty.
wa_final-MATNR = wa_mara-matnr.
wa_final-MAKTX = wa_makt-maktx.
wa_final-ZZBASE_CODE = wa_mara-ZZBASE_CODE.
wa_final-WERKS = wa_marc-werks.
wa_final-ART = wa_qmat-art.
wa_final-VERWE = wa_plko-verve.
append i_final from wa_final.
endloop.
Hope this helps.
Regards,
Dhasarathy. K -
I HAVE PROBLEM IN KE24 SCREEN PROGRAM.THAT PROGRAM NAME Z RKEB0601.
HERE IN THIS PROGRAM OUTPUT I HAVE TO ADD ONE FIELDNAME ORDERABLITY WHICH IDENTIFY D STANDARD ORDER OR SAMPLE ORDER.
(WHEN SOME COMPANY GIVES US PO OR AFTER PRODUCTION I GIVE MY PRODUCT TO CUSTOMER FOR TEST,SO THIS FIELD IDENTIFY WHICH IS STDARDORDER OR SAMPLEORDER ),
MY TEAM LEADER TOLD ME FIND OUT THE ALV FUNCTION MODULE IN WHICH D FINAL INTERNAL TABLE Z TRIGGERED, AFTER DAT I CAN CUSTOMIZE DAT REPORT.
PLEAZE FRIENDS HELP ME AS SOON AS POSSIBLE.Hi,
Search the code of the program for any function module with name.
REUSE_ALV_GRID_DISPLAY or REUSE_ALV_LIST_DISPLAY.
You can see the table that is being displayed in the tables parameter of the function module call.
Regards,
Ravi
Maybe you are looking for
-
EXP-00037: Export views not compatible with database version
kindly help with this error. We have already run catexp.sql but still that is not helping, we are still getting the same error. we are exporting 8i db. Export: Release 8.1.7.0.0 - Production on Thu Feb 21 14:34:25 2008 (c) Copyright 2000 Oracle Corpo
-
Unable to see process activities in component palette
Hi I am unable to see the diagram view of BPEL(Even after successful migration from 10.1.2) I am using 10.1.3 JDev I am unable to see Process activities list in the componenet palette Can anybody help me ... Thanks -Praveen
-
Hi, Even though our SUN Netra 210 does have ALOM working fine, /dev/lom is not present on Solaris 9. I already tried to install SUNWlomr, SUNWlomu and SUNWlomm, but the problem remains. Does any know why /dev/lom is not showing up? Is it possible to
-
Framework Order without Requisition
Hi All, We wish to cater for the following scenario: All purchase orders require a requisition AND A framework order does not require a requistion By using the Functional Authorization for Buyer - this would mean that the Framework Order also require
-
Setting parameter in PreparedStatement results in different stored value
Hi, first of all: this might be an exotic case! When setting a parameter value of a PreparedStatement using Types.DECIMAL as sql-parameter-type like this: stm.setObject(x, new Long(92233720368547758l), Types.DECIMAL);the value in the database is 9223