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 PROBLEM

Former Member
0 Likes
620

Dear Guru,

I am currently creating an interactive report where I have a requirement that after getting a basic list output. When it click on any row output a new transaction will call . Now from CALL TRANSACTION Statement I call my Ztransaction. But my requirement is that when I click on Employee Number(basic list output) ,In next transaction the emplyee field should show the selected emplyee number.Currently my ztransaction comes but emploee filled remains empty.Below I have written

the code which I am using.Here Zattend-pernr stores the employee no. and also it is the name of the emploee field in my module pool(ZLCARD) .

HIDE zattend-PERNR .

AT LINE-SELECTION .

MOVE zattend-PERNR TO zattend-PERNR .

call TRANSACTION 'ZLCARD'.

After call Transaction , zattend-PERNR field becomes empty. Kindly provide me Logic.

<removed_by_moderator>

Regards,

Himanshu

Edited by: Julius Bussche on Feb 21, 2009 10:27 AM

1 ACCEPTED SOLUTION
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
549

hi,

use the following commands

GET CURSOR
SET PARAMETER ID

Thanks & Regards

4 REPLIES 4
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
550

hi,

use the following commands

GET CURSOR
SET PARAMETER ID

Thanks & Regards

Read only

0 Likes
549

Hi,

Can you pls give me some example(Written code). As I used this Get cursor statement but it will not work in report. Is it used before list processing? pls provide me code.

Regards,

Himanshu

Read only

0 Likes
549

Hi,

see the pseudo code



*&---------------------------------------------------------------------*
*&    DATA TYPES                                                       *
*&                                                                     *
*&---------------------------------------------------------------------*

TYPES : BEGIN OF ty_itab,
        kunnr TYPE kna1-kunnr,
        name1 TYPE kna1-name1,
        ort01 TYPE kna1-ort01,
        land1 TYPE kna1-land1,
        vbeln TYPE vbak-vbeln,
        erdat TYPE vbak-erdat,
        netwr TYPE vbak-netwr,
        posnr TYPE vbap-posnr,
        arktx TYPE vbap-arktx,
        werks TYPE vbap-werks,
        END OF ty_itab.

*&---------------------------------------------------------------------*
*&      WORK AREA                                                      *
*&                                                                     *
*&---------------------------------------------------------------------*
DATA : w_itab TYPE ty_itab.

*&---------------------------------------------------------------------*
*&      INTERNAL TABLE                                                 *
*&                                                                     *
*&---------------------------------------------------------------------*
DATA : t_itab TYPE ty_itab OCCURS 1.

*&---------------------------------------------------------------------*
*&     EXTRACTING DATA                                                 *
*&                                                                     *
*&---------------------------------------------------------------------*
SELECT k~kunnr
       k~name1
       k~ort01
       k~land1
       v~vbeln
       v~erdat
       v~netwr
       a~posnr
       a~arktx
       a~werks
       INTO TABLE t_itab
       FROM kna1 AS k
       INNER JOIN
       vbak AS v
       ON k~kunnr = v~kunnr
       INNER JOIN
       vbap AS a
       ON v~vbeln = a~vbeln.
*&---------------------------------------------------------------------*
*&     DISPLAYING DATA                                                 *
*&                                                                     *
*&---------------------------------------------------------------------*

WRITE : /36 'CUSTOMER  INFORMATION ' COLOR 6 INVERSE ON.
ULINE.
WRITE : /5 'CUSTOMER NO',
         18 'CUSTOMER NAME',
         57 'CITY',
         90 'COUNTRY'.
ULINE.
LOOP AT t_itab INTO w_itab.
  AT NEW kunnr.
    WRITE :/5 w_itab-kunnr.
  ENDAT.
  WRITE :18 w_itab-name1,
         57 w_itab-ort01,
         90 w_itab-land1.
  HIDE w_itab-kunnr.
  HIDE w_itab-name1.
ENDLOOP.
*****************************************************************
AT LINE-SELECTION.
********************************************************************
  DATA fld(20) TYPE c.
  GET CURSOR FIELD fld.  "-------> GET CURSOR
* WRITE :/ 'FIELD NAME ' , FLD.

  CASE sy-lsind.

***********FIRST DETAIL LIST
    WHEN '1'.
      IF fld = 'W_ITAB-KUNNR'.

        FORMAT COLOR 3.
        WRITE :/10 'CUSTOMER NO:',23 w_itab-kunnr .
        WRITE :30'CUSTOMER NAME:', 47 w_itab-name1 .
        FORMAT COLOR OFF.

        SKIP.
        WRITE : /36 'CUSTOMER ORDER INFORMATION LIST' COLOR 6 INVERSE ON.
        ULINE.
        WRITE : /5 'ORDER NO',
                 18 'ORDER DATE',
                 57 'ORDER VALUE'.
        ULINE.
        LOOP AT t_itab INTO w_itab WHERE kunnr = w_itab-kunnr.

          WRITE:/5 w_itab-vbeln,
                 18 w_itab-erdat,
                 57 w_itab-netwr.
          AT END OF kunnr.
            SUM.
            ULINE :/68(10).

            WRITE :/40 'TOTAL ORDER VALUE:' COLOR 5 INVERSE ON , 57
    w_itab-netwr.

            ULINE :/68(10).
            PERFORM sub USING w_itab-netwr.
          ENDAT.
          HIDE w_itab-vbeln.
          HIDE w_itab-erdat.
        ENDLOOP.
      ELSE.
        MESSAGE s000(zmukhtar).
      ENDIF.
****************SECOND DETAIL LIST
    WHEN '2'.
      IF fld = 'W_ITAB-VBELN'.
SET PARAMETER ID 'AUN' FIELD w_itab-vbeln.  "----> SET PARAMETER ID
        CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
      ENDIF.
    WHEN '3'.
      MESSAGE s001(zmukhtar).
  ENDCASE.
*&---------------------------------------------------------------------*
*&      Form  SUB
*&---------------------------------------------------------------------*

FORM sub  USING    p_w_itab_netwr.
  DATA : rupee(3) VALUE 'Rs',
         and(3) VALUE 'AND',
         paise(3) VALUE 'Ps',
         words TYPE string.
  TABLES : spell.

  CALL FUNCTION 'SPELL_AMOUNT'
   EXPORTING
     amount          = p_w_itab_netwr
     currency        = 'INR'

     language        = sy-langu
   IMPORTING
     in_words        = spell
        EXCEPTIONS
          NOT_FOUND       = 1
          TOO_LARGE       = 2
          OTHERS          = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CONCATENATE rupee spell-word(200) and spell-decword(64) paise INTO words SEPARATED BY space.

  WRITE :/40 'IN WORDS:' COLOR 1 INVERSE ON, 57 words COLOR 1 INVERSE ON.

ENDFORM.                    " SUB

Always Learner

Read only

Former Member
0 Likes
549

Hi,

HIDE zattend-PERNR .

AT LINE-SELECTION .

GET CURSOR FIELD zattend-PERNR VALUE w_cursor.

SET PARAMETER ID 'PER' FIELD w_cursor. "PER is the parameter id for data elemnt PERSNO

CALL TRANSACTION 'ZLCARD'.