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 Possible on ALV?

Former Member
0 Kudos
1,423

Hi All,

We have a requirement to write BDC on the ALV. Is it possible to write BDC on ALV Grid?

6 REPLIES 6

Former Member
0 Kudos
217

Hi,

Can you please let us know more about the requirement.A bdc is for batch input. how are you planning to upload data in an ALV report?

Viv

former_member186143
Active Contributor
0 Kudos
217

yes it is possible I do it in nuemrous occasions where users start an bdc depending on the selection they make in als but if you are not more specific in you're question than the answers can also not be very specific in detail

kind regards

arthur

Former Member
0 Kudos
217

Why dont you try it and find out.

Former Member
0 Kudos
217

HI,

You cannot record the any action on the ALV. But still the recording showing some values..as you run your BDC recording then there will no effect.

Former Member
0 Kudos
217

Hi All,

Requirement for my BDC is to record on ALV interactive. where from initial screen I am getting ALV output. and on that ALV I need to select line. and then process further for the output. I am having a doubt as the BDC Okcode is not getting line selection. Can we implement such requirement?

I have tried the same. But i could not get through.

0 Kudos
217

you don't get line selection with bdc ok code but with the chk field in the alv structure

declare a field CHK type xfeld in you're alv structure

here the parts you need in the alv to make it work

with this example a user can select multiple tasks and click on a button to edit them. when 1 is saved or skipped then automaticaly the next one in the selection is executed


  slayout-box_fieldname = 'CHK'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                = ' '
*   I_BUFFER_ACTIVE                   = ' '
      i_callback_program                = h_repid
      i_callback_pf_status_set          = 'SET_PF_STATUS'
      i_callback_user_command           = 'USER_COMMAND'


FORM user_command USING r_ucomm LIKE sy-ucomm
                        rs_selfield TYPE slis_selfield.
  CASE r_ucomm.

    WHEN 'WIJZ'.
      LOOP AT ta_zcs_operatielijst_alv WHERE chk = 'X'.
        REFRESH bdcdata.
        PERFORM display_change_maintenance_ord USING
                                               ta_zcs_operatielijst_alv-aufnr
                                               ta_zcs_operatielijst_alv-vornr
                                               con_change
                                               CHANGING
                                               h_transaction_code.

        CALL TRANSACTION f_tcode USING bdcdata MODE 'E' UPDATE  'S'.

      ENDLOOP.
      COMMIT WORK.
endform.

FORM display_change_maintenance_ord USING    p_aufnr
                                             p_vornr
                                             p_activity TYPE c
                                    CHANGING p_transaction_code
                                               LIKE sy-tcode.

  DATA: flg_transaction_found TYPE flag.

  PERFORM bdc_dynpro USING 'SAPLCOIH' '0101'.
  PERFORM bdc_field  USING 'CAUFVD-AUFNR' p_aufnr.
  CHECK NOT p_vornr IS INITIAL.
  PERFORM bdc_field  USING 'BDC_OKCODE' 'VGUE'.
  PERFORM bdc_dynpro USING 'SAPLCOIH'   '3000'.
  PERFORM bdc_field  USING 'BDC_OKCODE' 'OBSE'.
  PERFORM bdc_dynpro USING 'SAPLCO05' '2010'.
  PERFORM bdc_field  USING 'RCOLS-VORNR' p_vornr.
  PERFORM bdc_field  USING 'RC27X-OBJECT' 'O'.
  PERFORM bdc_dynpro USING 'SAPLCOIH'   '3000'.
  PERFORM bdc_field  USING 'RC27X-FLG_SEL(1)' 'X'.
  PERFORM bdc_field  USING 'BDC_OKCODE' 'VGD3'.
  PERFORM bdc_dynpro USING 'SAPLCOIH'   '3800'.
  IF p_activity = con_change.
    p_transaction_code = 'IW32'.
  ELSEIF p_activity = con_display.
    p_transaction_code = 'IW33'.
  ENDIF.

  flg_transaction_found = 'X'.

ENDFORM.                               " DISPLAY_CHANGE_MAINTENANCE_ORD

kind regards

arthur