Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Bdc Call transaction

hi ,

i have to develop bdc for upload the data to VA01 and VA02 Transactions,

i developed a code but here i am not able to call VA01 t.code after VA02.

here my requirement is 1 st have to run VA02 Based onthat i have to create SUBSEQUENT ORDRE TYPES .

here i am pasting my logic

please give me solution.

LOOP AT RECORD.

if sy-subrc <> 0. exit. endif.

perform bdc_dynpro using 'SAPMV45A' '0102'.

perform bdc_field using 'BDC_CURSOR'

'VBAK-VBELN'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'VBAK-VBELN'

  • '5710000102'.

record-vbeln.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_OKCODE'

'/EFAU1'.

perform bdc_field using 'VBKD-BSTKD'

  • '23'.

record-bstkd.

perform bdc_field using 'VBKD-BSTDK'

  • '04.04.2008'.

record-bstdk.

perform bdc_field using 'KUAGV-KUNNR'

  • '2600000016'.

record-kunnr.

perform bdc_field using 'KUWEV-KUNNR'

  • '2600000016'.

record-KUNNR1.

perform bdc_field using 'RV45A-KETDAT'

  • '08.01.2008'.

record-ketdat.

perform bdc_field using 'RV45A-KPRGBZ'

  • 'D'.

record-kprgbz.

perform bdc_field using 'BDC_CURSOR'

'VBAP-POSNR(01)'.

perform bdc_field using 'RV45A-VBAP_SELKZ(01)'

'X'.

perform bdc_transaction using 'VA02'.

perform bdc_dynpro using 'SAPMV45A' '0101'.

perform bdc_field using 'BDC_CURSOR'

'VBAK-AUART'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'VBAK-AUART'

  • 'zdps'.

record-auart.

perform bdc_field using 'VBAK-VKORG'

  • 'IN01'.

record-vkorg.

perform bdc_field using 'VBAK-VTWEG'

  • 'AI'.

record-vtweg.

perform bdc_field using 'VBAK-SPART'

  • 'LF'.

record-spart.

perform bdc_dynpro using 'SAPLV45C' '0100'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'BDC_CURSOR'

'LV45C-VBELN'.

perform bdc_field using 'LV45C-VBELN'

  • '5710000102'.

record-vbeln.

perform bdc_dynpro using 'SAPLV45C' '0100'.

perform bdc_field using 'BDC_OKCODE'

'=UEBR'.

perform bdc_field using 'BDC_CURSOR'

'LV45C-VBELN'.

perform bdc_field using 'LV45C-VBELN'

  • '5710000102'.

record-vbeln.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'BDC_CURSOR'

'VBKD-BSTDK'.

perform bdc_field using 'VBKD-BSTKD'

  • '23'.

record-bstkd.

perform bdc_field using 'VBKD-BSTDK'

  • '04.04.2008'.

record-bstdk.

perform bdc_field using 'KUAGV-KUNNR'

  • '2600000016'.

record-KUNNR.

perform bdc_field using 'KUWEV-KUNNR'

  • '2600000016'.

record-KUNNR1.

perform bdc_field using 'RV45A-KETDAT'

  • '08.01.2008'.

record-ketdat.

perform bdc_field using 'RV45A-KPRGBZ'

  • 'D'.

record-kprgbz.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_OKCODE'

'=SICH'.

perform bdc_field using 'VBKD-BSTKD'

  • '23'.

record-bstkd.

perform bdc_field using 'VBKD-BSTDK'

  • '04.04.2008'.

record-bstdk.

perform bdc_field using 'KUAGV-KUNNR'

  • '2600000016'.

record-KUNNR.

perform bdc_field using 'KUWEV-KUNNR'

  • '2600000016'.

record-KUNNR1.

perform bdc_field using 'RV45A-KETDAT'

  • '08.01.2008'.

record-ketdat.

perform bdc_field using 'RV45A-KPRGBZ'

  • 'D'.

record-kprgbz.

perform bdc_field using 'BDC_CURSOR'

'RV45A-MABNR(02)'.

perform bdc_transaction using 'VA01'.

*CLEAR RECORD.

ENDLOOP.

*perform close_group.

&----


*& Form bdc_dynpro

&----


  • text

----


  • -->P_0231 text

  • -->P_0232 text

----


FORM BDC_DYNPRO USING p_gv_program LIKE bdcdata-program

p_gv_dynpro LIKE bdcdata-dynpro.

CLEAR gt_bdcdata.

gt_bdcdata-program = p_gv_program.

gt_bdcdata-dynpro = p_gv_dynpro.

gt_bdcdata-dynbegin = 'X'.

APPEND gt_bdcdata.

ENDFORM. "BDC_DYNPRO

&----


*& Form bdc_field

&----


  • text

----


  • -->P_0236 text

  • -->P_0237 text

----


FORM bdc_field USING p_gv_fnam

p_gv_fval.

CLEAR gt_bdcdata.

gt_bdcdata-fnam = p_gv_fnam.

gt_bdcdata-fval = p_gv_fval.

APPEND gt_bdcdata.

ENDFORM. "BDC_FIELD

&----


*& Form bdc_transaction

&----


  • text

----


  • -->P_0301 text

----


FORM bdc_transaction USING VALUE(P_0301).

CALL TRANSACTION 'VA02' USING gt_bdcdata MODE 'A' UPDATE 'S'.

IF SY-SUBRC = 0.

CALL TRANSACTION 'VA01' USING gt_bdcdata MODE 'A' UPDATE 'S'.

ENDIF.

ENDFORM. " bdc_transaction

Not what you were looking for? View more on this topic or Ask a question