Extractor on Z table with currency fields referenced from T001
Good morning.
We have a requirement to extract a Z table (keys Material Number, Plant) to BW.
In trying to build a datasource on this table, I get a message saying currency fields referenced from another table.
So, the key figures in this Z table are referenced from T001 (which has Company Code as key
How do I tie these two tables? I was thinking if I could get Company code from any of the Material Master tables then I could include that in the view but haven't been able to Material and Company Code relation yet.
Any thoughts on how to go about building this datasource are greatly appreciated!
In your datasource just include the table name and check the datasource it should be ok.
The reason it asks for these tables could be that the Z table that you are using should be using a datatype "CURRENCY" and currency will by default have USD or EUR etc associated. So when you include the appropriate "T" table it knows to make connection. You need not have to write exits to populate the currency fields.
Hope this helps.
Similar Messages
-
How to convert internal table with dynamic fields to XML
Dear all,
I met a problem like the following:
The aim is to transform the following parameter to XML
IT_FIELD stores the dynamic filed name of the internal table,with these fields, the dynamic internal can be created by cl_abap_tabledescr=>create(it_field)
IT_VALUE stores the value of the internal table dynamically created with dynamic fields.
For example
IT_FIELD =>
line1: FIELD1
line2: FIELD2
line3: FIELD3,
three lines in this internal table.
dynamically created internal table structure FIELD1 FIELD2 FIELD3
And IT_VALUE=>
1 2 3 (First line)
11 22 33
two lines of data.
Do you have any idea about how to transform the IT_VALUE to XML here? And also the transformed XML to the IT_VALUE.( we may need remember IT_FIELD here for later XML to IT_VALUE.)
Hope I describe the problem clearly.
Any inputs will be appreciated.
Edited by: Max Tang on Jan 12, 2009 3:46 PM
Edited by: Max Tang on Jan 12, 2009 4:14 PMHi,
you need to implement a bit of coding for that.
With the 'do varying' statement abap provides a loop over those fields. Within this loop you can build up a new internal table with one entry for each period and amount.
kind regards
Siggi
PS: I am not very familiar with CO, but I guess there will be a standard extractor for that. -
Problem with currency field in smart form
hi
friends ..
i had problem with currency field in smartform iam printing 5 currecny
fields after the main window .But not getting printed on right way gets printed down from the given mesaurement and i get lot of gap betwen the
each fields for ex.
33,260.00
120.00
0.00
0.00
0.00
i thought the the problem is with space .so iwanted to condense it but cannot as it is currency field so move into character fields .but the user want out put in currency format like 22,60.20 if i get the value in char variable i get 2260.20 which i dont want .
so pls help me how to condense or shift left and print the currency field on right place.
regards
answers will be rewarded points.hi,
this is a normal problem u can avoid this by moveing these currencu value to a character field then print the char field us ing condece... &var(C)&..
eve if not solve the problem use the TEMPLATE node..
Please Close this thread.. when u r problem is solved. Reward all Helpful answers
Regards
Naresh Reddy K -
Understanding logminer results -- inserting row into table with CLOB field
In using log miner I have noticed that inserts into rows that contain a CLOB (I assume this applies to other LOB type fields as well, have only tested with CLOB so far) field are actually recorded as two DML entries.
--the first entry is the insert operation that inserts all values with an EMPTY_CLOB() for the CLOB field
--the second entry is the update that sets the actual CLOB value (+this is true even if the value of the CLOB field is not being set explicitly+)
This separation makes sense as there may be separate locations that the values are being stored etc.
However, what I am tripping over is the fact the first entry, the Insert, has a RowId value of 'AAAAAAAAAAAAAAAAAA' which is invalid if I attempt to use it in a flashback query such as:
SELECT * FROM PERSON AS OF SCN #####' where RowId = 'AAAAAAAAAAAAAAAAAA'The second operation, the Update of the CLOB field, has the valid RowId.
Now, again, this makes sense if the insert of the new row is not really considered "+done+" until the two steps are done. However, is there some way to group these operations together when analyzing the log contents to know that these two operations are a "+matched set+"?
Not a total deal breaker, but would be nice to know what is happening under the hood here so I don't act on any false assumptions.
Thanks for any input.
To replicate:
Create a table with CLOB field:
CREATE TABLE DEVUSER.TESTTABLE
ID NUMBER
, FULLNAME VARCHAR2(50)
, AGE NUMBER
, DESCRIPTION CLOB
);Capture the before SCN:
SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;Insert a new row in the test table:
INSERT INTO TESTTABLE(ID,FULLNAME,AGE) VALUES(1,'Robert BUILDER',35);
COMMIT;Capture the after SCN:
SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;Start logminer session with the bracketing scn values and options etc:
EXECUTE DBMS_LOGMNR.START_LOGMNR(STARTSCN=>2619174, ENDSCN=>2619191, -
OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + DBMS_LOGMNR.CONTINUOUS_MINE + -
DBMS_LOGMNR.COMMITTED_DATA_ONLY + DBMS_LOGMNR.NO_ROWID_IN_STMT + DBMS_LOGMNR.NO_SQL_DELIMITER)Query the logs for the changes in that range:
SELECT
commit_scn, xid,operation,table_name,row_id
,sql_redo,sql_undo, rs_id,ssn
FROM V$LOGMNR_CONTENTS
ORDER BY xid asc,sequence# ascResults:
2619178 0C00070028000000 START AAAAAAAAAAAAAAAAAA set transaction read write
2619178 0C00070028000000 INSERT TESTTABLE AAAAAAAAAAAAAAAAAA insert into "DEVUSER"."TESTTABLE" ...
2619178 0C00070028000000 UPDATE TESTTABLE AAAFEXAABAAALEJAAB update "DEVUSER"."TESTTABLE" set "DESCRIPTION" = NULL ...
2619178 0C00070028000000 COMMIT AAAAAAAAAAAAAAAAAA commitEdited by: 958701 on Sep 12, 2012 9:05 AM
Edited by: 958701 on Sep 12, 2012 9:07 AMScott,
Thanks for the reply.
I am inserting into the table over a database link.
I am using the new version of HTML Db (2.0)
HTML Db is connected to an Oracle 10 database I think, however the table I am trying to insert data into (via the database link) is in an Oracle 8 database - this is why we created a link to it as we couldn't have the HTML Db interacting with the Oracle 8 database directly due to compatibility problems (or so I've been told)
Simon -
...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 -
Error in smart form with currency fields
while i am using with currency fields in samrt forms error is comming in while i am giving print-preview in se38 "<b>Reference field WA_EKPO-NETPR unknown in form."</b>
In smart forms if we want to display quantity and currency fields. We cannott directly display currency field and quantity fields.
To display the mdo like this
Ex: GLOBAL Definitions
WA_NETPR LIKE EKPO-NETPR
For that we have to create an extra variable in global definitions
Ex: netpr FIELD of EKPO
CREATE program lines and specify WA_NETWR = itab-netpr.
Close the thread once your question is answered.
Regards,
SaiRam -
Subform with table with expanding fields - please help!
I am a new user of LiveCycle Designer ES and need help with a form. I've made so many changes within the form that I have now lost track and don't know where to start to fix the following two issues:
The form itself is one Master Page that needs to repeat, based on the amount of data entered. This is not happening.
Within the form is a Table with expanding fields. It is when the last field is full that I need a new page created.Also, as the table expands, it overwrites the Footer, which is a subform. The footer is set to have a top margin (.25).
Any assistance would be much appreciated. Thank you!Looks like a cross post. see other thread here...
http://forums.adobe.com/thread/489453?tstart=0 -
How to update database table with key field?
Hello Experts,
I have a database table with following fields
MATNR - Key
SSOUR - Key
KUNNR - Key
MENG1
MENG2
MENG3
And this table contains records like...
MSD50001 R 1000001 5.30 2.30 5.25
MSD50002 R 1000002 5.30 2.30 5.25
MSD50003 R 1000003 5.30 2.30 5.25
MSD50005 R 1000004 5.30 2.30 5.25
MSD50004 R 1000005 5.30 2.30 5.25
I have an internal table with same fields of above database table.
MSD50001 A 1000001 5.30 2.30 5.25
MSD50002 A 1000002 5.30 2.30 5.25
MSD50003 A 1000003 5.30 2.30 5.25
MSD50005 A 1000004 5.30 2.30 5.25
MSD50004 A 1000005 5.30 2.30 5.25
MSD50006 A 1000006 5.30 2.30 5.25
I want to update the DB table with following internal table records.
If internal table records = db table records are same then Update....else insert from internal table to db table.
But here, SSOUR is key field so i am not able to use
MODIFY dbtab from itab.
It results me , entries in internal table are inserted into db table.
So i have double records.
Is there any statement which updates the key field? and if no fields in db table then insert it?
Regards
RHhi,
u cannot update akey field.u can update only non key fields by using key field as a selection criteria.For example if u go to sm30 if u enter any table for inserting values, the key field will always be greyed out it is not succumbed to chnges.but u can insert value into ,if ur inserting and in the insert staemnet if u have key field which is already present in the table it will return sy-subrc = 4 otherwise it will insert the record and return 0.
eg for update :
UPDATE zdm_wtyprof SET upload_status = 'S'
WHERE spart = wa_upd-spart.
here spart is the key field and it will update the status field in the table as S.
if updated succesfully it will return 0.
SIMILARLY U CAN USE select. -
Fetch Table name and field name from a given entry
Hi ,
i know the entry which is present in the database .But i don't know the table name and field name which has that entry .
i have to fetch the table name and field name from a given entry .
Can anyone suggest me how will i fetch the table name and field name for a given entry .
thanks in advance.Hi ,
i know the entry which is present in the database .But i don't know the table name and field name which has that entry .
i have to fetch the table name and field name from a given entry .
Can anyone suggest me how will i fetch the table name and field name for a given entry .
thanks in advance.
Few more options to scan specific text in entire DB:
http://www.mssqltips.com/sqlservertip/1525/scan-a-sql-server-database-for-objects-and-columns-containing-a-given-text-value/
http://solutioncenter.apexsql.com/quickly-search-for-sql-database-data-and-objects/
Cheers,
Vaibhav Chaudhari
[MCTS],
[MCP] -
How to do the calculations with currency fields in table control?
Hi everybody,
Can anyone tell me how to do the calculations (arithmetical) with the currency fields which have been assigned for a table control fields? Actually they should be fetched from the database table and need to do some calculations and after that the same should get updated at the database level.
Here, i am getting the short dump after doing the calculations and trying to display at the table control field itself.....
Can anyone help me in this issue........
Thank you very much.....in advance,
Somu.Hi,
Thanks to your replies all,
But, even though the sign check box is checked in the SAP domain WRTV7, in my program it is not showing the negative sign at all...
I am keep trying for all the options...
But still it is not working out...
My requirement is after fetching the data from the database i need to do calculations and save back same to the customized table field, for which the domain i have checked the sign and have done it also...
I'd be highly thankful to you, if you can help me out...
Thank you,
Somu. -
Problem with currency fields in alv while editing
hi guys,
while creating the editable fields and saving the data in database i have problem with currency(price fields),
when iam entering 10000 it is storing as 100.00 in database but
i want to store it as 10,000.00
can any one help me ....
it is urgent
thanks..When populating the fieldcatalog for ur currency amount field then
populate these additional fields with currency key and table name where this key field belongs.
cfieldname type slis_fieldname, " field with currency unit
ctabname type slis_tabname, " and table
May be then it will solve ur prob.
Regards,
Joy. -
How to convert the table with separate fields for every period
Hi there,
I have the table in R/3 called COSP. The table contains the separate fields for values of separate reporting periods, let's say Amount01, Amount02 etc. I need to extract this data to BW and load it into ODS, which contains the data like common key figure for amount and info object Fiscal Period. How to extract and tansform the data to be able to load it there?
I mean, how to change the row like:
100 100 200 200....
for rows like:
001 100
002 100
003 200
004 200
I hope you'll help,
KooyotHi,
you need to implement a bit of coding for that.
With the 'do varying' statement abap provides a loop over those fields. Within this loop you can build up a new internal table with one entry for each period and amount.
kind regards
Siggi
PS: I am not very familiar with CO, but I guess there will be a standard extractor for that. -
Calculations with Currency fields
Hi Experts,
Could you kindly throw some light on how Currency fields are processed in the Dictionary? How does the system calculate the local currency?
For example, let us consider table BSAK, I see the fields WAERS(Curr key), DMBRT (Amount in local currency) and WRBTR (Amount in document currency).
How do I calculate the total Amount for a given values of
LIFNR, BUKRS,GJAHR, MONAT and SHKZG = 'S' ?
Do I just add all the DMBTR values?
What would be the local currency be?
Kindly advice.Hi Vimal,
The fields DMBRT and WRBTR hold the amount whereas the field WAERS specifies the currency key of these fields . That is whether they are in Indian Currency ( IND ) or is it US Dollars ( USD ) etc... The Table to hold the currency keys is TCURC. You can find this table as a value table in the domain of the field WAERS.
So if you have to calculate the currencies you have to check with their currency keys if the currency key is same then you Add the prices.
Try to write this code in ABAP Editor :
*"Table Declarations...................................................
TABLES :
sflight. " Flight
*"Select Screen Elements...............................................
SELECT-OPTIONS :
s_carrid FOR sflight-carrid. " Carrier ID
*"Data Declarations....................................................
* Work Variables *
DATA :
w_gross TYPE p DECIMALS 2, " Holds Gross Value
w_net TYPE p DECIMALS 2, " Holds Net Value
w_curr LIKE sflight-currency. " Holds Currency
* Internal table to hold Flight data *
DATA :
t_sflight LIKE
STANDARD TABLE
OF sflight.
* TOP-OF-PAGE EVENT *
TOP-OF-PAGE.
PERFORM top_of_page.
* AT SELECTION-SCREEN EVENT *
AT SELECTION-SCREEN.
PERFORM at_selection_screen.
* START-OF-SELECTION EVENT *
START-OF-SELECTION.
PERFORM fetch_sflight_data.
PERFORM display_sflight_data.
*& Form top_of_page
* This Subroutine Performs the Event Top-Of-Page
* There are no interface parameters to be passed to this subroutine. *
FORM top_of_page .
WRITE :/45 text-001.
ULINE.
ENDFORM. " FORM TOP_OF_PAGE
*& Form AT_SELECTION_SCREEN *
* This Subroutine Performs the Required Input Validations *
* There are no interface parameters to be passed to this subroutine. *
FORM at_selection_screen .
SELECT carrid " Carrier ID
FROM sflight
INTO TABLE t_sflight
WHERE carrid = s_carrid-low.
IF sy-subrc NE 0
AND s_carrid-low NE space.
MESSAGE e184(bc_global) WITH text-007.
ENDIF. " IF SY-SUBRC NE 0
SELECT carrid " Carrier ID
FROM sflight
INTO TABLE t_sflight
WHERE carrid = s_carrid-high.
IF sy-subrc NE 0
AND s_carrid-high NE space.
MESSAGE e184(bc_global) WITH text-008.
ENDIF. " IF SY-SUBRC NE 0
ENDFORM. " AT_SELECTION_SCREEN
*& Form FETCH_SFLIGHT_DATA *
* This Subroutine Fetches Data from the Database table Sflight *
* There are no interface parameters to be passed to this subroutine. *
FORM fetch_sflight_data .
SELECT carrid " Carrier ID
connid " Connection ID
fldate " Flight Date
price " Price
currency " Currency
seatsmax " Seats Maximum
seatsocc " Seats Occupied
FROM sflight
INTO CORRESPONDING FIELDS OF
TABLE t_sflight
WHERE carrid IN s_carrid.
ENDFORM. " FORM FETCH_SFLIGHT_DATA
*& Form display_sflight_data
* This Subroutine Displays Data from the Database table Sflight *
* There are no interface parameters to be passed to this subroutine. *
FORM display_sflight_data .
LOOP AT t_sflight INTO sflight.
AT FIRST.
FORMAT COLOR 1.
WRITE : /5 'Carrier ID'(002),
140 space,
/25 'Flight Date'(003),
140 space,
/44 'Seats'(004),
65 'Seats'(004),
140 space,
/44 '(Maximum)'(005),
65 '(Occupied)'(006),
140 space.
ULINE.
ENDAT.
*" AT NEW CONNID
AT NEW connid.
FORMAT COLOR 6 INTENSIFIED OFF.
WRITE :/ sflight-carrid UNDER text-002,
10 sflight-connid.
ENDAT. " AT NEW CONNID
FORMAT COLOR 5 INTENSIFIED OFF.
WRITE :/ sflight-fldate UNDER text-003,
sflight-seatsmax UNDER text-005,
sflight-seatsocc UNDER text-006,
90 sflight-currency,
110 space.
w_gross = w_gross + sflight-price * sflight-seatsocc.
w_curr = sflight-currency.
*" AT END OF CONNID
AT END OF connid.
FORMAT COLOR 3 INTENSIFIED OFF.
WRITE :/ 'Total Bookings so far '(009),
40 w_gross,
60 w_curr.
w_net = w_net + w_gross.
ENDAT. " AT END OF CONNID
*" AT END OF CARRID
AT END OF carrid.
SKIP 2.
FORMAT COLOR 3 INTENSIFIED ON.
WRITE :/ 'Total Bookings so far for '(013),
sflight-carrid,
w_net,
w_curr.
ULINE.
CLEAR w_gross.
CLEAR w_net.
ENDAT. " AT END OF CARRID
ENDLOOP. " LOOP AT T_SFLIGHT...
ENDFORM. " FORM DISPLAY_SFLIGHT_DATA
This is to sum the prices of a flight according to currency key
Regards,
Swapna. -
Error displaying a jpg file loaded into a table with blob field
This may not be the correct forum for this question, but if it isn't could someone direct me to the correct one.
I have created a table with a blob field in which I have loaded a jpg image. This appeared to work correctly, but when I try to display the image in internet explorer it comes back and tells me that it doesn't recognize the file type. Enclosed is the table create, load, and display pl/sql code. Can anyone tell me what I am doing wrong. Thanks. For the mime/header I used owa_util.mime_header('images/jpg') because my image is a jpg file.
The database is 10g
-- Create table
create table PHOTOS
IMAGEID NUMBER(10),
IMAGE BLOB,
IMAGE_NAME VARCHAR2(50)
load image
CREATE OR REPLACE PROCEDURE load_file ( p_id number, p_photo_name in varchar2) IS
src_file BFILE;
dst_file BLOB;
lgh_file BINARY_INTEGER;
BEGIN
src_file := bfilename('SNAPUNCH', p_photo_name);
-- insert a NULL record to lock
INSERT INTO photos (imageid, image_name, image)
VALUES (p_id , p_photo_name, EMPTY_BLOB())
RETURNING image INTO dst_file;
-- lock record
SELECT image
INTO dst_file
FROM photos
WHERE imageid = p_id AND image_name = p_photo_name
FOR UPDATE;
-- open the file
dbms_lob.fileopen(src_file, dbms_lob.file_readonly);
-- determine length
lgh_file := dbms_lob.getlength(src_file);
-- read the file
dbms_lob.loadfromfile(dst_file, src_file, lgh_file);
-- update the blob field
UPDATE photos
SET image = dst_file
WHERE imageid = p_id
AND image_name = p_photo_name;
-- close file
dbms_lob.fileclose(src_file);
END load_file;
display image
PROCEDURE display_image(p_id NUMBER) IS
Photo BLOB;
v_amt NUMBER DEFAULT 4096;
v_off NUMBER DEFAULT 1;
v_raw RAW(4096);
BEGIN
-- Get the blob image
SELECT image
INTO Photo
FROM PHOTOS
WHERE IMAGEID = p_id;
owa_util.mime_header('images/jpg');
BEGIN
LOOP
-- Read the BLOB
dbms_lob.READ(Photo, v_amt, v_off, v_raw);
-- Display image
htp.prn(utl_raw.cast_to_varchar2(v_raw));
v_off := v_off + v_amt;
v_amt := 4096;
END LOOP;
dbms_lob.CLOSE(Photo);
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;
END;
The url I enter is: http://webdev:7777/tisinfo/tis.tiss0011.Display_Image?p_id=1Just a little more information. When I enter owa_util.mime_header('image/jpeg') I can't display the file. It just shows up with a red x for the file.
When I enter owa_util.mime_header('image/jpg') it displays the file, but in the format
¿¿¿¿JFIF¿¿-Intel(R) JPEG Library, version [2.0.16.48]¿¿C
This is the way I would expect it to look if I opened it with Notepad, or an application that doesn't recognize jpg files. Can anyone tell me what I am doing wrong?? Thanks. -
Dynamic creation of table with variable field-names
HI
I am looking for a way in order to create a table during runtime. The problem is that the field names of the table are provided in another table.
TO illustrate the case at hand, an example:
The initial table contains the fields
UserID - attribut_name - attribute_value
Example Data
d00587 - first_name - Jon
d00587 - last_name - Smith
d00587 - age - 48
d00127 - first_name - Jack
d00127 - last_name - Daniels
d00127 - position - Manager
Now I need to create a table per User that looks as follows:
for user d00587
first_name - last_name - age
**Values
Jon - Smith - 48
for user d00127
first_name - last_name - positioin
Jack - Daniels - Manager
I split the initial table by sorting it according to userID and then looping into an itab with an AT END OF userid, thus I receive the table per user:
Example iTab
UserID - attribut_name - attribute_value
Example Data
d00587 - first_name - Jon
d00587 - last_name - Smith
d00587 - age - 48
However I have no clue on how to create a new internal table with field-names = attribute_name.
Does anybody have an idea or example code for this?
Thanks a lot for your help,
Kind regards,
MingoloHello Minima
Here is some sample coding:
DATA:
gt_fcat type lvc_t_fcat,
gdo_data TYPE REF TO data.
FIELD-SYMBOLS:
<gt_itab> TYPE table.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'MARA'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_BYPASSING_BUFFER =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
* I_STYLE_TABLE =
it_fieldcatalog = gt_fcat
IMPORTING
ep_table = gdo_data
* E_STYLE_FNAME =
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ASSIGN gdo_data->* TO <gt_itab>.
In your case, you would call the function module with your tables (D00587, D00127). Remove all fields from the fieldcatalog that you do not need before calling the static method.
Regards
Uwe
Maybe you are looking for
-
Where did the halftone screen settings go?
I've just downloaded Photoshop CS5 and am desperately seeking the halftone screen settings. It used to be in the print dialogue, but it's no more there. Where did it go? And yes, I have chosen a PostScript printer.
-
Suggest file name in JFileChooser?
I'm a newbie (student) to both Swing and Java in general. In using JFileChooser, It occurred to me that it would be nice to offer a suggested file name when saving files. For those of you who have used MS Word, when one saves a new file, Word offers
-
Hello gurus, what is score board and how do we create it? Priya
-
I need a report to know how many suppliers have registered on our Portal (ROS) with the details like their name,address,status (accepted or rejected),product categories for which they had registered etc. We are using SRM 7.0
-
i am using Eclipse. i installed Java EE 1.6.24. However, i cannot access: javax.persistence.*, it doesn't even show up in content assist. i realized this could be an Eclipse thing, but does anyone have anything else i can check? should i go look in t