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

Error in BDC_INSERT

Former Member
0 Likes
697

Hello Everyone,

i have created a BDC in session method,

the screens and all are supposed to be correct and still i am getting this error.

"BDC_INSERT, screen .&. is invalid"

i am using the same screens in many different programs, so i strongly feel that there is no problem with the screen. i have come across this error for the first time

in debugging, it is going into at end of xblnr, but when going to perform bdc_insert there is some error there...

the following is the code...

FORM SESSION.

LOOP AT RECORD.

REFRESH BDCDATA.

AT NEW XBLNR.

PERFORM HEADER_DATA.

ENDAT.

IF RECORD-NEWBS EQ '40' OR

RECORD-NEWBS EQ '50'.

PERFORM LINEITEM_40_50.

ELSEIF RECORD-NEWBS EQ '01' OR

RECORD-NEWBS EQ '11'.

PERFORM LINEITEM_01_11.

ELSEIF RECORD-NEWBS EQ '25' OR

RECORD-NEWBS EQ '35' OR

RECORD-NEWBS EQ '21' OR

RECORD-NEWBS EQ '31'.

PERFORM LINITEM_25_35_21_31.

ELSEIF RECORD-NEWBS EQ '29' OR

RECORD-NEWBS EQ '39'.

PERFORM LINEITEM_29_39.

ELSE.

MESSAGE E999 WITH RECORD-NEWBS 'POST KEY NOT USED IN THIS UPLOAD'.

ENDIF.

AT END OF XBLNR.

PERFORM BDC_DYNPRO USING 'ZSAPMF05A' '0700'.

PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RF05A-NEWBS'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '=BU'.

PERFORM BDC_INSERT.

ENDAT.

ENDLOOP.

PERFORM BDC_CLOSE.

so, pls let me know what i have to do to avoid this error.....

Thanks in Advance,

CAPC

3 REPLIES 3
Read only

Former Member
0 Likes
472

change ur code:

existed code:

AT END OF XBLNR.

PERFORM BDC_DYNPRO USING 'ZSAPMF05A' '0700'.

PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RF05A-NEWBS'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '=BU'.

PERFORM BDC_INSERT.

ENDAT.

ENDLOOP.

new code:

once control reaches to at end of xblnr.

do not perfrom any thing there, set a flag value = X.

AT END OF XBLNR.

v_flag = 'X'.

ENDAT.

if v_flag = 'X'.

PERFORM BDC_DYNPRO USING 'ZSAPMF05A' '0700'.

PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RF05A-NEWBS'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '=BU'.

PERFORM BDC_INSERT.

clear: v_flag.

endif.

ENDLOOP.

at end of xblnr, all the fields next to the xblnr becomes zero.

so u can't do this inside the control statetment.

try this, def. it will work.

Read only

0 Likes
472

Thanks a lot....for your reply...

but i still have the same error coming up....can u pls help me..

thanks and regards,

CAPC

Read only

0 Likes
472

Hi

I don't think you have any issue with writing the code in at end of control statement. in any case if thats helpful retain the code...

I believe that the problem can be because of either of the 2 cases below.. check these...

1. In debug mode when you reach the At end of control statement check the BDCDATA table... it is possible that any of the screens populated earlier may be wrong.

2. Clear the BDC table once you use BDC_INSERT.

-

Santosh