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

how to use bdc code in a report for save button

Former Member
0 Likes
632

hi to all can anybody please give some hints that how can i place the BDC code for the save button to pass the values from the editable grid to the standard table here i am sending my code .please advice me.

Moderator Message: Please post only relevant portions of your code. There is a 2,500 character per post limit.

here the second grid is editable.and i have to make changes in the second grid and save it to the standard tables. please advice me resma

Edited by: kishan P on Sep 13, 2010 3:59 PM

hi to all can anybody please give some hints that how can i place the BDC code for the save button to pass the values from the editable grid to the standard table here i am sending my code .please advice me.

Moderator Message: Please post only relevant portions of your code. There is a 2,500 character per post limit.

here the second grid is editable.and i have to make changes in the second grid and save it to the standard tables. please advice me resma

Edited by: kishan P on Sep 13, 2010 3:59 PM

2 REPLIES 2
Read only

Former Member
0 Likes
557

Hi,

Can you put only the relevant piece of code in a readable format. Code is should be within braces.

Sujay

Read only

Former Member
0 Likes
557

Hi,

I have done that many times. Create a button in the toolbar,say 'SAVE'. Write the code in the subroutine user command.For example :


*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
        RS_SELFIELD TYPE SLIS_SELFIELD.

  DATA : REF_GRID TYPE REF TO CL_GUI_ALV_GRID.

  DATA: L_VALID TYPE C.

*Code to reflect the changes done in the internal table

  IF REF_GRID IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
      IMPORTING
        E_GRID = REF_GRID.
  ENDIF.

  IF NOT REF_GRID IS INITIAL.

    CALL METHOD REF_GRID->CHECK_CHANGED_DATA
      IMPORTING
        E_VALID = L_VALID.

  ENDIF.

  CASE SY-UCOMM.

    WHEN 'SAVE'.

    PERFORM BDC."Write all you BDC code in this subroutine

  ENDCASE.

ENDFORM.

Hope this will help.

Thanks & Regards,

Rock.