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

please help with BDC error

aris_hidalgo
Contributor
0 Likes
1,004

Hello guys,

I recently modified a BDC program and I configured it's mode to be 'E' so when errors are present,pop up windows are shown. Unfortunately I can't seem to find the error. I will post below the code. What I did with the code was to clear the value of anep-anbtr to no value. help would really be appreciated. Thanks guys!

FORM GENERATE_BDC_DATA_ABAA.

DATA: I_ANBTR LIKE ANEP-ANBTR.

DATA: C_ANBTR(16), C_ANBTR2(16), C_DMBTR(16).

PERFORM BDC_DYNPRO USING 'SAPMA01B' '0100'.

PERFORM BDC_FIELD USING:

'BDC_OKCODE' '/00',

'ANBZ-BUKRS' 'GLOB',

'ANBZ-ANLN1' IT_REC-ANLN1,

'ANBZ-ANLN2' IT_REC-ANLN2,

'ANEK-BLDAT' IT_REC-BLDAT,

'ANEK-BUDAT' IT_REC-BUDAT,

'ANBZ-PERID' IT_REC-PERID,

'ANBZ-BWASL' IT_REC-BWASL.

PERFORM BDC_DYNPRO USING 'SAPMA01B' '0110'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'.

PERFORM BDC_FIELD USING 'ANBZ-DMBTR' IT_REC-DMBTR.

PERFORM BDC_FIELD USING: 'ANBZ-BZDAT' IT_REC-BUDAT,

'ANEK-SGTXT' IT_REC-SGTXT.

"I_ANBTR = '0'. "IT_REC-DMBTR * -1.

perform bdc_dynpro using 'SAPMA01B' '0285'. " '0600'.

*AVH

clear anep-anbtr.

perform bdc_field using 'BDC_CURSOR'

'ANEP-ANBTR'.

perform bdc_field using 'BDC_OKCODE'

'=AUSF'.

*AVH

clear anep-anbtr.

PERFORM BDC_DYNPRO USING 'SAPMA01B' '0285'. " '0600'.

*AVH

clear anep-anbtr.

PERFORM BDC_FIELD USING 'BDC_CURSOR' 'ANEP-ANBTR'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '=AUSF'.

PERFORM BDC_FIELD USING 'ANEP-ANBTR' '0'.

*AVH

clear anep-anbtr.

PERFORM BDC_DYNPRO USING 'SAPMA01B' '0110'.

PERFORM BDC_FIELD USING:

'BDC_OKCODE' '=UPDA',

'ANBZ-DMBTR' IT_REC-DMBTR,

'ANBZ-BZDAT' IT_REC-BUDAT,

'ANEK-SGTXT' IT_REC-SGTXT.

PERFORM BDC_DYNPRO USING 'SAPMA01B' '0285'. " '0600'.

*AVH

clear anep-anbtr.

PERFORM BDC_FIELD USING:

'BDC_CURSOR' 'ANEP-ANBTR',

'BDC_OKCODE' '=AUSF'.

PERFORM BDC_FIELD USING 'ANEP-ANBTR' '0'.

*AVH

clear anep-anbtr.

PERFORM BDC_DYNPRO USING 'SAPMA01B' '0285'. " '0600'.

*AVH

clear anep-anbtr.

PERFORM BDC_FIELD USING:

'BDC_CURSOR' 'ANEP-ANBTR',

'BDC_OKCODE' '=AUSF'.

PERFORM BDC_FIELD USING 'ANEP-ANBTR' '0'.

*AVH

clear anep-anbtr.

PERFORM BDC_DYNPRO USING 'SAPMA01B' '0110'.

PERFORM BDC_FIELD USING:

'BDC_OKCODE' '=UPDA'.

ENDFORM. " GENERATE_BDC_DATA_ABAA

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
887

Did you you use call transaction or session method?

7 REPLIES 7
Read only

suresh_datti
Active Contributor
0 Likes
887

Hi,

What is the error that you get? syntax error?

Regards,

Suresh Datti

Read only

0 Likes
887

I just know that it has an error because the BDC 'mode' is 'E'. And yes, the program used call transaction. So when I run the program and the transaction that is being called shows up, the ok-code pop up window shows up. If you review my code, what i'm trying to do is to change the value of anep-anbtr in screen 285. Thanks a lot guys...

Read only

0 Likes
887

for the error messages to be displayed in call transaction,

u need to call a fn module

BAPI_MESSAGE_GETDETAIL .

or READ TABLE T100

Read only

Former Member
0 Likes
887

Clearing ANBTR like this 'clear anep-anbtr' will not achieve any result as what you are doing here is just clearing a variable not the screen field value. For that you have to do this.

PERFORM BDC_FIELD USING 'ANEP-ANBTR' anep-anbtr.

Read only

Former Member
0 Likes
888

Did you you use call transaction or session method?

Read only

Former Member
0 Likes
887

Check Sy-subrc after CALL TRANSACTION.

If its 4 then wite the contents of BDCDATA to know what

data is causing the error.

Thanks & Regards,

Ankur

Read only

Former Member
0 Likes
887

Hi Viray,

Try to use MESSAGE_PREPARE Function Module. It'll show the errors columnwise so based on that i hope u can rectify.

cheers & ByE......,

Suresh Kancharla