2009 Dec 17 7:21 AM
Dear Guru's,
I have written a BDC for uploading billing from delivery , and creating header text in the same.
It contains 3 perform statement in start-of-selection.
START-OF-SELECTION.
PERFORM data_upload_itab. " Where I upload data into internal table.
PERFORM bdc_data1. " Where recording done by call transaction.
PERFORM CREATE_HEADER_TEXT. "Where text is created via FM CREATE_TEXT.
but a strange is that this above coding is not executed properly , as after perform BDC_DATA1 the next perform statement not
get executed.
but if I put a break point in between BDC_DATA1 and CREATE_HEADER_TEXT then it is working fine. I am using MESSTAB(BDC's)
to get the document number which is created in BDC_DATA1 and then use it for create_text.
Edited by: CONTACTSANKU on Dec 17, 2009 12:52 PM
2009 Dec 17 7:25 AM
I think you are missing commit_text or save_text function calls..in your code..
2009 Dec 17 7:25 AM
I think you are missing commit_text or save_text function calls..in your code..
2009 Dec 17 8:58 AM
Execution is not going to perform CREATE_HEADER_TEXT.
It skip the perform segment.
I have tried ur suggession , but still it is not working.
By the way the info was helpful
Thanks.
2009 Dec 17 10:01 AM
When you are debugging a program, you are delaying its execution a while, although you press F8 when the breakpoint stops the program and creates the debugging session.
When you execute the program "normally", this delay doesn't exist.
Can you check something? Add a small delay between both performs and tell us the result. Start with 5s (for example), and if it works, lower the amount of seconds until it stops working.
A better and cleaner option is to add a check before the second PERFORM to be sure your item has been created before continue, and not a crude WAIT (but you can save some time testing my supposition using WAIT, and if I'm right, then you can code a cleaner and better check).
2009 Dec 17 10:21 AM
Vicenc,
Your suggession is correct. when I put WAIT UP TO 1 SECONDS then it is executed properly. So , That means it is basically using the COMMIT time for the documents in the database , and due to this time the CREATE_TEXT is not working as it does not have any document at that moment of execution.
Yeah this is really helpful answer , but still looking for alternate of WAIT statement.
Thanks,
Sanku.
2009 Dec 17 10:50 AM
The alternate for a WAIT statement is a DO-ENDDO. Something like:
do.
select single.
if sy-subrc = 0.
exit loop.
elseif time_excessive.
message error_not_created.
endif.
enddo.Just ensure yourself the DO-ENDDO will not last too much. I cannot provide you the tables where you must do the SELECT because I don't know which ones are updated with your BDC. But I'm sure you've got the idea
Edited by: Vicenç Lozano on Dec 17, 2009 10:51 AM
2011 Mar 29 7:36 AM