Fill a table with a genil object
Hello,
I will fill a custom table with the class CL_CRM_GENIL_GEN_TABLE_OBJ. Could anyone explain me how to fill a table with this class?
Thank and regards,
Harris
Hello,
Thank you very much so far.
I followed the instructions in the above link.
I'm a little bit confused how to fill the table with values. The class CL_CRM_GENIL_GEN_OBJ offers me the method "Save". I can imagine, to use this method to fill my table with values.
Could anyone describe how to proceed if I want to fill my table.
Thank you very much so far.
Best regards,
Harris
Similar Messages
-
Fill internal table with mutliple entries for nested structure
Dear ABAP Experts,
I have a question related to fill internal tables with nested structures.
I have a structure like this:
BEGIN OF proto,
sicht TYPE ysicht,
version TYPE FAGLFLEXA-RVERS,
BEGIN OF kons,
kon TYPE YKONSEINHEIT,
END OF kons,
jahr TYPE CHAR04,
END OF proto.
Now I need to fill this structure with values (over an internal table), but how can I achieve that I save multiple datas für element "kon" für one single entry of structure "proto"?
An example could be:
sicht = '01'
version = '100'
kon = 1001 (first entry)
kon = 1002 (second entry)
usw... (n entry)
jahr = '2008'
Thanks in advance for every helpful answer.
Regards
ThomasBEGIN OF proto,
sicht TYPE ysicht,
version TYPE FAGLFLEXA-RVERS,
kons TYPE STANDARD TABLE OF YKONSEINHEIT WITH NON-UNIQUE KEY TABLE_LINE,
jahr TYPE CHAR04,
END OF proto.
DATA: ls_proto TYPE proto,
lt_proto TYPE STANDARD TABLE OF proto,
ls_kon
ls_proto-sicht = '01'.
ls_proto-version = '100'
INSERT '1001' INTO TABLE ls_proto-kons.
INSERT '1002' INTO TABLE ls_proto-kons.
ls_proto-jahr = '2008'.
INSERT ls_proto INTO TABLE lt_proto
If you're going to use a more complicated inner table with several components, then you need to define a type for those components.
matt -
Fill JCO.Table with Model from TableView
Hi all,
i need to fill a JCO.Table to save some data in a BAPI. I already have the data in form of a DefaulTableViewModel.
Is there a simple way to fill the table with this data, or do I have to loop through the model and fill the table row by row?
Kind regards
FranciscoHi Francisco,
there is no method which does it for you. I'm not that experienced in this field, but I think it seems hard to create the correct metadata from a HTMLB TableViewModel (for example the data field internal length as well as field types).
Also have a look here: JCO.table creation...
As you may have realized, the other way round - having a JCO.Table, creating a TableViewModel - works via HTMLB JCOTableViewModel.
Hope it helps
Detlev -
...but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address. Please help.
Thanks!That is a quirk of Pagesthat it applies only one record per page.
There is a way around this:
http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=245&highlight=labels &mforum=iworktipsntrick
Peter -
How to fill internal table with selection screen field.
Hi all,
i am new to sap . pls tell me how to fill internal table with selection screen field.Hi,
Please see the example below:-
I have used both select-options and parameter on the selection-screen.
Understand the same.
* type declaration
TYPES: BEGIN OF t_matnr,
matnr TYPE matnr,
END OF t_matnr,
BEGIN OF t_vbeln,
vbeln TYPE vbeln,
END OF t_vbeln.
* internal table declaration
DATA : it_mara TYPE STANDARD TABLE OF t_matnr,
it_vbeln TYPE STANDARD TABLE OF t_vbeln.
* workarea declaration
DATA : wa_mara TYPE t_matnr,
wa_vbeln TYPE t_vbeln.
* selection-screen field
SELECTION-SCREEN: BEGIN OF BLOCK b1.
PARAMETERS : p_matnr TYPE matnr.
SELECT-OPTIONS : s_vbeln FOR wa_vbeln-vbeln.
SELECTION-SCREEN: END OF BLOCK b1.
START-OF-SELECTION.
* I am adding parameter value to my internal table
wa_mara-matnr = p_matnr.
APPEND wa_mara TO it_mara.
* I am adding select-options value to an internal table
LOOP AT s_vbeln.
wa_vbeln-vbeln = s_vbeln-low.
APPEND wa_vbeln TO it_vbeln.
ENDLOOP.
Regards,
Ankur Parab -
How to fill internal table with no data in debugging mode
Hi all,
I modified one existing program.Now I want to test it.I am not given test data.So in the middle of my debugging, I found that one internal table with no data.My problem is how to fill that internal table with few records in that debugging mode just as we change contents in debugging mode.If I want to proceed further means that internal table must have some records.
Please I dont know how to create test data so I am trying to create values temporarily in debugging mode only.
Thanks,
BalajiHi,
In the debugging do the following..
Click the Table button..
Double click on the internal table name..
Then in the bottom of the screen you will get the buttons like CHANGE, INSERT, APPEND, DELETE..
Use the APPEND button to insert records to the internal table..
Thanks,
Naren -
In sm30, when save, how to fill the table with the system data in the table
Hi all, in SM30, we have user name and time fields, when we create record, after we click the SAVE button, it will automatically fill the fields with the system data, how can we realize it?
Hi ,
Do like this.
1. Go to SE11 -> give your table name and press on change button .
2.Go to Menu->Utilities-> Table Maintainance Generator , then it will take you another screen .
3.Assign Functin group if already have one , other wise create function group and assign
4.Go to Menu->Environment->Modification->Events , again it will take you to another screen
5.Click on new entries
->Now press F4 in T column . Select<u> "01" - Before saving the data in the database</u> and in form routinue give any name of the routinue like "SAVE_USER_DATA" and press enter then u can see an editor symbol in next column click on that it will take you ABAP editor there type this code .
ztable-username = sy-uname.
ztable-createtime = sy-uziet.
check and activate the code .
With this your job will be complete . Now while entering data just leave columns blank , they will insert corresponding username and time
Don't forget award points if it helps you.
Regards,
Raghav -
Filling dynamic table with dynamic structure en fields!
Hello All,
I have written the following code. Which is okay according the syntax check. But when I run the abap code it will give a syntax error. I want to insert data from database table into internal table. Because the tables that have to read are so many I decided to make a dynamic statement which can be used for all tables. Except it won't work as I wish.
(LT_FIELDS) content is the dynamic fields which are defined earlier in the code and will change each loop.
(TAB_X) content is the dynamic internal table which is defined earlier in the code and will change each loop.
= structure of PA0002.
(TAB_N) = T_PA0002.
The code:
SELECT (LT_FIELDS) FROM (TAB_X) INTO CORRESPONDING FIELDS OF .
ENDSELECT.
Can someone give me some advice how to solve this issue?
During the run at the line "INSERT (TAB_N) FROM . " SAP creates an error like below.
K. tekst
Ein in einem SQL-Befehl genannter Tabellenname ist unbekannt.
Wat is er gebeurd?
Error in ABAP application program.
The current ABAP program "ZPF_R_MUTATIEOVERZICHT_MAIA" had to be terminated
because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Foutenanalyse
Es ist eine Ausnahme aufgetreten, die weiter unten näher erläutert wird.
Die Ausnahme, der die Klasse 'CX_SY_DYNAMIC_OSQL_SEMANTICS' zugeordnet ist,
wurde nicht abgefangen und führte deshalb zu einem Laufzeitfehler.
Der Grund für die Ausnahme ist:
In einem SELECT-, UPDATE- oder DELETE-Befehl wurde ein ungültiger
Tabellenname "T_PA0002" angegeben.
Aus einem der folgenden Gründe tritt der Fehler erst zur Laufzeit auf:
- der Tabellenname wurde dynamisch angegeben, oder
- die SELECT-Klausel, WHERE-Klausel, GROUP-BY-Klausel, HAVING-Klausel
oder ORDER-BY-Klausel wurde dynamisch angegeben.I Just want to insert data into internal table T_PA0002 from database table PA0002.
The internal table and database table can change during the runtime of the program. But Its always filling the internal table with data from database table.
I made it this way because the data I need to extract from data base tables can change depending on the procedures in table T9VS2.
So I can't know the structure or the table which has to be selected each procedure. Or I have to make a big program with a lot of if or Case statements in it. I want to avoid that! Dynamic table is much quicker to write and understand when it works.
It wil reduce a lot of code! I hope someone can give me a hint to solve the problem. -
Fill a table with data coming from an RFC
Hello everyone:
I've followed the Weblog "How many lines of java code did i write for a simple Web Dynpro?"
/people/durairaj.athavanraja/blog/2004/10/17/how-many-lines-of-java-code-did-i-write-for-a-simple-web-dynpro
I've called an RFC and created a table with data coming from it (which is also a table). My question is, if in this table there's a field named "UserType" there are two possible values for this field:
"userA"
"userB"
How can I get the table only show me the "userA" registers? The RFC does return all of the users, but when filling the table, can I put an if-else somewhere on my code?
Thanks a lot
AlejandroHi Alejandro,
Referring to the link provided "The logic of the filter process is not implemented in Web Dynpro. The application developer must implement the action to be executed."
We would have to implement the action onFilter in the controller implementation. Ideally, we fill the data retrieved from backend into a List (java.util.List) (this could be done on init of view) and then subset the list after meeting the criteria in the action handler(say
onActionFilterData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent).
Having done this, you may bind the output list back to the node (shown in table)
Regards,
Chaitanya -
How to Fill Internal Table with contents of Select-Option
Hi all:
There is a select-option s_matnr on the self-made screen. An internal table t_int is declared in the program. The requirement is that users makes selection with multiple material numbers. I want to put the values of s_matnr into internal table t_int directly. Would you please tell me how?
Thank you very much in advance.
Edited by: dongdong guo on Jun 13, 2008 3:40 AMHi,
Select option works like an internal table only.
For table selection you can use it directly using IN operator in where clause
eg : where matnr IN s_matnr.
Before that you may need to validate the content of the select-option. For that also you need to transfer the content to a new internal table.
u can loop at the select-option.
eq: loop at s_matnr.
if s_matnr-low = 'MAT1'.
condition.
endif.
endloop.
if you just want to check whether any single valid material number exist in your user screen, then u can use a select single option with s_matnr directly.
select single matnr from mara
where matnr in s_matnr.
select-option s_matnr behaves like an internal table with four fields.
sign, option, low, high. -
Fill a table with multiple records
REPORT REPORT1.
DATA: wa_itab1 LIKE TABLE1.
DATA: wa_itab2 LIKE TABLE2.
DATA: itab1 TYPE STANDARD TABLE OF TABLE1,
itab2 TYPE STANDARD TABLE OF TABLE2.
DATA: v_dat TYPE d VALUE '20080101'.
SELECT * FROM TABLE1 INTO TABLE itab1.
LOOP AT itab1 INTO wa_itab1.
wa_itab2-FIELD1 = wa_itab1-FIELD1.
wa_itab2-FIELD2 = wa_itab1-FIELD2.
wa_itab2-FIELD3 = wa_itab1-FIELD3.
wa_itab2-FIELD4 = v_dat. "pass the initialized date
APPEND wa_itab2 TO itab2.
v_dat = v_dat + 1. " increment the date
IF v_dat GT '20080105'.
EXIT.
ENDIF.
ENDLOOP.
MODIFY TABLE2 FROM TABLE itab2.
I have the program above which is not doing exactly what I need. Lets say TABLE1 has 3 records
FIELD1 FIELD2 FIELD3
PLANT1 STOR_LOC1 20
PLANT2 STOR_LOC2 30
PLANT3 STOR_LOC3 40
The loop is for 5 days so in TABLE2 I want to see the following
FIELD1 FIELD2 FIELD3 FIELD4
PLANT1 STOR_LOC1 20 20080101
PLANT2 STOR_LOC2 30 20080101
PLANT3 STOR_LOC3 40 20080101
PLANT1 STOR_LOC1 20 20080102
PLANT2 STOR_LOC2 30 20080102
PLANT3 STOR_LOC3 40 20080102
PLANT1 STOR_LOC1 20 20080103
PLANT2 STOR_LOC2 30 20080103
PLANT3 STOR_LOC3 40 20080103
PLANT1 STOR_LOC1 20 20080104
PLANT2 STOR_LOC2 30 20080104
PLANT3 STOR_LOC3 40 20080104
PLANT1 STOR_LOC1 20 20080105
PLANT2 STOR_LOC2 30 20080105
PLANT3 STOR_LOC3 40 20080105
At the moment the program gives me
FIELD1 FIELD2 FIELD3 FIELD4
PLANT1 STOR_LOC1 20 20080101
PLANT2 STOR_LOC2 30 20080101
PLANT3 STOR_LOC3 40 20080101
Do I need a WHERE clause and if so how do I add assuming that the equal fields are FIELD1 and FIELD2? ThanksI have added a DO condition to the program and tried a couple of attempts. The latest is below. With this attempt I get 80,000+ records the majority of which do not have the fields filled. Thanks
REPORT REPORT1.
DATA: wa_itab1 LIKE TABLE1.
DATA: wa_itab2 LIKE TABLE2.
DATA: itab1 TYPE STANDARD TABLE OF TABLE1,
itab2 TYPE STANDARD TABLE OF TABLE2.
DATA: v_dat TYPE d VALUE '20080101'.
SELECT * FROM TABLE1 INTO TABLE itab1.
DO v_dat+1 TIMES.
LOOP AT itab1 INTO wa_itab1.
wa_itab2-FIELD1 = wa_itab1-FIELD1.
wa_itab2-FIELD2 = wa_itab1-FIELD2.
wa_itab2-FIELD3 = wa_itab1-FIELD3.
wa_itab2-FIELD4 = v_dat. "pass the initialized date
APPEND wa_itab2 TO itab2.
v_dat = v_dat + 1. " increment the date
IF v_dat GT '20080105'.
EXIT.
ENDIF.
ENDLOOP.
ENDDO.
MODIFY TABLE2 FROM TABLE itab2. -
How to fill a table with data from columns & rows from a txt file
I am trying to fill say:
Myname Myclass Mycollege
Mohan MD Stanford
from a txt file into 3 columns of a table. I can easily do it into a textarea component by
clicking a button:
try{
FileReader fr = new FileReader("F:/CreatorProjects1/stan.txt");
BufferedReader br = new BufferedReader(fr);
String s1="";
String s="";
stantxtarea.setValue(s);
while((s=br.readLine())!=null) {
s1 = s1+s;
s1=s1+"\n";
stantxtarea.setValue(s1);
br.close();
fr.close();
} catch(Exception e) {
e.printStackTrace();
return null;
All table components seem to need a database. I do not use any database. I run exe files that give output to txt files. How to solve it?
I appreciate any help in this regard...
dr.mohan raothere may be another way. This is some thing some thing I can recommend. You can create property type of ObjectListDataProvider in session or application based on the scope you required. Create web bean class with property you want to show in the column (say col1, col2, col2). Initialize the list property like similar below
List dataList = new ArrayList();
ObjectListDataProvider mytableprops = new ObjectListDataProvider();
try {
//start loop read data from your txt file
//create instance of web bean for each line
//add web bean instance into dataList
//end of loop readind data from txt file
oldpins.setList(dataList );
oldpins.setObjectType(NotificationProfileBean.class);
} catch (Exception ee1){;}
return oldpins;
Sri Thuraisamy -
Filling Standard table with Data
Hi All,
how to configure a table for updating with data.
I am working with Migo Movements & I want those movements data to be updated in MARI Table.
Is it Possible to configure the standard table for updating with data?
Thanks & Regards,
Ravi SHi,
Thanks for Your Reply.
Actually I'm interested to know how the Migo TCode is configured so that MARI Table gets Updated.AS of Now it is Empty & when ever the Next transactions are done in Migo,the Mari Table Needs to be Updated.
Thanks & Regards,
Ravi S -
Filling temporary table with two other tables.
Hi everyone,
In an start routine, I would like to do the following :
read values in an internal table, save it in temporary table tab1.
read values in an internal table (the same with a different request) and save it in temporary table tab2.
save with no duplicate keys and in a sorted table tab3 the result of the two tables.
I have coded like this, but it doesn't work, since the final table is empty.
Indeed, the system says it is tried to insert a duplicate key. How is it possible using instruction INSERT ?
DATA : t_agence_1 TYPE SORTED TABLE OF ty_agence
WITH UNIQUE KEY /BIC/C_AGENCE2
WITH HEADER LINE.
DATA : t_agence_2 TYPE SORTED TABLE OF ty_agence
WITH UNIQUE KEY /BIC/C_AGENCE2
WITH HEADER LINE.
DATA : t_agence TYPE SORTED TABLE OF ty_agence
WITH UNIQUE KEY /BIC/C_AGENCE2
WITH HEADER LINE.
SELECT * FROM /BIC/PC_AGENCE2
INTO CORRESPONDING FIELDS OF TABLE t_agence_1
FOR ALL ENTRIES IN DATA_PACKAGE
WHERE CALMONTH = DATA_PACKAGE-CALMONTH
AND /BIC/C_AGENCE2 = DATA_PACKAGE-/BIC/C_AG1
AND objvers = 'A'.
IF sy-subrc = 0.
INSERT LINES OF t_agence_1 INTO TABLE t_agence.
endif.
SELECT * FROM /BIC/PC_AGENCE2
INTO CORRESPONDING FIELDS OF TABLE t_agence_2
FOR ALL ENTRIES IN DATA_PACKAGE
WHERE CALMONTH = DATA_PACKAGE-CALMONTH
AND /BIC/C_AGENCE2 = DATA_PACKAGE-/BIC/C_AG2
AND objvers = 'A'.
IF sy-subrc = 0.
INSERT LINES OF t_agence_2 INTO TABLE t_agence.
endif.
Thanks if you can help !
regards
fred
Edited by: Christophe BELIN on Dec 5, 2008 3:43 PMShanon,
You would handle the parent with two child tables exactly the same way you would a parent with one child.
1) Bring in all 3 tables through the Database Expert.
2) On the Links Tab, place the parent table on the left of the window and the two child tables to the right (yes there is a reason for doing this).
3) Delete any CR generated links between the tables.
4) "Draw" a link that starts from the parent table to the 1st child table and then again, from the parent to the 2nd child.
a. I'm assuming that you know which fields to link on.
b. No links between children.
5) Once you have both links in place right click them and change the "Link Type" to "Left Outer Join"
a. The reason for doing this: It allows ALL of the parent records to come through, even if they do not have any matching records in
one or both of the child tables.
Hope this helps,
Jason -
Fill setup table with a large of data
hi all:
There is a large of data that need ECC system stop 3 days must be filled in setup table ,what can I do it step by step?
Thanks!
Best regards!Hi Lian,
You can divide the data into some segments for example say on calendr day or calendar month and the run the loads based on these selections. It will take less time as compared to run all the data at the same time.
Cheers...
Puneesh
Maybe you are looking for
-
Deploying web dynpro application into portal
hi I have created a simple example in webdynpro in Netweaver developer studio, and I have deployed it into the portal whose version is EP6 SP9. where can I see that deployed webdynpro application(in my case it is WebDynpro_Basics.ear) in the portal.
-
A good SSD for MacBook Pro Early 2008
I have a MacBook Pro Early 2008 and im looking at replacing the hd to speed. What is a good SSD for me to get?
-
Problem changing location of Deleted email
I've got my iPhone setup to use my imap server. Everything works well so far, have all the folders displayed, and things look good. I can't seem to change the location of the Deleted Emails though. Whenever I go into advanced options, click "Deleted
-
Cannot bring up Finder preferences and general Finder issues in Yosemite
Since installing Yosemite, I've been having multiple issues with the Finder: Finder seems to hang occasionally when trying to delete a file Finder seems to hang occasionally when trying to empty the trash When trying to open the Finder preferences, i
-
When I try to finalize my project a message pops up, "Sharing requires more memory to be available." How do I work this issue out?