‎2006 Aug 03 12:28 PM
Hi,
I am recording (using T.Code: SHDB) a transaction, where there is a Table control. when i select the record, the indicator is 'X' and then i proceed with function buttons. After finishing the work with that record, i have to deselect the record, i.e. i have pass space ('') for the indicator.
But the passing of space is not valid with BDC recording. i.e. the BDCdata will not get appended with the field name and value.
Can anyone suggest solution for this or an alternative.
regards
satya
‎2006 Aug 03 12:35 PM
go to the form bdc_value
and see if there is an IF condition before you fill the bdcadta-fval anf fnam fields.
remove that IF condition.
Regards,
Ravi
‎2006 Aug 03 12:35 PM
go to the form bdc_value
and see if there is an IF condition before you fill the bdcadta-fval anf fnam fields.
remove that IF condition.
Regards,
Ravi
‎2006 Aug 03 12:44 PM
Hi,
The sap defined bdc_field subroutine has this check.
for appending the data. I dont think we can change this BDC_field fn.
is there any alternative for this
regards
Satya
‎2006 Aug 03 12:47 PM
HI satya,
YOu can copy the two forms bdc_field and bdc_dynpro that are created in the include bdcrex something
into your own program and then modify that code.
also comment the bdcrex include.
Regards,
Ravi
‎2006 Aug 03 12:50 PM
Is there any button to "deselect all"? May be you can use it.
‎2006 Aug 03 12:36 PM
Hi,
Take space in a one character variable and then pass it to the BDC value...
Anyway for deselecting u will have get some function code while recording..
just check that one...
cheers,
Simha.
‎2006 Aug 03 12:59 PM
Hi,
Copy the Forms in the standard program BDCRECX1 into the main program.
You need to copy:
1)Data Defns for BDCDATA and BDCMSGCOLL
2)The forms bdc_field, bdc_dynpro
Also remove the things in bold in the forms.
*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
FORM BDC_FIELD USING FNAM FVAL.
<b> IF FVAL <> NODATA.</b>
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
<b> ENDIF.</b>
ENDFORM.<b>Consider this sample code on the same approach.</b>
REPORT zztest.
DATA : it_mara TYPE STANDARD TABLE OF mara WITH HEADER LINE,
layout TYPE rm61m-usprf.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
layout = 'SAPMPS'.
SELECT * FROM mara INTO TABLE it_mara UP TO 2 ROWS.
LOOP AT it_mara.
PERFORM bdc_dynpro USING 'SAPMM61M' '0103'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RM61M-MATNR'
it_mara-matnr.
PERFORM bdc_field USING 'RM61M-USPRF'
layout.
CALL TRANSACTION 'MD48'
USING bdcdata
MODE 'E'.
ENDLOOP.
*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELDRegards,
AS