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

BDC Problem

Former Member
0 Likes
453

Hi,

I am running a BDC for VF01.

Invoice with reference to Sales Order.

For the first iteration, the SO is picked from internal table and passed to VF01 screen field.

In the second iteration, my internal table field is not getting passed but the last sales order is coming up there automatically in VF01.

Any idea how to refresh that VF01 screen field before calling the second iteration?

Please reply

Thanks in advance.

3 REPLIES 3
Read only

JozsefSzikszai
Active Contributor
0 Likes
407

hi Pranu,

check if there is any parameter (in user master record) which controls this. Also check if there is any menu option in VF01 to clear everything.

ec

Read only

Former Member
0 Likes
407

Hi Pranu,

Check your internal table values in the debugging mode.

Check the exact values from the internal tables are getting populated in the BDC.

Read only

0 Likes
407

I have checked it.

The problem comes if I run call transaction with No screens

If I run with all screens, I am getting correct entries.

========

Please correct the code if any error.

LOOP AT ITAB_VBUK.

  • DO.

  • READ DATASET DATASET INTO RECORD.

  • IF SY-SUBRC <> 0. EXIT. ENDIF.

  • PERFORM BDC_DYNPRO USING 'SAPMV60A' '0102'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • ITAB_VBUK-VBELN.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '/00'.

  • PERFORM BDC_FIELD USING 'KOMFK-VBELN(01)'

  • ITAB_VBUK-VBELN.

    • RECORD-VBELN_01_001.

  • PERFORM BDC_DYNPRO USING 'SAPMV60A' '0104'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'ZESO'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=SICH'.

  • PERFORM BDC_TRANSACTION USING 'VF01'.

  • ENDDO.

perform bdc_dynpro using 'SAPMV60A' '0102'.

perform bdc_field using 'BDC_CURSOR'

ITAB_VBUK-VBELN.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMV60A' '0104'.

perform bdc_field using 'BDC_CURSOR'

ITAB_VBUK-VBELN.

  • 'VBRK-FKART'.

perform bdc_field using 'BDC_OKCODE'

'=SICH'.

*perform bdc_transaction using 'VF01'.

CALL TRANSACTION 'VF01' USING BDCDATA MODE 'N'

UPDATE 'A'

MESSAGES INTO MESSTAB.

COMMIT WORK AND WAIT.

clear bdcdata.

refresh bdcdata.

ENDLOOP.

loop at MESSTAB.

write : Messtab.

endloop.

ENDFORM. " CREATE_INVOICE

----


  • Start new screen *

----


FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

ENDFORM. "BDC_DYNPRO

----


  • Insert field *

----


FORM BDC_FIELD USING FNAM FVAL.

IF FVAL <> SPACE.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

ENDIF.

ENDFORM. "BDC_FIELD