Skip to Content

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

BDC not working in Background

Hi,

I have recorded BDC for QE01, if i execute BDC in Foreground it's working fine but when i execute it in Back ground it does not upload Data.Please suggest the solution.

Code is as below.

LOOP AT IT_QAMV INTO WA_QAMV.

REFRESH BDCDATA.

PERFORM BDC_DYNPRO USING 'SAPMQEEA' '0100'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'QALS-PRUEFLOS'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENT0'.

PERFORM BDC_FIELD USING 'QALS-PRUEFLOS'

WA_QAMV-PRUEFLOS."'40000000253'.

PERFORM BDC_FIELD USING 'QAQEE-VORNR'

WA_QAMV-VORNR. "'0010'.

PERFORM BDC_FIELD USING 'QAQEE-PRPLATZWRK'

WA_QAMV-WERKS. "'2010'.

PERFORM BDC_FIELD USING 'QAQEE-MODUS'

'1'.

PERFORM BDC_FIELD USING 'QAQEE-PRUEFER'

SY-UNAME."'TCSQM'.

PERFORM BDC_FIELD USING 'QAQEE-PRUEFZEITV'

'00:00:00'.

READ TABLE IT_QALS INTO WA_QALS

WITH KEY PRUEFLOS = WA_QAMV-PRUEFLOS BINARY SEARCH.

IF SY-SUBRC = 0.

LOOP AT IT_INPUT INTO WA_INPUT WHERE MATNR = WA_QALS-SELMATNR

AND CHARG = WA_QALS-CHARG

AND VORNR = WA_QAMV-VORNR.

COUNT = COUNT + 1.

IF COUNT LT 10.

CONCATENATE '0' COUNT INTO COUNT.

ELSEIF COUNT GE 10.

COUNT = COUNT.

ENDIF.

CONCATENATE 'QAQEE-SUMPLUS(' COUNT ')' INTO WA_QAQEE_SUMPLUS.

PERFORM BDC_DYNPRO USING 'SAPLQEEM' '1110'.

IF COUNT GE 11.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=P+'.

ENDIF.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'QAQEE-SUMPLUS(01)'.

PERFORM BDC_FIELD USING WA_QAQEE_SUMPLUS

WA_INPUT-MESSWERT."' 3.180'.

CLEAR: WA_INPUT.

ENDLOOP.

ENDIF.

PERFORM BDC_DYNPRO USING 'SAPLQEEM' '1110'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'QAQEE-SUMPLUS(01)'.

PERFORM BDC_DYNPRO USING 'SAPLQEEM' '1110'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=MKAL'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAQEE-SUMPLUS(01)'.

PERFORM BDC_DYNPRO USING 'SAPLQEEM' '1110'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ABSL'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'QAQEE-SUMPLUS(01)'.

PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'QAEEA-MERKNR'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENTE'.

PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

'X'.

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

  • 'X'.

*

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

  • 'X'.

*

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

  • 'X'.

*

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

  • 'X'.

*

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

  • 'X'.

*

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

  • 'X'.

*

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

  • 'X'.

*

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

  • 'X'.

*

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-ANNEHMEN'

  • 'X'.

*

  • PERFORM BDC_DYNPRO USING 'SAPLQEBR' '0501'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'QAEEA-MERKNR'.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ENTE'.

  • PERFORM BDC_FIELD USING 'QAEEA-RUECKWEIS'

  • 'X'.

PERFORM BDC_DYNPRO USING 'SAPLQEEM' '1110'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=BU'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'QAQEE-SUMPLUS(01)'.

CLEAR: WA_QAMV,WA_QALS,WA_INPUT.

COUNT = 0.

CLEAR: WA_QAQEE_SUMPLUS.

WA_OPT-DISMODE = 'A'.

WA_OPT-UPDMODE = 'A'.

WA_OPT-NOBINPT = 'X'.

CALL TRANSACTION 'QE01' USING BDCDATA

MESSAGES INTO IT_MESSTAB OPTIONS FROM WA_OPT.

ENDLOOP.

*----


  • Start new screen

*----


FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR WA_BDCDATA.

WA_BDCDATA-PROGRAM = PROGRAM.

WA_BDCDATA-DYNPRO = DYNPRO.

WA_BDCDATA-DYNBEGIN = 'X'.

APPEND WA_BDCDATA TO BDCDATA.

ENDFORM. "BDC_DYNPRO

*----


  • Insert field

*----


FORM BDC_FIELD USING FNAM FVAL.

IF FVAL <> W_NODATA.

CLEAR WA_BDCDATA.

WA_BDCDATA-FNAM = FNAM.

WA_BDCDATA-FVAL = FVAL.

APPEND WA_BDCDATA TO BDCDATA.

ENDIF.

ENDFORM. "BDC_FIELD

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