Abap MDM API - get table fields and types
Hi gurus,
dealing with a simple task for my development... I need to retrieve, for a given MDM table name, a list of field's names with their data types in Value_pair format.
Basically, this is what RETRIEVE method does; but:
- I don't need any value; I just need to know which fields build up the table (in order to create entries for that)... Let's say that I'm interested in the CODE and the TYPE fields of an MDM_NAME_VALUE_PAIR structure describing each field of my MDM table.
- I can't workaround extracting a certain index (say, the first) from the table using a RETRIEVE, as the target table could also be empty.
How to do that?
Thanks in advance
Hello Binori,
Thanks a lot for the immediate reply!
I have connected MS SQL server mgmt studio to MAP tool, as you have already mentioned!
How do I get access to MAP's db, since I need data from MAP's db in our application db, and our application is purely java based.
For ex: I need data of all Operating Systems, Performance metrics, Server name, Hardware Configurations etc.
Thanks in advance,
Sheetal
Similar Messages
-
Abap MDM API query with OR operation
Hi experts,
not sure this is the proper section for the thread, anyway; dealing with ABAP MDM API, is there a way to build up a query which involves several clause in OR conjunction?
This is the scenario: I've got to extract several items on the basis of exact product codes. Tipically, I've got huge vectors of hundreds of product codes; actually, I could easily retrieve data by looping over them and, for each code, perform a query on MDM via QUERY method building the clause as follows:
ls_query-parameter_code = 'MDMSRM_PART_NO'. "Field code
ls_query-operator = 'EQ'. "Contains
ls_query-dimension_type = mdmif_search_dim_field. "Fieldsearch
ls_query-constraint_type = mdmif_search_constr_text. "Text search
lv_text = wa_codes-product_code.
GET REFERENCE OF lv_text INTO ls_query-value_low.
APPEND ls_query TO lt_query.
This will however result in hundreds of query in the LOOP itself.
Is there any way to build a query with OR operators ?
Thanks,
M.Hi,
I see you are not clearing your local structure "ls_query". This could be reason of problem, try this and let us know the result:
DATA lt_query TYPE mdm_query_table.
DATA ls_query TYPE mdm_query.
DATA lv_search_text TYPE string.
DATA lt_result_set TYPE mdm_search_result_table.
DATA ls_result_set LIKE LINE OF lt_result_set.
Fill query structure with FIRST parameter
ls_query-parameter_code = 'Name'.
ls_query-operator = 'CS'.
ls_query-dimension_type = mdmif_search_dim_field.
ls_query-constraint_type = mdmif_search_constr_text.
lv_search_text = 'BMW'.
GET REFERENCE OF lv_search_text INTO ls_query-value_low.
APPEND ls_query TO lt_query.
CLEAR ls_query.
Fill query structure with SECOND parameter
ls_query-parameter_code = 'Model'.
ls_query-operator = 'CS'.
ls_query-dimension_type = mdmif_search_dim_field.
ls_query-constraint_type = mdmif_search_constr_text.
lv_search_text = '2009'.
GET REFERENCE OF lv_search_text INTO ls_query-value_low.
APPEND ls_query TO lt_query.
CLEAR ls_query.
Query on records (search for value 'BMW' model '2009' in table Products)
CALL METHOD lr_api->mo_core_service->query
EXPORTING
iv_object_type_code = 'Products'
it_query = lt_query
IMPORTING
et_result_set = lt_result_set. -
Link B/W table field and Applications
hi
Is there any transaction for Link B/W table fields and Applications.
regards,
pavan.Hi
If you starts from delivery you can find the sales order number and item in LIPS table: LIPS-VGBEL and LIPS-VGPOS, if you need to start from sales order it should be better to use the table VBFA (document flow) and search the next document of sales order VBFA-VBELN and VBFA-POSNN with VBFA-VBTYP_N = 'J'
Max -
want to buy a iphone 4 in asia, can i get swedish meny and lett, want to buy a iphone 4 in asia, can i get swedish meny and type board, want to buy a iphone 4 in asia, can i get swedish meny and dash board
Why are you repeating over and over?
Nobody can understand what you are looking for.
Now. I assume you are looking to buy a factory unlocked iphone? You can easily to go U.K and get it from there. -
Help with writing and retrieving data from a table field with type "LCHR"
Hi Experts,
I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
Thanks in advance,
C
SAVING THE LIST DATA TO DB
DATA: L_WA(800).
LOOP AT T_TAB into L_WA.
ZDBTAB-DATALEN = STRLEN( L_WA ).
MOVE: L_WA to ZDBTAB-RAWDATA.
ZDBTAB-LINENUM = SY-TABIX.
INSERT ZDBTAB.
READING THE DATA FROM DB
DATA: BEGIN OF T_DATA,
SEQNR type ZDBTAB-LINENUM,
DATA type ZDBTAB-RAWDATA,
END OF T_TAB.
Select the data.
SELECT linenum rawdata from ZDBTAB into table T_DATA
WHERE repid = w_repname
AND rundate = w_rundate
ORDER BY linenum.
Populate calling Internal Table.
LOOP AT T-DATA.
APPEND T_DATA to T_TAB.
ENDLOOP.Hi Anuj,
The unicode flag is active.
When I run our report and then to try and save the list data a dump is happening at the following point
LOOP AT T_TAB into L_WA.
As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
When I try to load a saved list the dump is happening at the following point
APPEND T_DATA-RAWDATA to T_TAB.
T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
Regards
C -
How to get table fields programatically?
I am using a table component with associated data provider. In the same form, I need to have a drop down with the values same as the columns/fields of the table. I am looking at the APIs to find a way to access the table fields/columns, so that I can have them in the drop down, but I can't find out.
Please note that I need to access the field names (i.e First_Name, Last_Name, User_Name, etc.) not the field values (i.e Joe, Bloe, jbloe, etc.) If it was field values, there are tons of example out there. Actually, I am trying to build searhing, where users can pick a field from the drop down, and type text to search on that field. See the screenshots here:
http://bedriven.blogspot.com/2006/08/filtering-data-table-in-java-studio.htmlI tried this:
tableRowGroup.getSourceData().getFieldKeys()but, the problem is, it gives me the field names, but not the display values. I want to use the display values (i.e Last Name) for dropdown text, and field keys (i.e user_last_name) for dropdown values.
I ended up using this code to get the list of column fileds (field name in database) and the column header (display value in table header):
Iterator it=getTableRowGroup1().getTableColumnChildren();
Option options[]=new Option[getTableRowGroup1().getColumnCount()];
int i=0;
while (it.hasNext()){
TableColumn column=(TableColumn)it.next();
if (column.getSort()!=null){
options=new Option(column.getSort().toString(), column.getHeaderText());
}else{
options[i]=new Option(column.getHeaderText(), column.getHeaderText());
i++;
This approach works fine. The only problem is that getTableColumnChildren returns size 0 when the page is loaded the first time. It works fine on the subsequent post backs. You can see this reported by other users as well:
http://swforum.sun.com/jive/thread.jspa?threadID=101630&tstart=0 -
Server return code 0x80020004 : Error reading fileu201D from ABAP MDM API
Hello,
I am trying use ABAP APIs to create records in a qulifier table in SRM MDM catalog . The tabel i am trying to update is Contract price. it has 4 non qualifier fields and 5 qualifier fields. I am using below code to create it.
CALL METHOD lr_api->mo_core_service->create_simple
EXPORTING
iv_object_type_code = 'MDMSRM_CONTRACT_PRICE'
is_ddic_structure = ls_retrive
IMPORTING
ev_new_internal_id = lv_key.
But it retuns an exception cx_mdm_server_rc_code : Server return code 0x80020004 : Error reading file . My ID has admin auth in MDM data manger and able to create recrds direclty in data manager. But API retuns an error.
Requst you to help me ith this . Please advice if i have posted it in wrong section.
Thanks,
DIvya.done. This API is working from MDM7 version, not available in MDM5
-
Get Table fields name for an SAP table
hi,
i need to pass SAP table name as a parameter to the selection screen of a Report program.
This prog shud give me the table Fields name along with type and length.
Is there any standard SAP report program for the same or i have to write my own logic?
Please advise.
regards,
ags.Hi,
For your requirement you have to write own program in dynamic manner by using field symbol concept.
Use this FM DDIF_FIELDINFO_GET and get the field information of database table.
call function 'DDIF_FIELDINFO_GET'
exporting
tabname = <master> u201C Table name
Tables
DFIES_TAB = <table_field> u201C here you will get field information of table
exceptions
not_found = 1
internal_error = 2
others = 3.
if sy-subrc <> 0.
message text-005 type 'E' .
endif.
Loop <table_field> assignigng <field>
*---here you have to collect the relevant information that you are going to display in your output.
Endloop.
Use any one of ALV or OOALV and display your records.
Regards,
Peranandam -
Need to create an ABAP query on 2 tables BSIK and BSAK
Hi,
I need to create an ABAP query which has the fields document no, doc date, amount in doc currency and some other fields from 2 tables BSIK and BSAK. Is it possible to write a single abap query to fetch the data from both the tables.
The selection screen fields are doc number, date and doc type.
I need to display invoices for open items and cleared items together.
Please let me know if this is possible.
Thanks and Regards,
AjithSee if this is anything like what you need:
REPORT ztest MESSAGE-ID 00.
TABLES: bkpf, bseg.
SELECT-OPTIONS: s_bukrs FOR bkpf-bukrs,
s_belnr FOR bkpf-belnr,
s_gjahr FOR bkpf-gjahr,
s_blart FOR bkpf-blart,
s_budat FOR bkpf-budat.
DATA: BEGIN OF bkpf_int OCCURS 0.
INCLUDE STRUCTURE bkpf.
DATA: END OF bkpf_int.
DATA: BEGIN OF bseg_int OCCURS 0.
INCLUDE STRUCTURE bseg.
DATA: END OF bseg_int.
DATA: BEGIN OF bsik_int OCCURS 0.
INCLUDE STRUCTURE bsik.
DATA: END OF bsik_int.
SELECT *
FROM bkpf
INTO TABLE bkpf_int
WHERE bukrs IN s_bukrs
AND belnr IN s_belnr
AND gjahr IN s_gjahr
AND blart IN s_blart
AND bldat IN s_budat.
SORT bkpf_int BY bukrs belnr gjahr.
SELECT *
FROM bseg
INTO TABLE bseg_int
FOR ALL ENTRIES IN bkpf_int
WHERE bukrs = bkpf_int-bukrs
AND belnr = bkpf_int-belnr
AND gjahr = bkpf_int-gjahr
AND koart = 'K'.
SORT bseg_int BY bukrs belnr gjahr buzei.
LOOP AT bseg_int.
MOVE-CORRESPONDING bseg_int TO bsik_int.
READ TABLE bkpf_int WITH KEY
bukrs = bseg_int-bukrs
belnr = bseg_int-belnr
gjahr = bseg_int-gjahr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE-CORRESPONDING bkpf_int TO bsik_int.
APPEND bsik_int.
ELSE.
MESSAGE e001 WITH 'Error during read'.
ENDIF.
ENDLOOP.
Rob -
Table field and structure field
Hi ,
I am working on an user exit.
I have to update a field on the transaction screen DFBATCH-MHD_IO (DFBATCH is a struture).
Now the same field is defined in table MARA-VFDAT (MARA is a table).
Now in the user exit function module I have written a code which will update the table field MARA-VFDAT.
So will the structure field also gets updated automatically since that structure field is same as the table field (only name is different) or I have to explicitly equate table field to structure field.
Raghu.How do you know that DFBATCH-MHD_IO is tied to MARA-VFDAT. Is there a line of code in the transaction like this.
MARA-VFDAT = DFBATCH-MHD_IO.
or
DFBATCH-MHD_IO = MARA-VFDAT.
If you are updating MARA-VFDAT from your userexit, and the existing code in the transaction is filling the DFBATCH-MHD_IO from MARA-VFDAT, then no you shouldn't need to fill it.
Regards,
Rich Heilman -
How to get equipment number and type for given PM order
hello all,
i know the PM order number and corresponding object number (like OR9100000175),
now using these how do i get equipment number and equipment type..
do i need to use any function module...
thanks in advance...From VBAK table with order number AUFNR, get notification no - QMNUM.
From QMIH table with this notification no QMNUM, get equipment no - EQUNR.
And then from equipment master EQUI, you can get the equipment categeory EQTYP from EQUNR -
I want count "space" token in my table field and separate them
I want count "space" token in my table one field column and separate the word between them.
word are store in another table.
possibly give solution in[b] Postgres DB and Oracle DB
for example
table name search
column name is keyword
keyword
" chinese colaba" --> spaces are 2
" chinese borivali (W)" --> spaces are 3
" deal shoes bandra (E)" --> spaces are 4
and separate word in new table
field
chinese
colaba
chinese
borivali
(W)
deal
shoes
bandra
E)
Message was edited by:
Rajiv_BirariHi,
Can you rephrase you Question..!!
My understanding with your quesiton might be thinking about Partitions or Moving the data to Different tablespace.
Thanks & Regards,
Pavan Kumar N -
Checking of database table field and then update that field
hello there,
In my program I want to check the field 'XRUEM' of database table MARV, If that field is check i.e. 'X' in table then I want to clear that field and then I have to proceed can anyone please guide me in this.Chetan,
Do you have to clear the field XRUEM from database table MARV if it is 'X' ???
or you just want to clear this field in the report?? Please do specify.
To clear field from database table MARV us UPDATE command (Please be careful... one should not make changes in master tables using reports)
To clear runtime contents of a filed in the report use CLEAR command.
Let me know if this doesnt clear your doubt.
Thanks. -
API to restric size and type documents uploaded
Hi Guys,
I'd like to know if exists any api to restrict the each document size and type, when you upload it?
For example, load anly documents type .pdf with size no higher than 4K.
Thanks.
Ciao.Liliana.How about using folder quotas to tackle the size issue? As for file types, I'm not sure on how this could be done.
-
Sort table field from type character
Hi all,
I have a database table where a specific field (e. g. ID) is specified as character.
This field contains a number.
Now I want to get the highest ID which is available in the database table.
This statement does not work, because the max value is only determined by the first character.
SELECT single * FROM <table>
INTO <workarea>
WHERE id = (
SELECT MAX( id ) FROM <table>
Example: Entries in database table
ID
1
10
2
3
The max value is here then 3 and not 10. -> only the first character will be checked
Any ideas?
regards>
VENKATESWARAREDDY D wrote:
> Hai,
>
> Here matnr is a character data type.
>
> data matnr type matnr.
>
> select max( matnr ) from mara into matnr.
>
> write: matnr.
>
>
>
> Regards,
> Venkat
Never forget: if a materialno. consist of digits only, the database value will have leading zeroes. And then it will work. In this case there are no leading zeroes, so character 3 is bigger than 10.
If there were leading zeroes, then 10 would be bigger then 03.
Maybe you are looking for
-
Mini-Display Adapter Not Working?
Hello, Has anyone had issues with the Apple mini-display to Dual-Link adapter? Any problems getting it connected to the DVI cable (very tight fit) or have a dead on arrival adapter? I have a Mac Pro 6-core. I just received my 27-inch monitor and plug
-
Since updating to Mavericks it's very hard for me to get a complete Time Machine backup. Time Machine is backing up to an AEX moubnted harddrive and I never had any problems before the update. Now most backups will stall and I;ll notice a few days la
-
Hi to all, This is my first time here. I am having a problem that I've never had before. I am attempting to upload images to Flickr, which I do daily without trouble. However, this time I'm getting the message: "The selected original image is either
-
Getting an error when trying to restore iPod Touch 2g
When I'm trying to restore my iPod touch 2g, I keep getting the following error: An error occured while restoring this iPod (-402620415). I called support but my phone support warranty has run out and I don't want to pay $30 to have this problem look
-
Supplementary characters and string functions
I am using AL32UTF8 as my database character set and plan to store Japanese supplementary characters in the DB character set itself. Do I need to use any special string functions for these supplementary Japanese characters.