Skip to Content
0
Former Member
Jun 30, 2009 at 12:17 PM

Regarding container in oops alv

18 Views

hi,

i have created two containers in the screen 100 and I have written tha code as below, but i m getting nothing in my output.........

can anyone please help me in solving this

TABLES : VBRK.
DATA: O_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
      O_CONTAINER2 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
      O_GRID1      TYPE REF TO CL_GUI_ALV_GRID,
      O_GRID2      TYPE REF TO CL_GUI_ALV_GRID.

TYPES: begin of typ_vbrk,
         vbeln TYPE vbrk-vbeln,
       end of typ_vbrk,
       BEGIN OF typ_vbrp,
         VBELN TYPE vbrp-vbeln,
         POSNR TYPE vbrp-posnr,
         FKIMG TYPE vbrp-fkimg,
         MEINS TYPE vbrp-meins,
       end of typ_vbrp.
DATA: IT_VBRK TYPE STANDARD TABLE OF TYp_VBRK,
      WA_VBRK TYPE TYp_VBRK,
      it_final TYPE STANDARD TABLE OF typ_vbrp,
      wa_final TYPE typ_vbrp,
      IT_VBRP TYPE STANDARD TABLE OF TYp_VBRP,
      WA_VBRP TYPE TYp_VBRP.


SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.

START-OF-SELECTION.
  CALL SCREEN 100.
if s_vbeln is not initial.
  select vbeln from vbrk
    INTO TABLE it_vbrk
    where vbeln in s_vbeln.
    if sy-subrc = 0.
      sort it_vbrk by vbeln.
    endif.
if it_vbrk is NOT INITIAL.
  SELECT VBELN
         POSNR
         FKIMG
         MEINS
    from vbrp
    INTO TABLE it_vbrp
    FOR ALL ENTRIES IN it_vbrk
    where vbeln = it_vbrk-vbeln.
  if sy-subrc eq 0.
    sort it_vbrp by vbeln posnr.
    endif.
   endif.
endif.
    loop at it_vbrp INTO wa_vbrp.
      clear wa_final.
      READ TABLE it_vbrk INTO wa_vbrk
                WITH key vbeln = wa_vbrp-vbeln
                BINARY SEARCH.
      wa_final-vbeln = wa_vbrp-vbeln.
      wa_final-posnr = wa_vbrp-posnr.
      wa_final-fkimg = wa_vbrp-fkimg.
      wa_final-meins = wa_vbrp-meins.
      append wa_final to it_final.
      endloop.

Edited by: Vijay Babu Dudla on Jun 30, 2009 8:27 AM