Sunday 11 December 2011

TO display the selection screen in the report output

  * Print input selection criteria
  PERFORM print_selections.
  LOOP AT gdt_list_comments INTO gds_list_comments.
*Adding Line
    CALL METHOD top->new_line.
    ldf_text = gds_list_comments-info.

    CALL METHOD top->add_text
      EXPORTING
        text = ldf_text.

    CLEAR gds_list_comments.



***********************************************
  FORM print_selections .

  IF gdf_flag3 IS INITIAL.
    DATA:
      ldf_report   TYPE raldb_repo,
      ldf_variante TYPE raldb_vari,
      ldf_string   TYPE string.

    DATA:
      ldf_text     TYPE char255,
      ldf_date     TYPE char10,
      ldf_time     TYPE char15.

    DATA:
      BEGIN OF %selections OCCURS 24,
         z(2TYPE c,
         line TYPE raldb_info,    " Zeile des Selektionsbildes
      END OF %selections.

    DESCRIBE TABLE %selections LINES sy-tfill.
    IF sy-tfill EQ 0.

      ldf_report   = gcf_prog_name.
      ldf_variante = sy-slset.

      CALL FUNCTION 'RS_COVERPAGE_SELECTIONS'
        EXPORTING
          report            = ldf_report
          variant           = ldf_variante
          no_import         = 'X'
        TABLES
          infotab           = %selections
*        infotab           = mtab_sel_options
        EXCEPTIONS
          error_message     = 01
          variant_not_found = 02
          OTHERS            = 03.

      IF sy-subrc EQ 0.

        DELETE %selections FROM 1 TO 5.
        DESCRIBE TABLE %selections LINES sy-tfill.
        DELETE %selections INDEX sy-tfill.
        sy-tfill = sy-tfill - 1.
        DELETE %selections INDEX sy-tfill.

        CLEAR: gds_list_comments.
        gds_list_comments-typ  = 'A'"A = Action
        gds_list_comments-key  = ''.

        LOOP AT %selections.
          IF NOT %selections+4(1IS INITIAL.
            gds_list_comments-info = %selections+4.
            CONCATENATE gds_list_comments-info ':'
                        INTO gds_list_comments-info.
          ELSE.


**          if not %selections+5(75) cs 'No selections' and
**          %selections+5(75) ne ''.
            IF %selections+5(75NE ''.

              CONCATENATE gds_list_comments-info %selections+5(75)
                          INTO ldf_string.
              CONDENSE ldf_string.

              gds_list_comments-info = ldf_string.
              APPEND gds_list_comments TO gdt_list_comments.
            ENDIF.

            CLEAR: gds_list_comments-info.
          ENDIF.
        ENDLOOP.


      ENDIF.

    ENDIF.
    gdf_flag3 = '1'.
  ENDIF.

ENDFORM.                    " PRINT_SELECTIONS

No comments:

Post a Comment