INTERNAL TAB
hI ALL
I WANT OT KNOW
1) IS IT POSSIBLE TO NEST INTERNAL TAB ? HOW ?
2 )SYNTEX TO CALL REPORT FROM TRANSACTION ?
3) DIIF WAYS TO PASS DATA BETWEEN LISTS ?
THANKS
hi,
1. it is possible to club to int tables, only if any commom fields are there..
ex :
consider 3 itab's
begin of itab1 occurs 0,
pernr like pa0001-pernr,
ename like pa0001-ename,
end of itab1.
begin of itab2 occurs 0,
pernr like pa0001-pernr,
icnum like pa0185-icnum,
end of itab2.
begin of itab3 occurs 0,
pernr like pa0001-pernr,
ename like pa0001-ename,
icnum like pa0185-icnum,
end of itab3.
consider u hav data on both the itab;'s....
<b>now to club :</b>
loop at itab1.
loop at itab2 where pernr = itab1-pernr.
move-corresponding itab1 to itab3.
move-corresponding itab2 to itab3.
append itab3.
endloop.
endloop.
2. once u hav crated a report prgm.
then goto <b>SE93</b>, giv a new tcode starts with Z,
then <b>CREATE</b>, it will ask for the pgnm name, giv the progm name.....
save & execute.
reply back
With Regards,
S.Barani
Message was edited by:
S BHARANIDARAN
Similar Messages
-
How do i transfer data from one internal tabe to another.
Hi All,
How do i transfer data from one internal tabe to another.
Can i do it ebven if he tables are different in structure.
Please Advice.
Thanks in advance.Hi Saket Tiwari,
I hope the earlier post by kashyap is good enough an answer. anywas in addition to it let me give a detailed
explanation of how you can populate an internal table.
1) Append data line by line.
Syntax : APPEND [<wa> TO / INITIAL LINE TO] <itab>.
this appends new line to internal table <itab>.
2) Using COLLECT statement.
COLLECT is another form of statement used for populating the internal tables. Generally COLLECT is used while inserting lines into an internal table with unique standard key. The syntax for COLLECT statement is as shown
Syntax : COLLECT [<wa> INTO] <itab>.
3) Using INSERT statement
Syntax INSERT [<wa> INTO / INITIAL LINE INTO] <itab> [index <idx>].
INSERT statement adds a line/work area to the internal table. You can specify the position at which the new line is to be added by using the INDEX clause with the INSERT statement.
Now coming to your request..
To append part or all of an internal table
Syntax
APPEND LINES OF <itab1> [FROM <n1>] [TO <n2>] TO <itab2>.
* Note:
Without the FROM and TO options, this statement appends the entire table <itab1> to <itab2>.*
b) To insert part or all of an internal table into another internal table
Syntax
INSERT LINES OF <itab1> [FROM <n1>] [TO <n2>]
INTO <itab2> [INDEX <idx>].
c) Using Move statement.
To copy entire contents of one table into another in one execution
Syntax MOVE <itab1> To <itab2>.
OR
<itab1> = <itab2>.
but u hav to be careful because he contents of itab2 will eb overwritten on the execution of this statement.
These copy the contents of ITAB1 to ITAB2. Incase of internal tables with header line we have to use [] inorder to distinguish from work area. So, to copy contents of internal tables with header line the syntax becomes,
ITAB1[] = ITAB2[].
Coming to the letter part of your question, Yes, we can copy values between tables having different structures.
for this we use
MOVE-CORRESPONDING <itab1> TO <itab2>
this executes the statement for their header lines. Searches for the sub-fields which occur both in itab1 and itab2 and then generates, for all relevant field pairs which correspond to the
sub-fields ni , statements of the form MOVE itab1-ni TO itab2-ni. The other fields remain unchanged.
I hope the information provided has been of your help.
Reward if useful.
Regards,
Jose -
URGENT:calling subscreen in IA05 - Internal tab
Hi All
I have an urgent Requirement.
I need to upload data into SAP using transaction IA05.
In IA05 first we need to enter header data then operation data.
After entering data for particular operation then we need to select "Internal" tab to enter the data. In the "Internal" screen we need to enter standard text Key only.
If we manually enter data in Internal screen then a pop up screen is appearing. In that pop up we need to select "No" so that operation short text will not be replaced with standard text.
But when i do recording i am unable to see that pop up.
I have written the program with out the sub screen .But operation short text is getting replaced with standard text.
But in the program if i pass the subscreen name in the following way i am getting an error message stating that "Invalid OK Code NO".
perform bdc_field using 'BDC_SUBSCR'
'SAPLCPDI3300OPR_DETAIL'.
perform bdc_field using 'BDC_OKCODE'
'=NO'.
If any one have uploaded data using IA05 kindly let me how to avoid overwriting of operation short text with standard text.
Points will be rewarded.
Thanks.Hi Deepthi,
I have checked the standard code and what I found from that is, you will not get that pop-up during recording or in batch input. But the answer is being taken as 'NO' in batch-input mode directly without any users interaction. You also can check it out by yourself.
The function module which is giving this pop-up is 'TEXT_FOR_OPERATION'. Check from line 321.
Anyways, I hope you will have no problem to fulfill you requirement as the answer is being taken as 'NO' which is required for your case.
Please reward, if helpful.
Regards,
Chiranjit -
Problem while uploading file from application server to internal tab in BG
Hi all,
When i see the file in application server.data is like this
#################00\);_(#####}#-#}###############################00\);_(#####}#-#}###############################00\);_(*#####}#-#}#########
###################}###}#############A#############???#00\);_(*#################;_(@_) ########???# ########???# ########???###
#######???#########}###}#############)##############}##00\);_(*#################;_(@_) ############ ############ ##############
###################}#A#}#############:##############}##00\);_(#################;_(@_) }###}##############################00\);_(*##########
#######???#########}#-#}#############F#################00\);_(#####}###}#############@#################00\);_(#################;_(@_) #####
###################}#-#}#############3#################00\);_(#####}#U#}#############E#################00\);_(#################;_(@_) #####
Because the csv which is uploaded has dropdowns and some formattings.
when download from tcode cg3y i am getting correct file
When try to use open(binary mode) and read dataset i getting data as it is (junk).
i need to process in background.
Any help.
Rhea.upload file to string format
begin of ty_tab,
string type char200,
end of ty_tab.
loop at ty_tab into string
use statement replace string into tab deliminated fromat(particular occurance in string)
now call class to break string at tab into fields
endloop.
DATA : BEGIN OF i_data OCCURS 0,
data(200) TYPE c, "To hold Upload file data
END OF i_data.
OPEN DATASET v_str FOR INPUT
IN TEXT MODE
ENCODING DEFAULT IGNORING CONVERSION ERRORS.
IF sy-subrc EQ 0.
DO.
*Read a line from input file
READ DATASET v_str INTO i_data-data.
IF sy-subrc NE 0.
EXIT.
ENDIF.
*Append record to an internal table
APPEND i_data.
CLEAR: i_data.
ENDDO.
*Close the file
CLOSE DATASET v_str.
*---Start of inserti
LOOP AT i_data.
REPLACE ALL OCCURRENCES OF '"' IN i_data WITH '#'.
SPLIT i_data AT cl_abap_char_utilities=>horizontal_tab
INTO i_doc-pvaudt
i_doc-pvpate
i_doc-vecatc
i_doc-vhvend
i_doc-vhidt8
i_doc-vhinvn
i_doc-vhhexp
i_doc-vhiref. -
Double quotes problem while uploading tablimeited text file to internal tab
H all,
I am uploading excel data using GUI_UPLOAD function module by converting excel to tab delimited text format.
Problem is Material AB" is converted to "AB" " " material in tabdelimited text format.
Can anybody give solution to problem?
Is it possible to upload excel file directly using GUI_UPLOAD function module?
I can not use 'ALSM_EXCEL_TO_INTERNAL_TABLE' and 'TEXT_CONVERT_XLS_TO_SAP'
as i want to upload upload fields of length 3000 cahrs and these function module uploads fields of only 256 chars.
Thanks.Get a excel - 97-2003.Fil the data which you want to upload .(3 columns )
A I B I C I.
save it
Code :
TABLES : thead.
Structure to store the file name, as selected from the open dialog
TYPES: BEGIN OF file ,
filename TYPE file_table-filename,
END OF file.
Output for excel
TYPES : BEGIN OF test,
a(5),
b(5),
c(5),
END OF test.
Internal table of excel
DATA : it_test TYPE TABLE OF test.
DATA : it_filename TYPE TABLE OF file,. "to store file names.
ws_filename TYPE file.
SELECTION-SCREEN
PARAMETER: p_file LIKE rlgrap-filename LOWER CASE.
At Selection Screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Parameter to store the sy-subrc value from FM file_open_dialog
DATA: rc TYPE i.
CLEAR: it_filename,
ws_filename,
p_file .
Get the file name and path from the presenatation server
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select Input File'
default_filename = '*.xls'
CHANGING
file_table = it_filename
rc = rc
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc = 0.
LOOP AT it_filename INTO ws_filename.
p_file = ws_filename.
EXIT.
ENDLOOP.
ENDIF.
DATA: l_file TYPE string.
CLEAR it_test .
l_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_file
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_test
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc NE 0.
WRITE: "Upload error".
STOP.
ENDIF. -
Call an Function Module from BSP page to import an CSV file to internal tab
Hi Experts,
I am working on creating a web application in BSP which will call the function module ALSM_EXCEL_TO_INTERNAL_TABLE.
This function module imports an excel file into an internal table.
Since this is the first time I am working on BSP I am not sure how to call this FM from event handler tab in BSP page.
What I could gather from previous posts is that we need to create an attribute which should take the value of the export parameter of the function module.But I am kind of messed up on this.
Could u guys please help ,I would be extremely grateful.Points will be assigned for sure
Thanking in anticipation
AnkitCould you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
Thanks,
Shashi. -
BDC Call Transaction - Doc.No not getting generated in Message Internal tab
Dear All,
I am using BDC Call Transaction method for uploading data for transaction, Iam able to successfully capture the Error messages, sucess messages and the transaction number is also displayed for the bdc run in Mode A, but in case of scheduling the job in background, the Error messages are displayed but the transaction number is not captured in the message Internal table( BDCMSGCOLL).
Kindly look into the matter and revert back for any further info.
Regards
NareshHi,
Please try using the following kind of code in 'CALL TRANSACTION'
opt-dismode = 'E'. " Exclusive mode
opt-defsize = 'X'.
opt-updmode = 'S'.
opt-nobinpt = ' '.
CALL TRANSACTION transaction_code USING ft OPTIONS FROM opt
MESSAGES INTO t_bdcmsgcoll .
Hope this will work.
Thanks,
Leo -
Passing the data from a internal tabe to sapscript form
Hi folks,
I have an question, how to pass an each character value of a field into the sapscript form separately,
I have an field value from an internal table in the print program say - itab-ssn = 123789345 and I need to pass each character separately into the sapscript form. How do you write the code in the sapscript text editor
I tried this piece of code did not work...
&itab-ssn(0)&,, &itab-ssn(1)&,, &itab-ssn(2)& and relaised it adds up characters as I go on...
I just need 1 2 3 7 8 ...
How to do that?
Thanks,
SKTry &itab-ssn0(1)&,, &itab-ssn1(1)&,, &itab-ssn+2(1)& and so on
Formatting option +n(a) where n is the offset and a the length
Regards,
Nick -
Mesg mapping:File-to-RFC-1 row in src mapped as 3 rows in RFC internal tab
Hi,
I am doing a message mapping for a file-to-RFC scenario.
The source structure has fields material and material desc.
The RFC has an internal table as a parameter with the following structure:
Item (0..unbounded)
Material 0..1
Level 0..1
Desc 0..1
The requirement is to split the material number into 3 different numbers acc to some logic. These 3 numbers will go as <b>Material</b> in the 3 diff rows in the target internal table with some values for <b>Level</b> and material desc will be mapped to <b>Desc</b>.
I tried to do this by using <b>Duplicate Subtree</b>. But i get the following error while saving the mapping:
Target structure has no such path: /ns0:ZRFC_ZMDM_PROD_HIERARCHY/PROD_HIERARCHY/item[1]/MATERIAL. Skipping mapping..... and so on for other fields...
Can someone suggest a solution for the same?
Thanks in advance.
Regards,
Karen PereiraHi ,
U can write Used defined function to do the same , which returns the expected result . Copy it for three times change the Logic.
Hope it helps.,
Best Regards.,
V.Rangarajan -
How to Convert internal table data into xml and xml data into internal tab
Hi Guys,
I have a requirement that i have to convert the internal table data into xml format and viceversa . for my requirement i came to know that i have to use Transformations concept. i done the converting the data from internal table into xml data by using standard Tranformations. My Question is
1) Can i use same Transformation to convert the xml data into abap internal table. if it is possible then how ???
2) Is it possible using the standard Transformation or I have to go for XSLT approach
Please help me out from this guys,
Thanks and Regards
KotiHi Koti,
This is possible. There is a link. With the help of this link you can convert ABAP data to XML and vice versa.
Link: http://www.heidoc.net/joomla/index.php?option=com_content&view=article&id=15:sapxslt&catid=22:sap-xslt&Itemid=31 -
How could I delete leading zeros in a p decimals 2 field in an internal tab
how could I delete leading zeros in a p decimals 2 field in an internal table. Could you give me an short example
Hi,
Use SHIFT
Example..
DATA: V_CHAR(10) VALUE '0000012345'.
SHIFT V_CHAR LEFT DELETING LEADING '0'.
WRITE: / V_CHAR.
Thanks,
Naren -
Even if the if condn is not satisfied, I want to move & append internal tab
Hi!
Please give me a solution to this problem.
In this, I want to move and append the contents into ist_vbap_ot even if the if condition is not met.
Please give me a simple solution as to how do I do it?
The code is as follows
Loop at ist_vbap into wa_vbap where matnr = wa_vbap-matnr.
Read table ist_vbap into wa_vbap with key matnr = wa_vbap-matnr
matkl = wa_vbap-matkl.
if wa_vbap-matkl eq 'ZCHCLUBFE'.
wa_vbap-otext = '3. Club House Fee'.
wa_vbap-otamt = wa_vbap-fakwr.
endif.
if wa_vbap-matkl eq 'ZCHELWASA'.
wa_vbap-otext = '4. External electrification, water & sanitary connections'.
wa_vbap-otamt = wa_vbap-fakwr.
endif.
if wa_vbap-matkl eq 'ZCHPROPAS'.
wa_vbap-otext = '5. Property Assessment & Khatha Transfer charges'.
wa_vbap-otamt = wa_vbap-fakwr.
endif.
if wa_vbap-matkl eq 'ZCHREGSDT'.
wa_vbap-otext = '6. Stampduty, Registration (on prevailing valuation)'.
wa_vbap-otamt = wa_vbap-fakwr.
endif.
if wa_vbap-matkl eq 'ZCHLEGFEE'.
wa_vbap-otext = '7. Legal Fee'.
wa_vbap-otamt = wa_vbap-fakwr.
endif.
if wa_vbap-matkl eq 'ZCHMAINTC'.
write: wa_vbap-fakwr to ch_value1.
write: wa_vbap-kwmeng to ch_value2.
CONCATENATE '8. Maintenance Charges (Rs.)' ch_value1 '/-per sft. x' ch_value2 into wa_vbap-otext.
wa_vbap-otamt = wa_vbap-fakwr * wa_vbap-kwmeng * 12.
endif.
if wa_vbap-matkl eq 'ZCHCORPFU'.
wa_vbap-otext = '9. Corpus Fund equivalent to one years maintenance'.
wa_vbap-otamt = wa_vbap-fakwr.
endif.
if wa_vbap-matkl eq 'ZCHPOPCHA'.
write: wa_vbap-fakwr to ch_value1.
CONCATENATE '10. Towards Park & Open space @ Rs.' ch_value1 '/-per sft.' into wa_vbap-otext.
wa_vbap-otamt = wa_vbap-fakwr * wa_vbap-kwmeng.
endif.
move wa_vbap-matnr to wa_vbap_ot-matnr.
move wa_vbap-matkl to wa_vbap_ot-matkl.
move wa_vbap-otext to wa_vbap_ot-otext.
move wa_vbap-otamt to wa_vbap_ot-otamt.
Append wa_vbap_ot to ist_vbap_ot.
sort ist_vbap_ot by otext.
endloop.Hi,
See I want to append into internal table ist_vbap_ot the contents of wa_vbap_ot especially the otext field along with the amount which will be zero even if the condition is not met.
For eg:
My ist_vbap_ot should contain
3. Club House Fee 0000.00
4. Extern elect..... 450065.00
5. Prop .................... 00.00
6. Stamd..................... 68752.00
10. ............................ 12563.00 -
Hi all,
i have a query, i have a internal table in which i have wage types like bleow
1000 5000
1001 0
1002 500
1003 0
1010 2000
1011 0
1012 50
1013 0
1020 500
1021 0
1022 50
1023 0
but i dont want the data like this. i want the addition of similar group of wage types
like below.
1000 5500
1010 2050
1020 550
how can i get this?
thanx...Hi,
I would suggest using the COLLECT Statement.
Basic form
COLLECT [wa INTO] itab.
Addition
... SORTED BY f
Effect
COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .
If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.
If, besides its default key fields, the internal table contains number fields (see also ABAP/4 number types ), the contents of these number fields are added together if the internal table already contains an entry with the same key fields.
If the default key of an internal table processed with COLLECT is blank, all the values are added up in the first table line.
If you specify wa INTO , the entry to be processed is taken from the explicitly specified work area wa . If not, it comes from the header line of the internal table itab .
Example:
Compressed sales figures for each company
DATA: BEGIN OF COMPANIES OCCURS 10,
NAME(20),
SALES TYPE I,
END OF COMPANIES.
COMPANIES-NAME = 'Duck'. COMPANIES-SALES = 10.
COLLECT COMPANIES.
COMPANIES-NAME = 'Tiger'. COMPANIES-SALES = 20.
COLLECT COMPANIES.
COMPANIES-NAME = 'Duck'. COMPANIES-SALES = 30.
COLLECT COMPANIES.
The table COMPANIES now has the following appearance:
NAME SALES
Duck 40
Tiger 20
Regards,
Jayanth G -
Passin one internal tab to another
Hi all,
According to the problem i need to pass
<b>i_mard to t_mard</b>
But it showing error conversion is not possible
what I have to do ,so that FM on EXECL will work.
report y_test.
data: begin of i_mard occurs 0,
matnr like mard-matnr,
labst like <b>mard-labst</b> ,
end of i_mard.
data: begin of t_mard occurs 0,
matnr like mard-matnr,
labst(17) <b>type c</b> ,
end of t_mard.
data : begin of it_fnames occurs 0,
reptext like dfies-reptext,
end of it_fnames.
select matnr LABST from mard into table i_mard.
t_mard = i_mard.
it_fnames-reptext = 'MATERIAL'.
Append it_fnames.
it_fnames-reptext = 'Valued Stock'.
Append it_fnames.
CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
EXPORTING
FILE_NAME = 'C:\T001'
DATA_SHEET_NAME = 'Companies'
TABLES
DATA_TAB = t_MARD
FIELDNAMES = it_fnames
EXCEPTIONS
FILE_NOT_EXIST = 1
FILENAME_EXPECTED = 2
COMMUNICATION_ERROR = 3
OLE_OBJECT_METHOD_ERROR = 4
OLE_OBJECT_PROPERTY_ERROR = 5
INVALID_FILENAME = 6
INVALID_PIVOT_FIELDS = 7
DOWNLOAD_PROBLEM = 8
OTHERS = 9hi Satya,
Is both of your Itab contain <b>Same Structure</b> ?
Use,
I_mard[] = t_mard[] .
If the structures are not same, just loop the itab and insert the wa accordingly.
Rgds,
Jothi.P -
Get the Number of rows or set the number of rows dynamically (internal tab)
Hi,
question pls see subject ?
Regards
sasHi,
Use the method describe_by_data of the class cl_abap_structdescr. this will give you a refernce of the class type descriptor class and you need to down cast it to a more specifc class of cl_abap_structdescr.
Once you get the correct reference, you can use the components attribute and you will get a list of all the fields of that table.
DATA: BEGIN OF line OCCURS 0,
col1 TYPE i,
col2(10) TYPE c,
col3 TYPE i,
END OF line.
FIELD-SYMBOLS : <itab_line> TYPE ANY.
DATA : BEGIN OF t_comp OCCURS 0,
comp(5) TYPE c,
END OF t_comp.
DATA : l_struc TYPE REF TO cl_abap_structdescr.
DATA : l_typedesc TYPE REF TO cl_abap_typedescr.
DATA : lt_comp TYPE abap_compdescr_tab,
w_comp LIKE LINE OF lt_comp.
line-col1 = 11.line-col2 = 'SAP'.line-col3 = 33.
APPEND line.
line-col1 = 44.line-col2 = 'P.I.'.line-col3 = 66.
APPEND line.
ASSIGN line TO <itab_line>. " Refer of the table is passed to the field symbol
*Call the static method of the structure descriptor describe_by_data
CALL METHOD cl_abap_structdescr=>describe_by_data
EXPORTING
p_data = <itab_line>
RECEIVING
p_descr_ref = l_typedesc.
*The method returns a reference of a type descriptor class therefore
*we need to Cast the type descriptor to a more specific class i.e
*Structure Descriptor.
l_struc ?= l_typedesc.
*Use the Attribute COMPONENTS of the structure Descriptor class to get
*the field names of the structure
lt_comp = l_struc->components.
data l_components.
describe table lt_comp lines l_compoents. " count the components
Write : 'Table has ', l_component, ' fields.'.
Hope this helps.
regards,
Advait
Maybe you are looking for
-
Can links from InDesign or InCopy Articles use non-file: URLs?
I am trying to determine if InDesign CS6 or newer provides any way for links to be to URLs that are not file: URLs. For example, I am using a CMS that provides HTTP access to images. I would like to do something like: <Link Self="uf
-
Problem in licence manager service
Hello, Even though the licence manager service is set as automatic is services, it stops suddenly and this happens many times. Each time, the service should be restarted manually. I need your help please. Thank you.
-
Yipee, Project completed Now need to remove all project off my Mac and save
I have completed a 1:17:00 minute project. I now want to remover everything off my Mac and save the project either on Disc or Lacie or ?. Is there a way to save everything, capture scratch, footage, etc to disc or a hard drive? I also need to know wh
-
We upgraded our modem forcing me to put our AirPort Extreme in to bridge mode. Ever since this occurred I have been receiving great connection with my iPad, iPods, iPhones, apple tvs and Mac but our work pcs have not been ale to connect wirelessly. P
-
How to get last login date of the user
Hi, I have an application where i need the last login date of the user and if the differance between the last login date and the system date is greater than a certain range the user account should be locked automatically.Please suggest me how resolve