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

BDC problem

Former Member
0 Likes
834

I created a recording for transaction KE51 (create profit center)

When i run this using call transaction , the execution stops at second step (screen.

Although its okay in session method.

The program is as follows

report ZVAT_PRCTR

no standard page heading line-size 255.

include bdcrecx1.

start-of-selection.

perform open_group.

perform bdc_dynpro using 'SAPLRKPM' '0200'.

perform bdc_field using 'BDC_CURSOR'

'PRCT_V-PRCTR'.

perform bdc_field using 'BDC_OKCODE'

'=MD_SMDM'.

perform bdc_field using 'PRCT_V-PRCTR'

'TEST19'.

perform bdc_field using 'PRCT_V-REF_KOKRS'

'1003'.

perform bdc_dynpro using 'SAPLRKPM' '0298'.

perform bdc_field using 'BDC_OKCODE'

'=MD_ACTIVATE'.

perform bdc_field using 'BDC_CURSOR'

'PRCT_V-KHINR'.

perform bdc_field using 'PRCT_V-DATAB'

'01.05.2006'.

perform bdc_field using 'PRCT_V-DATBI'

'31.12.9999'.

perform bdc_field using 'PRCT_V-KTEXT'

'Test Profit Center'.

perform bdc_field using 'PRCT_V-LTEXT'

'Test Profit Center'.

perform bdc_field using 'PRCT_V-VERAK'

'Roger federrer'.

perform bdc_field using 'PRCT_V-KHINR'

'54T_AM'.

perform bdc_transaction using 'KE51'.

perform close_group.

let me know where i am going wrong ?

Regards

Alok Pathak

6 REPLIES 6
Read only

Former Member
0 Likes
777

Hi Alok,

If you run in 'A' All Screen mode, what is the message you are getting in second step?

Any ok_code or data is missing?

Regards,

Raj

Read only

0 Likes
777

Initially i created a session and it worked fine ,later on i changed the values and tried call transaction option . It didn't work. The OK_CODE and data is perfectly correct, but the execution stopped at the second screen

Read only

0 Likes
777

i think there in mistake in some value...

r u sure that u put proper value for craeting profit center .. plz 1st check it ...

Read only

Former Member
0 Likes
777

i think when u run 2nd time ur code by any method it fails.

becoz u hard coded the value in bdc(only one recored)

when u first run using session method profut center created.

when u run it 2nd time u have to pass new value to ur code.

Read only

Former Member
0 Likes
777

Hi,

perform bdc_field using 'PRCT_V-PRCTR'

<b>'TEST19'.</b>

change your procit centre no ezch time you

run BDC. Problem is that TEST19 procit center

is already created and syatem prompts you to

enter other procit center name.

Regards

Amole

Read only

Former Member
0 Likes
777

I Alok,

One of the resons may be u r no clearing internal tables I_BDCDATA and I_BDCMSG after call transaction statement.

Try this out. Hope it helps.

Regards

Saurabh.