Skip to Content
0
Former Member
Mar 07, 2009 at 11:49 AM

Plz explain why concatenate statement is used in BDC

119 Views

Please do not post subject or content as ALL CAPITALS

hi friends,

for the first time i am doing bdc table control. i just cant make out the use of concatenate statement in that code. i have gone thru some bdc table control codes in the forum but almost everywhere the concatenate statement has been used. can u plz explain the use of that statement . THANKS IN ADVANCE.

eg: THIS IS A CODE FROM ONE OF THE FORUM POSTS, SO I AM NOT COPYING IT FULLY.

I HAVE HIGHLIGHTED THE CONCATENATE PART.

DATA : M(2) TYPE C,

N(2) TYPE C,

TEMP(50) TYPE C,

WA_KUNNR LIKE KNA1-KUNNR.

****POPULATING HEADER DATA *******

LOOP AT IT_HEADER INTO WA_HEADER.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = WA_HEADER-KUNNR

IMPORTING

OUTPUT = WA_HEADER-KUNNR

.

SELECT SINGLE KUNNR FROM KNA1 INTO WA_KUNNR WHERE KUNNR = WA_HEADER-KUNNR.

IF SY-SUBRC 0.

MESSAGE I004(ZZS_MSG).

ENDIF.

PERFORM BDC_DYNPRO USING 'SAPMV45A' '0101'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'VBAK-SPART'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'VBAK-AUART' WA_HEADER-AUART.

PERFORM BDC_FIELD USING 'VBAK-VKORG' WA_HEADER-VKORG.

PERFORM BDC_FIELD USING 'VBAK-VTWEG' WA_HEADER-VTWEG.

PERFORM BDC_FIELD USING 'VBAK-SPART' WA_HEADER-SPART.

PERFORM BDC_DYNPRO USING 'SAPMV45A' '4001'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'VBKD-BSTKD' WA_HEADER-BSTKD.

PERFORM BDC_FIELD USING 'KUAGV-KUNNR' WA_HEADER-KUNNR.

PERFORM BDC_FIELD USING 'KUWEV-KUNNR' WA_HEADER-KUNNR1.

PERFORM BDC_FIELD USING 'RV45A-KETDAT'

'21.10.2008'.

PERFORM BDC_FIELD USING 'RV45A-KPRGBZ'

'D'.

PERFORM BDC_FIELD USING 'VBKD-PRSDT'

'21.10.2008'.

**********ITEM LOOP TO FIND NO.OF ITEMS ************

M = 0.

LOOP AT IT_ITEMS INTO WA_ITEMS WHERE BSTKD = WA_HEADER-BSTKD.

M = M + 1

ENDLOOP.

CONCATENATE 'VBAP-PS_PSP_PNR(' M ')' INTO TEMP.

PERFORM BDC_FIELD USING 'BDC_CURSOR' TEMP.

CLEAR TEMP.

******POPULATING ITEMS DATA ********

N = 1.

LOOP AT IT_ITEMS INTO WA_ITEMS WHERE BSTKD = WA_HEADER-BSTKD.

CONCATENATE 'RV45A-MABNR(' N ')' INTO TEMP.

PERFORM BDC_FIELD USING TEMP WA_ITEMS-MABNR.

CLEAR TEMP.

CONCATENATE 'RV45A-KWMENG(' N ')' INTO TEMP.PERFORM BDC_FIELD USING TEMP WA_ITEMS-KWMENG.

CLEAR TEMP.

CONCATENATE 'VBAP-PS_PSP_PNR(' N ')' INTO TEMP.

PERFORM BDC_FIELD USING TEMP WA_ITEMS-WBS.

CLEAR TEMP.

N = N + 1.

ENDLOOP.

PERFORM BDC_DYNPRO USING 'SAPMV45A' '4001'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'VBKD-BSTKD' WA_HEADER-BSTKD.

PERFORM BDC_FIELD USING 'KUAGV-KUNNR' WA_HEADER-KUNNR.

PERFORM BDC_FIELD USING 'KUWEV-KUNNR' WA_HEADER-KUNNR1.

PERFORM BDC_FIELD USING 'RV45A-KETDAT'

'21.10.2008'.

PERFORM BDC_FIELD USING 'RV45A-KPRGBZ'

'D'.

PERFORM BDC_FIELD USING 'VBKD-PRSDT'

'21.10.2008'.

PERFORM BDC_FIELD USING 'VBKD-ZTERM'

'N30'.

PERFORM BDC_FIELD USING 'VBKD-INCO1'

'FOB'.

PERFORM BDC_FIELD USING 'VBKD-INCO2'

'NEW YORK'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RV45A-MABNR(02)'.

PERFORM BDC_DYNPRO USING 'SAPMV45A' '4001'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=PKO1'.

PERFORM BDC_FIELD USING 'VBKD-BSTKD' WA_HEADER-BSTKD.

PERFORM BDC_FIELD USING 'KUAGV-KUNNR' WA_HEADER-KUNNR.

PERFORM BDC_FIELD USING 'KUWEV-KUNNR' WA_HEADER-KUNNR1.

PERFORM BDC_FIELD USING 'RV45A-KETDAT'

'21.10.2008'.

PERFORM BDC_FIELD USING 'RV45A-KPRGBZ'

'D'.

PERFORM BDC_FIELD USING 'VBKD-PRSDT'

'21.10.2008'.

PERFORM BDC_FIELD USING 'VBKD-ZTERM'

'N30'.

PERFORM BDC_FIELD USING 'VBKD-INCO1'

'FOB'.

PERFORM BDC_FIELD USING 'VBKD-INCO2'

'NEW YORK'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'VBAP-POSNR(01)'.

PERFORM BDC_FIELD USING 'RV45A-VBAP_SELKZ(01)'

'X'.

LOOP AT IT_ITEMS INTO WA_ITEMS WHERE BSTKD = WA_HEADER-BSTKD.

PERFORM BDC_DYNPRO USING 'SAPMV45A' '5003'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'KOMV-KBETR(07)'.

PERFORM BDC_FIELD USING 'KOMV-KSCHL(07)' WA_ITEMS-KSCHL.

PERFORM BDC_FIELD USING 'KOMV-KBETR(07)' WA_ITEMS-KBETR.

PERFORM BDC_DYNPRO USING 'SAPMV45A' '5003'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=POS+'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'KOMV-KSCHL(08)'.

ENDLOOP.

PERFORM BDC_DYNPRO USING 'SAPMV45A' '5003'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/EBACK'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'KOMV-KSCHL(08)'.

PERFORM BDC_DYNPRO USING 'SAPMV45A' '4001'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SICH'.

CALL TRANSACTION 'VA01' USING IT_BDCDATA MODE 'A'.

REFRESH IT_BDCDATA.

ENDLOOP.

-


u2022 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 IT_BDCDATA.

ENDFORM. "BDC_DYNPRO

-


u2022 Insert field *

-


FORM BDC_FIELD USING FNAM FVAL.

IF FVAL SPACE.

CLEAR WA_BDCDATA.

WA_BDCDATA-FNAM = FNAM.

WA_BDCDATA-FVAL = FVAL.

APPEND WA_BDCDATA TO IT_BDCDATA.

ENDIF.

ENDFORM. "BDC_FIELD

Edited by: Matt on Mar 9, 2009 4:38 PM