cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in displaying ALV

Former Member
0 Kudos

Hello everyone,

I am having a problem in displaying ALV when click on SEARCH.

Here is my code on action method SEARCH with attached screen shot.No ALV is getting displayed when hit search button.

method ONACTIONSEARCH .

   DATA node_custmain TYPE REF TO if_wd_context_node.

   DATA el_custmain TYPE REF TO if_wd_context_element.

   DATA ls_custmain TYPE wd_this->Element_custmain.

* navigate from <CONTEXT> to <CUSTMAIN> via lead selection

   node_custmain = wd_context->get_child_node( name = wd_this->wdctx_custmain ).

* get element via lead selection

   el_custmain = node_custmain->get_element( ).

* get all declared attributes

   el_custmain->get_static_attributes(

     IMPORTING

       static_attributes = ls_custmain ).

data:   node_custlist type ref to if_wd_context_node.

* navigate from <CONTEXT> to <CUSTLIST> via lead selection

   node_custlist = wd_context->get_child_node( name = wd_this->wdctx_custlist ).

*data:   node_custmain type ref to if_wd_context_node.

   TYPES:

      lty_r_OPPDESCRIPTION  TYPE RANGE OF ZOPPDES,

      lty_r_OPPCUSTID       TYPE RANGE OF ZOPPCID,

      lty_r_OPPCUSTNAME     TYPE RANGE OF ZOPPNME,

      lty_r_OPPERPCUSTID    TYPE RANGE OF ZERPCID,

      lty_r_OPPERPCUSTNAME  TYPE RANGE OF ZERPCNM,

      lty_r_OPPGLOBULTID    TYPE RANGE OF ZGLUID,

      lty_r_OPPSTATUS       TYPE RANGE OF ZOPPST,

      lty_r_OPPPHASE        TYPE RANGE OF ZOPPHS,

      lty_r_OPPSALESORGDESC TYPE RANGE OF ZSLSDES.

   DATA

      lt_sel_item TYPE if_wd_select_options=>tt_selection_screen_item.

   FIELD-SYMBOLS:

      <fs_sel_item>        LIKE LINE OF lt_sel_item,

      <fs_OPPDESCRIPTION>  TYPE lty_r_OPPDESCRIPTION,

      <fs_OPPCUSTID>       TYPE lty_r_OPPCUSTID,

      <fs_OPPCUSTNAME>     TYPE lty_r_OPPCUSTNAME,

      <fs_OPPERPCUSTID>    TYPE lty_r_OPPERPCUSTID,

      <fs_OPPERPCUSTNAME>  TYPE lty_r_OPPERPCUSTNAME,

      <fs_OPPGLOBULTID>    TYPE lty_r_OPPGLOBULTID,

      <fs_OPPSTATUS>       TYPE lty_r_OPPSTATUS ,

      <fs_OPPPHASE>        TYPE lty_r_OPPPHASE,

      <fs_OPPSALESORGDESC> TYPE lty_r_OPPSALESORGDESC.

* Get the selection-screen items

   wd_this->m_helper->get_selection_screen_items(

     IMPORTING et_selection_screen_items = lt_sel_item ).

   DATA:

   ls_output           TYPE zhpt_crm_report,

   lt_output           LIKE TABLE OF ls_output,

   gt_crmextract       TYPE STANDARD TABLE OF zcrmextract

                         WITH NON-UNIQUE         KEY primary_key

                                                 COMPONENTS oppid

                        WITH NON-UNIQUE SORTED  KEY customer

                                                 COMPONENTS oppcustid,

    BEGIN               OF gs_customer,

       crmcustnumber     TYPE zhncustomer-crmcustnumber,

       customerid        TYPE zhncustomer-customerid,

       custname          TYPE zhncustomer-custname,

     END                 OF gs_customer,

     gt_customer         LIKE SORTED TABLE OF gs_customer

                         WITH NON-UNIQUE KEY crmcustnumber,

     BEGIN               OF gs_project,

       liccrmopp         TYPE zproject-liccrmopp,

       srvcrmopp         TYPE zproject-srvcrmopp,

       id                TYPE zproject-id,

       projectname       TYPE zproject-projectname,

     END                 OF gs_project,

     gt_project          LIKE SORTED TABLE OF gs_project

                         WITH NON-UNIQUE         KEY primary_key

                                                 COMPONENTS liccrmopp

                         WITH NON-UNIQUE SORTED  KEY service

                                                 COMPONENTS srvcrmopp.

   FIELD-SYMBOLS:

    <fs_crmextract>     LIKE LINE OF gt_crmextract.

* Retrieve the values from the select-options items

   LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.

     CASE <fs_sel_item>-m_id.

       WHEN `OPPDESCRIPTION`.

         ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_OPPDESCRIPTION>.

       WHEN `OPPCUSTID`.

         ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_OPPCUSTID>.

       WHEN `OPPCUSTNAME`.

         ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_OPPCUSTNAME>.

       WHEN `OPPERPCUSTID`.

         ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_OPPERPCUSTID>.

       WHEN `OPPERPCUSTNAME`.

         ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_OPPERPCUSTNAME>.

       WHEN `OPPGLOBULTID`.

         ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_OPPGLOBULTID>.

       WHEN `OPPSTATUS`.

         ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_OPPSTATUS>.

       WHEN `OPPPHASE`.

         ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_OPPPHASE>.

       WHEN `OPPSALESORGDESC`.

         ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_OPPSALESORGDESC>.

     ENDCASE.

   ENDLOOP.

CLEAR: lt_output[], gt_crmextract[].

   SELECT  *

      FROM  zcrmextract

      INTO  TABLE gt_crmextract

      WHERE oppdescription  IN <fs_OPPDESCRIPTION>

      AND   oppcustid       IN <fs_OPPCUSTID>

      AND   oppcustname     IN <fs_OPPCUSTNAME>

      AND   opperpcustid    IN <fs_OPPERPCUSTID>

      AND   opperpcustname  IN <fs_OPPERPCUSTNAME>

      AND   oppglobultname  IN <fs_OPPGLOBULTID>

      AND   oppstatus       IN <fs_OPPSTATUS>

      AND   oppphase        IN <fs_OPPPHASE>

      AND   oppsalesorgdesc IN <fs_OPPPHASE>.

   IF sy-subrc = 0.

     SELECT  crmcustnumber customerid custname

       FROM  zhncustomer

       INTO  TABLE gt_customer

       FOR ALL ENTRIES IN gt_crmextract

       WHERE crmcustnumber = gt_crmextract-oppcustid.

     SELECT  liccrmopp srvcrmopp id projectname

       FROM  zproject

       INTO  TABLE gt_project

       FOR ALL ENTRIES IN gt_crmextract

       WHERE liccrmopp = gt_crmextract-oppid

       OR    srvcrmopp = gt_crmextract-oppid.

   ENDIF.

   LOOP AT gt_crmextract ASSIGNING <fs_crmextract>.

     CLEAR: ls_output , gs_customer, gs_project.

     ls_output  = <fs_crmextract>.

     IF ls_output-oppcustid IS NOT INITIAL.

       READ TABLE gt_customer INTO gs_customer

             WITH KEY crmcustnumber = ls_output-oppcustid.

       IF sy-subrc = 0.

         ls_output-custid    = gs_customer-customerid.

         ls_output-custname  = gs_customer-custname.

       ENDIF.

     ENDIF.

     IF ls_output-oppid IS NOT INITIAL.

       READ TABLE gt_project INTO gs_project

             WITH KEY liccrmopp = ls_output-oppid.

       IF sy-subrc <> 0.

         READ TABLE gt_project INTO gs_project

               WITH KEY srvcrmopp = ls_output-oppid.

       ENDIF.

      ls_output-projid    = gs_project-id.

       ls_output-projname  = gs_project-projectname.

     ENDIF.

     APPEND ls_output  TO lt_output .

   ENDLOOP.

   IF lt_output[] IS NOT INITIAL.

      node_custlist = wd_context->get_child_node( name = `CUSTLIST` ).

      node_custlist->bind_elements( lt_output ).

   ENDIF.

Thanks,

Kiran

Accepted Solutions (1)

Accepted Solutions (1)

farooq_basha
Active Participant
0 Kudos

HI Kiran,

How are you making table in VIEW visible and invisible. Have u created the VIEWCONTAINER and embeeded with VIEW at window level? and Reused the SALV_WD_TABLE component and mapped the DATA with ur NODE?

Thanks,

Farooq

Former Member
0 Kudos

Thanks Farooq!

Just tried...not working .Don't know what is the problem.Everything looks Okay but still no ALV getting display.I am wondering atleast blank ALV should get display.

Former Member
farooq_basha
Active Participant
0 Kudos

Hi Kiran,

I suggest if it is new development application then delete the REUSE ALV component and again define and embeed and MAP to DATA to the NODE which u want to display.

Regards,

Farooq

Former Member
0 Kudos

Have followed the steps from one of the forum example on web.

Yes I have created VIEWCONTAINER and embeded it under view and then selected TABLE.

Any idea?

Former Member
0 Kudos

Thanks Karthik!

I followed this link only to create ALV.

farooq_basha
Active Participant
0 Kudos

Hi Kiran,

I am not sure u have MAP ALV data to NODE or not and Embeded ur VIEW

Follow this process and do this if u have not done -

1) Go to WINDOW and Embeed the table in VIEWCONTAINER

2) In COMPONENT USAGE open ur ALV and click on interface controller then u can c CONTEXT INTERFACE NODE 'DATA' and right hand side u can c ur NODE . DRAG and DROP ur NODE to DATA .

Regards,

Farooq

Former Member
0 Kudos

Check whether u binded the elements in the right order

Former Member
0 Kudos

Done,still the same

Thanks,

Kiran

farooq_basha
Active Participant
0 Kudos

Hi Kiran,

Cross check with below links whether you have followed the same process or not.

http://www.saptechnical.com/Tutorials/WebDynproABAP/ALV/page1.htm

http://wiki.sdn.sap.com/wiki/display/WDABAP/Creating+an+ALV+List+in+Web+Dynpro+Application

Regards,

Farooq

Former Member
0 Kudos

Thanks Farooq!

I deleted the mapping from DATA and then again created mapping between ALV data and 'DATA' node and it is working .

One more question: I don't want my ALV to  appear initially, it get appear only when user hit SEARCH button.Would you know by any chance?

Regards,

Kiran

Answers (5)

Answers (5)

Former Member
0 Kudos

hi kiran did u embed table view in view container?

Former Member
0 Kudos

yes

Former Member
0 Kudos

Hi,

Have you created the external context mapping with DATA  node of ALV to your context node in component controller?

Former Member
0 Kudos

Hi Kiran u can also do it using select-options in webdynpro .. but it will solve ur problem..

http://scn.sap.com/docs/DOC-2212

Former Member
0 Kudos

my requirement is to display customer and project details in ALV.

Former Member
0 Kudos

Check in ur table that data is available

Former Member
0 Kudos

yes..data is available

Former Member
0 Kudos

Hii Kiran... the way u r approaching is gud..

what i understand by ur program is .. ur getting input variable data and assaigning to field symbols and getting data using quiery based on conditions k..

then where are u setting this data to output..

use bind_table to bind data ..

check standard alv is declared in used components..

and also in view properties,..

i think u have used view controoler to display data...?

pls check this i think this will solve ur problem

Thanks and regards ..

lokesh

Former Member
0 Kudos

Hey Lokesh,

I tried with t bind_table , but still the same issue.

Thanks,

Kiran

chengalarayulu
Active Contributor
0 Kudos

Kiran,

Check ALV view embedded at window level?

Former Member
0 Kudos

Yes...embedded at window level only

Former Member
0 Kudos

It does not go to the page or displaying some error

Former Member
0 Kudos

It does not display the ALV in same screen(below the button),you can see how it looks in the screen shot.

Thanks,

Kiran

Former Member
0 Kudos

Did u bind all the elements in order and gave the lead selection?