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

Reg Report....

Former Member
0 Likes
441

hi,

How to put the input field in ALV report....?

Thanks in adv....

Reg,<b>

Suresh Kumar.V</b>

3 REPLIES 3
Read only

suresh_datti
Active Contributor
0 Likes
415

Have you checked this <a href="https://forums.sdn.sap.com/click.jspa?searchID=2822805&messageID=3116038">Thread</a> ?

~Suresh

Read only

Former Member
0 Likes
415

Hi Suresh,

Check the following URL.

<b>Reprots</b>

http://www.sapgenie.com/abap/reports.htm

http://www.allsaplinks.com/material.html

http://www.sapdevelopment.co.uk/reporting/reportinghome.htm

<b>ALV</b>

1. Please give me general info on ALV.

http://www.sapfans.com/forums/viewtopic.php?t=58286

http://www.sapfans.com/forums/viewtopic.php?t=76490

http://www.sapfans.com/forums/viewtopic.php?t=20591

http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.

<b>2. How do I program double click in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=11601

http://www.sapfans.com/forums/viewtopic.php?t=23010

<b>3. How do I add subtotals (I have problem to add them)...</b>

http://www.sapfans.com/forums/viewtopic.php?t=20386

http://www.sapfans.com/forums/viewtopic.php?t=85191

http://www.sapfans.com/forums/viewtopic.php?t=88401

http://www.sapfans.com/forums/viewtopic.php?t=17335

<b>4. How to add list heading like top-of-page in ABAP lists?</b>

http://www.sapfans.com/forums/viewtopic.php?t=58775

http://www.sapfans.com/forums/viewtopic.php?t=60550

http://www.sapfans.com/forums/viewtopic.php?t=16629

<b>5. How to print page number / total number of pages X/XX in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)

<b>6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.</b>

http://www.sapfans.com/forums/viewtopic.php?t=64320

http://www.sapfans.com/forums/viewtopic.php?t=44477

<b>7. How can I set the cell color in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=52107

<b>8. How do I print a logo/graphics in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=81149

http://www.sapfans.com/forums/viewtopic.php?t=35498

http://www.sapfans.com/forums/viewtopic.php?t=5013

<b>9. How do I create and use input-enabled fields in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=84933

http://www.sapfans.com/forums/viewtopic.php?t=69878

<b>10. How can I use ALV for reports that are going to be run in background?</b>

http://www.sapfans.com/forums/viewtopic.php?t=83243

http://www.sapfans.com/forums/viewtopic.php?t=19224

<b>11. How can I display an icon in ALV? (Common requirement is traffic light icon).</b>

http://www.sapfans.com/forums/viewtopic.php?t=79424

http://www.sapfans.com/forums/viewtopic.php?t=24512

<b>12. How can I display a checkbox in ALV?</b>

http://www.sapfans.com/forums/viewtopic.php?t=88376

http://www.sapfans.com/forums/viewtopic.php?t=40968

http://www.sapfans.com/forums/viewtopic.php?t=6919

<b>Check this for basic concepts of OOPS</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

<b>Tabstrip</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

<b>Editable ALV</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

<b>Tree</b>

http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm

<b>General Tutorial for OOPS</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20ea...

http://www.sapdevelopment.co.uk/reporting/alvhome.htm

http://www.sap-img.com/abap/what-is-alv-programming.htm

http://www.sap-img.com/abap-function.htm

http://www.geocities.com/mpioud/Abap_programs.html

http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm

http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf

http://www.sap-img.com/abap-function.htm

<b>Regards,

Jackie..</b>

Read only

Former Member
0 Likes
415

By making the alv editable. Following is the referance code:

DATA: g_container TYPE scrfname VALUE 'CUSTOM CONTROL',
      g_custom_container TYPE REF TO cl_gui_custom_container,
      g_grid  TYPE REF TO cl_gui_alv_grid,
      gs_layout TYPE lvc_s_layo,
      ok_code LIKE sy-ucomm,
      save_ok LIKE sy-ucomm.
.

DATA: gt_outtab TYPE TABLE OF sflight.


*---------------------------------------------------------------------*
*       MAIN                                                          *
*---------------------------------------------------------------------*
CALL SCREEN 100 STARTING AT 1 1..

*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*

MODULE status_0100 OUTPUT.
  SET PF-STATUS 'MAIN100'.
  SET TITLEBAR 'MAIN100'.

ENDMODULE.                 " STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  pbo  OUTPUT
*&---------------------------------------------------------------------*
MODULE pbo OUTPUT.

  IF g_custom_container IS INITIAL.

    CREATE OBJECT g_custom_container
      EXPORTING
        container_name              = g_container
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.
    IF sy-subrc <> 0.
*      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.


    CREATE OBJECT g_grid
      EXPORTING
        i_parent          = g_custom_container
      EXCEPTIONS
        error_cntl_create = 1
        error_cntl_init   = 2
        error_cntl_link   = 3
        error_dp_create   = 4
        OTHERS            = 5 .
    IF sy-subrc <> 0.
*      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    gs_layout-edit = 'X'.

    SELECT * FROM sflight INTO TABLE gt_outtab UP TO 10 ROWS.

*§1.Set status of all cells to editable using the layout structure.
    CALL METHOD g_grid->set_table_for_first_display
      EXPORTING
        i_structure_name              = 'SFLIGHT'
        is_layout                     = gs_layout
      CHANGING
        it_outtab                     = gt_outtab
      EXCEPTIONS
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        OTHERS                        = 4.
    IF sy-subrc <> 0.
*      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

*§2.Use SET_READY_FOR_INPUT to allow editing initially.
    CALL METHOD g_grid->set_ready_for_input
      EXPORTING
        i_ready_for_input = 1.

  ENDIF.
ENDMODULE.                 " pbo  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  pai  INPUT
*&---------------------------------------------------------------------*
MODULE pai INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'EXIT'.
      PERFORM exit_program.
    WHEN 'SWITCH'.
      PERFORM switch_edit_mode.
    WHEN OTHERS.
*     do nothing
  ENDCASE.
ENDMODULE.                 " pai  INPUT
*&---------------------------------------------------------------------*
*&      Form  exit_program
*&---------------------------------------------------------------------*
FORM exit_program .
  LEAVE PROGRAM.
ENDFORM.                    " exit_program
*&---------------------------------------------------------------------*
*&      Form  switch_edit_mode
*&---------------------------------------------------------------------*
FORM switch_edit_mode .

*§3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
  IF g_grid->is_ready_for_input( ) EQ 0.
    CALL METHOD g_grid->set_ready_for_input
      EXPORTING
        i_ready_for_input = 1.
  ELSE.
    CALL METHOD g_grid->set_ready_for_input
      EXPORTING
        i_ready_for_input = 0.
  ENDIF.
ENDFORM.                    " switch_edit_mode