Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in BDC program

Former Member
0 Likes
825

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

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
796

I think you are missing commit_text or save_text function calls..in your code..

6 REPLIES 6
Read only

former_member156446
Active Contributor
0 Likes
797

I think you are missing commit_text or save_text function calls..in your code..

Read only

0 Likes
796

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.

Read only

VXLozano
Active Contributor
0 Likes
796

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).

Read only

Former Member
0 Likes
796

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.

Read only

VXLozano
Active Contributor
0 Likes
796

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

Read only

Former Member
0 Likes
796

thanks