Application Development 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: 

BDC issue - passing space

Former Member
0 Kudos
664

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

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos
106

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

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos
107

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

0 Kudos
106

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

0 Kudos
106

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

0 Kudos
106

Is there any button to "deselect all"? May be you can use it.

Simha_
Employee
Employee
0 Kudos
106

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.

Former Member
0 Kudos
106

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_FIELD

Regards,

AS