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

why we write refresh bdc in bdc program?

Former Member
0 Likes
714

why we write refresh bdc in bdc program?what is the use of this?plzz tell

Edited by: Alvaro Tejada Galindo on Feb 7, 2008 10:48 AM

6 REPLIES 6
Read only

andreas_mann3
Active Contributor
0 Likes
663

you must refresh your int.table (with bdc-data) aftter every transaction

A.

Read only

Former Member
0 Likes
663

Hi,

It refreshes Intermidate Table.

<REMOVED BY MODERATOR>

Gaurav J.

Edited by: Alvaro Tejada Galindo on Feb 7, 2008 10:49 AM

Read only

0 Likes
663

what is men by intermidate table

Read only

0 Likes
663

I'll give an example.

BDCDATA internal table is like a container, in which you pass the data to be entered in a transaction.

In order to enter the next record, you need to empty the previous records values, hence you refresh the BDCDATA internal table.

As an analogy, BDCDATA is like a Bucket.

If you are taking water out of a well using that Bucket, you need to empty it before you put it in the well next time

Regards,

Ravi kanth Talagana

Read only

0 Likes
663

Hi,

In this we use Refresh To Free the Contents of the Table BDCDATA.

Why do we empty the Table ?

Need to Fill with other Values.

Hope you got it.

Please check code for further clarification.

Bala.M

report ZCCEXP01 no standard page heading.

INCLUDE ZBDCRECP.

DATA : BEGIN OF WA_RECORD,
**      mandt(3),

MATNR(7),

WERKS(4),

MAXLZ(2),

LZEIH(3),

END OF WA_RECORD.

* default datapath of the file
DATA : V_DATE(8) TYPE C.
PARAMETERS : V_FILE(50) TYPE C DEFAULT

'\\sapsrv\tmp\mat.txt'.

START-OF-SELECTION.

OPEN DATASET V_FILE FOR INPUT IN TEXT MODE.

DO.

READ DATASET V_FILE INTO WA_RECORD.

IF SY-SUBRC NE 0.

EXIT.

ENDIF.

WRITE:/ WA_RECORD.
*form to fill bdc structure

PERFORM FILL_LINE_TEXT.

CALL TRANSACTION 'MM02' USING BDCDATA MODE 'E' UPDATE 'S' .

CLEAR WA_RECORD.

*REFRESH BDCDATA.*

ENDDO.

CLOSE DATASET V_FILE.

END-OF-SELECTION.

FORM FILL_LINE_TEXT.
perform bdc_dynpro      using 'SAPLMGMM' '0060'.
perform bdc_field       using 'BDC_OKCODE'

'/00'.
perform bdc_field       using 'BDC_CURSOR'

'RMMG1-MATNR'.
PERFORM BDC_FIELD       USING 'RMMG1-MATNR'

WA_RECORD-MATNR.
perform bdc_dynpro      using 'SAPLMGMM' '0070'.
perform bdc_field       using 'BDC_OKCODE'

'RESA'.
perform bdc_field       using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

perform bdc_dynpro      using 'SAPLMGMM' '0070'.
perform bdc_field       using 'BDC_OKCODE'

'ENTR'.
perform bdc_field       using 'BDC_CURSOR'

'MSICHTAUSW-KZSEL(11)'.
PERFORM BDC_FIELD       USING 'MSICHTAUSW-KZSEL(11)'

'X'.
perform bdc_dynpro      using 'SAPLMGMM' '0080'.
perform bdc_field       using 'BDC_OKCODE'

'ENTR'.
perform bdc_field       using 'BDC_CURSOR'

'RMMG1-WERKS'.
perform bdc_field       using 'RMMG1-WERKS'

WA_RECORD-WERKS.
perform bdc_dynpro      using 'SAPLMGMM' '3000'.
perform bdc_field       using 'BDC_OKCODE'

'BU'.
perform bdc_field       using 'BDC_CURSOR'

'MARC-LZEIH'.
perform bdc_field       using 'MARC-MAXLZ'

WA_RECORD-MAXLZ.
perform bdc_field       using 'MARC-LZEIH'

WA_RECORD-LZEIH.
ENDFORM.

Read only

Former Member
0 Likes
663

hi

if we dont use refresh bdc in bdc program,same record will be updated every time,the next record will not be inserted.