Reg. commit work
friends,
i have defined a follow-up action for txn qa11/12 and assigned a customized mail-sending fm to it..am on 4.7 and to send the mail to an internal lotus notes id using so_new_document_send_api1, but the problem is without using commit work and submit rsconn01 commands, am failing in doing the same...just want to make sure that my follow-up action will take place after all the database commits and will not cause any problems? ..please guide me on this friends...thanks in advance
regards,
Sathish. R
hi
thanks for your response...but QFOA_MAIL_SENDING_STANDARD is the fm used by a standard follow-up action that sends a mail to user's SAP office...that fm uses so_object_send to send the mail, which finally calls a commit work...just in a general sense, i hope follow up action triggers after all database commits..correct me if am wrong...i've never used perform on commit...any suggestions will be of great help
regards
Sathish. R
Similar Messages
-
Reg. commit work in a follow-up action
friends
i am using the following approach to solve a requirement which is posted in this thread..How to send a mail after a usage decision is made in QA11?
got a nice reply too
i have defined a follow-up action and assigned a customized mail-sending fm to it..my doubts are, i am on 4.7..am able to send the mail to an internal id, but the problem is without using commit work and submit rsconn01 commands, am failing in doing the same...i have read in a thread that commit work or submit (if the called program uses commit work) will cause data inconsistencies and will trigger locks if it's used in any user-exit or badi...but in my case, when will a follow-up action actually take place? will it happen after all the database commits? if so, then i believe that even i use commit work and submit commands in my z mail sending fm, it wouldn't cause any problems...am just sort of afraid whether this approach is the correct one? or triggering the mail code from the last user exit or badi itself will solve the purpose? i believe not..please guide me on this friends...helpful replies will be appreciated and awarded..thanks in advance
Regards,
Sathish. Rless views and no answers:-(
-
Dear Experts,
My requirement is that i need to send the PDF attachment via Outlook Express as Mail. I am using the FM "SO_NEW_DOCUMENT_ATT_SEND_API1" for sending to Outlook Express. Here i need to check "Commit work" flag. Else it will not be sent to the mail. When i do this, i am getting the short dump saying "MESSAGE_TYPE_X" - Pre_commit check.
Is the above issue related to any configuration settings done by Basis. I checked the forum but i could not get suitable post.
Kindly help me in this regard.
Regards,
Ramesh ManoharanHi Ramesh,
Check subrc and RETRN_CODE value for the table RECEIVERS. If subrc is inintial and Return_code is fine.
Then check with your basis team. They might need to do some config change.
I have used used a Z-FM to do this job. Find the code below.
FUNCTION z_send_pdf_2_email .
*"*"Local Interface:
*" IMPORTING
*" VALUE(EMAILID) TYPE INTAD
*" VALUE(SUBJECT) TYPE CHAR200
*" VALUE(ATTACH_NAME) TYPE CHAR200
*" VALUE(PONUM) TYPE EBELN
*" VALUE(PODATE) TYPE BEDAT
*" EXPORTING
*" REFERENCE(RETURN) TYPE SUBRC
*" TABLES
*" I_OTF STRUCTURE ITCOO
TYPES : t_record TYPE solisti1,
t_objpack TYPE sopcklsti1,
t_objtxt TYPE solisti1,
t_reclist TYPE somlreci1.
DATA : l_lines_bin TYPE i,
l_lines_txt TYPE i,
l_len_in TYPE sood-objlen,
l_date TYPE char10,
i_record TYPE TABLE OF t_record,
i_objpack TYPE TABLE OF t_objpack,
i_objtxt TYPE TABLE OF t_objtxt,
i_objbin TYPE TABLE OF t_objtxt,
i_reclist TYPE TABLE OF t_reclist,
i_tline TYPE TABLE OF tline,
w_record TYPE t_record,
w_objpack TYPE t_objpack,
w_objtxt TYPE t_objtxt,
w_objbin TYPE t_objtxt,
w_reclist TYPE t_reclist,
w_tline TYPE tline,
w_doc_chng TYPE sodocchgi1,
w_buffer TYPE string,
w_objhead TYPE soli_tab.
CONSTANTS: c_smart(5) TYPE c VALUE 'SMART',
c_u TYPE c VALUE 'U',
c_raw(3) TYPE c VALUE 'RAW',
c_f TYPE c VALUE 'F',
c_pdf(3) TYPE c VALUE'PDF',
c_x TYPE c VALUE 'X'.
* Convert OTF data to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = c_pdf
max_linewidth = 132
IMPORTING
bin_filesize = l_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT i_tline INTO w_tline.
TRANSLATE w_tline USING '~'.
CONCATENATE w_buffer w_tline INTO w_buffer.
ENDLOOP.
TRANSLATE w_buffer USING '~'.
DO.
w_record = w_buffer.
APPEND w_record TO i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
* Attachment
REFRESH: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR w_objhead.
i_objbin[] = i_record[].
CONCATENATE podate+6(2) '.' podate+4(2) '.' podate(4) INTO l_date.
* Create Message Body Title and Description
w_objtxt = text-003.
APPEND w_objtxt TO i_objtxt.
CLEAR w_objtxt.
CONCATENATE l_date text-004 ponum text-005 INTO w_objtxt SEPARATED BY space.
APPEND w_objtxt TO i_objtxt.
CLEAR: w_objtxt, l_date.
w_objtxt = text-006.
APPEND w_objtxt TO i_objtxt.
CLEAR w_objtxt.
w_objtxt = space.
APPEND w_objtxt TO i_objtxt.
CLEAR w_objtxt.
w_objtxt = text-007.
APPEND w_objtxt TO i_objtxt.
CLEAR w_objtxt.
w_objtxt = space.
APPEND w_objtxt TO i_objtxt.
CLEAR w_objtxt.
w_objtxt = text-008.
APPEND w_objtxt TO i_objtxt.
CLEAR w_objtxt.
DESCRIBE TABLE i_objtxt LINES l_lines_txt.
READ TABLE i_objtxt INTO w_objtxt INDEX l_lines_txt.
w_doc_chng-obj_name = subject.
w_doc_chng-expiry_dat = sy-datum + 10.
w_doc_chng-obj_descr = subject.
w_doc_chng-sensitivty = c_f.
w_doc_chng-doc_size = l_lines_txt * 255.
*Main Text
CLEAR w_objpack-transf_bin.
w_objpack-head_start = 1.
w_objpack-head_num = 0.
w_objpack-body_start = 1.
w_objpack-body_num = l_lines_txt.
w_objpack-doc_type = c_raw.
APPEND w_objpack TO i_objpack.
CLEAR w_objpack.
* Attachment (pdf-Attachment)
w_objpack-transf_bin = c_x.
w_objpack-head_start = 1.
w_objpack-head_num = 0.
w_objpack-body_start = 1.
DESCRIBE TABLE i_objbin LINES l_lines_bin.
READ TABLE i_objbin INTO w_objbin INDEX l_lines_bin.
w_objpack-doc_size = l_lines_bin * 255 .
w_objpack-body_num = l_lines_bin.
w_objpack-doc_type = c_pdf.
w_objpack-obj_name = c_smart.
w_objpack-obj_descr = attach_name.
APPEND w_objpack TO i_objpack.
CLEAR w_reclist.
w_reclist-receiver = emailid.
w_reclist-rec_type = c_u.
APPEND w_reclist TO i_reclist.
CLEAR:w_reclist.
* Send Mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
put_in_outbox = c_x
* commit_work = c_x
TABLES
packing_list = i_objpack
object_header = w_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
READ TABLE i_reclist INTO w_reclist INDEX 1.
IF sy-subrc IS INITIAL.
return = w_reclist-retrn_code.
ENDIF.
*Clear Refresh Data
CLEAR: l_lines_bin,
l_lines_txt,
l_len_in,
i_record,
i_objpack,
i_objtxt,
i_objbin,
i_reclist,
i_tline,
w_record,
w_objpack,
w_objtxt,
w_objbin,
w_reclist,
w_tline,
w_doc_chng,
w_buffer,
w_objhead.
REFRESH:i_record,
i_objpack,
i_objtxt,
i_objbin,
i_reclist,
i_tline.
ENDFUNCTION. -
Reg. Commit Work Response time
Hi All,
Could you please let me know to which factors the response of the Commit work belong to.
Regards,
SenHi,
Commit work for the database tables.
Regards,
Naresh. -
BCS: Performance Issue - Most of the time is spent doing commit work.
Hello,
We are experiencing performance issues with our BI server. This performance issue can been seen during our BCS runs. Our DBA has indicated that he sees a very high percentage of time time is spent doing "commit work".
Curretly, we are running BI7 nw2004s, Basis 700, support pack 14.
Anyone else experience this? As the BCS run is mainly stanard SAP code, I was wondering if there may be some snotes that correct this?
Thank you for any help you could provide us.If it is related to SEM-BCS and new EHP releases, then there are still big problems with the monitor and tasks status management (meaning problems with performance). Is it the case? If yes, then you'd better look for already released notes reg this and formulate your own OSSs if you don't find anything relevant.
-
Commit work not working in Routine for Transaction because of LUW
Hi all,
i have req to send adobe PDF as attachement by email.
Basically i am calling adobe from output type of VL02n .
Inside this i can not use commit work because of LUW.Please suggest what should i do.
so not able to send email in green status.
i am using below code
TRY.
zlcl_send_request->set_document( zlcl_document ).
CATCH cx_send_req_bcs INTO zicl_oref_cast.
CLEAR gv_text_cast .
gv_text_cast = zicl_oref_cast->get_text( ).
ENDTRY.
Email sender
TRY.
zlcl_sender = cl_sapuser_bcs=>create( sy-uname ).
CATCH cx_address_bcs INTO zicl_oref_cast.
CLEAR gv_text_cast .
gv_text_cast = zicl_oref_cast->get_text( ).
ENDTRY.
TRY.
CALL METHOD zlcl_send_request->set_sender
EXPORTING
i_sender = zlcl_sender.
CATCH cx_send_req_bcs INTO zicl_oref_cast.
CLEAR gv_text_cast .
gv_text_cast = zicl_oref_cast->get_text( ).
ENDTRY.
Create the Reciever address
TRY.
zlcl_recipient = cl_cam_address_bcs=>create_internet_address(
gv_email ).
CATCH cx_address_bcs INTO zicl_oref_cast.
CLEAR gv_text_cast .
gv_text_cast = zicl_oref_cast->get_text( ).
ENDTRY.
TRY.
zlcl_send_request->add_recipient( EXPORTING i_recipient =
zlcl_recipient ).
CATCH cx_send_req_bcs INTO zicl_oref_cast.
CLEAR gv_text_cast .
gv_text_cast = zicl_oref_cast->get_text( ).
ENDTRY.
TRY.
zlcl_send_request->set_send_immediately( gc_x ).
CATCH cx_send_req_bcs INTO zicl_oref_cast.
CLEAR gv_text_cast .
gv_text_cast = zicl_oref_cast->get_text( ).
ENDTRY.
Send the mail
TRY.
zlcl_send_request->send( ).
CATCH cx_send_req_bcs INTO zicl_oref_cast.
CLEAR gv_text_cast .
gv_text_cast = zicl_oref_cast->get_text( ).
ENDTRY.Hi
From abap help:
SY-ONCOM
On Commit flag. This system field is set to different values depending on the call status of an ABAP program. Of these, only the value of u2018Pu2019 is guaranteed. If at all, SY-ONCOM must only be queried for u2018Pu2019.
The value 'P' means that the program is already executing a subroutine started using PERFORM u2026 ON COMMIT and therefore a
further subroutine call using PERFORM ... ON COMMIT would cause a runtime error.
That means the variable SY-ONCOM has the information if a process "ON COMMIT" is working and so it determines if a dump has to be raised.
Now it's clear the meaning of that correction: if before calling a new commit the value of SY-ONCOM is changed the dump will be avoided.
I've done the following texts:
REPORT ZCOMMIT.
WRITE: 'Calling routine on commit'.
PERFORM DO_SOMETHING ON COMMIT.
COMMIT WORK.
FORM DO_SOMETHING.
DATA: ONCOM TYPE SY-UCOMM.
MOVE SY-ONCOM TO ONCOM.
SY-ONCOM = 'S'.
COMMIT WORK.
MOVE ONCOM TO SY-ONCOM.
ENDFORM.
The code above is very dangerous, because it triggeres a ricorsive loop: no dump, but the form is continuously called, just as help says SY-ONCOM is equal to P
REPORT ZCOMMIT.
WRITE: 'Calling routine on commit'.
CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK.
COMMIT WORK.
FUNCTION Z_MAX_COMMIT.
DATA: ONCOM TYPE SY-UCOMM.
MOVE SY-ONCOM TO ONCOM.
SY-ONCOM = 'S'.
COMMIT WORK.
MOVE ONCOM TO SY-ONCOM.
ENDFUNCTION.
I expected the same behavior as above, but here no dump and no infinite loop, SY-ONCOM = V
Now your process working in update task, but probably many function are called, I mean the system creates a queue of functions to be run in update task, so what happens here?
I've tried this:
FUNCTION Z_MAX_COMMIT.
*"*"Function module di reg.:
*"*"Interfaccia locale:
*" IMPORTING
*" VALUE(NO_COMMIT) TYPE FLAG DEFAULT SPACE
CHECK NO_COMMIT IS INITIAL.
DATA: ONCOM TYPE SY-UCOMM.
MOVE SY-ONCOM TO ONCOM.
SY-ONCOM = 'S'.
COMMIT WORK.
MOVE ONCOM TO SY-ONCOM.
ENDFUNCTION.
REPORT ZCOMMIT.
WRITE: 'Calling routine on commit'.
CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK
EXPORTING
NO_COMMIT = 'X'.
CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK.
CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK
EXPORTING
NO_COMMIT = 'X'.
COMMIT WORK.
Here no dump and no infinite loop too, but also no impact on the rest of the functions,
I can suppose the impact will be on the saving of data on database only, because your COMMIT ends the LUW, so it's very important the routine for printing is called at the end, after all saving routines.
Max -
CO54: Message is not sent to any destination: Commit Work is getting failed
Hello,
While processing the Messages from XFP to SAP Update is getting terminated due to the use of Commit Work. SAP Note 147467 - Update termination when sending process messages has been referred which is for 4.6C, but we are in ECC6.0.
While processing the message in second iteration Commit Work triggres and Update happens in the data base.
Following Issue is only concerned with Nested HUs
T-Code used CO54
Following are the analysis:
it looks like u201CCreate and Post a Physical Inventory Docu201D is failing in the initial processing because the inventory doc is created when the Transfer Order to the PSA (or the TO from the PSA) is not yet completed (quant is still locked somehow).
CO54, process message category=ZHU_CONS: HU to be consumed is a nested pallet (unpacking/ repacking and TOs to/from) and qty to consume is greater that HU qty in SAP (creation of a physical inventory doc is required).
1. The error occurs while clearing the inventory posting for the physical inventory document.
2. The surprising factor is the u201CProcess Messageu201D is not processed correctly for the first time.
3. Indeed it is successfully processed without any error if you do process it second time.
Error Log from C054 T-Code.
02.08.2010 Dynamic List Display 1
Type
Message text
LTxt
Message category: ZHU_CONS --- Process message: 100000000000000621 "Send to All Destinations" Is Active
Message to be sent to destination:
ZHGI ZPP_0285_XFP_GOODSISSUE Individual Processing Is Active
=> Message will be sent to destination (check log for destination)
Message category: ZHU_CONS --- Process message: 100000000000000621 "Send to All Destinations" Is Active
Message destination ZPP_0285_XFP_GOODSISSUE triggered COMMIT WORK
Input parameters OK, passed to source field structure
Step 0: Now checking if scenario with HU
Step 2: Scenario with HU, Now checking if HU nested
Step 3: HU nested, checking if HU in repack area
Step 4: HU not in repack area, moving it to repack area
HU moved to repack area, TO number 0000000873
Step 5: Depacking nested HU...
Nested HU depacked, HU pallet n°: 00176127111000461994
Steps 6-7: Moving back HUs to supply storage type / bin...
HU 00376127111000462001 moved back to original area with TO number 0000000875
Steps 6-7: Moving back HUs to supply storage type / bin...
No need to move back HU 00176127111000461994 (not in table LEIN)
Step 8: Checking if HU fully used and quantity matches HU system quantity
HU not fully used but picked quantity > HU quantity: inventory necessary
Step 9: Inventory needed, creating physical inventory document...
Physical inventory document 0000000126 created
Step 10: Adding weighted quantity on inventory document...
Weighted quantity entered in document 0000000126
Step 11: Posting rectification in inventory document 0000000126...
Physical inventory document 0000000126 rectified
Error: rectification for doc 0000000126 not updated in DB!
=> Destination ZHGI ZPP_0285_XFP_GOODSISSUE can currently not process the message
=> Message is not sent to any destination
The errors in SM13 for this contain the program SAPLZPP_0285_HUINV_ENH (creating/changing the HUM physical inventory doc). WM Function module L_LK01_VERARBEITEN is also involved.
From SM13, it displays the following piece of code in include LL03TF2M (read the LEIN table=Storage Units table):
WHEN CON_LK01_NACH.
IF (LEIN-LGTYP = LK01-NLTYP AND
LEIN-LGPLA = LK01-NLPLA) OR
NOT P_LEDUM IS INITIAL.
ELSE.
Das ist der Fall einer TA-Quittierung wo Von-Hu = Nach-HU ist und sofort die WA-Buchung erfolgt. Dann steht die HU noch auf dem Von-Platz, daher darf hier kein Fehler kommen, sondern es wird ein. Flag gesetzt, daß verhindert daß die LE fortgeschrieben wird.
FLG_NO_LE_UPDATE = CON_X.
MESSAGE A558 WITH P_LENUM.
ENDIF.
Translation in English of the German text via Google:
"This is the case where confirmation of a TO source-HU = destination-HU, and now the WA (Good Issue?)- made book. Then, the HU is still on the From-space may therefore come here not a mistake, but it sets a flag that prevents that the LE is updated."
Thanks and Regards,
Prabhjot Singh
Edited by: Prabhjot Singh on Aug 2, 2010 4:39 PMHope you have carried out following things in Production ( Please refer to SAP help before actually doing it in production).
1. Transport the predefined characteristics from the SAP reference client (000) to your logon client.
2. Adopt Predefined Message Categories - In this step, you copy the process message categories supplied by SAP from internal tables as Customizing settings in your plants. -
How to execute Update Module FM after final commit work for a T-code.
Hello Folks,
I have a bit complex issue with my current object.
We have modified MM41/MM42 transactions and added a subscreen to fulfill the requirement.
We have designed the subscreen and embedded the same to MM41/MM42 through SPRO configuration.
Now for update business logic,i am trying to execute one Function module(Update Module) in update Task...so that it will be executed once after the final commit work will be done for MM41/MM42.
But its not executing.
To fulfill my requirement i need to execute the FM only after Final Commit work for MM41/MM42.
Please suggest in this regard.
Even i can see few BADI's which are triggering through MM01/MM02 but not through MM41/MM42.
BADI_ARTICLE_REF_RT
BADI_MATERIAL_CHECK
BADI_MAT_F_SPEC_SEL
Code with which i am trying is given below.
After PAI event of the subscreen---
1: MODULE USER_COMMAND_9001.
2: MODULE user_command_9001 INPUT.
PERFORM sub_save_mara ON COMMIT.
ENDMODULE.
3: FORM sub_save_mara.
CALL FUNCTION 'ZMMUPDATE_MARA_APPEND_STRUCT' "IN UPDATE TASK
EXPORTING
materialno = gv_matnr
appendmara = ty_zzmara.
ENDFORM. "sub_save_mara
4: FUNCTION zmmupdate_mara_append_struct.
""Update Function Module:
""Local Interface:
*" IMPORTING
*" VALUE(MATERIALNO) TYPE MATNR
*" VALUE(APPENDMARA) TYPE ZZMARA
Data Declaration for Local use
DATA : w_mara TYPE mara.
Selecting the latest values for the material.
SELECT SINGLE * FROM mara INTO w_mara WHERE matnr = materialno.
IF sy-subrc = 0.
Move the ZZMARA values to structure MARA
MOVE-CORRESPONDING appendmara TO w_mara.
Update the values in table MARA.
MODIFY mara FROM w_mara.
ENDIF.
ENDFUNCTION.
Kindly suggest.Thanks in advance.
Regards
AnsumeshHi..
The code given by me will work fine provided the Final commit should happen.
Because to execute FM with update task,final commit work should happen which is mandatory and after that it will call the update task.
In my case final commit work was not happeneing because..SAP standard program was not able to detect wether there is any change in my sub-screen or not as the standard program & my custom program,subscreens are different.
As it was not able to detect the change,so final commit was not happening and hence update task also.
To provide the reference of change in my subscreen to standard program ,i set a flag as per the change in the subscreen
And exported the same to memory.
Then Implemented one enhacement spot in MATERIAL_CHANGE_CHECK_RETAIL Fm where i have Imported the flag value.
Based on my custom flag value,i have set one standard flag FLG_AENDERUNG_GES which tells SAP standard program for MM42 wether any change has happened or not.
The above solved my purpose.
Regards
Ansumesh -
SO_OBJECT_SEND function does not work without an explicit COMMIT WORK
Hi,
We have used this Function module (SO_OBJECT_SEND) inside a custom BAdI Implementation , which sends e-mails when some of the fields inside an infotype are modified using transaction PA30 (HR-Maintain master data).
After the system was upgraded to BASIS version 7.0 , as per SAP note 489286 ,the calling program of the send interface must execute an explicit COMMIT WORK.But inside an update , COMMIT WORK should not be executed.
So we did not execute explicit COMMIT WORK inside BAdI.
But after this upgrade, the emails are not sent out of R/3 , and the status message 672 (Still no entry in queue) is displayed on the program 'Administration of External Send Processes' - Transaction SOST.
Can anyone suggest a solution , if you have used this Function module (SO_OBJECT_SEND) inside a BAdI during update?
Thanks,
KiranHi Kiran,
create one remote enable function module, write your required logic in this remote enableD function module.
Now call this function module in Badi as below,
eg. suppose Remote enable function module created is 'ztest'.
then,
In BadI write logic,
CALL FUNCTION 'ZTEST' SEPARATE TASK 'T'
EXPORTING ......
IMPORTING.......
also inside this function module
call function 'SO_OBJECT_SEND' separate task 'T'
exporting....
importing....
committwork.
after doing this what will happen is your mail logic will be in saperate session, so your current program will pass the data and execution of this RFC and Program having BADI, will be in two saperate sessions, so although you are using committ work standred program will not get affected.
This will improve performance too...:)
Please Give points if it is going to help you. -
COMMIT WORK AND WAIT does not work
Hello,
I know this question has been asked many times in various forums. But the fact remains that there is no definitive solution found for this problem which does not involve WAIT UP TO n SECONDS or SELECT until the DB commit has been completed.
We have an IDoc based inbound interface for creating Project Defintion and WBS Elements. Here is how the code looks like in the processing function module:
* Create Project Defintion
CALL FUNCTION 'BAPI_PROJECTDEF_CREATE'
EXPORTING
project_definition_stru = lwa_proj_bapi
TABLES
e_message_table = lt_messages.
* If no errors
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
* Other code
* Create WBS Element (BAPI could not be used because not all fields are allowed to be updated)
CALL TRANSACTION 'CJ11'
Now while creating the WBS Element, transaction CJ11 returns an error that 'Project does not exist'. This is not correct because the same Project was successfully created in the previous step.
It is clear that the problem is because of the delay in database commits.
This happens only with few IDoc's and not all of them. And of course, the problem does not occur if I induce WAIT UP TO n SECONDS after BAPI_TRANSACTION_COMMIT. But this is not the best practice.
The question is why BAPI_TRANSACTION_COMMIT does not wait even though we are forcing it to?
Thanks in advance
Sagar AcharyaSuhas wrote:
But i am baffled that although the COMMIT has happened earlier why is the data not updated in the DB ?
Well, it's just a [COMMIT WORK|http://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm] and not a [COMMIT WORK AND WAIT|http://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm#@@AND%20WAIT@@COMMIT%20WORK@@]. Let me quote the ABAP help:
If you do not specify the addition AND WAIT, the program does not wait until the update work process has executed it (asynchronous updating), but instead is resumed immediately after COMMIT WORK. However, if the addition AND WAIT is specified, program processing after COMMIT WORK will not continue until the update work process has executed the high-priority update function modules (synchronous updating).
@Sagar Acharya: Well, I thought you were looking for an explanation why sometimes the project isn't created (and you only had posted coding that showed details for step 1) - I'm trying hard, but my mind reading skills are rather limited yet...
So let's think about step 2 and 3: I assume that you made sure that your coding always references the correct WBS element. Again the commit (without wait) is done already via CJ11 (e.g. check form BUCHEN in SAPLCJWB). I'd expect though that the synchronous update mode should make this work. Since it doesn't, I'd try local update mode, which is what I'd choose in your case anyhow.
Apart from that my mind is pretty blank, except for the usual silly things to check. E.g. are you sure you're coding is correct, you are handling all return messages and log them for inspection later (e.g. application log), you are certain that the WBS was actually created by the same IDoc that throws the fit (and IDoc was not reprocessed), etc.
So maybe somebody else has better ideas... -
Lock and Commit work in INBOUND IDOC
Hi Experts,
Problem is about lock and commit work
i need to receive idoc for Good receipt for purchase order.
For one Purchase Order i can receive many good receipt Idoc at the same time and when first came in Lock the Purchase Order and further idoc came after give Errors becouse purchase Order is lock.
Problem is not the serialization (the sequence is correct), but is the lock.
Any idea on how to fix this issue? (maybe there is some std settings??)
Cheers
BorisHello Guys
the packetsize is already set to 1 but the problem still again..... and where i can find this setting "in Customizing choose Engineering Change Management ® Define statuses for master record". ?
Any way i try in function module in inbound to check the lock object with this sample code:
DO 30 TIMES.
CALL FUNCTION 'ENQUEUE_EMEKKOS'
EXPORTING
mode_ekko = 'S'
mandt = sy-mandt
ebeln = goodsmvt_item-po_number
_scope = '2'
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
WAIT UP TO 1 SECONDS.
ELSE.
EXIT.
ENDIF.
ENDDO.
but also with this....problem syill again...
thanks
Boris -
Commit work statement creating problem in CALL TRANSACTION
Hi Friends,
we are facing a problem where we need to call a standard program from a Zprogram.
we have tried the following ways.
1. Using SUBMIT statement , we are sending the parameters to the standard program, but when the standard program gives a
dump our program cannot process further records. we are calling the submit statment in a loop. As because the standard
program is giving dump our program is not able to process the next record in the loop and this should not be the case.
To avoid this we have used the second method.
2. we used a CALL transaction, we have created a Tcode for the standard program and called this transaction in the calling
program. We are passing the parameters for the standard program via BDC table. this works fine even when the standard
program gives a dump but when ever the control comes across a Commit work statement the the control comes back to our
calling program with out executing the rest of the statments after the commit.
now our concern is even though there is an commit work statement , statements after the commit work should also get executed in call transaction. Is thee any way?
Regards,
SravanHi All,
I got the solution
DATA: ctu_parameters TYPE ctu_params.
ctu_parameters-dismode = 'E'.
ctu_parameters-updmode = 'A'.
ctu_parameters-racommit = 'X'. "No abortion by COMMIT WORK
CALL TRANSACTION USING itab_bdcdata OPTIONS FROM ctu_parameters.
the above code will work even if there is an commit work . This might help some others. -
Need help: Sending mail to internet address without commit work statement
Dear Experts,
I have a problem in sending mails from sap to internet address.Am using the function module
SO_NEW_DOCUMENT_SEND_API1 and am passing parameters like,
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_TYPE = 'RAW'
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
My problem here is,with the commit work statement after FM, the mail is triggering correctly.but if, am not using the commit work statement,at the very first time of execution mail is not triggering, and the second time of execution first mail is triggering like wise it is going.The status of the message is waiting in queue.
i have refresh receiver's list also.I want to use this concept in badi.So anyone can pls help me,how to send a mail without commit work statement.
Thanks in advance.There is a parameter Commit_Work pass it as 'X'
<code>
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_TYPE = 'RAW'
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
commit_work = 'X'
TABLES
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
</code>
Edited by: Saravanan Ramasamy on Nov 11, 2009 1:31 PM -
Continue behind COMMIT WORK.
Hi all,
I am facing problem with COMMIT WORK in my STANDARD SAP modification for executing ABAP Proxy. The problem is that the program doesnt continue after COMMIT WORK (messages, screens), but return to the initial screen.
Is there any way to commit data sent via proxy and then continue (with next proxy calling, processing screens etc)?
Thank you very much.
Frantisek Holas, CZHi,
I solved the problem myself.
http://help.sap.com/saphelp_nw70/helpdata/EN/41/7af4e3a79e11d1950f0000e82de14a/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/EN/41/7af4e3a79e11d1950f0000e82de14a/frameset.htm
The point of solve the problem is place certain statements following with commit into standalone report, that you can call with SUBMIT command, passing value from ABAP memory or via select-option, as explained in documentation for SUBMIT STATEMENT.
The trick of this solution is that calling new report via submit creates new SAP LUW, which can contain COMMIT WORK, that commit ONLY SAP LUW of the called report. When the report finishes and you return to the calling report/fm/trasaction/..., the SAP LUW of the calling rept/fm/transaction/... continue not affected by this COMMIT.
It helped me to solve my problem. -
The abap dump is occured in function module when the COMMIT WORK statement is executed.
This function module updates a custom table.
When creating a invoice through VF01 transaction this abap dump is occured.
But for the next time the invoice is created successfully.
What is the reason behind this.Hi,
Refer
https://forums.sdn.sap.com/click.jspa?searchID=11053241&messageID=5085300
Regards
Kiran Sure
Maybe you are looking for
-
Logic keeps randomly quitting when I'm mixing or just listening to my project with no consistency. I've tried restarting it, closing all my other apps, and restarting my computer and none of it worked. I'm on Yosemite 10.10 and logic X. The crash rep
-
All sql is working fine except for the COUNT statement ... ?
This piece of code using taglib <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> <sql:query var="aantalantw" scope="session"> SELECT COUNT(*) FROM antwoorden </sql:query> <c:out value="${aantalantw}"/> This result should be som
-
Cost of Balckberry Classic in India
Can anyone lemme know if Blackbery Classic is availabe in Indian market and the cost of the same. Want to gift it o someone special.
-
Raw Camera Support for OS 10.3.9
Hi There, I have an eMac running on OS 10.3.9 (Panther) which I am unable to upgrade either with Adobe Plug-ins or Apple software fixes to support RAW camera formats. It would be great if someone could let me know the following: A) If there is a quic
-
Embedded video is black but with audio, but the video works fine on youtube.
I'm having trouble with firefox not been able to display embedded video on sites. I see the preview image but when i start play all video area becomes black and I can hear the audio playing. I also can pause the "video". If I start firefox in safe mo