‎2008 Apr 25 10:21 AM
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'.
‎2008 Apr 25 10:30 AM
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.