How do we Use Internal table in Global Memory ?
Hi All ,
Can anyone help me with how to create and use an internal table in SAP global memory ?
Regards,
Ranjita
Hi,
Try with GET PARAMETER AND SET PARAMETER
Refer the below link,
Export Import Internal tables across two z programs
Regards,
Vijay
Similar Messages
-
How to create CMPCTRL attribute of the type internal table (as global list)
Hi,
I want to create global internal table to be able to access it across all my webdynpro views.
Ideally I will create this global internal table in CMPCTRL and will add different values from diffent methods of one view and use in another view as table of values. So I am thinking to use CMPCTRL Attribute declaration to my make internal table as global internal table. How do I achieve this ? Please help
Thanks
PraveenThanks Aditya, But I am getting "comp_attr" unknown.
I am pasting here What I am doing, Please let me know ehere is the error?
CMPCTRL:
it_pod Public clicked, Type Clikced Assoc Type:Element_<node_name>.
View access
DATA lo_nd_<node_name> TYPE REF TO if_wd_context_node.
DATA lo_el_nd_<node_name> TYPE REF TO if_wd_context_element.
DATA ls_nd_<node_name> TYPE wd_this->Element_<node_name>.
data podetails TYPE TABLE OF WD_COMP_CONTROLLER->IT_POD.
Here it says IT_POD unknown. any issues?
Thanks
Praveen -
Using internal tables in BI 7 Start routines
Hi All
I tried searching for using internal tables in a start routine in BI 7 could not find the right pointers.
This is what I am trying to do is the following:
In a DSO ZSD_O01 I have a sales order and sales order item number and this DSO also contains the Contract number and the contract Item number.
The DSO structure is as follows:
/BIC/AZSD_O0100
DOC_NUMBER
ITEM
CONTRACT
CITEMNUM
I want to read the data in this DSO into a internal table. But the key fields in this DSO is DOC_NUMBER and ITEM so I want to read this data into a internal table only for the first data package into the internal table. Thereafter I want to lookup into the internal table given the doc_number and ITEM to find the CONTRACT and CITEMNUM.
Can any of you kindly show me how to :
- Read data from a DSO into a internal table
- Read the internal table for the first data package
- How do I make the access in the internal table fast when my lookup in the internal table is not on the
DSO key columns but on a different key column
Appreciate your help
Thanks
KarenHi Karen ,
It will be helpful if you tell your requirement as the approach you suggested is not looks convincing .May be their is some easy way and we can suggest you better approach
-how to check for source_package = 1
You need to hard code it .
We decide package size at DTP level so you can declare a global variable .let say you have 50000 size of your package then use global variable as counter and read only when record_count is <= 50000 .
-how to declare the internal table so the values in it exists between different data packages
Declare a global table and select data into it .A global table retain data across the packages .
- The key on which I need to lookup in the internal table is not the key fields as in the DSO
Its ok .Let say you are doing lookup on A B and C field of DSO1 and the values may duplicate in your source .then you just need to read the internal table having data from DSO2 with key field A B C .
Better if you set them as semantic keys at DTP level so that all duplicate entries of A B C will appear in same package .
global Declarations
In your start routine you will have this following code :
TYPES:
tyt_SC_1 TYPE STANDARD TABLE OF tys_SC_1
WITH NON-UNIQUE DEFAULT KEY.
$$ begin of global - insert your declaration only below this line -
... insert your code here
$$ end of global - insert your declaration only before this line -
One question
Why you want to populate values for 1 source package only not for all ?This will be helpful to understand your requirement and may be we can fulfill it in some other manner .
Regards,
Jaya Tiwari -
How to declare a internal table in start routine i.e. transformations
Hi Gurus,
How to define an internal table in a start rotuine?
any help greatly appreciated.
Best Regards,
Reddy.Hi,
types: begin of str,
field1 type c,
field2 type c,
end of str.
data : itab type table of str with header line.
the above code should be inserted where it says insert code below this. this will be like a global decleration. this table will be available for all the routines that you write in the transformation.
All the best !!
Regards
Aparna -
How to import the internal table into subroutine as parameter
how to import the internal table into subroutine as parameter, and its structure can be recognized inside the subroutine
Hi Yong,
try this:
parameters: p_tabnm like dd03l-tabname.
field-symbols: <fs_tabname> type standard table.
data: itab_ref type ref to data.
create data itab_ref type standard table of (p_tabnm)
with default key.
assign itab_ref->* to <fs_tabname>.
select * from (p_tabnm) into table <fs_tabname>.
perform subroutine tables <fs_tabname>
using p_tabnm.
*& Form subroutine
text
-->P_<FS_TABNAME> text
-->P_P_TABNM text
form subroutine tables p_tabname type standard table
using p_tabnm.
Here p_tabname already has the structure of the table you gave as input
parameter
endform. " subroutine -
How to define an internal table which have to be dynamic
Hallo,
here's a problem that i have to solve (but how ?).
I defined an internal Table with 2 columns:
col1: tablename
col2: fieldname
This table is filled with an unknown number of datasets like this:
dataset1: A001 KAPPL
dataset2: A001 KNUMH
dataset3: A903 KUNNR and so on.
I don't know which tablenames and fieldnames are contained.
Now i have to read those fields (e.g. KAPPL) from those tables (e.g. A001) into an internal table.
But i don't know how to define this internal table.
Could anyone help me please ?
Thanks a lot.
SilvioHi Wirth
DATA:
w_tabname TYPE w_tabname,
w_dref TYPE REF TO data,
table_name TYPE tadir-obj_name.
FIELD-SYMBOLS: <t_itab> TYPE ANY TABLE.
READ YOUR INTERNAL TABLE (DATA SET) AND GET THE TABLE NAME,
AND PASS IT TO W_TABNAME.
w_tabname = A001.
CREATE DATA w_dref TYPE TABLE OF (w_tabname).
ASSIGN w_dref->* TO <t_itab>.
Now use <t_itab> as your internal table to fetch data .
<t_itab> will have the structure of A001.
SELECT *
FROM (w_tabname) UP TO 10 ROWS
INTO TABLE <t_itab>.
Regards
Hareesh Menon -
Selecting records from DB table with out using internal tables
hi,
i need to retrieve values from a database table based on few fields and date as well. however, i need to check whether the date is less or equal to the current date and along with that i should get the appropriate record. how can i do that with out using internal table.
field1-----date---
11111----
20070219
11111--20070214 <---
11111----
20070205
in the above scenario i should get the second record
Regards,
Kranthi.Try:
REPORT ztest MESSAGE-ID 00.
TABLES bkpf.
SELECT * FROM bkpf
UP TO 1 ROWS
WHERE budat <= sy-datum
ORDER BY budat DESCENDING.
ENDSELECT.
Rob -
Which method to use internal table?
Should I declare a type and then internal table of that type with a field symbol
OR should I go for a work area ( using DATA ) and OR should I use STANDARD table with a header line.
Also what is better using Field Symbols or Work Area.
AmolHi amol,
you should consider a few things when deciding how to declare an internal table.
1. statement "WITH HEADER LINE" is deprecated in object oriented context and in new SAP R/3 releases. You should avoid it
2. accessing a table via work area is slower than Field-symbol ( but in some cases using a work area is a must ).
Examples:
loop at table assigning <fs>.
<fs>-field1 = 'X'.
endloop.
is more fast then
loop at table into wa.
wa-field1 = 'X'.
modify table from wa.
endloop.
It is not a good idea to use field-symbols with at statement inside a loop.
loop at table assigning <fs>.
at new field1.
... do something ...
endat.
endloop.
It changes your internal table with some dirty data (***)
3. Use sorted/hashed tables when possible
Regards, Manuel
Please remember to reward points for useful answers and to close the post if your problem is solved -
Submititng the program to another program using internal table values
Hi All,
How to Submit from one program to another program using internal table values minimum 7 int tables without using the seletion screen
thanks
rajHi All,
Thank you very much for your inputs.
i am facing another issue:
For each 10,000 records it should trigger a job (we are trying to call a program) were the validation will be done only through the other program.
please find the code mentioned below :
TABLES : but000.
DATA: int_bp LIKE but000 OCCURS 0 WITH HEADER LINE.
data released like BTCH0000-CHAR1.
DATA: jobnumber LIKE tbtcjob-jobcount, " Job ID and
jobname LIKE tbtcjob-jobname, " job name.
startdate LIKE tbtcjob-sdlstrtdt, " Start-time
starttime LIKE tbtcjob-sdlstrttm, " window specs.
laststartdate LIKE tbtcjob-laststrtdt,
laststarttime LIKE tbtcjob-laststrttm,
job_released LIKE btch0000-char1. " JOB_CLOSE: Was job released?
DATA : l1 TYPE i,
b_size TYPE i,
b_cursor TYPE cursor.
INITIALIZATION.
b_size = 5000.
START-OF-SELECTION.
OPEN CURSOR WITH HOLD b_cursor
FOR
SELECT *
FROM but000
WHERE bpkind = 'AA'.
IF sy-subrc = 0.
DO.
FETCH NEXT CURSOR b_cursor INTO TABLE int_bp
PACKAGE SIZE b_size.
Note : here in this point we are getting a dump for the second job trigger.
IF sy-subrc = 0.
CLEAR jobname.
CONCATENATE sy-repid sy-datum sy-uzeit INTO jobname.
export int_bp to memory id 'ABC'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobnumber.
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobname = jobname
jobcount = jobnumber
report = 'YTEST_RRR'.
variant = lv_variant.
SUBMIT ytest_rrr
VIA JOB jobname NUMBER jobnumber
AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
event_periodic = 'X'
jobcount = jobnumber
jobname = jobname
strtimmed = 'X'
IMPORTING
job_was_released = released
else.
EXIT.
ENDIF.
ENDDO.
calling program :
REPORT YTEST_RRR .
data itab1 like but000 occurs 0 with header line.
data l type i.
import itab1 from memory id 'ABC' .
describe table itab1 lines l.
free memory id 'ABC'.
write:/ 'total records are:', l.
Please give your suggestion why its going for dump in the second iteration.
thanks in advance. -
How to copy complete internal table into main dababase table
please tell me how to copy complete internal table into main dababase table by overwriting all the entries of the main DBtable.
HI,
you can use<b> Insert Or Modify statement ..</b>
<b>Modify updates the existing record, insert creates a new one. ...</b>
insert ZDBTAB from table itab.
Modify ZDBTAB from table Itab.
The structure of itab should be exactly the same as the z table.
You should not update standard tables directly though.
rewards if usefuyl
regards,
nazeer -
Best way to declare and use internal table
Hi all,
As per my knoledge there are various techeniques (Methods) to declare and use the internal tables.
Please Suggest me the Best way to declaring and using internal table ( WITH EXAMPLE ).
Please Give the reason as well how the particular method is good ?
What are benefits of particular method ?
Thanks in advance.
Regards
RajHello Raj Ahir,
There are so many methods to declare an internal table.
Mainly I would like to explain 2 of them mostly used.
1. Using Work Area and
2. With header line.
This with header line concept is not suggestable, because, when we shift the code to oops concept.. it doesn't work... Because OOPS doesn't support the Headerline concept...
But it all depends on the situation.
If you are sure that your program doen't make use of the OOPs concept, you can use HEADER LINE concept. If it invols OOPs use WORK AREA concept.
Now I'l explain these two methods with an example each...
1. Using Work area.
TABLES: sflight.
DATA: it_sflight TYPE TABLE OF sflight.
DATA: wa_sflight LIKE LINE OF it_sflight.
SELECT *
FROM sflight
INTO it_sflight
WHERE <condition>.
LOOP AT it_sflight INTO wa_sflight.
WRITE / wa_sflight.
ENDLOOP.
In this case we have to transfer data into work area wa_sflight.
We can't access the data from the internal table direclty without work
area.
*<===============================================
2. Using Header line.
DATA: BEGIN OF it_sflight OCCURS 0,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
END OF it_sflight.
SELECT *
FROM sflight
INTO it_sflight
WHERE <condition>.
LOOP AT it_sflight INTO wa_sflight.
WRITE / wa_sflight.
ENDLOOP.
In this case we can directly access the data from the internal table.
Here the internal table name represents the header. for each and every
interation the header line will get filled with new data. If you want to
represnent the internal table body you can use it_sflight[].
*<======================================================
TYPES: BEGIN OF st_sflight,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
END OF st_sflight.
DATA: it_sflight TYPE TABLE OF st_sflight,
wa_sflight LIKE LINE OF it_sflight.
This is using with work area.
DATA: it_sflight LIKE sflight OCCURS 0 WITH HEADER LINE.
This is using header line.
<b>REWARD THE POINTS IF IT IS HELPFUL.</b>
Regards
Sasidhar Reddy Matli.
Message was edited by: Sasidhar Reddy Matli
Sasidhar Reddy Matli -
Compare the elements data of the 2 context nodes using internal table
Hi,
How can i compare the elements data of the 2 context nodes using internal table?
Regards,
Ronitahi ronita,
just get the nodes data into internal tables and just compare them......
node1->get_static_attributes_table(importing table = ITAB_node1)
node2->get_static_attributes_table(importing table = ITAB_node2)
now u have the data of ur 2 context nodes in 2 different internal tables ..
just compare them like
if ITAB_node1[ ] = ITAB_node2[ ].
write: / 'itab1 is equal to itab2'..
endif.
and u can use as many as comparision operators between these 2 tables to compare them....
regards....
srini,,,, -
How to pass an internal table to LVC_FIELDCATALOG_MERGE
Hi Abap'ers
I want to know how to pass an internal table to the function module LVC_FIELDCATALOG_MERGE, as like we do in the FM REUSE_ALV_FIELDCATALOG_MERGE.
For Eg
v_name = 'I_OUTPUT'.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = wrk_repid
i_internal_tabname = v_name
i_inclname = wrk_repid
changing
ct_fieldcat = wrk_fld_cat
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
Where I_OUTPUT is the internal table name.Re: LVC_FIELDCATALOG_MERGE with internal table
Check this
In PBO,
Building the field catalog
PERFORM f9001_build_field_cat TABLES i_fieldcat
USING 'ZCSA_MARKETIING_EXPENSE_OUTPUT'
FORM f9001_build_field_cat TABLES p_fieldcat STRUCTURE lvc_s_fcat
USING value(p_structure).
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = p_structure
CHANGING
ct_fieldcat = p_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE i013 WITH text-e05."Error in ALV field catalogue creation
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " f9001_build_field_cat
U can create a structure or example pass MARA then it will take the structure of MARA. -
How to Read the internal table for the data download from the spool
HI all,
I have one issue regarding the spool ,we are getting the correct output as per requirement of user but when we send the same to the user in pdf format they did notget the same.
they are telling that the due date is missing from the pdf.
Please advice me how to track the internal table for the spool data converted intopdf in a readable format.
the FM used for the above task is :
call function 'CONVERT_OTFSPOOLJOB_2_PDF'
Please reply if any one worked on the same.
Thanks in advance.
Gaurav,Hi Wang,
Please let me know how you solved your question.
Points will be rewarded.
Thanks,
Arun. -
How to combine 2 internal tables ?
how to combine 2 internal tables ? which statement is used to combine int tables ?
Instead of using the normal loop-endloop approach for this kind of programming, use the variation of the append command. Care should be taken that the definition of both the internal tables should be identical.
Not Recommended
Loop at int_fligh1.
Append int_fligh1 to int_fligh2.
Endloop.
Recommended
Append lines of int_fligh1 to int_fligh2.
reward if helpful
Maybe you are looking for
-
apple id is working fine on computer but when using it to sign in for aps on iphone, it says 'incorrect id or password'
-
Screen turns black while trying to make a Video ca...
ok so i tried other websites and my webcam works fine with those. but i get on skype to make a skype call to friends or family and my screen turns back and i'm unable to do anything at that point. so i came on here to look if anyone had this problem
-
Render - Error: Out of Memory
I have been getting the following error message while trying to render - Error: Out of Memory. The system I am working on has 10 gigs of RAM and is connected to a SAN with a whole lots of storage. The error message doesn't appear until almost the end
-
iCloud will backup Photo Stream picture, but that only accounts for a fraction of the photos I have on my iPad. How can I truly backup everything on my iPad to the iCloud, including the thousands of photos I have? I am trying to completely free mysel
-
User Status Approval securities for Work Notifications
We created 3 levels of User Status Approvals for Work Notification: -Supervisor Approved -Deputy Manger Approved -Manager Approved Is there a way to have supervisors only choose "Supervisor approved", Deputy Managers only choose "Deputy Manager Appro