Bdc transaction problem
hi,
i am create a programm for f-27 type DG by bdc session method
when i execute it on 3rd screen of execution it ask for the values for PAYMENT TERMS but in manual entry OF F-27 it does not TAKE ANY PAYMENT TERMS. plz check my code and tell me where is the problem in coding.
CODES:
REPORT zcrdtdgupld
NO STANDARD PAGE HEADING LINE-SIZE 255.
*INCLUDE zdata_declarations.
I N T E R N A L T A B L E *
DATA: BEGIN OF wa_data,
bldat TYPE BDC_FVAL, "Document Date10
blart TYPE BDC_FVAL, "Document Type
bukrs TYPE BDC_FVAL, "Company Code
budat TYPE BDC_FVAL, "Posting Date10
monat TYPE BDC_FVAL, "Period
waers TYPE BDC_FVAL, "Currency
xblnr TYPE BDC_FVAL, "Reference Field
docid TYPE BDC_FVAL, "Document ID
newbs TYPE BDC_FVAL, "Posting Key
newko TYPE BDC_FVAL, "Account Code
wrbtr TYPE BDC_FVAL, "Amount in Documentcurrency
zfbdt TYPE BDC_FVAL, "Baseline Date10
newbs2 TYPE BDC_FVAL, "Account Key2
newko2 TYPE BDC_FVAL, "Account code2
wrbtr2 TYPE BDC_FVAL, "bseg-wrbtr,"Amount2
kostl TYPE BDC_FVAL, " cost center
prctr TYPE BDC_FVAL, " profit center
END OF wa_data.
D A T A *
DATA: it_data LIKE TABLE OF wa_data.
DATA: it_bdcdata TYPE TABLE OF bdcdata.
DATA: wa_bdcdata LIKE LINE OF it_bdcdata.
DATA: v_file TYPE string.
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b.
PARAMETERS : pa_file LIKE fc03tab-pl00_file OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b.
AT SELECTION-SCREEN *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_file.
PERFORM get_file USING pa_file.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
v_file = pa_file.
*uploading flat file into internal table
PERFORM upload_file USING v_file CHANGING it_data.
*open the session
PERFORM open_session.
*POPULATING THE BDCDATA
LOOP AT it_data INTO wa_data.
REFRESH it_bdcdata.
PERFORM bdc_dynpro USING 'SAPMF05A' '0100' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RF05A-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BKPF-BLDAT' wa_data-bldat.
PERFORM bdc_field USING 'BKPF-BLART' wa_data-blart.
PERFORM bdc_field USING 'BKPF-BUKRS' wa_data-bukrs.
PERFORM bdc_field USING 'BKPF-BUDAT' wa_data-budat.
PERFORM bdc_field USING 'BKPF-MONAT' wa_data-monat.
PERFORM bdc_field USING 'BKPF-WAERS' wa_data-waers.
PERFORM bdc_field USING 'BKPF-XBLNR' wa_data-xblnr.
PERFORM bdc_field USING 'FS006-DOCID' wa_data-docid.
PERFORM bdc_field USING 'RF05A-NEWBS' wa_data-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO' wa_data-newko.
PERFORM bdc_dynpro USING 'SAPMF05A' '0301' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BSEG-WRBTR' wa_data-wrbtr.
PERFORM bdc_field USING 'BSEG-ZFBDT' wa_data-zfbdt.
PERFORM bdc_field USING 'RF05A-NEWBS' wa_data-newbs2.
PERFORM bdc_field USING 'RF05A-NEWKO' wa_data-newko2.
PERFORM bdc_dynpro USING 'SAPMF05A' '0300' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.
PERFORM bdc_field USING 'BSEG-WRBTR' wa_data-wrbtr2.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002' 'X'.
PERFORM bdc_field USING 'BDC_CURSOR' 'COBL-PRCTR'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTE'.
PERFORM bdc_field USING 'COBL-KOSTL' wa_data-kostl. "'101902'
PERFORM bdc_field USING 'COBL-PRCTR' wa_data-prctr.
PERFORM bdc_insert USING 'F-27' it_bdcdata.
ENDLOOP.
*close the session
PERFORM close_session.
*& Form get_file
text
-->P_PA_FILE text
FORM get_file USING p_pa_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = syst-repid
field_name = 'PA_FILE'
CHANGING
file_name = pa_file.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " get_file
*& Form upload_file
text
-->P_V_FILE text
<--P_IT_DATA text
FORM upload_file USING p_v_file
CHANGING p_it_data LIKE it_data.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_v_file
filetype = 'DAT'
has_field_separator = '#'
TABLES
data_tab = p_it_data.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " upload_file
*& Form open_session
text
--> p1 text
<-- p2 text
FORM open_session .
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
DEST = FILLER8
group = 'JAYANT'
HOLDDATE = FILLER8
keep = 'X'
user = sy-uname.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " open_session
*& Form bdc_dynpro
text
-->P_0043 text
-->P_0044 text
FORM bdc_dynpro USING program TYPE BDC_PROG
dynpro TYPE BDC_DYNR
dynbegin TYPE BDC_START.
wa_bdcdata-program = program.
wa_bdcdata-dynpro = dynpro.
wa_bdcdata-dynbegin = dynbegin.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0048 text
-->P_0049 text
FORM bdc_field USING fnam TYPE FNAM_____4
fval TYPE BDC_FVAL.
wa_bdcdata-fnam = fnam.
wa_bdcdata-fval = fval.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
ENDFORM. " bdc_field
*& Form bdc_insert
text
-->P_0183 text
-->P_IT_BDCDATA text
FORM bdc_insert USING p_tcode TYPE sytcode
p_it_bdcdata LIKE it_bdcdata.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = p_tcode
TABLES
dynprotab = p_it_bdcdata.
ENDFORM. " bdc_insert
*& Form close_session
text
--> p1 text
<-- p2 text
FORM close_session .
CALL FUNCTION 'BDC_CLOSE_GROUP'.
ENDFORM. "close_session
plz help me in this programm
thanks
jayant.
why not post this in the ABAP forum?
You expect Basis people to help you on this one?
Similar Messages
-
hi folks,
I am having two issues related to the BDC transaction, I have recorded the below transaction using the BDC transaction recorder
'X' 'SAPMP50A' '1000',
' ' 'BDC_OKCODE' '=INS',
' ' 'RP50G-PERNR' REC-PERNR,
' ' 'BDC_CURSOR' 'T582S-ITEXT(01)',
' ' 'RP50G-SELEC(01)' 'X',
' ' 'RP50G-TIMR6' 'X',
'X' 'MP000000' '2000',
' ' 'BDC_CURSOR' 'P0000-MASSG',
' ' 'BDC_OKCODE' '/00',
' ' 'P0000-BEGDA' format_termin,
' ' 'P0000-MASSN' 'TM',
' ' 'P0000-MASSG' zmassg,
'X' 'MP000000' '2000',
' ' 'BDC_CURSOR' 'P0000-BEGDA',
' ' 'BDC_OKCODE' '/00',
' ' 'P0000-BEGDA' format_termin,
' ' 'P0000-MASSN' 'TM',
' ' 'P0000-MASSG' zmassg,
'X' 'MP000000' '2000',
' ' 'BDC_CURSOR' 'P0000-BEGDA',
' ' 'BDC_OKCODE' 'UPD',
' ' 'P0000-BEGDA' format_termin,
' ' 'P0000-MASSN' 'TM',
' ' 'P0000-MASSG' zmassg,
'X' 'MP000100' '2010',
' ' 'BDC_CURSOR' 'P0001-SACHZ',
' ' 'BDC_OKCODE' 'UPD',
' ' 'P0001-BEGDA' format_termin,
' ' 'P0001-ENDDA' '12/31/9999',
*' ' 'P0001-BTRTL' 'SNXP',
*' ' 'P0001-ABKRS' 'GA',
*' ' 'P0001-ANSVH' '04',
*' ' 'P0001-SACHP' 'H13',
*' ' 'P0001-PLANS' '99999999',
' ' 'P0001-SACHZ' 'P99',
*' ' 'P0001-SACHA' '026',
'X' 'MP003500' '2000',
' ' 'BDC_CURSOR' 'P0035-DAT35',
' ' 'BDC_OKCODE' '/00',
' ' 'P0035-BEGDA' format_termin,
' ' 'P0035-ENDDA' '12/31/9999',
' ' 'P0035-BLEHR' ZBLEHR,
' ' 'P0035-DAT35' format_termin,
'X' 'MP003500' '2000',
' ' 'BDC_CURSOR' 'P0035-BEGDA',
' ' 'BDC_OKCODE' '=UPD',
' ' 'P0035-BEGDA' format_termin,
' ' 'P0035-ENDDA' '12/31/9999',
' ' 'P0035-BLEHR' ZBLEHR,
' ' 'P0035-DAT35' format_termin,
'X' 'MP005000' '3000',
' ' 'BDC_CURSOR' 'P0050-BEGDA(01)',
' ' 'BDC_OKCODE' '=DLIM',
' ' 'RP50M-BEGDA' format_termin,
' ' 'RP50M-ENDDA' '12/31/9999',
' ' 'RP50M-ABGRD' format_termin,
' ' 'RP50M-PAGEA' ' 1',
' ' 'RP50M-SELE2(01)' 'X',
' ' 'BDC_OKCODE' '/11',
' ' 'BDC_OKCODE' '/11'.
The process flow:
Menu Path: Human Resources > Personnel Management -> HR Master Data -> Maintain -> Enter
Personnel Number -> Select Actions (0000) Infotype -> Create -> Enter the defined date -> Select Action Termination -> Insert Termination Reason -> Click SAVE -> Insert P99 in Time Administrator field -> click SAVE _->Populate 12/31/9999 in End Date on IT 0035 -> Populate "ELIG" -> Populate Termination Date in DAT 35 -> click SAVE -> Delimit IT 0050.
I have two questions.
Firslty, when I SAVE the data entered for each infotype that action is not getting recorded in the transaction recorder which means that transaction is stopping right after the Actions (0000) infotype as a result the subsequent infotypes are not getting populated even though I recorded the entire process in the transaction recorder.
Secondly, delimit the Time recording info IT0050 I click the delimit button again this action is not recorded in the transaction recorder.
Bottom line: the action related to the buttons(SAVE or DELIMIT) is not getting recorded.
How can I solve this?
Any leads would be helpful
Thanks in advance.\
Vinu.hi folks,
In the thread you have mentioned to add the (termination date)date record to '0050-enda' I did that and I commented the begda portion of it.
As I was examining how the data is getting populated on the screen (for DElimit 0050) by default the termination date is taken into the 'begda' field
That means the screen is getting populated as
03/31/2006 to 03/31/2006 and the second thing is it is throwing an error ' choose the valid function' which means the delimit action is not getting recorded.
How can I solve this problem?
'X' 'MP005000' '3000',
' ' 'BDC_CURSOR' 'P0050-BEGDA(01)',
' ' 'BDC_OKCODE' '=DLIM',
*' ' 'RP50M-BEGDA' format_termin,
' ' 'RP50M-ENDDA' format_termin,
' ' 'RP50M-ABGRD' format_termin,
' ' 'RP50M-PAGEA' ' 1',
' ' 'RP50M-SELE2(01)' 'X',
' ' 'BDC_OKCODE' '/11',
' ' 'BDC_OKCODE' '/11'.
ANY LEADS WILL BE HELPFUL.
THANKS.
VINU -
BDC transaction "The function is not possible"
Dear Experts,
I have made a BDC transaction program according to recording from SHDB in order to have batch transaction for FB50.
However, when I run the program. It shows an error "The function is not possible". But when I press the "Save" button manually, the function passed and result is saved. Just do not know what happens.
report YFB50 no standard page heading line-size 255.
include bdcrecx1.
type-pools : TRUXS.
data : rawdata type TRUXS_T_TEXT_DATA.
parameters: sfile TYPE localfile default 'C:\fb50.txt'.
parameters: plant like BKPF-BUKRS default '1000'.
data: pfile type string.
data: post_date(8) type c.
data: record_count(2) type c.
data: v_HKONT(19) type c.
data: v_SHKZG(19) type c.
data: v_WRBTR(19) type c.
data: v_SGTXT(19) type c.
data: v_KOSTL(19) type c.
*** DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
* If it is nessesary to change the data section use the rules:
* 1.) Each definition of a field exists of two lines
* 2.) The first line shows exactly the comment
* '* data element: ' followed with the data element
* which describes the field.
* If you don't have a data element use the
* comment without a data element name
* 3.) The second line shows the fieldname of the
* structure, the fieldname must consist of
* a fieldname and optional the character '_' and
* three numbers and the field length in brackets
* 4.) Each field must be type C.
*** Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of record occurs 0,
* data element: HKONT
HKONT(010),
* data element: SHKZG
SHKZG(007),
* data element: WRBTR
WRBTR(017),
* data element: SGTXT
SGTXT(050),
* data element: KOSTL
KOSTL(010),
end of record.
*** End generated data section ***
start-of-selection.
pfile = sfile.
concatenate sy-datum+6(2) sy-datum+4(2) sy-datum+0(4) into post_date.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = pfile
TABLES
DATA_TAB = rawdata
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC <> 0.
WRITE:/ 'SY-SUBRC:', SY-SUBRC.
ENDIF.
CALL FUNCTION 'TEXT_CONVERT_CSV_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR = ';'
I_TAB_RAW_DATA = rawdata
TABLES
I_TAB_CONVERTED_DATA = record
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
perform bdc_dynpro using 'SAPMF05A' '1001'.
*Input header information
perform bdc_field using 'BDC_OKCODE'
'/00'.
*Document Date
perform bdc_field using 'ACGL_HEAD-BLDAT'
post_date.
*Posting Date
perform bdc_field using 'ACGL_HEAD-BUDAT'
post_date.
perform bdc_field using 'BDC_OKCODE'
'/ECCDE'.
perform bdc_dynpro using 'SAPLACHD' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
*Company Code
perform bdc_field using 'BKPF-BUKRS'
plant.
perform bdc_dynpro using 'SAPMF05A' '1001'.
*Input header information
perform bdc_field using 'BDC_OKCODE'
'/BU'.
*Document Date
perform bdc_field using 'ACGL_HEAD-BLDAT'
post_date.
*Posting Date
perform bdc_field using 'ACGL_HEAD-BUDAT'
post_date.
*Input item text
loop at record.
*write sy-tabix to record_count.
*concatenate 'ACGL_ITEM-HKONT(' record_count ')' into v_HKONT.
*concatenate 'ACGL_ITEM-SHKZG(' record_count ')' into v_SHKZG.
*concatenate 'ACGL_ITEM-WRBTR(' record_count ')' into v_WRBTR.
*concatenate 'ACGL_ITEM-SGTXT(' record_count ')' into v_SGTXT.
*concatenate 'ACGL_ITEM-KOSTL(' record_count ')' into v_KOSTL.
perform bdc_field using v_HKONT
record-HKONT.
perform bdc_field using v_SHKZG
record-SHKZG.
perform bdc_field using v_WRBTR
record-WRBTR.
perform bdc_field using v_SGTXT
record-SGTXT.
perform bdc_field using v_KOSTL
record-KOSTL.
endloop.
perform bdc_transaction using 'FB50'.
Here is my input:
206090203;H;41.74;abc;MISHK
206090203;H;14.36;abc;FACHK
206100100;S;41.74;def;MISHK
206070100;S;14.36;def;FACHK
Regards,
CatoMake your LOOP.... ENDLOOP... Like this
LOOP AT RECORD.
perform bdc_dynpro using 'SAPMF05A' '1001'.
*Input header information
perform bdc_field using 'BDC_OKCODE'
'/00'.
*Document Date
perform bdc_field using 'ACGL_HEAD-BLDAT'
post_date.
*Posting Date
perform bdc_field using 'ACGL_HEAD-BUDAT'
post_date.
perform bdc_field using 'BDC_OKCODE'
'/ECCDE'.
perform bdc_dynpro using 'SAPLACHD' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
*Company Code
perform bdc_field using 'BKPF-BUKRS'
plant.
perform bdc_dynpro using 'SAPMF05A' '1001'.
*Input header information
perform bdc_field using 'BDC_OKCODE'
'/BU'.
*Document Date
perform bdc_field using 'ACGL_HEAD-BLDAT'
post_date.
*Posting Date
perform bdc_field using 'ACGL_HEAD-BUDAT'
post_date.
*Input item text
**loop at record.
*write sy-tabix to record_count.
*concatenate 'ACGL_ITEM-HKONT(' record_count ')' into v_HKONT.
*concatenate 'ACGL_ITEM-SHKZG(' record_count ')' into v_SHKZG.
*concatenate 'ACGL_ITEM-WRBTR(' record_count ')' into v_WRBTR.
*concatenate 'ACGL_ITEM-SGTXT(' record_count ')' into v_SGTXT.
*concatenate 'ACGL_ITEM-KOSTL(' record_count ')' into v_KOSTL.
perform bdc_field using v_HKONT
record-HKONT.
perform bdc_field using v_SHKZG
record-SHKZG.
perform bdc_field using v_WRBTR
record-WRBTR.
perform bdc_field using v_SGTXT
record-SGTXT.
perform bdc_field using v_KOSTL
record-KOSTL.
**endloop.
perform bdc_transaction using 'FB50'.
ENDLOOP.
Now should work fine.. -
A Major Transaction Problem!
"A" is a record which has already been inserted into a table(TBL).
"insert(Y)" is a method that inserts a given record -Y- into TBL.
"foo(X)" is a method that takes a record as a parameter and queries it on a view(VIEW). This view is a
huge select statement that selects from TBL.
Here is the problem:
insert(B);
foo( A ); /* returns true */
but
insert(B); /* B does not exist in TBL */
foo(B); /* returns false and catches an exception that "A" is not found! */
insert(Y) method is a CMP EJB method but foo(X) uses JDBC to access DBMS.
so what can cause this transaction problem?
thanks in advance,
-selcukHi,
Maybe foo is running in a different transaction than insert?
Some possible causes:
-you are starting a new transaction for foo, either via the UserTransaction or via REQUIRES_NEW
-you are using a regular JDBC driver for foo instead of an XADataSource.
Did you try to set foo's transaction attribute to REQUIRED?
Best,
Guy
http://www.atomikos.com -
If anyone can help point me in the right direction of what I should be looking for in my configuration files for the following transaction problem. It looks like the delete is being committed one entity at a time instead of at the ened of the transaction.
I'm using OC4J, eclipselink and Spring.
I have two entities that I am trying to delete. They have a OneToOne relationship which in the underlying database (Oracle) has a deferred foreign key integrity constraint. I believe that this means that if the intities are delted in the same transaction everything should work, but if they are deleted in seperate transactions then the constraint should kick in and disallow the delete. I am using code similar to below to attempt to delete in one transaction. I am using Spring to inject an EntityManager and to control the transaction handling.
@Transactional(readOnly=true)
public class ProductServiceImpl implements ProductService{
@PersistenceContext(type = PersistenceContextType.TRANSACTION)
private EntityManager emp;
@Transactional(readOnly=false, propagation=Propagation.REQUIRES_NEW)
public void deleteProduct(Product prod){
Object managedEntity = em.find(product.getClass(), prod.getId);
em.remove(managedEntity);
}Spring configuration xml file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<jee:jndi-lookup id="myEmf" jndi-name="persistence/JPA"/>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="myEmf"/>
</bean>
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="ProductService" class="ProductServiceImpl"/>
</beans>On calling the delete I get the following error message
org.springframework.transaction.TransactionSystemException -
Could not commit JPA transaction; nested exception is
javax.persistence.RollbackException: Exception [EclipseLink-4002]
(Eclipse Persistence Services - 1.0 (Build SNAPSHOT - 20080508)):
org.eclipse.persistence.exceptions.DatabaseException Internal Exception:
java.sql.SQLException: ORA-02091: transaction rolled back ORA-02292:
integrity constraint (RVEL_FK) violated - child record found Error Code: 2091 Call:
DELETE FROM RVEL_REVENUE_ELEMENT WHERE (ID = ?) bind => [6594]
Query: DeleteObjectQuery(RevenueElement@1eafdce)I have also tried doing all this programatically, using a jndi lookup as follows
EntityManager em = null;
try{
Context ctxt = new InitialContext();
emf = (EntityManagerFactory)ctxt.lookup("jpaTest/ServerJPA");
em = emf.createEntityManager();
EntityTransaction et = em.getTransaction();
try{
et.begin();
em.remove(managedEntity);
et.commit();
} finally{
if(et != null && et.isActive()){
et.rollback();
} catch(NamingException nme) {
} finally{
if(em != null && em.isOpen()){
em.close();
} When debugging the error is thrown on the line
em.remove(managedEntity);before the transaction commit is called.Thanks for the reply.
The managed entity being deleted in the call to the delete method has one to many relationship with one of the entities in the one to one relationship which then has a reference to the second entity. These references are annotated with cascade ALL.
A --> B --> C. The error is referring to entity C and its relationship back to B. The error is being thrown before the transaction is being committed.
After doing a bit more research I believe that it is caused by the lack of the following property in my persistence.xml.
<property name="eclipselink.target-server" value="OC4J_10_1_3"/>But if I put this property in then I get the errorException creating EntityManagerFactory using PersistenceProvider class org.eclipse.persistence.jpa.PersistenceProvider for persistence unit ServerJPA. -
I am having BDC upload problem . 2 transaction upload in one pgm.
Hi ,
I am having problems .In one BDC program that i have written. The data is plopulating the first tcode screens i.e of T Code KL01 but its not populating screen of TCode KP26.
Please can you let me the reason why the screen of t code KP26 is not getting populated correctly .
please help me with directions of where i am going wrong
The code is below .
report ZPM_ACTIVITY_UPLOAD
no standard page heading line-size 255.
*include bdcrecx1.
***************DATA DECLARATION**************************
DATA : message like bdcmsgcoll occurs 0.
DATA : bdcdata type standard table of bdcdata with header line .
data : file type string,
v_msg(255).
DATA:Begin of itab_main occurs 0,
LSTAR type CSLAZ-LSTAR,
DATAB_ANFO(10),
DATAB_ANFO type CSLAZ-DATAB_ANFO,
KTEXT type CSLAZ-KTEXT,
LTEXT type CSLAZ-LTEXT,
LEINH_CHAR type CSLAZ-LEINH_CHAR,
KSTTY type CSLAZ-KSTTY,
LATYP type CSLAZ-LATYP,
VKSTA type CSLAZ-VKSTA,
VERSN type CCSS-VERSN,
PERBL type RKPLN-PERBL,
PERBL1 type RKPLN-PERBL,
GJAHR type CCSS-GJAHR,
KOSTL type CCSS-KOSTL,
LSTAR1 type CCSS-LSTAR,
TKV type RKPLN-TKV,
End of itab_main.
Data :v_file type string.
Data :Begin of itab_KL01 occurs 0,
KL01_LSTAR type CSLAZ-LSTAR,
KL01_DATAB_ANFO(10), " type CSLAZ-DATAB_ANFO,
KL01_DATAB_ANFO type CSLAZ-DATAB_ANFO,
KL01_KTEXT type CSLAZ-KTEXT,
KL01_LTEXT type CSLAZ-LTEXT,
KL01_LEINH_CHAR type CSLAZ-LEINH_CHAR,
KL01_KSTTY type CSLAZ-KSTTY,
KL01_LATYP type CSLAZ-LATYP,
KL01_VKSTA type CSLAZ-VKSTA,
End of itab_KL01.
Data : Begin of error_itab occurs 0,
msg(255),
End of error_itab.
Data :wa_error_itab like line of error_itab.
Data : Begin of itab_KP26 occurs 0,
KP26_VERSN type CCSS-VERSN,
KP26_PERBL type RKPLN-PERBL,
KP26_PERBL1 type RKPLN-PERBL,
KP26_GJAHR type CCSS-GJAHR,
KP26_KOSTL type CCSS-KOSTL,
KP26_LSTAR type CCSS-LSTAR,
KP26_TKV type RKPLN-TKV,
End of itab_KP26.
data : l_v_tab type abap_char1
value cl_abap_char_utilities=>horizontal_tab.
data : counter type c value 0,
countere type c value 0,
counters type c value 0.
PARAMETER: p_file TYPE ibipparms-path obligatory." Needed to upload the file
At selection-screen on value-request for p_file.
Perform get_file.
start-of-selection.
perform file_upload.
Perform split_itab.
****************************************KL01
loop at itab_KL01.
refresh bdcdata.
perform bdc_dynpro using 'SAPLKMA6' '0200'.
perform bdc_field using 'BDC_CURSOR'
'CSLAZ-LSTAR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'CSLAZ-KOKRS'
'1000'.
perform bdc_field using 'CSLAZ-LSTAR'
itab_KL01-KL01_LSTAR .
perform bdc_field using 'CSLAZ-DATAB_ANFO'
itab_KL01-KL01_DATAB_ANFO.
perform bdc_field using 'CSLAZ-DATBI_ANFO'
'31.12.9999'.
perform bdc_dynpro using 'SAPLKMA6' '0299'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'CSLAZ-TARKZ'.
perform bdc_field using 'CSLAZ-KTEXT'
itab_KL01-KL01_KTEXT.
perform bdc_field using 'CSLAZ-LTEXT'
itab_KL01-KL01_LTEXT.
perform bdc_field using 'CSLAZ-LEINH_CHAR'
itab_KL01-KL01_LEINH_CHAR.
perform bdc_field using 'CSLAZ-KSTTY'
itab_KL01-KL01_KSTTY.
perform bdc_field using 'CSLAZ-LATYP'
itab_KL01-KL01_LATYP.
perform bdc_field using 'CSLAZ-VKSTA'
itab_KL01-KL01_VKSTA .
call transaction 'KL01' using BDCDATA MODE 'A' update 's' messages into message .
If sy-subrc eq 0.
counters = counters + 1.
else.
countere = countere + 1 .
perform error_msg.
wa_error_itab-msg = v_msg.
append wa_error_itab-msg to error_itab.
clear wa_error_itab-msg.
endif.
Endloop.
Loop at itab_KP26.
refresh bdcdata.
perform bdc_dynpro using 'SAPLSPO4' '0300'.
perform bdc_field using 'BDC_CURSOR'
'SVALD-VALUE(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FURT'.
perform bdc_field using 'SVALD-VALUE(01)'
'1000'.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_CURSOR'
'KPP0B-VALUE(09)'.
perform bdc_field using 'BDC_OKCODE'
'=CSUB'.
perform bdc_field using 'KPP1B-ONLY'
'X'.
perform bdc_field using 'KPP0B-VALUE(01)'
itab_KP26-KP26_VERSN .
perform bdc_field using 'KPP0B-VALUE(02)'
itab_KP26-KP26_PERBL.
perform bdc_field using 'KPP0B-VALUE(03)'
itab_KP26-KP26_PERBL1 .
perform bdc_field using 'KPP0B-VALUE(04)'
itab_KP26-KP26_GJAHR .
perform bdc_field using 'KPP0B-VALUE(06)'
itab_KP26-KP26_KOSTL .
perform bdc_field using 'KPP0B-VALUE(09)'
itab_KP26-KP26_LSTAR.
perform bdc_dynpro using 'SAPLKPP2' '0112'.
perform bdc_field using 'BDC_CURSOR'
'K-BK_0403'.
perform bdc_field using 'BDC_OKCODE'
'=CBUC'.
perform bdc_field using 'Z-BDC08(01)'
itab_KP26-KP26_TKV .
call transaction 'KP26' using BDCDATA MODE 'A' update 'S' messages into message .
If sy-subrc eq 0.
counters = counters + 1.
else.
countere = countere + 1 .
perform error_msg.
wa_error_itab-msg = v_msg.
append wa_error_itab-msg to error_itab.
clear wa_error_itab-msg.
endif.
Endloop.
counter = countere + counters.
write /: 'Total Number of Records is',counter .
Write /: 'Total Number of Successfull records',counters.
Write /: 'Total Number of error records',countere.
If countere GT 0.
Write :/'The error out record message are'.
Loop at error_itab.
write:/ error_itab-msg.
Endloop.
Endif.
*& Form file_upload
text
--> p1 text
<-- p2 text
FORM file_upload .
v_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = v_file
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = l_v_tab
TABLES
DATA_TAB = itab_main
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " file_upload
*& Form split_itab
text
--> p1 text
<-- p2 text
FORM split_itab .
loop at itab_main.
MOVE itab_main-LSTAR TO itab_KL01-KL01_LSTAR.
MOVE itab_main-DATAB_ANFO TO itab_KL01-KL01_DATAB_ANFO.
MOVE itab_main-KTEXT TO itab_KL01-KL01_KTEXT.
MOVE itab_main-LTEXT TO itab_KL01-KL01_LTEXT.
MOVE itab_main-LEINH_CHAR TO itab_KL01-KL01_LEINH_CHAR.
MOVE itab_main-KSTTY TO itab_KL01-KL01_KSTTY.
MOVE itab_main-LATYP TO itab_KL01-KL01_LATYP.
MOVE itab_main-VKSTA TO itab_KL01-KL01_VKSTA.
MOVE itab_main-VERSN TO itab_KP26-KP26_VERSN.
MOVE itab_main-PERBL TO itab_KP26-KP26_PERBL.
MOVE itab_main-PERBL1 TO itab_KP26-KP26_PERBL1.
MOVE itab_main-GJAHR TO itab_KP26-KP26_GJAHR.
MOVE itab_main-KOSTL TO itab_KP26-KP26_KOSTL.
MOVE itab_main-LSTAR1 TO itab_KP26-KP26_LSTAR.
MOVE itab_main-TKV TO itab_KP26-KP26_TKV.
APPEND itab_KL01.
APPEND itab_KP26.
CLEAR itab_KL01.
CLEAR itab_KP26.
endloop.
ENDFORM. " split_itab
*& Form get_file
text
--> p1 text
<-- p2 text
FORM get_file .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_file.
ENDFORM. " get_file
Start new screen *
form bdc_dynpro using program dynpro.
clear bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
append bdcdata.
endform. "bdc_dynpro
Insert field *
form bdc_field using fnam fval.
if fval <> space.
clear bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
append bdcdata.
endif.
endform. "bdc_field
*& Form error_msg
text
--> p1 text
<-- p2 text
FORM error_msg .
call function 'FORMAT_MESSAGE'
EXPORTING
id = sy-msgid
lang = 'E'
IMPORTING
msg = v_msg
EXCEPTIONS
not_found = 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.
ENDFORM. " error_msgHi ,
I am having problems .In one BDC program that i have written. The data is plopulating the first tcode screens i.e of T Code KL01 but its not populating screen of TCode KP26.
Please can you let me the reason why the screen of t code KP26 is not getting populated correctly .
please help me with directions of where i am going wrong
The code is below .
report ZPM_ACTIVITY_UPLOAD
no standard page heading line-size 255.
*include bdcrecx1.
***************DATA DECLARATION**************************
DATA : message like bdcmsgcoll occurs 0.
DATA : bdcdata type standard table of bdcdata with header line .
data : file type string,
v_msg(255).
DATA:Begin of itab_main occurs 0,
LSTAR type CSLAZ-LSTAR,
DATAB_ANFO(10),
DATAB_ANFO type CSLAZ-DATAB_ANFO,
KTEXT type CSLAZ-KTEXT,
LTEXT type CSLAZ-LTEXT,
LEINH_CHAR type CSLAZ-LEINH_CHAR,
KSTTY type CSLAZ-KSTTY,
LATYP type CSLAZ-LATYP,
VKSTA type CSLAZ-VKSTA,
VERSN type CCSS-VERSN,
PERBL type RKPLN-PERBL,
PERBL1 type RKPLN-PERBL,
GJAHR type CCSS-GJAHR,
KOSTL type CCSS-KOSTL,
LSTAR1 type CCSS-LSTAR,
TKV type RKPLN-TKV,
End of itab_main.
Data :v_file type string.
Data :Begin of itab_KL01 occurs 0,
KL01_LSTAR type CSLAZ-LSTAR,
KL01_DATAB_ANFO(10), " type CSLAZ-DATAB_ANFO,
KL01_DATAB_ANFO type CSLAZ-DATAB_ANFO,
KL01_KTEXT type CSLAZ-KTEXT,
KL01_LTEXT type CSLAZ-LTEXT,
KL01_LEINH_CHAR type CSLAZ-LEINH_CHAR,
KL01_KSTTY type CSLAZ-KSTTY,
KL01_LATYP type CSLAZ-LATYP,
KL01_VKSTA type CSLAZ-VKSTA,
End of itab_KL01.
Data : Begin of error_itab occurs 0,
msg(255),
End of error_itab.
Data :wa_error_itab like line of error_itab.
Data : Begin of itab_KP26 occurs 0,
KP26_VERSN type CCSS-VERSN,
KP26_PERBL type RKPLN-PERBL,
KP26_PERBL1 type RKPLN-PERBL,
KP26_GJAHR type CCSS-GJAHR,
KP26_KOSTL type CCSS-KOSTL,
KP26_LSTAR type CCSS-LSTAR,
KP26_TKV type RKPLN-TKV,
End of itab_KP26.
data : l_v_tab type abap_char1
value cl_abap_char_utilities=>horizontal_tab.
data : counter type c value 0,
countere type c value 0,
counters type c value 0.
PARAMETER: p_file TYPE ibipparms-path obligatory." Needed to upload the file
At selection-screen on value-request for p_file.
Perform get_file.
start-of-selection.
perform file_upload.
Perform split_itab.
****************************************KL01
loop at itab_KL01.
refresh bdcdata.
perform bdc_dynpro using 'SAPLKMA6' '0200'.
perform bdc_field using 'BDC_CURSOR'
'CSLAZ-LSTAR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'CSLAZ-KOKRS'
'1000'.
perform bdc_field using 'CSLAZ-LSTAR'
itab_KL01-KL01_LSTAR .
perform bdc_field using 'CSLAZ-DATAB_ANFO'
itab_KL01-KL01_DATAB_ANFO.
perform bdc_field using 'CSLAZ-DATBI_ANFO'
'31.12.9999'.
perform bdc_dynpro using 'SAPLKMA6' '0299'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'CSLAZ-TARKZ'.
perform bdc_field using 'CSLAZ-KTEXT'
itab_KL01-KL01_KTEXT.
perform bdc_field using 'CSLAZ-LTEXT'
itab_KL01-KL01_LTEXT.
perform bdc_field using 'CSLAZ-LEINH_CHAR'
itab_KL01-KL01_LEINH_CHAR.
perform bdc_field using 'CSLAZ-KSTTY'
itab_KL01-KL01_KSTTY.
perform bdc_field using 'CSLAZ-LATYP'
itab_KL01-KL01_LATYP.
perform bdc_field using 'CSLAZ-VKSTA'
itab_KL01-KL01_VKSTA .
call transaction 'KL01' using BDCDATA MODE 'A' update 's' messages into message .
If sy-subrc eq 0.
counters = counters + 1.
else.
countere = countere + 1 .
perform error_msg.
wa_error_itab-msg = v_msg.
append wa_error_itab-msg to error_itab.
clear wa_error_itab-msg.
endif.
Endloop.
Loop at itab_KP26.
refresh bdcdata.
perform bdc_dynpro using 'SAPLSPO4' '0300'.
perform bdc_field using 'BDC_CURSOR'
'SVALD-VALUE(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FURT'.
perform bdc_field using 'SVALD-VALUE(01)'
'1000'.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_CURSOR'
'KPP0B-VALUE(09)'.
perform bdc_field using 'BDC_OKCODE'
'=CSUB'.
perform bdc_field using 'KPP1B-ONLY'
'X'.
perform bdc_field using 'KPP0B-VALUE(01)'
itab_KP26-KP26_VERSN .
perform bdc_field using 'KPP0B-VALUE(02)'
itab_KP26-KP26_PERBL.
perform bdc_field using 'KPP0B-VALUE(03)'
itab_KP26-KP26_PERBL1 .
perform bdc_field using 'KPP0B-VALUE(04)'
itab_KP26-KP26_GJAHR .
perform bdc_field using 'KPP0B-VALUE(06)'
itab_KP26-KP26_KOSTL .
perform bdc_field using 'KPP0B-VALUE(09)'
itab_KP26-KP26_LSTAR.
perform bdc_dynpro using 'SAPLKPP2' '0112'.
perform bdc_field using 'BDC_CURSOR'
'K-BK_0403'.
perform bdc_field using 'BDC_OKCODE'
'=CBUC'.
perform bdc_field using 'Z-BDC08(01)'
itab_KP26-KP26_TKV .
call transaction 'KP26' using BDCDATA MODE 'A' update 'S' messages into message .
If sy-subrc eq 0.
counters = counters + 1.
else.
countere = countere + 1 .
perform error_msg.
wa_error_itab-msg = v_msg.
append wa_error_itab-msg to error_itab.
clear wa_error_itab-msg.
endif.
Endloop.
counter = countere + counters.
write /: 'Total Number of Records is',counter .
Write /: 'Total Number of Successfull records',counters.
Write /: 'Total Number of error records',countere.
If countere GT 0.
Write :/'The error out record message are'.
Loop at error_itab.
write:/ error_itab-msg.
Endloop.
Endif.
*& Form file_upload
text
--> p1 text
<-- p2 text
FORM file_upload .
v_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = v_file
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = l_v_tab
TABLES
DATA_TAB = itab_main
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " file_upload
*& Form split_itab
text
--> p1 text
<-- p2 text
FORM split_itab .
loop at itab_main.
MOVE itab_main-LSTAR TO itab_KL01-KL01_LSTAR.
MOVE itab_main-DATAB_ANFO TO itab_KL01-KL01_DATAB_ANFO.
MOVE itab_main-KTEXT TO itab_KL01-KL01_KTEXT.
MOVE itab_main-LTEXT TO itab_KL01-KL01_LTEXT.
MOVE itab_main-LEINH_CHAR TO itab_KL01-KL01_LEINH_CHAR.
MOVE itab_main-KSTTY TO itab_KL01-KL01_KSTTY.
MOVE itab_main-LATYP TO itab_KL01-KL01_LATYP.
MOVE itab_main-VKSTA TO itab_KL01-KL01_VKSTA.
MOVE itab_main-VERSN TO itab_KP26-KP26_VERSN.
MOVE itab_main-PERBL TO itab_KP26-KP26_PERBL.
MOVE itab_main-PERBL1 TO itab_KP26-KP26_PERBL1.
MOVE itab_main-GJAHR TO itab_KP26-KP26_GJAHR.
MOVE itab_main-KOSTL TO itab_KP26-KP26_KOSTL.
MOVE itab_main-LSTAR1 TO itab_KP26-KP26_LSTAR.
MOVE itab_main-TKV TO itab_KP26-KP26_TKV.
APPEND itab_KL01.
APPEND itab_KP26.
CLEAR itab_KL01.
CLEAR itab_KP26.
endloop.
ENDFORM. " split_itab
*& Form get_file
text
--> p1 text
<-- p2 text
FORM get_file .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_file.
ENDFORM. " get_file
Start new screen *
form bdc_dynpro using program dynpro.
clear bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
append bdcdata.
endform. "bdc_dynpro
Insert field *
form bdc_field using fnam fval.
if fval <> space.
clear bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
append bdcdata.
endif.
endform. "bdc_field
*& Form error_msg
text
--> p1 text
<-- p2 text
FORM error_msg .
call function 'FORMAT_MESSAGE'
EXPORTING
id = sy-msgid
lang = 'E'
IMPORTING
msg = v_msg
EXCEPTIONS
not_found = 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.
ENDFORM. " error_msg -
Hi all,
I have a problem with my BDC, I am using a CALL transaction to update few fields. When I do a Call transaction using 'A'(all screen mode) the values which I am passing are getting updated.But when I do the same thing using 'N'(No screen mode) the values are not getting updated.
Please help me with this.
Thanks
JMHi,
You would be some BDC_OKCODE(e.g for information POPUP) which is not captured in your BDC recording. This OKCODE maybe manually proccesed
by you using enter or click in the forreground mode. Also check for warning messages.
If there are none of those mentioned, you can use the following option of Call transaction
CALL TRANSACTION <tcode> USING <bdcdata_tab> OPTIONS FROM <opt>.
opt is a structure of type ctu_params and it needs to be populated(before calling the above statement) as below.
opt-dismode = 'N'.
Regards -
Hi All,
i have created a bdc which is working well but mine problem is that if some item is not updated by BDC then it should show in my program or save on desktop.
thanxHello Mr. Suneel,
i am using call by transaction method.plz check the below:--
LOOP AT ITAB.
perform bdc_dynpro using 'SAPMF02K' '0101'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-D0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
ITAB-LIFNR.
perform bdc_field using 'RF02K-BUKRS'
'NILR'.
perform bdc_field using 'RF02K-D0110'
'X'.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
ITAB-TELF1.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
*perform bdc_field using 'LFA1-NAME1'
record-NAME1_004.
*perform bdc_field using 'LFA1-SORTL'
record-SORTL_005.
*perform bdc_field using 'LFA1-STRAS'
record-STRAS_006.
*perform bdc_field using 'LFA1-ORT01'
record-ORT01_007.
*perform bdc_field using 'LFA1-PSTLZ'
record-PSTLZ_008.
*perform bdc_field using 'LFA1-LAND1'
record-LAND1_009.
*perform bdc_field using 'LFA1-REGIO'
record-REGIO_010.
*perform bdc_field using 'LFA1-SPRAS'
record-SPRAS_011.
perform bdc_field using 'LFA1-TELF1'
ITAB-TELF1.
*ALL TRANSACTION 'XK02' USING BDCDATA MODE 'A'.
call transaction 'XK02' USING BDCDATA MODE 'A'.
ENDLOOP.
thanx -
Stored procedure in a transaction problem
hello to everybody
I have an application under weblogic8.1 sp3.
I have to call an Oracle stored procedure that populate a table and I have to see the new record anly at the end of the ejb service transaction ( a Container transaction ).When the procedure terminate I see the db data before the transaction end.So I have created a XA DataSource and changed the oracle 9.2 thin drivers in oracle 9.2 thin drivers XA.But Now I receive this Oracle Error:
ORA-02089: COMMIT is not allowed in a subordinate session
Why?How Can I resolve my problem?Can Anyone Help Me?Thanks...giorgio giustiniani wrote:
hello to everybody
I have an application under weblogic8.1 sp3.
I have to call an Oracle stored procedure that populate a table and I have to see the new record anly at the end of the ejb service transaction ( a Container transaction ).When the procedure terminate I see the db data before the transaction end.So I have created a XA DataSource and changed the oracle 9.2 thin drivers in oracle 9.2 thin drivers XA.But Now I receive this Oracle Error:
ORA-02089: COMMIT is not allowed in a subordinate session
Why?How Can I resolve my problem?Can Anyone Help Me?Thanks...It sounds like you have transactional syntax embedded in your
procedure. You can't do that and still include it in an XA
transaction.
Joe -
How to prevent users from creating transactional problems?
Dear Sirs...
Using JDeveloper 10.1.2 and ADF UIX technology. If i created a web application that contains many pages. Assume the application contains pages A,B,C,D.
The end user should access the pages A then B then C then D to get the transaction executed and commited correctly.
the problem is:
1- if a user navigates from A to B to C then he press the Back button to A then he commits the transaction, the data would be stored in correctly.
2- if page C requires some preparations in page B (initalization of session variables) and the user enters page A then he changes the URL to C, then this would cause inproper execution of application and so the data would be stored incorrectly.
so how can i prevent the user from pressing the back button of the browser (which i do not think is possible) or how can i prevent him from making any errors by inproper page navigation?
thanks for any help in advance and best regardsI really don't know if this is the correct way of doing it, but we prevent navigation directly to any page within our application if the HTTP Referer header is null. If it's null, we redirect to a page that says the user should use the navigation buttons provided and not enter the page via bookmarks, history, or direct navigation via a typed in URL.
-
Add a New Field to Selection Screen of VL10 Transactions problem
Hello,
i have tried to add a selection field in the VL10G. I have used the docu from Gaurav Jagya (Thanks to Gaurav) an followed the steps. Here you can find the docu: Link: [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e07c282f-e2b4-2c10-e4b3-a314fc17b6a1]
In the Step 2 , Point 4 i declare the Select option ST_MTART and use it later in Step 5 in the form USEREXIT_SELECT_OPTIONS_TRANSF.
Step 2.
4. Write the declaration of new select-option inside include ZV50RSEL_MTART.
DATA: V_MTART TYPE MARA-MTART.
SELECT-OPTIONS: ST_MTART for V_MTART.
Step 5. Transfer values from selection screen to range.
For this step, again an access key is required to modify include V50R_USEREXIT_TRANSF.
1. Open include V50R_USEREXIT_TRANSF in change mode. It will ask for an access key. Enter the same and proceed.
2. Write following line of code inside form USEREXIT_SELECT_OPTIONS_TRANSF:
CX_SELECT_OPTIONS-MTART = ST_MTART[].
When i start the VL10G it works fine, but when i start another VL10* transaction i get a dump. Example VL10:
Runtime Errors SYNTAX_ERROR
Date and Time 20.04.2010 13:54:00
Short text
Syntax error in program "RVV50R10C ".
What happened?
Error in the ABAP Application Program
The current ABAP program "SAPLV50R_PRE" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
The following syntax error occurred in program "RVV50R10C " in include
"V50R_USEREXIT_TRANSF " in
line 18:
"field "ST_MTART unknown. .."
It dumped, because the form V50R_USEREXIT_TRANSF is used in EVERY VL10* transaction and the select-option is declared ONLY in my Z-include.
Is the someone out there, who has solved the problem? Is the an error in the docu or am i wrong?
Thanks!
AndreasHas there been any further information on this issue in this or any other threads. I am encountering the same issue as identified by Andreas.
Thanks,
Brian -
Hi
I have a problem related to CMP entity beans.
I am using Oracle 9i and weblogic 6.1
Here is the description of the problem.
The transaction attribute of all the beans is set to 'Required'.
I have a PersonBean (CMP) in Person.jar mapping to Person table along with other
beans.
I have a MemberBean(CMP) in Member.jar file mapping to Member table along with
many other beans.
There is a one to many relation ship between person and member tables in Oracle
9i database :
Id in the person table is the P_Key and Person_Id in Member table is the related
foreign key.
No relationship was made between Person and Member beans as there were in two
different jar files with different deployment descriptors.
I have a stateless session bean PersonService bean.
There is a method in PersonService bean called createPerson(String name);
This method creates Person in the database using Person p = PersonHome.create(),
long personId = p.getId()..returns the primary key of the person.
PersonService calls createMember(long personId) now.
which will try to create a Member record in the database using the personId.
Now the Member bean fails to create and the transaction is rolled back with a
foreign_key violation exception.
because it cannot locate the Person EJB Primary key entry in the underlying table.
But the EJB cache is still inserted properly with Person EJB (findByPrimaryKey
works).
I feel that Member bean is not able to participate in the same transaction of
the Person bean inspite of keeping the transaction attribute to 'Required'.
When I keep the transaction of Person bean to 'RequiresNew', then the transation
of createPerson is getting committed and Member is starting a New transaction
and it gets created.
But I donot want like this.
I want all the beans to be participating in the same transaction.
According to Oracle / Weblogic documentation the default database isolation mode
Read_Committed should allow participants in transaction to see uncommitted data
while participants outside the transaction see only committed data. I have tried
other dataabase isolation modes (such as Read_Uncommitted, "Serializable") these
appear to either create other problems or not have an affect.
Any solution to this problem is highly appreciated.
Thanks
LavanyaPreviously our code was running on Weblogic where
methodA() -> Transaction Attribute -> Supports
methodB() -> Transaction Attribute -> Required
But in JBOSS in order to run the same thing we have to do
methodA() -> Transaction Attribute -> Required
methodB() -> Transaction Attribute -> Required
Any Pointers?? -
BDC upload problem in hr master
Hi,
we are facing a problem in BDC upload for hr master tcode pa40.
we want to stop bdc after 2 screens only and not process further screens. how to do this?
please help
Thanks.Hi,
If you are using Session Mode :
After 2nd screen's is porcessed Use \BEND in the ok code field of BDC TABLE.
This will work,
Regards,
Gurpreet. -
Transaction problem with jconn5.2
jconn5.2 and iASsp2
I am using Bean Managed Transaction in my application, start the first
transaction is fine, but once the application going to start another
transaction, errors occoured:
"the transaction onwer is not in current thread".Hi,
I've had the very same problem with RAD.
Try to set the Transaction attribute to SUPPORTS. With SUPPORTS the EJB method will use the same transaction as the caller.
package hu.bme.ett.raktar.facade;
import hu.bme.ett.raktar.ejbs.Raktar;
import hu.bme.ett.raktar.ejbs.controller.RaktarManager;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
@Stateless
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class RaktarListazas implements RaktarListazasLocal {
RaktarManager rm = new RaktarManager();
* Default constructor.
public RaktarListazas() {
// TODO Auto-generated constructor stub
public Raktar getRaktar(long raktId) {
return rm.findRaktarByRaktId(raktId);
public void createRaktar(long raktId) {
Raktar r = new Raktar();
r.setRaktId(raktId);
r.setRaktAzonosito("Y1RAK-01" + raktId);
r.setMegnevezes("Elso raktaram");
try {
rm.createRaktar(r);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}Cheers,
Viktor -
ABAP - BDC transaction not saving changes to records
I am trying to write my first ABAP code using BDC recording. Essentially I would like to flag the "Final Delivery" field (EKPO-EGLKZ) for a range of documents by recording transaction MASS.
The code runs without errors - but the changes are not saved. I have run the code in "Processing Mode: A" (Display all screens) and the program successfully loops through each record & saves the updated fields. When I look at the documents in ME23N the changes have not been saved. Running the MASS transaction manually results in the changes being successfully saved so I can rule out any data validation issues.
Does anyone know why the changes refuse to save when running the code below?
I have considered trying to use BAPI_PO_CHANGE instead of BDC, but I am new to ABAP and I thought the BDC code would be less complex.
report Z_MASS_REMOVE_FDI_DCI
no standard page heading line-size 255.
include bdcrecx1.
TYPES: BEGIN OF ty_tab,
MASSOBJTYP(7),
MASSVARNAM(7),
DOCNO(9),
ITEM(1),
END OF ty_tab.
DATA : it_tab TYPE STANDARD TABLE OF ty_tab.
DATA : wa_tab TYPE ty_tab.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'X:\STO.TXT'
* FILETYPE = 'ASC
has_field_separator = 'X'
TABLES
data_tab = it_tab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
END-OF-SELECTION.
LOOP AT it_tab INTO wa_tab.
WRITE:/ wa_tab-MASSOBJTYP,
wa_tab-MASSVARNAM,
wa_tab-DOCNO,
wa_tab-ITEM.
PERFORM open_group.
perform bdc_dynpro using 'SAPMMSDL' '0100'.
perform bdc_field using 'BDC_CURSOR'
'MASSSCREEN-OBJECT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MASSSCREEN-OBJECT'
wa_tab-MASSOBJTYP.
perform bdc_field using 'MASSSCREEN-VARNAME'
wa_tab-MASSVARNAM.
perform bdc_dynpro using 'SAPMMSDL' '0100'.
perform bdc_field using 'BDC_CURSOR'
'MASSSCREEN-OBJECT'.
perform bdc_field using 'BDC_OKCODE'
'=NEXT'.
perform bdc_dynpro using 'SAPLMASS_SEL_DIALOG' '0100'.
perform bdc_field using 'BDC_CURSOR'
'MASSFREESEL-LOW(01)'.
perform bdc_field using 'MASSFREESEL-LOW(01)'
wa_tab-DOCNO.
perform bdc_dynpro using 'SAPLMASS_SEL_DIALOG' '0100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MASSFREESEL-LOW(02)'.
perform bdc_field using 'MASSFREESEL-LOW(02)'
wa_tab-ITEM.
perform bdc_dynpro using 'SAPLMASS_SEL_DIALOG' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=CRET'.
perform bdc_field using 'BDC_CURSOR'
'MASSFREESEL-LOW(01)'.
perform bdc_dynpro using 'SAPLMASSINTERFACE' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=FDAE'.
perform bdc_field using 'BDC_CURSOR'
'NR_ITEMS'.
perform bdc_dynpro using 'SAPLMASSINTERFACE' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field using 'BDC_CURSOR'
'NR_ITEMS'.
perform bdc_dynpro using 'SAPLMASSMSGLIST' '0300'.
perform bdc_field using 'BDC_CURSOR'
'REOML-MSGTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=EXIT'.
perform bdc_transaction using 'MASS'.
ENDLOOP.
PERFORM close_group.Where is BDC_INSERT.
If u use OPEN and CLOSE_group u need to use INSERT_GROUP also to update in database.
A session will be created and u nedd to run the Session in Sm35 in order to update the database.
Edited by: Ranjith Kumar on Sep 18, 2008 6:41 AM
Maybe you are looking for
-
How do I get my photos on my iMac sent to my iPad and iPhone? Nothing seems to work.
How do I get my photos on my iMac sent to my iPad and iPhone? Nothing seems to work. hurtalert
-
Hi Gurus, How can I add business partner (BUT000) master data fields (including custom fields) to Mapping Format in ELM??? Your prompt response will be highly appreciated and rewarde... Cheers, Peter J
-
Dashed line around iCal appointment
I have seen this posted in several areas but no solution to be found as of yet. SOMETIMES when I create an appointment in iCal, I get a clear background with a white dotted line around the appointment. Each time I create an appointment, I invite my
-
Hi the iTUNES iPad app does not show the genres, bpm or comments. How do I view these? It is way more important to me than the album or the artwork? TIA Enio
-
I have a 2008 21-inch iMac, and a 2010 MacBook Pro, both with 4 GB RAM, running OS X Lion 10.7.3. Ever since I installed Lion, I've had this problem of available memory dwindling to almost nothing (10-20 MB) after a day or so of usage. Last night I w