Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8720

Re: Creating a table in CRM UI

$
0
0

Hi,

ok I have created the View "Streets" with one Node "streetshode" and two attirbutes, Postnumbers and streets. in the Streets attributes i have GET_V_STREET:

 

method GET_V_STREET.

DATA:

       lt_sel_table     TYPE          bsp_wd_dropdown_table,

       lt_STREETS           TYPE TABLE OF ZPFG_GATA,

       l_ref_ddlb_type  TYPE REF TO   cl_crm_uiu_ddlb,

       ls_sel_table     TYPE LINE OF  bsp_wd_dropdown_table,

       ls_STREETS         TYPE          ZPFG_GATA.          "ZPFG_GATA is a database table

 

 

**** zregion table has region id, region name and country id which refers to the zcounty table

 

 

IF l_ref_ddlb_type IS NOT BOUND.

     CREATE OBJECT l_ref_ddlb_type

       EXPORTING

         iv_source_type = cl_crm_uiu_ddlb=>if_bsp_wd_valuehelp_pldescr~source_type_table.

   ENDIF.

 

 

SELECT * FROM ZPFG_GATA INTO TABLE lt_STREETS WHERE POSTNUMER = gv_postnumber.

**** In this query use your static variable that is created in view impl class which stores the current **** selected country id.

 

 

APPEND INITIAL LINE TO lt_sel_table.

LOOP AT lt_state INTO ls_STREETS.

     ls_sel_table-key   = ls_STREETS-HEITI_NEFNIFALL.

     ls_sel_table-value = ls_STREETS-HEITI_NEFNIFALL.

     APPEND ls_sel_table TO lt_sel_table.

     CLEAR: ls_sel_table, ls_STREETS.

   ENDLOOP.

 

 

   l_ref_ddlb_type->set_selection_table( it_selection_table = lt_sel_table ).

   rv_valuehelp_descriptor = l_ref_ddlb_type.

 

 

   DATA:

       lt_sel_table     TYPE          bsp_wd_dropdown_table,

       lt_STREETS           TYPE TABLE OF ZPFG_GATA,

       l_ref_ddlb_type  TYPE REF TO   cl_crm_uiu_ddlb,

       ls_sel_table     TYPE LINE OF  bsp_wd_dropdown_table,

       ls_STREETS         TYPE          ZPFG_GATA.          "zregion is a database table

 

 

**** zregion table has region id, region name and country id which refers to the zcounty table

 

 

IF l_ref_ddlb_type IS NOT BOUND.

     CREATE OBJECT l_ref_ddlb_type

       EXPORTING

         iv_source_type = cl_crm_uiu_ddlb=>if_bsp_wd_valuehelp_pldescr~source_type_table.

   ENDIF.

 

 

SELECT * FROM ZPFG_GATA INTO TABLE lt_STREETS WHERE  POSTNUMER = gv_postnumber.

**** In this query use your static variable that is created in view impl class which stores the current **** selected country id.

 

 

APPEND INITIAL LINE TO lt_sel_table.

LOOP AT lt_STREETS INTO ls_STREETS.

     ls_sel_table-key   = ls_STREETS-HEITI_NEFNIFALL.

     ls_sel_table-value = ls_STREETS-HEITI_NEFNIFALL.

     APPEND ls_sel_table TO lt_sel_table.

     CLEAR: ls_sel_table, ls_STREETS.

   ENDLOOP.

 

 

   l_ref_ddlb_type->set_selection_table( it_selection_table = lt_sel_table ).

   rv_valuehelp_descriptor = l_ref_ddlb_type.

 

 

endmethod.

 

 

 

GET_P_STREET:

 

method GET_P_STREET.

   CASE iv_property.

      WHEN if_bsp_wd_model_setter_getter~fp_fieldtype.

        rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.

ENDCASE.

endmethod.

 

 

In the postnmumber attribute i have the GET_V_POSTUNUMBER:

 

 

method GET_V_POSTNUMBER.

  DATA:

       lt_sel_table     TYPE          bsp_wd_dropdown_table,

       lt_POSTNUMBERS       TYPE TABLE OF ZPFG_GATA,

       l_ref_ddlb_type  TYPE REF TO   cl_crm_uiu_ddlb,

       ls_sel_table     TYPE LINE OF  bsp_wd_dropdown_table,

       ls_POSTNUMBERS       TYPE          ZPFG_GATA.          "ZPFG_GATA is the database table

 

 

**** The table ZPFG_GATA has fields countryid and countryname

 

 

IF l_ref_ddlb_type IS NOT BOUND.

     CREATE OBJECT l_ref_ddlb_type

       EXPORTING

         iv_source_type = cl_crm_uiu_ddlb=>if_bsp_wd_valuehelp_pldescr~source_type_table.

   ENDIF.

 

 

SELECT * FROM ZPFG_GATA INTO TABLE lt_POSTNUMBERS.

 

 

APPEND INITIAL LINE TO lt_sel_table.

 

 

LOOP AT lt_POSTNUMBERS INTO ls_POSTNUMBERS.

     ls_sel_table-key   = ls_POSTNUMBERS-POSTNUMER.

     ls_sel_table-value = ls_POSTNUMBERS-POSTNUMER.

     APPEND ls_sel_table TO lt_sel_table.

     CLEAR: ls_sel_table, ls_POSTNUMBERS.

   ENDLOOP.

 

 

   l_ref_ddlb_type->set_selection_table( it_selection_table = lt_sel_table ).

   rv_valuehelp_descriptor = l_ref_ddlb_type.

endmethod.

 

 

 

GET_P_POSTUNUMBER:

 

method GET_P_POSTNUMBER.

  CASE iv_property.

      WHEN if_bsp_wd_model_setter_getter~fp_fieldtype.

        rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.

      WHEN if_bsp_wd_model_setter_getter~fp_onclick.

        rv_value = store_postnumber      "This is the event handler

ENDCASE.

        DATA:

    l_ref_entity TYPE REF TO if_bol_bo_property_access.

 

    l_ref_entity = me->typed_context->context_name->collection_wrapper->get_current( ).

    IF l_ref_entity IS BOUND.

      gv_postnumber = l_ref_entity->get_property_as_string( 'Postnúmer' ).

    ENDIF.

endmethod.

 

 

When i save and activate i get the error:

the field "STORE_POSTNUMBER" is unknown, but there is a field with the similar name "GV_POSTNUMBER". "GV_POSTNUMBER"

 

I am not an ABAPer so please help me   I have not changed some parts of the comments.

 

thanks for everyones help.

Lisa


Viewing all articles
Browse latest Browse all 8720

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>