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

Syntax error on reading internal table

Former Member
0 Likes
1,133

Hi Experts,

I am trying to read the column name and row number of the cell selected in the ALV output and call standard transaction based on the selection.

I am getting syntax error for line READ TABLE T_SALV_CELL INTO ME->WA_SALV_CELL INDEX 1.

Error: Read dbtab is not supported in OOcontext. Use select single * from dbtab into wa.

Also, inspite of passing the correct parameter id it is not skipping the initial screen of transaction BP.

My code goes like this:

*&---------------------------------------------------------------------&
*& CLASS - DEFINITION
*&---------------------------------------------------------------------&
CLASS LCL_EVENT_HANDLER DEFINITION.
  PUBLIC SECTION.
    METHODS: ON_LINK_CLICK
               FOR EVENT LINK_CLICK
               OF  CL_SALV_EVENTS_TABLE
               IMPORTING ROW
                         COLUMN.  "#EC NEEDED

  PRIVATE SECTION.
     DATA: L_ROWNUM TYPE I,
           L_COLNAME TYPE LVC_FNAME,
           WA_SALV_CELL TYPE SALV_S_CELL.

ENDCLASS.  "LCL_EVENT_HANDLER



CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*-- create hotspot on Partner Number column
    METHOD ON_LINK_CLICK.
     CLEAR: WA_FINAL, WA_SALV_CELL.

     CALL METHOD GR_SALV_TABLE->GET_SELECTIONS
      RECEIVING
        VALUE  = GR_SALV_SELECTIONS.
        
     CALL METHOD GR_SALV_SELECTIONS->GET_CURRENT_CELL
      RECEIVING
        VALUE  = T_SALV_CELL.
 
     READ TABLE T_SALV_CELL INTO ME->WA_SALV_CELL INDEX 1.
     IF SY-SUBRC = 0.
*-- Read Row information
        READ TABLE T_FINAL INTO WA_FINAL INDEX WA_SALV_CELL-ROW.
        IF SY-SUBRC = 0.
         IF WA_SALV_CELL-COLUMNNAME = C_COLUMN_PARTNER AND WA_FINAL-PARTNER_NO IS NOT INITIAL.
            SET PARAMETER ID 'BPA' FIELD WA_FINAL-PARTNER_NO.
            CALL TRANSACTION C_BP AND SKIP FIRST SCREEN.
         ELSEIF  WA_SALV_CELL-COLUMNNAME = C_COLUMN_OBJ_ID AND WA_FINAL-OBJECT_ID IS NOT INITIAL.
           SET PARAMETER ID 'CRM_OBJECT_ID' FIELD WA_FINAL-OBJECT_ID.
            CALL TRANSACTION C_CRMD_BUS2000126 AND SKIP FIRST SCREEN.
         ENDIF.

        ENDIF.
     ENDIF.

Please let me know how to correct it.

Regards,

Sangeeta.

Edited by: Matt on Jun 8, 2009 10:27 AM - added tags.

6 REPLIES 6
Read only

matt
Active Contributor
0 Likes
827

READ T_SALV_CELL INTO ME->WA_SALV_CELL INDEX 1.

(Don't use the TABLE keyword at this point!)

Read only

matt
Active Contributor
0 Likes
827

For your other question, it may be that you can't use "and skip first screen". Tx BP calls screen 100,, which is a dummy screen that loads screen 3000, which contains subscreen 1510 which uses BPA, and a docking container.

Screen 100 doesn't contain any fields other than OKCODE, so that's probably sufficient to disrupt "and skip first screen".

matt

Read only

Former Member
0 Likes
827

Thanks for the prompt reply.

Matt....Can you please tell then how to call standard transaction BP by passing the value.

Read only

Former Member
0 Likes
827

Hi Matt,

The statement READ TABLE T_SALV_CELL INTO ME->WA_SALV_CELL INDEX 1 is not working.

Read only

Former Member
0 Likes
827

Solved myself....Thanks

Read only

matt
Active Contributor
0 Likes
827

Well, what was the solution then?

matt