CMP additional field in join table
I'm sorry if this question was already post on the forum, but I could not find any answer....
I have an existing application which is using CMP entity beans.
A and B have a many to many relation, then the relation is mapped to a join table with 2 columns (key of A, key of B)
I need to modify this relation in order to specify the number of B linked to A for a given relation, then adding a column to the join table :
(key of A, key of B, MyParameter)
Is there a way to specify the parameter in the beans ?
Do I have to change my CMP entity bean to BMP beans?
If I do have to use BMP, many other CMP entity beans have relations with one of the beans that I will have to modify to BMP. Will I have to transform all the CMP beans with relation to BMP beans (then almost all the application) to BMP?
Thanks a lot for your answers.
Manohar,
You need to create an append structure for table VBAP (for example ZAVBAP) using SE11. In this structure you create your ZZ fields. If you need a non-SAP domain/data element for your field then you need to create it first using the same transaction and activate it. Attach ZAVBAP to VBAP so the SE11 shows:
.APPEND in the Fields column and
ZAVBAP in the Field type column.
Your ZZ fields will be shown automatically.
When you have finished then activate your ZAVBAP structure. You will notice when you go VA01 (for example) that a lot of programs are being recompiled. Don't worry. It will be ok.
The user-exit screen number for items is 8459 (in program SAPMV45A).
Thanks,
Wojtek
Similar Messages
-
Additional field in join table for CMP EJB
Hello,
I'm trying to perform this task using CMP entity beans:
The entity A has a CMR relation of cardinality m-n with entity B (bidirectional) (This is working fine).
I want to add a parameter to the relation.
Ex : When I find that A1 is linked to B1, I need to perform "x" times an action. x would be my parameter, and I would have kept this parameter as an additional column in the join table A_TO_B.
Could anyone provide an example of how to perform this with CMP EJB?
NOTE: I'm using OC4J 10g 9.0.4 standalone (and cannot change my version).
Thanks
TanguyManohar,
You need to create an append structure for table VBAP (for example ZAVBAP) using SE11. In this structure you create your ZZ fields. If you need a non-SAP domain/data element for your field then you need to create it first using the same transaction and activate it. Attach ZAVBAP to VBAP so the SE11 shows:
.APPEND in the Fields column and
ZAVBAP in the Field type column.
Your ZZ fields will be shown automatically.
When you have finished then activate your ZAVBAP structure. You will notice when you go VA01 (for example) that a lot of programs are being recompiled. Don't worry. It will be ok.
The user-exit screen number for items is 8459 (in program SAPMV45A).
Thanks,
Wojtek -
Hi Experts,
How to add additional field into output table VENDORS/WH TAX TYPES AND CODES in RFIDYYWT(Generic Withholding Tax Reporting).
I have no idea how to start with, please give some advice.
Thanks!
IceDear Ice,
Use Append structure, see given link:
https://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eb61446011d189700000e8322d00/content.htm
Regards,
Abbas. -
Choose field from joined table based on another field?
Good morning!
Is it possible to select a field from a joined table row based on another field? Consider the following data in the CVALUES table:
ID C1 C2 C3 C4 C5 C6
T1 9.6 10.3 12.4 19.6 19.6 0
T7 9.6 10.4 0 0 0 0
T3 8.2 9.9 11.4 19.6 19.6 0
T8 8.3 10.7 13.5 20.7 0 0
T5 9.4 10.3 12.7 22.9 19.6 0
...And the following data in the MDETAIL table:
ID MDATE CNUM ...
T1 03/28/2012 18:00:00 4
T1 03/28/2012 18:00:00 1
T8 03/29/2012 06:00:00 6
T8 03/29/2012 06:00:00 5
...I want to get the column from CVALUES corresponding to the CNUM field in the MDETAIL table. I'm currently doing this:
SELECT m.t1, m.mdate,
CASE WHEN m.cnum = 1 THEN c.c1
WHEN m.cnum = 2 THEN c.c2
WHEN m.cnum = 3 THEN c.c3
WHEN m.cnum = 4 THEN c.c4
WHEN m.cnum = 5 THEN c.c5
WHEN m.cnum = 6 THEN c.c6 END AS cvalue
FROM mdetail m
JOIN cvalues c ON m.id = c.idThe records in the CVALUES table are unique; only one row per ID.
This method works, and it's fast but it's messy code and I think there has to be a better way to do it. I use the cvalue value in several calculations so every calculation I use it in has this giant glob of CASE in it!Since you're comparing the same column against scalar values, the CASE statement could be simplified in a similar way :
CASE m.cnum
WHEN 1 THEN c.c1
WHEN 2 THEN c.c2
WHEN 3 THEN c.c3
WHEN 4 THEN c.c4
WHEN 5 THEN c.c5
WHEN 6 THEN c.c6
END AS cvalueSince performance is not the issue here, now it depends on what you consider "more readable".
Using a one-liner piece of code certainly makes the query looks less bulky, but I won't be so sure about readability and immediate understanding. -
VT01N User exit for adding additional field to VTTP table and populate the
Hi,
Can any one sujjest what is the use exit/bapi when we add(append) a custom field to vttp table to populate the incremental number based on ship to address when we create a shipment..
need user exit in ...............to populate data to vttp table custom field when we append......hi,
check these exits for vt01n.
Transaction Code - VT01N Create Shipment
Enhancement/ Business Add-in Description
Enhancement
V56USVDP Preparation for updating new objects for transport?
V56USVDO Update new objects for transport
V56USTAT User-individual definition of transportation planning status
V56UNUMB Shipment number allocation
V56UDLUP Obsolete as of 4.6C: Delivery Update on Delivery Routines
V56UCHCO Check shipments are complete
V56UCHCH Shipment processing: Check whether changes were made
V56TDLIF Filter Delivery Items for Shipment
V56SLDET Shipment processing: Leg determination
V56MVT04 Extensions for Collective Processing of Shipments
V56LOCID Shipment Processing: Determine Location Identification
MV56AINI Initialization of transaction control for transportation
V56AFCCH Shipment processing: Check function code allowed
V56AGTAR User Exit for Filtering Shipping Unit Calculation
V56ARCHV Customer-spec. checks for archiving shipments
V56ATKTX Change the number of lines for text input in shipment
V56BMOD Transportation processing: Field modification
V56DISTZ Shipment Processing: Determine Distance
V56FCOPY Shipment processing: Copy delivery data
V56FSTAT Shipment processing: Activities when setting a status
V56L0001 Status of Shipments for a Delivery
V56LDELI Read Delivery Data for Shipment Processing
Business Add-in
BADI_LE_SHIPMENT BadI: Shipment Processing
BADI_V56N User Exit for Message Determination: Shipment -
Unbound fields in a table built with rfc model
Hi,
I would like to have unbound fields in a table in addition to the fields that are coming from the model.
I have a model from an RFC function. I use this to build a table. There are 5 columns. This works fine. I would like to add two additional columns to the table that have their data coming from elsewhere (not from the rfc function).
I've tried using the wdDoModifyView as below:
IWDTextView text = (IWDTextView)view.getElement("TextView2");
text.setText("This is the text");
The problem here is that the value is shown on all the rows, not just one.
And if I try to use the object that contains the getters and setters for the table data, these additional unbound fields do not have the getters and setters.
How can I get to these unbound fields so I can fill them in a loop ? Can I create additional fields in the model so I can bind them to the context ?
I do not wish to change the rfc code to have these additional fields in there. I am also not able to add fields to the model by hand (should I be able to ?).
Any help greatly appreciated
Kind Regards,
Jari PakarinenThanks.
I will need a clarification though
Here is the code snippet from wdDoInit():
for (Iterator iter = list.iterator(); iter.hasNext();) {
Object skeduLine = iter.next();
StringTokenizer toker = new StringTokenizer(((Ztab4000)skeduLine).getWa(), "t");
Zmaterials zMats = new Zmaterials();
String blaa = (toker.nextToken().split("\,"))[0];
if (blaa.indexOf('.') != -1);
blaa = blaa.replaceAll("\.", "");
zMats.setWmeng(Integer.parseInt(blaa));
zMats.setEtdat(getDate(toker.nextToken()));
zMats.setMatnr(toker.nextToken());
zMats.setKdmat(toker.nextToken());
wdContext.nodeZ_Rfc_Schedagrt_Save_Input().currentZ_Rfc_Schedagrt_Save_InputElement().modelObject().addMaterials(zMats);
I'm going thogh a list that contains String objects.
Each String object contains fields separated by a tab. There are 6 fields, and 4 of them are going to the Zmaterilas object, and the rest 2 should be put to the additional fields of the table.
I create the Zmaterials (table contents minus the additional fields) object and populate these fields with the 4 fields of data.
How should I put the additional data to the table here ?
Kind regards,
Jari -
Standard fields in Total Table (FAGLFLEXT)
Hi,
can I add standard fields (like BLART - Document Type) to the Totals Table without create a new customer field???
Thanks
Stefano d
Message was edited by:
Stefano de Angelis
Message was edited by:
Stefano de AngelisDear Stefano,
You should avoid such modication to SAP Standard system, you can add the additional fields at the end of table but note that you are going to perform a modificarion which will probably need some adjustemt in the future (when importing a support package of during system upgrade).
I recommend to add the additional fields under a table append. The appended structures does not change the standard table definition.
i hope this helps.
Lucio Rodrigues -
SAP Query - Additional field that collects information from table RESB
Hello gurus. I have a question.
I want to create a SAP Query that shows me the stock level of a list of materials, and also show me the total quantity of order reservations in an additional field.
I created an InfoSet with table MARD, which is the one that holds the Stock information in a plant. Then I created an additional field which would read information from table RESB, the table that holds order reservations per material.
So I wrote this piece of code:
SELECT * FROM RESB
WHERE MATNR EQ MARD-MATNR and
WERKS EQ MARD-WERKS.
ENDSELECT.
if ( sy-dbcnt NE '0').
MOVE RESB-BDMNG to ZQTY.
ELSE.
MOVE '' to ZQTY.
ENDIF.
This works fine. However, this is currently just catching the first record in table RESB that matches my condition.
What I would like is to collect every instance of RESB-BDMNG and add them to field "ZQTY", have it loop in RESB until it finishes finding every record that match the MATNR and WERKS. With this I could get the total number of order reservations that this material has in that table.
Could someone share some coding that would help me achieve this?Yes! That did it. That's what I needed to do. Thank you so much.
While I'm at it, let me ask you a related question.
When I execute the query, in the first records of the query where there's no value from RESB to transfer, the value of field ZQTY appears empty. Once it finds the first record in RESB and it populates ZQTY with a value, then the rest of the records with no hit get the proper value of 0.
Do you know why the first records in the query appear empty and not with a 0? Is there anything I should add to the coding to fix this? -
In SQ02 after joining table if we want write condition on other field how ?
In SQ03 after joining table if we want write condition on some fields
for filtering records then what is the procedure.Please check forum subject. This is not a right forum for your question. Close your thread and post it on a proper forum.
Thanks,
Gordon -
"Additional Text" set for messageTextInput fields in Classic Table
i have set "Additional Text" for messageTextInput fields in Classic Table and am expecting that to display when the mouse is hovering on that field. however, that is not happening...
what am i doing wrong ? and what can i do to achieve that (NOTE - i cannot do either short or Long Tip because that looks wierd when data is displayed in a table (multiple rows))
thank you.
UPDATE - could anyone tell me where/when/how does the "Additional Text" data get displayed when the page is rendered ? there is hardly any info on this in the devguide and forum. If "Addtional Text" is not the right way to provide additional information on a field what else can be used (note these fields are in a classic table so i cannot use short/long tip)......
Edited by: user11972136 on Feb 4, 2013 10:33 AMHi,
I tried this case and its working for me.
Could you tell us what version of Jdev and OAF you are using? There might be some issue with that version.
Regards,
Sandeep M. -
Addition of field to FISL table
Hello,
Can I modify the special purpose ledger table by adding a field ? will it create problem ? What precaution we need to take for this?
Thanks in advanceYou can refer this help to add a field to a standard table.
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb61446011d189700000e8322d00/frameset.htm
But more importantly you should find how would you populate the data in that additional field.
Like, you should find a user exit in the standard program/transaction which populates the FISL table.
Regards,
Ravi Kanth Talagana -
Problem with joining tables in cmp bean
This is for an informix database. when i specify to join tables in CMP beans i get a sql error.. this is what the SQL join statement looks like when the server spits it out:
SELECT t0.id, t0.name, t0.available, t0.available_date FROM drs_product t0, outer drs_category t1 ON t0.style=t1.style WHERE t0.available = 'T'
it puts the "ON" string into the join?? this gives me a SQL error, it's supposed to be like this:
SELECT t0.id, t0.name, t0.available, t0.available_date FROM drs_product t0, outer join drs_category t1 WHERE t0.style=t1.style AND t0.available = 'T'
how can i fix thisnevermind..i figured it out again.. in the INFORMIX DYNAMIC SERVER.properties file replace the left join attribute with this:
LEFT_JOIN= left join
make sure there is a space before the "l" in left and a space after the "n" in join, otherwise it will be a sql error:
the previously LEFT_JOIN=, outer statement is clearly wrong for this database. -
hi all,
how to join 7 different table fields to final data? i need to pass all 7 table fields to final .
can u guys help me out thru code.
TYPES : BEGIN OF TY_FINAL,
LDDAT TYPE VBEP-LDDAT,
WERKS TYPE VBAP-WERKS,
LIFSK TYPE VBAK-LIFSK,
BSTKD TYPE VBKD-BSTKD,
AUART TYPE VBAK-AUART,
AUDAT TYPE VBAK-AUDAT,
VBELN TYPE VBAK-VBELN,
POSNR TYPE VBAP-POSNR,
KUNNR TYPE VBPA-KUNNR,
MATNR TYPE VBAP-MATNR,
WMENG TYPE VBEP-WMENG,
NETWR TYPE VBAK-NETWR,
AUGRU TYPE VBAK-AUGRU,
FAKSK TYPE VBAK-FAKSK,
ARKTX TYPE VBAP-ARKTX,
VKGRP TYPE VBAK-VKGRP,
VKBUR TYPE VBAK-VKBUR,
LIFNR TYPE VBPA-LIFNR,
LIFNR TYPE VBPA-LIFNR-LP,
PERNR TYPE VBPA-PERNR,
LPRIO TYPE VBAP-LPRIO,
INCO1 TYPE VBKD-INCO1,
ABLAD TYPE KUWEV-ABLAD,
BSTDK TYPE VBKD-BSTDK,
ZTERM TYPE VBKD-ZTERM,
WAERK TYPE VBAK-WAERK,
ERNAM TYPE VBAK-ERNAM,
ABGRU TYPE VBAP-ABGRU,
LFGSK TYPE VBUK-LFGSK,
PRSDT TYPE VBKD-PRSDT,
VDATU TYPE VBAK-VDATU,
CHARG TYPE VBAP-CHARG,
VSTEL TYPE VBAP-VSTEL,
LGORT TYPE VBAP-LGORT,
END OF TY_FINAL.
these r da fields of different table
thanks®ards,
sumanth reddy
Edited by: sumanth reddy on Feb 26, 2009 4:37 PMhi
declare 7 internal tables for ur 7 tables and one final internal table to hold all the data.
like
select vbeln vbtyp erdat kunnr vkorg vtweg spart from vbak
into table i_vbak.........
select vbeln posnr matnr arktx werks kwmeng from vbap
into table i_vbap for all entries in i_vbak where vbeln = i_vbak-vbeln.....
select vbelv posnv erdat vbeln posnn matnr vbtyp_n from vbfa
into table i_vbfa for all entries in i_vbap where vbelv = i_vbap-vbeln....
select vbeln posnr rfsta from vbup into table i_vbup for all entries in i_vbfa
where vbeln = i_vbfa-vbelv......
select vbeln posnr kwmeng from vbap into table i_vbap1 for all entries in i_vbfa
where vbeln = i_vbfa-vbeln.....
select vbeln posnr gbsta from vbup into table i_vbup1 for all entries in i_vbap1
where vbeln = i_vbap1-vbeln.....etc
and while looping into the final internal table
loop at i_vbap.
move i_vbap-vbeln to i_final-vbeln.
move i_vbap-posnr to i_final-posnr.
read table i_vbfa with key vbelv = i_vbap-vbeln
posnv = i_vbap-posnr.
if sy-subrc = 0.
move i_vbfa-vbeln to i_final-vbeln1.
move i_vbfa-posnn to i_final-posnn.
endif.
read table i_vbap1 with key vbeln = i_final-vbeln1
posnr = i_final-posnn.
if sy-subrc = 0.
endif.
read table i_vbap1 with key vbeln = i_final-vbeln1
posnr = i_final-posnn.
if sy-subrc = 0.
endif.
read table i_vbup with key vbeln = i_vbap-vbeln
posnr = i_vbap-posnr.
if sy-subrc = 0.
endif.
read table i_vbak with key vbeln = i_vbap-vbeln
binary search.
if sy-subrc = 0.
endif.
append i_final.
endloop.
u have to read all the internal tables based on the key common fields and put into final itab.
Regards
Regards -
Join table with additional data
Hi,
I'm new to JPA (Toplink Essentials) and I'd like to know how to handle this situation:
I have ORDER table, ITEMS table and "join table" ORDER_ITEMS which holds refernces to ordered items with quantity of each oredered item.
Many thanksI did mapping as shown in listing. It works for reading, but for writing JPA returns error. Can somebody help?
Thanks
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Column name 'idexpedice' appears more than once in the result column list.
Error Code: 264
Call: INSERT INTO vklad_expedice (IDEXPEDICE, IDVKLAD, VAHA, idexpedice, idvklad) VALUES (?, ?, ?, ?, ?)
bind => [null, null, 0, 4411, 2]
@Entity
public class Expedice implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer idexpedice;
@Temporal(TemporalType.DATE)
private Date datum;
@OneToMany(fetch = FetchType.EAGER, mappedBy="expedice", cascade = CascadeType.ALL)
private List<ExpediceVklad> vklady;
@Entity
public class Vklad implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer idvklad;
private String nazev;
@Entity
@Table(name = "vklad_expedice")
@IdClass(ExpediceVkladId.class)
public class ExpediceVklad implements Serializable {
@Id
private Integer idexpedice;
@Id
private Integer idvklad;
private Integer vaha;
@ManyToOne
@JoinColumn(name = "idexpedice")
private Expedice expedice;
@ManyToOne
@JoinColumn(name = "idvklad")
private Vklad vklad;
public class ExpediceVkladId {
@Id
private Integer idexpedice;
@Id
private Integer idvklad;
SQL tables
EXPEDICE
idexpedice
datum
VKLAD
idvklad
nazev
VKLAD_EXPEDICE (this is the join table with additional column)
idexpedice
idvklad
vaha
Edited by: user10933983 on 31.3.2009 13:47 -
SQVI - Join tables using similar fields (but not same)
Hi folks!
I would like to know if there is a way to do a join between two tables thru fields that are similar but not exactly the same. For example, I need to join tables EKKO and CDHDR, where the PO numbers do exist in both the tables (EKKO-EBELN and CDHDR-OBJECTID), but the fields are different. Is it possible to achieve such kind of a join?
Appreciate your help.
Regards,
Anwar.>
Mohammad Anwar wrote:
though their data type is the same (CHAR).
unfortunately it is not enough... You have to select separately from the two tables and merge the data somehow in the program.
Maybe you are looking for
-
Can I use this phone in Germany with a *local* SIM card for local rates if I get Verizon to unlock it or do I have to wait for the ever-elusive upgrade for this to be possible? I have been with Verizon since 2006, my original HTC Incredible has been
-
Security deposit - Setting restriction automatically after payment
Hello, After Iu2019ve created a security deposit (FPSEC1) and paid it for example with the cash desk. What I understand is that before you can release the security deposit you first have to u201Clocku201D the deposit using FPSEC2. This sets the restr
-
Contact or Custom List - How to: Checkbox Results Link to Other Sharepoint Sites or Pages
Hi, I am building a fairly simple employee contact list with the following column headers: Employee Name, Location, Department. For the location and department I am using the checkbox option with preset options (location: California, Nevada, etc. dep
-
How can I get a playlist created on my iPad to iTunes?
I create a playlist on the iPad... I love it... I want it on the iPhones in my household. How can I get that playlist into iTunes, so I can push it out to the other iOS devices? When I sync the iPad with iTunes, the playlist created on the iPad is wi
-
Bootcamp: The installer disc could not be found
I have downloaded Windows 8 to a flash drive and the installer doesn't recognize it. What should I do?