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,
Arun
assumption: 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
Similar Messages
-
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 data from multiple internal tables into a single one
Hello everyone,
I am creating a classical report which uses the following tables.
tables : ekko, ekpo, mara, makt,lfa1.
my input parameter is
Select-options Purchase Order number
Following fields are getting used.
Doc no EKKO-EBELN
Material EKPO-MATNR
Item number EKPO-EBELP
Quantity EKPO-MENGE
Material Group MARA-MATKL
Vendor EKKO-LIFNR
Old Material code MARA-BISMT
Material Desc. MAKT-MAKTX
Vendor name LFA1-NAME1
Now i need to do the following task.
1 Select record from EKKO Using document number.
2 Select record from EKPO using EKKO record using Document no as key.
3 Find out Old Material code of each and every material from Material master.
4 Find out Material description for each and every material from MAKT.
5 Sort record on Vendor, Purchase Order number and Material.
I have defined seperate internal tables for these operation.
Once i have fetched records into these individual internal tables from the corresponding DB tables i need to move these values into a new internal tables which has all the above fields mentioned
I need to move these values into a new internal table because to display the values on the report.
Any idea for the above ? Plz help with a sample example or some relevant.
Regards,
Ranjith NambiarHi
1 Select record from EKKO Using document number.
2 Select record from EKPO using EKKO record using Document no as key.
Use inner join and retrive data into one internal table.for Ex ITAB1
3 Find out Old Material code of each and every material from Material master.
Use ITAB1 with for allentries in MARA table to get the onl materil number populate in to one table.
4 Find out Material description for each and every material from MAKT.
Get the Material desc with the same manner as above,
5 Sort record on Vendor, Purchase Order number and Material.
now sort the ITAB1 as you req.
now Loop on the ITAB1.
and read above 2 tables for old matnr and matner deac and append into another table as you want.
Hope this will help.
Regards,
Hiren Patel -
How to read a table and transfer the data into an internal table?
Hello,
I try to read all the data from a table (all attribute values from a node) and to write these data into an internal table. Any idea how to do this?
Thanks for any help.Hi,
Check this code.
Here i creates context one node i.e flights and attributes are from SFLIGHT table.
DATA: lo_nd_flights TYPE REF TO if_wd_context_node,
lo_el_flights TYPE REF TO if_wd_context_element,
ls_flights TYPE if_main=>element_flights,
it_flights type if_main=>elements_flights.
navigate from <CONTEXT> to <FLIGHTS> via lead selection
lo_nd_flights = wd_context->get_child_node( 'FLIGHTS' ).
CALL METHOD LO_ND_FLIGHTS->GET_STATIC_ATTRIBUTES_TABLE
IMPORTING
TABLE = it_flights.
now the table data will be in internal table it_flights. -
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 -
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. -
Moving the data of five internal tables to one internal tables.
iam having the five internal table. like below
g_t_vbfa
g_t_vbrk
g_t_vbpa
g_t_kna1
g_t_vbak
this are the five internal tables. each tables having the datas . but each table having the number of records is different. one table having 100 records means another table having 50 records.
previously i used index sys-tabix concept it was not working properly...
my output table is g_t_output_header_data ..
i want to move that output table....
please coding wise give some solution...
thanks
santhoshhi,
chk a sample.
data : begin of itab1 occurs 0. "itab with work area.
key_field1 like ztable1-key_field1,
field1 like ztable1-field1,
field2 like ztable1-field2,
endof itab1.
data : begin of itab2 occurs 0. "itab with work area.
key_field2 like ztable2-key_field2,
field3 like ztable2-field3,
field4 like ztable2-field4,
endof itab2.
data : begin of itab_final occurs 0.
key_field1 like ztable1-key_field1,
field1 like ztable1-field1,
field2 like ztable1-field2,
field3 like ztable2-field3,
field4 like ztable2-field4,
endof itab_final.
put the date final(merged) internal table
1. loop at itab1.
read table itab2 with key keyfield2 = itab1-keyfield1.
if sy-surc = 0.
itab_final-key_field1 = itab1-keyfield1
itab_final-field1 = itab1-field1.
itab_final-field2 = itab1-keyfield2.
itab_final-field3 = itab2-field2.
itab_final-field4 = itab2-keyfield2.
append itab_final.
clear itab_final.
endif.
endloop.
or
LOOP AT ITAB1.
MOVE-CORRESPONDING TO ITAB1 to ITAB_FINAL.
READ TABLE ITAB2 WITH KEY FILED1 = ITAB1-FIELD1.
if sy-subrc = 0.
MOVE-CORRESPONDING TO ITAB2 to ITAB_FINAL.
endif,
READ TABLE ITAB3 WITH KEY FILED1 = ITAB1-FIELD1.
if sy-subrc = 0.
MOVE-CORRESPONDING TO ITAB2 to ITAB_FINAL.
endif,
append itab_final.
clear itab_final.
endloop
rgds
Anver -
To add the multiline data into an internal table from TextEdit
Hello Experts,
I have one requirement that I have to use the TextEdit field. and put the values into an internal table.
can you help me. with some sample code.
Thanks in Advance
KuldeepThe problem is solved by using the following code
DATA: data TYPE REF TO CL_HTMLB_TEXTEDIT.
Data itab1 type itab.
data ?= CL_HTMLB_MANAGER=>GET_DATA(
request = runtime->server->request
name = 'textEdit'
id = 'txt1'
data text type string.
IF data IS NOT INITIAL.
text = data->text.
ENDIF.
SPLIT text AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO
TABLE itab1.
Kuldeep -
Select data into deep internal table
Dear Experts.
I created a dynamiv deep internal table.
while selecting data , into the internal table it is giving a dump. saying that deep structure.
SELECT OBJTY OBJID ARBPL WERKS from crhd
INTO CORRESPONDING FIELDS OF TABLE <f_tab>
where WERKS = pr_werks.
I used the field catalog also.even same error is comming.
how to get data into deep internal table by select statement.
Please help me,
Regards,
RahulHI,
Try creating dynamic internal table like:
Field-symbols: <dyn_table> type standard table,
<dyn_wa> ,
<dyn_field>.
Data: dy_table type ref to data,
ifc type lvc_t_fcat ,
xfc type lvc_s_fcat ,
Count type i ,
Count1 type i ,
Index type i ,
dy_line type ref to data.
Data counter type i.
Data: line type string ,
List like table of line.
Data: idetails type abap_compdescr_tab,
xdetails type abap_compdescr .
Data: ref_table_des type ref to cl_abap_structdescr.
*Looping at field cat internal table to populate another field cat to be passed
* In method used below for creating final dynamic internal table
Loop at fieldcat into fieldcat1.
Clear xfc.
Xfc-fieldname = fieldcat1-fieldname.
Xfc-datatype = fieldcat1-datatype.
Xfc-intlen = fieldcat1-intlen.
Append xfc to ifc.
endloop.
Clear fieldcat1.
*Method called to create dynamic internal table on the basis of field catalog created above
Call method cl_alv_table_create=>create_dynamic_table
Exporting
it_fieldcatalog = ifc u201Cfield catalog appended above
Importing
ep_table = dy_table. u201CDynamic internal table which will be created
Assign dy_table->* to <dyn_table>.
*Create dynamic work area and assign to FS
Create data dy_line like line of <dyn_table>.
Assign dy_line->* to <dyn_wa>.
Then use this dynamic internal table created from above method
in the Select Query.
Hope it helps
Regards
Mansi -
Can we get the data from two internal tables in ALV.
hi friends i would like to display the data using two internal tables using alv grid.please guide me.
Hi,
ALV would be having a specific layout say :
MATNR
MAKTX
QTY
Now, if you have two internal tables, then do they have a different structure. If they have different structures, then what kind of ALV layout you expect. The ALV output should be as per the structure of 1st or 2nd internal table.
If both internal table have same layout, then populate the data from 2nd internal table into 1st internal table and pass the 1st internal table ( it will have data of both internal tables) to ALV.
Best regards,
Prashant -
Header data and item data into same internal table
Hi Experts,
I WANT TO KNOW THE LOGIC TO POPULATE HEADER DATA AND ITEM DATA INTO SAME INTERNAL TABLE AND AGAIN DOWNLOAD THE SAME TO EXCEL FILE .Output file should be displayed like this format
Header1 rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
Item1 : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Item2 : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Header2: rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
Item1 : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
Thanks
Moderator message: Please do not use all upper case in the future.
Edited by: Thomas Zloch on May 12, 2010 3:10 PMHi,
for example we have 3 internal tables
1> it_header 2>it_items 3>it_final (which contains all the header and item fields)
once it_header it_items are filled
loop at it_items.
read table it_header with key xyz = it_item-xyz.
if sy-subrc = 0.
here move all the header fields to it_final like below.
it_final -xfield = it_header-xfield.
endif.
here move all the item fields to it_final like below.
it_final -yfield = it_item-yfield.
append it_final.
clear it_final.
endloop.
now header and item fileds will be fillled in it_item -
How can i add two table data into third internal table see below
hi i insert diffferent table data into different internal table i did try to insert two different internal table data into third internal table by using move
but only single data is coming please help me
i want this two internal table data inot third internal table.
sELECT * FROM J_1IEXCHDR INTO CORRESPONDING FIELDS OF ITAB1 WHERE STATUS = 'P'.
SELECT * FROM J_1IEXCDTL INTO CORRESPONDING FIELDS OF ITAB2 WHERE LIFNR = J_1IEXCHDR-LIFNR.
AND DOCYR = J_1IEXCHDR-DOCYR,
AND DOCNO = J_1IEXCHDR-DOCNO.
WRITE: / ITAB1-LIFNR,
ITAB1-DOCNO,
ITAB1-EXYEAR,
ITAB1-BUDAT,
ITAB2-EXBED,
ITAB2-RDOC,
ITAB2-ECS.
ENDSELECT.
ENDSELECT.
thank you .hi
Two add two internal tables data. first we need to create third internal table with all the fields of first two internal tables.
later u move the two internal tables data to third internal table
by looping the internal table which have more records or depending on the requirement and move the corresponding fields of first internal table to the third internal table and use the read statement with condition based on primary key of first itab and get the corresponding data of 2table into 3table.
i am sending the sample code to u.
check it out. i think u will understand how to move.
select vbeln waerk netwr erdat audat kunnr
into table it_vbeln
from vbak
where vbeln in s_vbeln
and erdat in s_erdat.
if not it_vbeln[] is initial.
select kunnr name1
into table it_kunnr
from kna1
for all entries in it_vbeln
where kunnr = it_vbeln-kunnr.
endif.
loop at it_vbeln.
clear it_final.
it_final-vbeln = it_vbeln-vbeln.
it_final-waerk = it_vbeln-waerk.
it_final-netwr = it_vbeln-netwr.
it_final-erdat = it_vbeln-erdat.
it_final-audat = it_vbeln-audat.
read table it_kunnr with key kunnr = it_vbeln-kunnr.
it_final-name1 = it_kunnr-name1.
append it_final.
endloop. -
How to send multiple row data into an internal table??
I have a view with table control.i want to select multiple row and send all the row data into an internal table.i am able to select multiple row but all the selected row data is not going to the internal table.....only a particular row data which is lead selected is going.
Do anyone can help me regarding this issue?
Thanks in advance,
Subhasis.Hey,
Some code example:
declaring an internal table and work area to get all the elements from the node.
data : lt_Elements type WDR_CONTEXT_ELEMENT_SET,
ls_Element type WDR_CONTEXT_ELEMENT_SET,
considering flights is my node.
lt_data type sflight.
Node_Flights is the ref of the node to which ur table is binded.
Use Code Inspector to read the node.
lt_Element = Node_Flights->GET_ELEMENTS
loop at lt_elements into ls_Element.
l_bollean = ls_elements->is_selected ( returns abap true/false ).
if l_bollean IS INITIAL.
append ls_Element to lt_data.
endif.
Hope this would help.
Cheers,
Ashish -
Sending data from final internal table to application server in xml format
hi to all ,
can anyone send details about send data from final internal table to application server in xml format.right now i am able to download data to presentation server in xml format . love to here soon from all the abap gigs.welcome to SDN.
are you using call transformation to convert itab to XML? the XML string is in which format?
convert it to xstring and then use the following code to store it in application server.
OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
TRANSFER XML_content TO FNAME.
CLOSE DATASET FNAME.
where fname is the path to the file name.
Regards
Raja -
Can anyone confirm the date used for pushing the data into AR interface table? Is it abse don Actual ship date or scheduled ship date? We are facing a scenario where trx date is lower than the actual ship to which logically sounds incorrect.
Appreciate any quick response around this.Hi,
Transaction date will be your autoinvoice master program submission level date (If you haven't setup any logic.
Please check the program level default date, if user enter old date ststem will pick the same.
Customer is trying to set the value of the profile OM:Set receivables transaction date as current date for non-shippable lines at the responsiblity level. System does not set the transaction date to current date in ra_interface_lines_all.
CAUSE
Customer has used the functionality in R11i. But after the upgrade to R12, the system functions differently than R11i.
SOLUTION
1.Ensure that there are no scheduled workflow background process run.
2.Set the profile "OM: Set Receivables Transaction Date as Current Date for Non-Shippable Lines" at Responsibility level only as Yes.
3.Now switch the responsibility to which the profile is set.
4.Create order for Non-Shippable Lines and progress it to invoicing.
5.Ensure that the 'workflow background process' concurrent program is run in the same responsibility and this line is considered in it.
6.Now check if the 'SHIP_DATE_ACTUAL' is populated to ra_interface_lines_all
Maybe you are looking for
-
Using the Day view in Calendar, how do I turn off the list of events?
In Snow Leopard, the events were shown by the hour, as they are now in Lion on the far right (when in Day view). However, also in Day is a repeat of all the same events, but in word-list order. That appears in the middle of the interface if you are s
-
Changed number online now phone wont work what do i do?
my husband went on line and changed to a local number - now the phone wont work... i dont know whats wrong but hes stuck in flordia working third shift and im in sc and the account holder. everytim i call it it goes straight to voicemail and he has m
-
One Item Shopping cart check out
I only have one item to sell and don't want to use an whole cart system. Are there tags I can use to create a cart process at the bottom of my page? I'll be using Verisign for the processing.
-
Does the latest version of Pages show fonts on their own font?
Does the newest version of Pages show the fonts in the font that they are? I have been using the Pages 08 and it shows the fonts all in one font so you have to click on each one to see what it looks like. If the latest Pages shows them in the font th
-
Dear All, Oracle EBS 11.5.9 OS: Windows 2003 We are using some Arabic fonts in our customize report. The Arabic script is comming perfectly in request output. But while taking print by selecting printer from oracle print option, printer is printing J