cancel
Showing results for 
Search instead for 
Did you mean: 

Made a NEW ALV Report(using left outer join) but nothing apppear.

meetts
Explorer
0 Kudos

meetts_0-1708568402667.png

meetts_1-1708568452805.png

meetts_2-1708568465621.png

meetts_3-1708568498405.png

When I execute this program, it excutes without error.

But when I try to search some BP,

meetts_4-1708568591188.png

meetts_5-1708568602537.png

 

Nothing Appear.

There is no differnt if I put some bp code or taxnumber in parameters.

Do I have to add some fields in SET_FIELDCATALOG??

 

*&---------------------------------------------------------------------*
*& Report ZFIR0111
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*

INCLUDE ZFIR0111_TOP                            .    " Global Data

 INCLUDE ZFIR0111_O01                            .  " PBO-Modules
 INCLUDE ZFIR0111_I01                            .  " PAI-Modules
 INCLUDE ZFIR0111_F01                            .  " FORM-Routines

 START-OF-SELECTION.

    PERFORM get_data.

    CALL  SCREEN '100'.

 

*&---------------------------------------------------------------------*
*& Include ZFIR0111_TOP                             - Report ZFIR0111
*&---------------------------------------------------------------------*
REPORT ZFIR0111.
*----------------------------------------------------------------------*
* Tables
*----------------------------------------------------------------------*
TABLES DFKKBPTAXNUMKNA1LFA1.
*----------------------------------------------------------------------*
* Internal Tables
*----------------------------------------------------------------------*
DATABEGIN OF gt_list OCCURS 0,
  partner TYPE  DFKKBPTAXNUM-partner,
  taxtype TYPE  DFKKBPTAXNUM-taxtype,
  taxnum TYPE DFKKBPTAXNUM-taxnum,
  kunnr TYPE KNA1-kunnr,
  name1 TYPE KNA1-name1,
  lifnr TYPE LFA1-lifnr,
  mcod1 TYPE LFA1-mcod1,
END OF gt_list.

*----------------------------------------------------------------------*
* Alv Object
*----------------------------------------------------------------------*
DATA ok_code LIKE sy-ucomm.

DATA go_docking TYPE REF TO cl_gui_docking_container,
           go_grid TYPE REF TO cl_gui_alv_grid,
           gt_fcat TYPE  lvc_t_fcat,
           gs_layout TYPE  lvc_s_layo.

*----------------------------------------------------------------------*
* Parameters
*----------------------------------------------------------------------*
  SELECT-OPTIONS s_part FOR DFKKBPTAXNUM-partner,
                                s_taxnum FOR DFKKBPTAXNUM-taxnum.

 

*&---------------------------------------------------------------------*
*& Include          ZFIR0111_O01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
 SET PF-STATUS '100'.

 SET TITLEBAR '100'.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module SET_ALV OUTPUT
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
MODULE SET_ALV OUTPUT.

  PERFORM set_alv.

ENDMODULE.

 

*&---------------------------------------------------------------------*
*& Include          ZFIR0111_F01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM GET_DATA.
  FREE GT_LIST.

  SELECT
    D~PARTNER,
    D~TAXTYPE,
    D~TAXNUM,
    K~KUNNR,
    K~NAME1,
    L~LIFNR,
    L~MCOD1
   FROM DFKKBPTAXNUM AS D
    LEFT OUTER JOIN KNA1 AS ON D~PARTNER K~KUNNR
    LEFT OUTER JOIN LFA1 AS ON D~PARTNER L~LIFNR
   WHERE D~PARTNER IN @S_PART
      AND D~TAXNUM IN @S_TAXNUM
   INTO CORRESPONDING FIELDS OF @GT_LIST.

ENDSELECT.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form SET_ALV
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM SET_ALV .

 IF  go_grid IS INITIAL.

   PERFORM create_object.

   PERFORM set_fieldcatalog.

   PERFORM set_layout.

   PERFORM display_layout.

   ELSE.

     CALL METHOD go_grid->refresh_table_display.

 ENDIF.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form CREATE_OBJECT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM CREATE_OBJECT .

   CREATE OBJECT go_docking
      EXPORTING
        repid sy-repid
        dynnr sy-dynnr
        side go_docking->dock_at_top
        extension 2000.

  CREATE OBJECT go_grid
    EXPORTING
      i_parent go_docking.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form SET_FIELDCATALOG
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM SET_FIELDCATALOG .

  DATA ls_fcat TYPE lvc_s_fcat.
  REFRESH gt_fcat.

  CLEAR ls_fcat.
    ls_fcat-fieldname 'PARTNER'.
    ls_fcat-coltext 'BP코드'.
    ls_fcat-just 'c'.
    ls_fcat-outputlen 6.
  APPEND ls_fcat TO gt_fcat.

  CLEAR ls_fcat.
    ls_fcat-fieldname 'TAXTYPE'.
    ls_fcat-coltext '세금분류'.
    ls_fcat-just 'c'.
    ls_fcat-outputlen 3.
   APPEND ls_fcat TO gt_fcat.

   CLEAR ls_fcat.
    ls_fcat-fieldname 'TAXNUM'.
    ls_fcat-coltext '세금번호'.
    ls_fcat-just 'c'.
    ls_fcat-outputlen 12.
   APPEND ls_fcat TO gt_fcat.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form SET_LAYOUT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM SET_LAYOUT .

  CLEAR gs_layout.

  gs_layout-zebra 'X'.
  gs_layout-cwidth_opt 'A'.
  gs_layout-sel_mode 'A'.

ENDFORM.
*&---------------------------------------------------------------------*
*& Form DISPLAY_LAYOUT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM DISPLAY_LAYOUT .

  CALL METHOD go_grid->set_table_for_first_display
    EXPORTING
      i_save 'X'
      i_default 'X'
      is_layout gs_layout
   CHANGING
     it_outtab gt_list[]
     it_fieldcatalog gt_fcat.
ENDFORM.

 

 

 

 

 

 

 

Sandra_Rossi
Active Contributor
0 Kudos
Please post code as text, not image: each image is approx 50KB versus 1KB for text.
View Entire Topic
meetts
Explorer
0 Kudos

I upload my code in text

 

Sandra_Rossi
Active Contributor
0 Kudos
Thanks, removing the screenshots of code is also good because each time people display the question, the 50K images pass the network. By the way, please post a comment (via Show replies), not an answer.