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 with BDC session

Former Member
0 Likes
609

Hi,

I am currently coding a BDC program for transaction FB09.

When executing the program, the following message appeared:

"Field RF05L-BUZEI. input value is longer than screen field"

following are my BDC codes:

PERFORM bdc_dynpro USING 'SAPMF05L' '0102'.

PERFORM bdc_field USING 'BDC_CURSOR' 'RF05L-BELNR'.

PERFORM bdc_field USING 'BDC_OKCODE' '/00'.

PERFORM bdc_field USING 'RF05L-BELNR' 'T_BSEG-XBELNR'.

PERFORM bdc_field USING 'RF05L-BUKRS' 'BSEG-BUKRS'.

PERFORM bdc_field USING 'RF05L-GJAHR' 'BSEG-GJAHR'.

PERFORM bdc_field USING 'RF05L-BUZEI' 'T_BSEG-XBUZEI'.

the "T_BSEG-XBUZEI" field is declared LIKE BSEG-BUZEI, so i presume the field length should be the same.

if i remove the last line in this code, the message will be changed to

"Field RF05L-GJAHR. input value is longer than screen field", which is the line above.

Appreciate if any guru can advise how to solve this, thanks.

Regards,

CL

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
517

Please remove single quotes. FOllowing is the correct code:

PERFORM bdc_dynpro USING 'SAPMF05L' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RF05L-BELNR'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RF05L-BELNR' T_BSEG-XBELNR.
PERFORM bdc_field USING 'RF05L-BUKRS' T_BSEG-BUKRS.
PERFORM bdc_field USING 'RF05L-GJAHR' T_BSEG-GJAHR.
PERFORM bdc_field USING 'RF05L-BUZEI' T_BSEG-XBUZEI.

4 REPLIES 4
Read only

Former Member
0 Likes
517

Hi,

When you populate BDC data,

PERFORM bdc_field USING 'RF05L-BUZEI' 'T_BSEG-XBUZEI'.

Here first field is Screen field name and second field should contain value you need to pass to this field.

So here you need to pass value in stead of 'T_BSEG-XBUZEI'. It should be some internal table field reference.

Something like : PERFORM bdc_field USING 'RF05L-BUZEI' ITAB-BUZEI.

Hope this helps.

ashish

Read only

Former Member
0 Likes
518

Please remove single quotes. FOllowing is the correct code:

PERFORM bdc_dynpro USING 'SAPMF05L' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RF05L-BELNR'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RF05L-BELNR' T_BSEG-XBELNR.
PERFORM bdc_field USING 'RF05L-BUKRS' T_BSEG-BUKRS.
PERFORM bdc_field USING 'RF05L-GJAHR' T_BSEG-GJAHR.
PERFORM bdc_field USING 'RF05L-BUZEI' T_BSEG-XBUZEI.

Read only

Former Member
0 Likes
517

Hi CL,

I think there is lot many corrections related to data required in your BDC

For eg

PERFORM bdc_field USING 'RF05L-BELNR' <b>'T_BSEG-XBELNR'</b>. replace with <b>t_bseg-xbelnr</b>

PERFORM bdc_field USING 'RF05L-BUKRS'<b> 'BSEG-BUKRS'</b>.

PERFORM bdc_field USING 'RF05L-GJAHR' <b>'BSEG-GJAHR'</b>.

PERFORM bdc_field USING 'RF05L-BUZEI' <b>'T_BSEG-XBUZEI'</b>.

Same with the fields in BOLD. They should be values from internal table.

Regards,

Atish

Read only

varma_narayana
Active Contributor
0 Likes
517

Hi..

The reason for this Error is bcoz u are Passing the Field Names(Literals) like 'T_BSEG-XBUZEI' instead of Field values T_BSEG-XBUZEI.

So change the code like this:

PERFORM bdc_dynpro USING 'SAPMF05L' '0102'.

PERFORM bdc_field USING 'BDC_CURSOR' <b>RF05L-BELNR.</b>

PERFORM bdc_field USING 'BDC_OKCODE' '/00'.

PERFORM bdc_field USING 'RF05L-BELNR' <b>T_BSEG-XBELNR.</b>

PERFORM bdc_field USING 'RF05L-BUKRS' <b>BSEG-BUKRS.</b>

PERFORM bdc_field USING 'RF05L-GJAHR' <b>BSEG-GJAHR.</b>

PERFORM bdc_field USING 'RF05L-BUZEI' <b>T_BSEG-XBUZEI.</b>

It works properly now

<b>REWARD IF HELPFUL.</b>