Assignment Between Structure and Single Field - CL_ABAP_CONTAINER_UTILITIES
Hi, Need some help on this as I'm not familiar with Java programming.
Basically in ABAP, we can assign a structure (with complex data type) into a field (please refer to link below).
Now we need to do similar thing in PI, since PI only support Java then we need to perform similar logic as in CL_ABAP_CONTAINER_UTILITIES =>FILL_CONTAINER_C, but in Java. Understand that there's no concept of structure in Java, in this case PI will receive multiple fields (with different data type) and need to combine them into one field.
I tried few Java command/method but it doesnt give me the same result as in the ABAP class. Appreciate your help if you know anything about this or some sample program that i can test. thanks!
SAP Help Reference for ABAP
[ABAP - Assignment Between Structure and Single Field|http://help.sap.com/saphelp_nw04/helpdata/en/79/c554d3b3dc11d5993800508b6b8b11/frameset.htm]
Hello Rika,
In java we have collection framework instead...
As per your requirement I understood :
1. You will get a list of different type of objects as input.
2. You want to club it in one unit....right...
3. Once done.....I dont know what you will do with that.....I guess pass it somewhere.....
Now, You can use ArrayList in java to club all your objects in one unit....and send it to any function you want....
Arraylist list= new ArrayList();
list.add(new MachineGun());
list.add(new Gun());
But there be carefull when you extract data from List....as you need to type cast them accordingly....
Start trying it...and revert back if you face any problems.....
While extracting you will have to use something like :
if(list.get(0).getClass().getSimpleName().equals("MachineGun")){
//here you can safely cast in the right class
MachineGun mgun= (MachineGun )list.get(0);
Similar Messages
-
Differrences between structure and table in data dictionary in ABAP?
What is the differrences between structure and table in data dictionary in ABAP?
are they same?Tables :
1. The place where the data is stored so that you can retrieve at any time.
2. There can be more than one record stored
Structures :
1. The data / info stays only during the runtime of the application and will not get stored at all during the run time ....
2. Only one record can be stored at the runtime .....
A structure forms the skeleton of the table.
A structure comprises components i.e., fields. Types are defined for the components A component can refer to an elementary type (via a data element or by directly specifying the data type and length in the structure definition), another structure or a table type. A structure can therefore be nested to any depth
Tables can be defined independently of the database in the ABAP Dictionary. The fields of the table are defined with their (database-independent) data types and lengths.
When the table is activated, a physical table definition is created in the database for the table definition stored in the ABAP Dictionary. The table definition is translated from the ABAP Dictionary to a definition of the particular database. -
How to Assignment between Material and Account Assignment Group
Hi,
When we are creating a sales order with material ABCD, then in material line item -->under Billing Document Tab --> in Accounting screen, there is field Acct asgnmt grp (Account Assignment Group).
From where we can assign between Material and Account Assignment Group, after that it automatically pick in sales order creation.
Please guide..Please refere to below link it may help.
Re: how to configure new account assignment group of material
Thanks Dev. -
Convert structure into single field in string in unicode system .
Hi all
i need to convert whole structure in single fields which is string format
plese refer this code .....this is structure which i want to use in concatenate statement
statement is
CONCATENATE EXPORTSTRING HFTP_ZSD_RKFR CR_LF INTO EXPORTSTRING.
where data are ...
EXPORTSTRING type xstring
CR_LF type x
structure HFTP_ZSD_RKFR having follwing fields
MANDT MANDT CLNT 3 0
VBELN_VL VBELN_VL CHAR 10 0
LFDNUM LFDNUM NUMC 3 0
VKORG VKORG CHAR 4 0
VSTEL VSTEL CHAR 4 0
VSBED VSBED CHAR 2 0
KUNAG KUNAG CHAR 10 0
KUNWE KUNWE CHAR 10 0
SPDNR SPDNR CHAR 10 0
LFDAT LFDAT DATS 8 0
LFUHR LFUHR TIMS 6 0
WADAT WADAT DATS 8 0
TRAID TRAID CHAR 20 0
ROUTE ROUTE CHAR 6 0
WERKS WERKS_D CHAR 4 0
MATNR MATNR CHAR 18 0
LFIMG LFIMG QUAN 13 3
MEINS MEINS UNIT 3 0
ANZPK ANZPK NUMC 5 0
ANZPK ANZPK NUMC 5
KBETR KBETR CURR 11
KPEIN KPEIN DEC 5
KMEIN KMEIN UNIT 3
KWAER KWAER CUKY 5
KWERT KWERT CURR 13
BELNR BELNR_FI CHAR 10
GJAHR GJAHR NUMC 4
MWSKZ MWSKZ CHAR 2
SAKNR SAKNR CHAR 10
BUKRS BUKRS CHAR 4
BUDAT BUDAT DATS 8
KOSTL KOSTL CHAR 10
AUFNR AUFNR CHAR 12
PRCTR PRCTR CHAR 10
BRGEW BRGEW QUAN 13
GEWEI GEWEI UNIT 3
XBILL ZSD_XBILL CHAR 1
XPARK ZSD_XPARK CHAR 1
XPARK ZSD_XPARK CHAR 1
XBLNR XBLNR CHAR 16
KHERK ZSD_KHERK CHAR 1
LIFEX LIFEX CHAR 35
SDABW SDABW CHAR 4
KBETR_MAUT KBETR CURR 11
KPEIN_MAUT KPEIN DEC 5
KMEIN_MAUT KMEIN UNIT 3
KWERT_MAUT KWERT CURR 13
KBETR_OEL KBETR CURR 11
KPEIN_OEL KPEIN DEC 5
KMEIN_OEL KMEIN UNIT 3
KWERT_OEL KWERT CURR 13
KBETR_PAL KBETR CURR 11
KPEIN_PAL KPEIN DEC 5
KMEIN_PAL KMEIN UNIT 3
KWERT_PAL KWERT CURR 13
KBETR_VAT KBETR CURR 11
KPEIN_VAT KPEIN DEC 5
KPEIN_VAT KPEIN DEC 5
KMEIN_VAT KMEIN UNIT 3
KWERT_VAT KWERT CURR 13
BLDAT BLDAT DATS 8
MWS_BETRG WRBTR CURR 13
KURSF KURSF DEC 9
UVK06 CHAR 1I have used this FM
SAP_CONVERT_TO_TXT_FORMAT
There's also a method in cl_abap_char_utilities to convert a structure to a C container, look for it, I only have 4.6C here and that class is only in ECC -
Difference between Structural and Org. Based Security
Hi
Could anyone please explain the difference between Structural and Org. based security
Also could anyone please point to relevant documents.
ThanksStructural authorization:
ex: assigning roles to position and not to userids.. Listed below are some links that may help you to get started in understanding "Structural authorization".
http://www.sap-img.com/human/structural-authorization-vs-role-authorization.htm
http://www.sap-press.de/katalog/buecher/inhaltsverzeichnis/gp/titelID-1071
https://websmp205.sap-ag.de/~form/ehandler?_APP=00200682500000001337&_EVENT=DISPLAY&COURSE=ADM940
HB -
What is the difference between Structure and Work area
Hi Guys,
What is the difference between Structure and work area?
Are they same with different names?
Thanks,
mini.hey buddies,*
i had this same doubt for a long time and i have my finds with me ie wa and structure are the same but wa can hold a single record but structure cannot hold data in it but according to the previous posts folks say structure too holds data as wa does but i guess when debugging wa holds data and structure doesnt hold bcoz i tried.
types : begin of str_mara,
matnr type mara-matnr,
ernam type mara-ernam,
end of str_mara.
data it_mara type table of str_mara.
select matnr ernam from mara into it_mara where matnr = '100-101'.
*********************if folks say wa = structure,this should work,isn't it?*********************************
loop at it_mara into str_mara.
write:/ str_mara-matnr , str_mara-ernam.
endloop.
*******************but it throws an error saying that str_mara is not a wa*******************************
i may not be correct too plz let me know if i'm wrong
Edited by: arun_aime on Feb 12, 2010 4:41 PM -
Include structure and extra fields in the same Internal Table
Hi developers,
im trying to declare an internal table with include structure and extra fields,
something like this:
data: BEGIN OF it_loans occurs 0,
include structure zthrca006,
status(10),
pernr like pa0001-pernr,
sname like pa0001-pernr,
tipomov(20),
monto like zthrca006-monto,
data: END of it_loans.
zthrca006 is huge so i dont want to type everithing.What is the issue?
data: BEGIN OF it_loans occurs 0.
include structure zthrca006.
data : status(10),
data : pernr like pa0001-pernr.
data : sname like pa0001-pernr.
data : tipomov(20).
data : monto like zthrca006-monto,.
data: END of it_loans.
Regards,
Ravi
Note - Please mark all the helpful answers -
Controlling the space between label and Input field in SELECT-OPTION
Hi ,
I am using WDR_SELECT_OPTIONS as a used component in order to dynamically generate the Select option in my WD Component.
Can any one tell me if there is a way to control the spacing between Label and Input field? This is because rest of the UI elements are in one particular order but for this dynamically generated UI.
Please help me.
Thanks,
KavithaHi Kavitha,
The label is required for accessibility reasons. It's not possible to remove it and to use your own label from outside the component to point to it. Labels cannot point to targets across views (and hence acress component) boundaries.
Best regards,
Thomas -
Diference between structure and infostructure
Hi All!
What is the difference between structure and infostructure in SAP.What are the pros and cons.
Please provide me any analysis on this?
Regards
Praneethhi Praneeth,
<b>Structure:</b>In structure there will be no data present.
Only the tables contains data.
Structures are meant for temporary passage of data and we can include tht structure in any tables..
Check these links
http://help.sap.com/saphelp_nw04/helpdata/en/5c/11afb6d55711d2b1f80000e8a5b9a5/content.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/6b/9f97e674547b4fa7e33e5d36cea248/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/61/d25eb4166811d2a2380000e8a5f24f/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ff/6bb43b3d4a7958e10000000a114084/frameset.htm
Regards,
Santosh -
Diff. between currency and unit fields
Hi All,
What is the diff. between 0DOC_CURRCY and 0CURRENCY, OUNIT and 0BASE_UOM? In which scenarios do we use each of them?
I have a flat file which contains some values for sales and quantity but does not have any units. So I have to upload them using constant currency and unit. now, I have to create my own keyfigures for the sales and quantity. What currency and unit fields should I use i.e 0CURRENCY or 0DOC_CURRCY and OUNIT or 0BASE_UOM?
Thanks a lot,
James.hi James,
0doc_currency, 0currency share the same master data->0currency, 0unit, 0base_uom share the same master data->0unit, the 'basic' infoobject is 0currency and 0unit, all currency and unit will have reference to these infoobjects.
currency is used for keyfigures amount, with currency e.g usd, gbp, etc.
unit for keyfigures quantity, with unit like KG, CM etc.
currency tables are TCUR* and unit table T006*
you can use any of these infoobject currency or unit in your keyfigure (RSD2) or fix value like USD etc, normaly 0doc_currcy used for document currency; 0loc_currcy for local currency, you can create your own infoobject currency/unit with RSD3.
hope this helps. -
Difference between semantic and key fields in DSO
Hello All,
Please help me in understanding about difference between "Key fields" and "Semantic key" in write optimize DSO.
thanksHi,
you dont have key fields in write-optimized DSO, key fields terminology is forin standard DSO.
And semantic key is used in write-optimized DSO.
As we know standard DSO is a flat structure similar to transparent tables that we have in R3/ECC system with key fields (combination of values which needs to be unique).
Now, The system generates a unique technical key for the write-optimized DataStore object. The standard key fields are not necessary with this type of DataStore object. If there are standard key fields anyway, they are called semantic keys so that they can be distinguished from the technical keys. The technical key consists of the Request GUID field (0REQUEST), the Data Package field (0DATAPAKID) and the Data Record Number field (0RECORD). Only new data records are loaded to this key.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm -
Assigning Table/Structure Types using Field-Symbols
Hello Gurus,
How can we assign a table or structure type to a particulart internal table?
What I want to do is to make my data declaration for i_tab reusable.
i.e.
DATA: v_tab TYPE string.
v_tab = 'MARA'.
DATA : i_tab TYPE STANDARD TABLE OF v_tab.
The purpose is to make the declaration flexible so program can change v_tab to any table names like LIPS, KNA1...etc making the i_tab flexible and reusable enough. Can anyone help me please? I try to use field-symbols, but I can not achieve what I want. Any bright ideas please?DATA: dref TYPE REF TO data.
FIELD-SYMBOLS: <table> TYPE STANDARD TABLE,
<line> TYPE ANY.
PARAMETERS: pa_tab TYPE tabname DEFAULT 'BUT000'.
CREATE DATA dref TYPE STANDARD TABLE OF (pa_tab).
ASSIGN dref->* TO <table>.
SELECT * FROM (pa_tab) INTO TABLE <table>
UP TO 10 ROWS.
LOOP AT <table> ASSIGNING <line>.
ENDLOOP.
<LINE> will take the structure of the table line at runtime.
This is quite flexible.
But you can also declare it like this, as we did with the <table>:
DATA: dref1 TYPE REF TO data.
CREATE DATA dref1 TYPE (pa_tab).
ASSIGN dref1->* TO <line>.
This way <line> will already have the correct structure, even before the <ASSIGNING>.
Edited by: Micky Oestreich on Mar 24, 2009 8:21 AM -
Cross-reference between structured and unstructured FM documents
Hello,
Is it possible to retain FM cross-references from structured to unstructured FM documents during an XML round trip?
From what I know, cross-references between or inside structured documents form pairs of ID and IDREF, while cross-references to unstructured documents are dumped as normal text and lose their functionality.
The unstructured target documents might be converted to Structured FM at some point, but for the time being I'd like to find another solution. Do you know any solution to this?
Thanks,
JohannesJohannes,
This is just a guess, because I do not do this.
First, of course, you cannot export the unstructured file to XML, because it is unstructured.
Second, IF the cross-reference from the structured file to the unstructured file were done via your cross-reference ELEMENT, then the cross-reference element should export to XML as an XML element with one of its IDref attribute set to the ID of something in the unstructured file. When you open the XML file in FrameMaker, the cross-reference is re-established.
In other words, when exporting to XML, FrameMaker does not care to what you are referencing. It just converts the cross-reference element into an element with an attribute in the XML file. So, it should work as expected when opened in FrameMaker. Of course, I am assuming your read-write file is set up to handle cross-references.
On the other hand, IF you are creating your cross-reference from the structured file by simply inserting a cross-reference, that is NOT as an element, then I do not know what happens. If it is being exported as text, then I am not sure FrameMaker will know what to do with it when you reopen the XML file.
Hope this helps,
Van -
How to decrease the gap between label and input field.. pls respnd
hi friends,
I am facing this problem since long time and couldnt get any solution...
pls respnd,
i need to decrease the gap between my input field and label.. its very much gap there..
thanks in very advacne,
nirajaHi WD ABAP,
i am doing the same, created tcontainer, and just binded my node. i given matrix layout. But i dont know why it is coming like that.
Also WDABAP, could you pls reply me to the other thread,
about when im trying to read the dropdown value of subnode, the get_static_attribute or create_element method is going into my supplyfunction.
supplyfunction - my code is to fill the dropdown. and due to this supply function triggering,
my get_static_att or create_element is not reruting currenct row dropdown value.
what am i doing wrong.. can u pls pls.. its kicking me. i have spent my whole weekend on this, but couldnt solve this.
plsfnds :(((((
Niraja -
Full database exp/imp between RAC and single database
Hi Experts,
we have a RAC database oracle 10GR2 with 4 node in linux. i try to duplicate rac database into single instance window database.
there are same version both database. during importing, I need to create 4 undo tablespace to keep imp processing.
How to keep one undo tablespace in single instance database?
any experience of exp/imp RAC database into single instance database to share with me?
Thanks
Jim
Edited by: user589812 on Nov 13, 2009 10:35 AMJIm,
I also want to know can we add the exclude=tablespace on the impdp command for full database exp/imp?You can't use exclude=tablespace on exp/imp. It is for datapump expdp/impdp only.
I am very insteresting in your recommadition.
But for a full database impdp, how to exclude a table during full database imp? May I have a example for this case?
I used a expdp for full database exp. but I got a exp error in expdp log as ORA-31679: Table data object "SALE"."TOAD_PLAN_TABLE" has long columns, and longs can not >be loaded/unloaded using a network linkHaving long columns in a table means that it can't be exported/imported over a network link. To exclude this, you can use the exclude expression:
expdp user/password exclude=TABLE:"= 'SALES'" ...
This will exclude all tables named sales. If you have that table in schema scott and then in schema blake, it will exclude both of them. The error that you are getting is not a fatal error, but that table will not be exported/imported.
the final message as
Master table "SYSTEM"."SYS_EXPORT_FULL_01" successfully loaded/unloaded
Dump file set for SYSTEM.SYS_EXPORT_FULL_01 is:
F:\ORACLEBACKUP\SALEFULL091113.DMP
Job "SYSTEM"."SYS_EXPORT_FULL_01" completed with 1 error(s) at 16:50:26Yes, the fact that it did not export one table does not make the job fail, it will continue on exporting all other objects.
. I drop database that gerenated a expdp dump file.
and recreate blank database and then impdp again.
But I got lots of error as
ORA-39151: Table "SYSMAN"."MGMT_ARU_OUI_COMPONENTS" exists. All dependent metadata and data will be skipped due to table_exists_action of skip
ORA-39151: Table "SYSMAN"."MGMT_BUG_ADVISORY" exists. All dependent metadata and data will be skipped due to table_exists_action of skip
......ORA-31684: Object type TYPE_BODY:"SYSMAN"."MGMT_THRESHOLD" already exists
ORA-39111: Dependent object type TRIGGER:"SYSMAN"."SEV_ANNOTATION_INSERT_TR" skipped, base object type VIEW:"SYSMAN"."MGMT_SEVERITY_ANNOTATION" >already exists
and last line as
Job "SYSTEM"."SYS_IMPORT_FULL_01" completed with 2581 error(s) at 11:54:57Yes, even though you think you have an empty database, if you have installed any apps or anything, it may create tables that could exist in your dumpfile. If you know that you want the tables from the dumpfile and not the existing ones in the database, then you can use this on the impdp command:
impdp user/password table_exists_action=replace ...
If a table that is being imported exists, DataPump will detect this, drop the table, then create the table. Then all of the dependent objects will be created. If you don't then the table and all of it's dependent objects will be skipped, (which is the default).
There are 4 options with table_exists_action
replace - I described above
skip - default, means skip the table and dependent objects like indexes, index statistics, table statistics, etc
append - keep the existing table and append the data to it, but skip dependent objects
truncate - truncate the existing table and add the data from the dumpfile, but skip dependent objects.
Hope this helps.
Dean
Maybe you are looking for
-
Am I the only one who has firefox crashing when trying to use "Clear Recent History"?
Well I installed Firefox 4 on both my laptop and my desktop and it does the same problem to both of them, which annoys me greatly. Such a simple feature should have no problems working right? Well not for me apparently. When I try to use Clear Recent
-
How can I test Cinema HD and 24 LED displays?
Hi, I have two apple displays that I am trying to test to see if they work but I don't have a PC to hook them up to. I plug them into the wall outlet but nothing happens. Do I have to have them plugged up to a mac/pc to get anything to happen? thx
-
Netweaver Mobile Add-in Installation on NW700 with EHP1
Dear all, we have a netweaver 7.00 EHP1 platform, on which Mobile Infrastructure also has to be installed But i am not sure how it can be done. Reading notes i saw that as of EHP1 it is not possible to install MI as Java Add-in Many thanks in advance
-
Intermedia Image transform problem with Tifs 64k
Hello, I have loaded a bunch of Tifs ranging in size from about 8k up to 120 or so kilobytes. When I try to do a scale transform on them and change them into GIFs using the image.process('scale="0.2"') command for example only the TIf images that are
-
SAP Bydesign...insert report function.
Hi Gurus... While making report selection criteria and save it as a report, how do i share my selection with other users as well? Regards Aswad D.