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

ABAPGENERAl

Former Member
0 Likes
717

How to create the detail list without using HIDE int the internal table?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
698

hi

go through this code

REPORT Without_hide NO STANDARD PAGE HEADING LINE-COUNT 10.


*" Data declarations...................................................
*"--------------------------------------------------------------------*
*  Declaration of field- string
************************************************************************


  DATA: BEGIN OF fs_sflight,
          carrid TYPE sflight-carrid,
          connid TYPE sflight-connid,
          fldate TYPE sflight-fldate,
        END OF fs_sflight.


  DATA: BEGIN OF fs_sbook,
          carrid TYPE sbook-carrid,
          connid TYPE sbook-connid,
          fldate TYPE sbook-fldate,
          bookid TYPE sbook-bookid,
          customid TYPE sbook-customid,
        END OF fs_sbook.

*" Table declarations...................................................
*"--------------------------------------------------------------------*


  DATA: t_sflight LIKE STANDARD TABLE OF fs_sflight,
        t_sbook LIKE STANDARD TABLE OF fs_sbook.


*"--------------------------------------------------------------------*
*                      TOP-OF-PAGE.                                   *
*"--------------------------------------------------------------------*

  TOP-OF-PAGE.
    WRITE: sy-title.
    ULINE.
    WRITE: 'Carrid' ,
          /9 'Connid' ,
          /20 'Fldate'.
    ULINE.

*"--------------------------------------------------------------------*
*                      START-OF-SELECTION                             *
*"--------------------------------------------------------------------*

  START-OF-SELECTION.

    SELECT                              "To Fetch basic list data
           carrid
           connid
           fldate
           INTO TABLE t_sflight
           FROM sflight.
    IF sy-subrc = 0.
     PERFORM display.                  "For displaying  detail list data
    ELSE.
      MESSAGE e004(z_yh1050_msg).
    ENDIF.
*"--------------------------------------------------------------------*
*                     AT LINE-SELECTION.                              *
*"--------------------------------------------------------------------*


  AT LINE-SELECTION.
    PERFORM detailed_list.









*&---------------------------------------------------------------------*
*&      Form  display
*&---------------------------------------------------------------------*
*      To display basic list data
*----------------------------------------------------------------------*
  FORM display .
    DATA: lw_carrid TYPE sflight-carrid,
          lw_connid TYPE sflight-connid.

    SORT t_sflight  BY carrid connid fldate.

  LOOP AT t_sflight INTO fs_sflight.       "To output data as per format

      IF lw_carrid  NE fs_sflight-carrid.
        WRITE:/ fs_sflight-carrid.
      ENDIF.

      IF lw_connid NE fs_sflight-connid.

        WRITE:/9 fs_sflight-connid,
              /20 fs_sflight-fldate.
      ELSE.

        WRITE:/20 fs_sflight-fldate.

      ENDIF.

      lw_carrid = fs_sflight-carrid.
      lw_connid = fs_sflight-connid.


    ENDLOOP.


  ENDFORM.                               " display
*&---------------------------------------------------------------------*
*&      Form  detailed_list
*&---------------------------------------------------------------------*
*       To get and display detailed list data
*----------------------------------------------------------------------*
  FORM detailed_list .



    DATA: lw_lisel(100) TYPE c,
          lw_carrid TYPE sflight-carrid,
          lw_connid TYPE sflight-connid,
          lw_fldate TYPE sflight-fldate.

 lw_lisel = sy-lisel.


    lw_fldate+0(4) = lw_lisel+19(4).
    lw_fldate+4(2) = lw_lisel+24(2).
    lw_fldate+6(2) = lw_lisel+27(2).




    READ TABLE t_sflight WITH KEY fldate = lw_fldate  INTO fs_sflight.

        if sy-subrc = 0.

        lw_connid = fs_sflight-connid.
        lw_carrid = fs_sflight-carrid.

    else.
    message e008(z_yh1050_msg).

    endif.

    SELECT                               "To Fetch detail list data

          carrid
          connid
          fldate
          bookid
          customid
          INTO TABLE t_sbook
          FROM sbook
          WHERE
          carrid = lw_carrid AND
          connid = lw_connid AND
          fldate = lw_fldate.

    IF sy-subrc = 0.
     PERFORM detail_display.           "For displaying  detail list data
    ELSE.
      MESSAGE e004(z_yh1050_msg).
    ENDIF.



  ENDFORM.                                "detailed_list
*&---------------------------------------------------------------------*
*&      Form  detail_display
*&---------------------------------------------------------------------*
*       To display detailed list data
*----------------------------------------------------------------------*

  FORM detail_display .




    LOOP AT t_sbook INTO fs_sbook.      "To output data

      WRITE:/
              fs_sbook-carrid,
              fs_sbook-connid,
              fs_sbook-fldate,
              fs_sbook-bookid,
              fs_sbook-customid.

    ENDLOOP.


  ENDFORM.                             " detail_display

Reward Points

Cheers

Snehi

5 REPLIES 5
Read only

Former Member
0 Likes
698

Hi,

Create your own Internal table like hide fields...

And after write statements you just append line number to the internal table...

Read the list pertaining to that line no SY-LILLI ie from which line the even has been triggered from the internal table and then read that particular record and perform necessary operations of that line.

Hope this would be helpful

Regards

Narin Nandivada

Read only

Former Member
0 Likes
698

Hi,

use user comman and then read the internal table.

Do like this in the user command subroutine:

form user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when '&IC1'.

read table it_vbrk index rs_selfield-tabindex.

perform get_data_vbrp.

perform build_fieldcatalog_vbrp .

perform display_alv_vbrp.

endcase.

endform.

Thanks,

Keerthi.

Read only

Former Member
0 Likes
698

hi

when u display the basic list... just populate the internal table which has the structure of the hide table and then u can read this internal table whenever a particular line is selected

Read only

Former Member
0 Likes
698

Hi Sravanthi,

We can achieve this thing by simulating the hide table. Create a table exactly as HIDE table with the following fields.

sy-linno - Line number

sy-lsind - List Index.

sy-lilli - Distinct Line Number

and with the field names.

Populate the values in this table while displaying the data on the list.

Then in the At Line-selection event we directly use the values in the table as we use the HIDE table.

Hope this solves your problem.

Any queries, get back to me.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
699

hi

go through this code

REPORT Without_hide NO STANDARD PAGE HEADING LINE-COUNT 10.


*" Data declarations...................................................
*"--------------------------------------------------------------------*
*  Declaration of field- string
************************************************************************


  DATA: BEGIN OF fs_sflight,
          carrid TYPE sflight-carrid,
          connid TYPE sflight-connid,
          fldate TYPE sflight-fldate,
        END OF fs_sflight.


  DATA: BEGIN OF fs_sbook,
          carrid TYPE sbook-carrid,
          connid TYPE sbook-connid,
          fldate TYPE sbook-fldate,
          bookid TYPE sbook-bookid,
          customid TYPE sbook-customid,
        END OF fs_sbook.

*" Table declarations...................................................
*"--------------------------------------------------------------------*


  DATA: t_sflight LIKE STANDARD TABLE OF fs_sflight,
        t_sbook LIKE STANDARD TABLE OF fs_sbook.


*"--------------------------------------------------------------------*
*                      TOP-OF-PAGE.                                   *
*"--------------------------------------------------------------------*

  TOP-OF-PAGE.
    WRITE: sy-title.
    ULINE.
    WRITE: 'Carrid' ,
          /9 'Connid' ,
          /20 'Fldate'.
    ULINE.

*"--------------------------------------------------------------------*
*                      START-OF-SELECTION                             *
*"--------------------------------------------------------------------*

  START-OF-SELECTION.

    SELECT                              "To Fetch basic list data
           carrid
           connid
           fldate
           INTO TABLE t_sflight
           FROM sflight.
    IF sy-subrc = 0.
     PERFORM display.                  "For displaying  detail list data
    ELSE.
      MESSAGE e004(z_yh1050_msg).
    ENDIF.
*"--------------------------------------------------------------------*
*                     AT LINE-SELECTION.                              *
*"--------------------------------------------------------------------*


  AT LINE-SELECTION.
    PERFORM detailed_list.









*&---------------------------------------------------------------------*
*&      Form  display
*&---------------------------------------------------------------------*
*      To display basic list data
*----------------------------------------------------------------------*
  FORM display .
    DATA: lw_carrid TYPE sflight-carrid,
          lw_connid TYPE sflight-connid.

    SORT t_sflight  BY carrid connid fldate.

  LOOP AT t_sflight INTO fs_sflight.       "To output data as per format

      IF lw_carrid  NE fs_sflight-carrid.
        WRITE:/ fs_sflight-carrid.
      ENDIF.

      IF lw_connid NE fs_sflight-connid.

        WRITE:/9 fs_sflight-connid,
              /20 fs_sflight-fldate.
      ELSE.

        WRITE:/20 fs_sflight-fldate.

      ENDIF.

      lw_carrid = fs_sflight-carrid.
      lw_connid = fs_sflight-connid.


    ENDLOOP.


  ENDFORM.                               " display
*&---------------------------------------------------------------------*
*&      Form  detailed_list
*&---------------------------------------------------------------------*
*       To get and display detailed list data
*----------------------------------------------------------------------*
  FORM detailed_list .



    DATA: lw_lisel(100) TYPE c,
          lw_carrid TYPE sflight-carrid,
          lw_connid TYPE sflight-connid,
          lw_fldate TYPE sflight-fldate.

 lw_lisel = sy-lisel.


    lw_fldate+0(4) = lw_lisel+19(4).
    lw_fldate+4(2) = lw_lisel+24(2).
    lw_fldate+6(2) = lw_lisel+27(2).




    READ TABLE t_sflight WITH KEY fldate = lw_fldate  INTO fs_sflight.

        if sy-subrc = 0.

        lw_connid = fs_sflight-connid.
        lw_carrid = fs_sflight-carrid.

    else.
    message e008(z_yh1050_msg).

    endif.

    SELECT                               "To Fetch detail list data

          carrid
          connid
          fldate
          bookid
          customid
          INTO TABLE t_sbook
          FROM sbook
          WHERE
          carrid = lw_carrid AND
          connid = lw_connid AND
          fldate = lw_fldate.

    IF sy-subrc = 0.
     PERFORM detail_display.           "For displaying  detail list data
    ELSE.
      MESSAGE e004(z_yh1050_msg).
    ENDIF.



  ENDFORM.                                "detailed_list
*&---------------------------------------------------------------------*
*&      Form  detail_display
*&---------------------------------------------------------------------*
*       To display detailed list data
*----------------------------------------------------------------------*

  FORM detail_display .




    LOOP AT t_sbook INTO fs_sbook.      "To output data

      WRITE:/
              fs_sbook-carrid,
              fs_sbook-connid,
              fs_sbook-fldate,
              fs_sbook-bookid,
              fs_sbook-customid.

    ENDLOOP.


  ENDFORM.                             " detail_display

Reward Points

Cheers

Snehi