on 05-09-2012 5:31 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
C this article for example
http://www.saptechnical.com/Tutorials/WebDynproABAP/ALV/page1.htm
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
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
hi kiran did u embed table view in view container?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran u can also do it using select-options in webdynpro .. but it will solve ur problem..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kiran,
Check ALV view embedded at window level?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It does not go to the page or displaying some error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.