‎2008 Feb 07 2:33 PM
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
‎2008 Feb 07 2:35 PM
you must refresh your int.table (with bdc-data) aftter every transaction
A.
‎2008 Feb 07 2:35 PM
Hi,
It refreshes Intermidate Table.
<REMOVED BY MODERATOR>
Gaurav J.
Edited by: Alvaro Tejada Galindo on Feb 7, 2008 10:49 AM
‎2008 Feb 07 3:25 PM
‎2008 Feb 07 3:56 PM
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
‎2008 Feb 07 4:04 PM
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 fileDATA : 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.
‎2008 Feb 07 3:54 PM
hi
if we dont use refresh bdc in bdc program,same record will be updated every time,the next record will not be inserted.