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

Interactive report

Former Member
0 Likes
688

Hi All,

Need your help in solving an issue, I am working on an interactive report and the output is getting displayed in the form on an ALV report.

I need to know how to navigate and to move to another tcode(CV03N) from the output . In the Output I am having both the feilds which are mandatory for the Tcode CV03N ( the fields are Document and Document type). In the code i used

IF R_UCOMM EQ '&IC1'.

CASE RS_SELFIELD-FIELDNAME.

WHEN 'DOKNR'.

READ TABLE IT_BATCH INDEX RS_SELFIELD-TABINDEX.

SET PARAMETER ID 'CV1' FIELD IT_BATCH-DOKNR. "doc number

SET PARAMETER ID 'CV2' FIELD IT_BATCH-DOKAR. "doc type

SET PARAMETER ID 'CV4' FIELD IT_BATCH-DOKTL. "doc part

SET PARAMETER ID 'CV3' FIELD IT_BATCH-DOKVR. "version

CALL TRANSACTION 'CV03N' AND SKIP FIRST SCREEN.

ENDCASE.

ENDIF.

Can you please suggest what needs to be done so that i can navigate by clicking on the document in the report output to the Tcode CV03N.

Thanks in advance.

3 REPLIES 3
Read only

Former Member
0 Likes
519

get the parameter ids from the table TPARA for all the tcodes and set them correctly

http://www.sap-basis-abap.com/abap/to-call-transaction-in-alv.htm

Read only

Former Member
0 Likes
519

Hi Dolly,

Use the syntax: get cursor field field1.

if field1 = 'docnum'.

set parameter id:

call transaction 'TRANS'.

Regards,

Naveen.

Read only

Former Member
0 Likes
519

Yes you can do that. using the fieldcatalog there is an option for that. give HOT_SPOT = 'X'. for the column you want.

wa_field-hotspot = 'X'.

REPORT  ztest_alv.
 
TYPE-POOLS:slis.
DATA:it_fieldcat  TYPE  slis_t_fieldcat_alv,
     wa_field LIKE LINE OF it_fieldcat.
DATA: BEGIN OF it_likp OCCURS 0,
       vbeln TYPE likp-vbeln,
      END OF it_likp.
DATA: layout TYPE slis_layout_alv.
 
wa_field-fieldname = 'VBELN'.
wa_field-tabname = 'IT_LIKP'.
wa_field-hotspot = 'X'.
wa_field-outputlen = 10.
wa_field-no_zero = 'X'.
wa_field-seltext_l = 'Sales'.
APPEND wa_field TO it_fieldcat.
 
SELECT vbeln FROM likp
UP TO 10 ROWS
INTO TABLE it_likp.
 
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_callback_program      = sy-repid
    is_layout               = layout
    i_callback_user_command = 'USER_COMMAND'
    it_fieldcat             = it_fieldcat
  TABLES
    t_outtab                = it_likp
  EXCEPTIONS
    program_error           = 1.
 
*&---------------------------------------------------------------------*
*&      Form  user_Command
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->UCOMM      text
*      -->SELFIELD   text
*----------------------------------------------------------------------*
FORM user_command USING ucomm TYPE sy-ucomm
                    selfield TYPE slis_selfield.
  CASE ucomm.
 
    WHEN '&IC1'.
 
      SET PARAMETER ID 'VL'  FIELD selfield-value.
      CALL TRANSACTION 'VL02N' AND SKIP FIRST SCREEN.
  ENDCASE.
 
ENDFORM.                    "user_Command