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 on BDC

Former Member
0 Likes
479

I create a BDC to simulate the MRI7 process in my program, But i have a problem about that. The following is my BDC code. First of all, after enter the first screen by MIR7, then change company and finally, input header data. But I found that after I check the company, the subsequence code will not be input. Then I use the T-code to simulate the process, after change the company and press enter, trigger error message "invalid date", How to ignore those error and input subsequence data.

Remark: The code was generated by SHDB. Thanks!

perform bdc_dynpro using 'SAPLMR1M' '6000'.

perform bdc_field using 'BDC_OKCODE'

'/ENEWCC'.

perform bdc_dynpro using 'SAPLACHD' '1000'.

perform bdc_field using 'BDC_CURSOR'

'BKPF-BUKRS'.

perform bdc_field using 'BKPF-BUKRS'

p_lifnr+6(4).

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_dynpro using 'SAPLMR1M' '6000'.

perform bdc_field using 'RM08M-VORGANG'

'1'.

perform bdc_dynpro using 'BDC_CURSOR'

'INVFO-BLDAT'.

perform bdc_field using 'INVFO-BLDAT'

lv_date.

perform bdc_field using 'INVFO-BUDAT'

lv_date.

perform bdc_field using 'INVFO-XBLNR'

'Reference'.

perform bdc_field using 'INVFO-WRBTR'

'5000'.

perform bdc_field using 'INVFO-MWSKZ'

'P0'.

perform bdc_field using 'BDC_OKCODE'

'=/00'.

1 REPLY 1
Read only

Sougata
Active Contributor
0 Likes
372

Sounds like the date format that you are passing to the fields 'INVFO-BLDAT' and 'INVFO-BUDAT' are in an incorrect format which is not expected by the system. These fields are date fields and SAP expects you'll convert the date to YYYYMMDD format before passing it to BDC for the Call Transaction. So convert the date format first in your variable lv_date into YYYYMMDD format and then continue:


perform bdc_field using 'INVFO-BLDAT'  lv_date.
perform bdc_field using 'INVFO-BUDAT'  lv_date.
.....

Hope this solves your issue.

Cheers,

Sougata.