Can I use LDB in a WDA !?

Can I use LDB in a WDA !?
  Just like we do in a HR ABAP program with PNP or PCH .
  and get the infotype data with Get PERNR .
  If the LDB doesn't work in WDA again,
  Is there any other special tools in WDA for HR develop !?!?!?
Thanks a lot.

Hi Wang,
Here in my project what we are doing to read the infotype is see the code whcih will give clear idea.
Here in my example i am reading the infortype 221.
<b>Code:</b>
method GET_221_DATA .
This method gets the 0221 data by calling the model component.
The dataset retrieved is then mapped to the Do_Not_Change node.
    DATA:
      lt_infotype_datasets                TYPE /kyk/s_paitf_dataset_tab,
      lv_temp                             TYPE string.                    " to hold the fieldname in a string type
    DATA lo_nd_node_it0221structure TYPE REF TO if_wd_context_node.
    DATA lo_el_node_it0221structure TYPE REF TO if_wd_context_element.
    DATA ls_node_it0221structure TYPE wd_this->element_node_it0221structure.
declarations for 0221 data
    DATA:
      ls_infotype_dataset                 TYPE /kyk/s_paitf_dataset,
      it_ui_structure                     TYPE /kyk/t_dataset_uistructure,
      wa_ui_structure                     TYPE /kyk/s_dataset_uistructure,
      wa_field_structure                  TYPE /kyk/s_value_of_field,
      wa_field_structure1                 TYPE /kyk/s_value_of_field,
      it_field_structure                  TYPE /kyk/t_value_of_field.
    DATA:
      l_ref_interfacecontroller           TYPE REF TO /kyk/iwci_c_pa_model,
      l_componentinterface                TYPE REF TO if_wd_component_usage.
    l_componentinterface =  wd_this->wd_cpuse_model( ).
    IF  l_componentinterface->has_active_component( ) IS INITIAL.
      l_componentinterface->create_component( ).
    ENDIF.
    l_ref_interfacecontroller =   wd_this->wd_cpifc_model( ).
ls_node_it0221structure-begda = '18000101'.
ls_node_it0221structure-endda = '99991231'.
ls_node_it0221structure-pernr = PERNR.
    l_ref_interfacecontroller->readinfty(
     EXPORTING
       begda =   ls_node_it0221structure-begda                     " Begda
       endda =   ls_node_it0221structure-endda                     " Endda
       infty =   '0221'                                         " Infty
       pernr =   ls_node_it0221structure-pernr                     " Persno
       subty =   '*'                                             " Subty
     IMPORTING
       patif_dataout =  lt_infotype_datasets                    " /kyk/s_Paitf_Dataset_Tab
delete lt_infotype_datasets where subty ne 'YAWA' and subty ne 'YANA'.
  navigate from <CONTEXT> to <NODE_IT0221STRUCTURE> via lead selection
    lo_nd_node_it0221structure = wd_context->get_child_node( name = wd_this->wdctx_node_it0221structure ).
*--- first loop at infotype dataset
    LOOP AT lt_infotype_datasets INTO ls_infotype_dataset.
      it_ui_structure = ls_infotype_dataset-uifields.
      lo_el_node_it0221structure = lo_nd_node_it0221structure->create_element( ).
      lo_nd_node_it0221structure->bind_element( new_item = lo_el_node_it0221structure set_initial_elements
      = abap_false ).
*---set lead selection
      lo_nd_node_it0221structure->set_lead_selection( lo_el_node_it0221structure ).
**---second loop at uifieldstructure
      LOOP AT it_ui_structure INTO wa_ui_structure where structurename eq 'HCMT_BSP_PA_CA_R0221'.
        it_field_structure = wa_ui_structure-fieldvalues.
*--- Do not read if STATUS is not 'X'
        READ TABLE it_field_structure WITH KEY fieldname = 'ADJRN' INTO wa_field_structure1.
        IF wa_field_structure1-fieldvalue <> 'X'.
          lo_nd_node_it0221structure->remove_element( lo_el_node_it0221structure ).
        ELSE.
*---third loop at fieldstructure
          LOOP AT it_field_structure INTO wa_field_structure.
      Set all the general attribute values
            lv_temp = wa_field_structure-fieldname.
            CALL METHOD lo_el_node_it0221structure->set_attribute
              EXPORTING
                value = wa_field_structure-fieldvalue
                name  = lv_temp.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
endmethod.
Warm Regards,
Vijay

Similar Messages

  • Can we use bdc in WDA?

    hi,
          can we use bdc in WDA? if yes please tell me how to do?

    Dear Murthy Ganti  ,
    yes it is possible by creating the Functional module for your BDC recording . i.e you will get the code generated by the BDC recording . create a FM using the Code .
    for example the below code is your recoding code
    Assign your import parameters to your code
    wa_iq02-MATNR      =  MATNR.
    wa_iq02-SERNR      =  SERNR.
    wa_iq02-GWLDT_O    =  GWLDT_O.
    append wa_iq02 to itab_iq02.
    clear wa_iq02.
    LOOP AT itab_iq02 INTO wa_iq02.
    PERFORM bdc_dynpro      USING 'SAPMIEQ0' '1000'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RISA0-MATNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RISA0-MATNR' 
                                      wa_iq02-matnr.                      " IMPORT parameters
        PERFORM bdc_field       USING 'RISA0-SERNR'
                                      wa_iq02-sernr.                        "IMPORT parameters
    CALL TRANSACTION 'IQ02' USING bdcdata MODE 'N' UPDATE 'S' MESSAGES INTO IT_MSG.
    IF sy-subrc EQ 0 .
    *      CONCATENATE 'Material No ' matnr  sernr INTO text.
          return_message-MESSAGE = 'Address was updated '.
         else .
           return_message-MESSAGE = 'Address Was Not Changed '.
        ENDIF .
    ENDLOOP .
    and check your FM is working fine . and consume it in WDA through call function or service call
    revert back if any doubt
    regards
    chinnaiya P
    Edited by: chinnaiya pandiyan on Jul 20, 2009 7:13 PM

  • Can i use select statements in LDB

    Hai All,
       Can i use select statements and internal table in a LDB program.
    my requirement is that if i enter company code , fiscal year and reporting periods.
    generally fiscal year will be jan to dec.but in my requirement the fiscal year is apr of previous year to march of currentyear.
    so as i require the last years data can iuse select statement in that ldb program or is there any solution for this.
    Thanks in Advance
    kiran

    Hi Kiran,
    To retrive records from ldb you have to use the
    GET <node> statement. This will invoke the selection screen of the node. An alternate solution is to use the function module LDB_PROCESS.
    Please see the following link for help and example
    http://help.sap.com/saphelp_nw04/helpdata/en/64/237f8cd43711d1950b0000e8353423/content.htm
    Thanks
    Vinod

  • How can we use the standard LDB in custom program.

    Dear all,
    can you please tell me the way , how can we use the standard LDB in custom program.
    Thanks & Regards,
    Jyothi.

    Hi
    You can use the Function module LDB_PROCESS to use the Standard LDB in your Z custome program for further details about using the Standard LDB and accessing the LDB in to the program search SDN
    http://help.sap.com/saphelp_nw04/helpdata/en/64/237f8cd43711d1950b0000e8353423/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/97/b3edb8163111d2953c0000e8353423/frameset.htm

  • Can I use logical databases in a WebDynpro ABAP program?

    can I use logical databases in a WebDynpro ABAP program?
    I need to build a WDA screen that is similar to the SAPDBPNP selection screen (user can find the personnel number based on several criteria, such as last_name/first_name of the employee).  So it seems that the existing logical databases have already many nice features already built (like the selection screens, the logic behind the screens etc). So I was wondering if/how I can use them in my WDA application.

    Hello, Tiberiu.
    You cannot use LDB directly within your WDA programa. BUT, you can fetch results from this LDB by using FM LDB_PROCESS. This function module can be called anytime from any kind of ABAP program. But you will still have to create the screen, as it only processes data, not screens.
    Regards,
    Andre
    PS: Pls reward points if it helps.

  • Can I use logical databases in a WebDynpro for ABAP program?

    can I use logical databases in a WebDynpro ABAP program?
    I need to build a WDA screen that is similar to the SAPDBPNP selection screen (user can find the personnel number based on several criteria, such as last_name/first_name of the employee).  So it seems that the exisinting logical databases have already many nice features already built (like the selection screens, the logic behind the screens etc). So I was wondering if/how I can use them in my WDA application.

    Hi
    Please let me also know the solution to this. I am a beginner to WebDynpro  and want to know if I can make use of LDB's as we do in our normal HR programming do develop a WDA in HR.
    Thanks and regards,
    Uma.

  • How to use LDB PNP with ABAP objects in a program

    Hello,
    I am wondering if anybody has used the HR logical database(LDB) PNP with user defined ABAP objects in a program? I am using the FM- <b>LDB_PROCESS</b> but its not working. Also assigning PNP in the attributes section of the program -- so that I can use predefined fields from the LDB and then invoking the FM doesn't work -- throwing 'Logical database already active' error.
    I suppose even with the ABAP objects and the new FM -- I should still be able to utilize the pre-defined fields of the PNP database -- and also the built in authorizations. I cannot use GET PERNR and REJECT as they give errors. I understand that the use of HR-macros (RP-PROVIDE-FROM-LAST and et al.) are not allowed as they use the table work area -- which is not allowed in ABAP-OOPS.
    I would really appreciate if anyone could show me some insight regarding this. Thank you.
    Kshitij R. Devre

    Hi Kshitij
    It would be really good if we could use both together. But as I know, it is not possible. "GET pernr." is an event-like loop statement and so cannot be used in OO context. And I guess, the same restriction holds for the "LDB_PROCESS" since it uses LDB-specific processing.
    What I suggest you is to use standard and BAPI functions.
    Sorry for giving bad news...
    *--Serdar

  • How to Create and Use ldb in reports?

    Give examples that uses ldb.

    Hi Albert
    You can create and maintain logical databases via the transaction <b>SE36</b>.
    You can relate a LDB to your program using the 'Attributes' window by entering the LDB name to the relevant field.
    Additional to what Andreas told, many HR programs use LDB. Check programs with 'RH*'.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • How to get a default variant screen using LDB.(HR-ABAP)

    Hello,
                   I have created a report using LDB PNP.Used HRBEN000 as a hr report category.
    Got a default selection screen, I want to add one more field, for this I have selected the field from further
    selection button, and displayed on the screen. Now i saved as a variant.
    how to get this default screen using the variant in the report/program when executed?
    Please help me.
    Thanks&Regards,
    Archana.

    Hi ,you camn always make your Z report category...if the field is present in further selection tab..
    if not you can create your own paramerter or select option.....
    but you have to handle it in your code ....as get pernr wont filter on its basis(parameter select optyin created by you)
    but why loop at screen is not working?
    let me know how you are doing...
    have to do it in at selection-screen output

  • Want to have own selection screen  in HR-ABAP report using LDB

    Hi experts,
            I am working on HR-ABAP report using LDB pnp and infotypes..But, here we get the built in selection criterion..but I want my own selection screen to be displayed..whats the solution for this??? Is it possible to create my own selection screen instead of default one..and how???
    Please help me..its very urgent..

    Hi,
    chk this out:
    Create Report Categories                                                                               
    In this step, you define the report categories and determine the layout
       of the standard selection screen for these report categories. You can 
       create report categories for programs or queries that are based on the
       PNP or PNPCE logical databases.                                                                               
    The definition of report categories is divided into two sections:                                                                               
    o   In the Change Report Category view, you define general attributes 
           such as sort order, input fields for date, and so on.                                                                               
    o   In the Change Selection Criteria view, you define which selection 
           fields of the logical database should be avaliable on the selection
           screen.                                                                               
    Example                                                                               
    You want to set up your system so that your employees can only start  
       evaluation reports for Payroll if they use a payroll area. Within a   
       payroll area, you should be able to select according to personnel     
       number. Additional selection criteria should not be possible and you  
       should not be allowed to enter a sort sequence.                       
    Standard settings                                                                               
    The standard system already contains report categories. You can find the 
    attributes of the report categories in the table.                                                                               
    Note the following five report categories in particular:                                                                               
    o   Report category ' ' is the SAP default report category for     
        programs that are based on the PNP logical database.                                                                               
    o   Report category PNPCE is the SAP default category for programs that  
        are based on the PNPCE logical database.                                                                               
    o   Report category '00000000' is the customer-specific default category 
        for programs that are based on the PNP logical database.                                                                               
    o   Report category '0PNPCE' is the customer-specific default category   
        for programs that are based on the PNPCE logical database.                                                                               
    o   Report category __X2001 is the default category for Queries  that    
        are based on an InfoSet of the PNP LDB.                                                                               
    o   Report category QUEPNPCE is the default category for queries that    
        are based on an InfoSet of the PNPCE LDB.                                                                               
    The default report categories are used when a report is called if    
        the report has not been assigned a report category.                  
    Parameters and Options for Report Categories of the LDB PNP and PNPCE  
    Parameters and Options in Screen Area General Data                     
       If you activate this parameter, you can only enter data on the data
       selection period if you use reports that have been assigned. The   
       same date entries are then used for the person selection as for the
       date selection.                                                                               
    o   Matchcode allowed                                                  
       If you activate this parameter, you have use of a Matchcode        
       pushbutton (search help) if you use reports that have been assigned.
       This pushbutton enables you to perform the person selection.                                                                               
    o   Sort allowed                                                       
       If you activate this parameter, you have use of a Sort pushbutton if
       you use report that have been assigned. This pushbutton enables you
       to define a sort order before you execute the report.                                                                               
    o   Organizational structure allowed                                   
       If you activate this parameter, you have use of an Org.Structure   
       pushbutton if you use reports that have been assigned. This        
       pushbutton enables you to perform the person selection.            
       Note:                                                              
       For more information about these options, see the online           
       documentation under this path:                                     
       SAP Library -> Human Resources -> Reporting in Human Resources     
       Management -> Standard HR Reports -> Report Selection Screen in    
       Human Resources Management.                                                                               
    Parameters and Options in Screen Areas Data Selection Period/Person    
    Selection Period/Payroll Area/Period/Year                                                                               
    o   Options for data selection period and person selection period (key 
        date and so on)                                                    
        Here you define which options for date and person selection are    
        available for reports that have been assigned.                                                                               
    o   Options for payroll area/period/year                               
        Here you define which options for selection using payroll          
        area/period/year are available for reports that have been assigned.                                                                               
    Parameters and Options in Screen Area Selection View                                                                               
    o   Type/Name                                                          
        This parameter enables you to use selection views to define report 
        categories. You use the selection view selected here to determine  
        which fields are available in the Dynamic Selectionsy.                                                                               
    Note:                                                              
        You create selection views for the PNP and PNPCE logical databases 
        in the Object Navigator (SE80):                                    
        1. Start the Object Navigator (SE80)                               
        2. Choose Workbench -> Edit Object.                                
        3. Choose the More... tab page and the Selection view on this tab  
        page.                                                              
        4. Choose Create.                                                  
        5. In the Create Selection View dialog box, choose the For any     
        tables option.                                                     
        6. In the Name of view field, enter a name for your selection view.
        7. In the Tables dialog box, enter the name of the table from which
        you want to use fields.                                            
        Note:                                                              
        When you enter the table name, observe the naming convention in    
        Personnel Administration:                                          
        Infotype number: nnnn -> table name: PAnnnn                        
        8. Choose Continue.                                                
        9. In the Functional groups area, define functional groups by      
        assigning a name and a number.                                     
        10. Assign fields from the selected tables to the functional groups
        by entering the number of the desired functional group in front of 
        each field.                                                        
        11. Save your entries.                                                                               
    For more information about adjusting the dynamic selections using 
    your own selection views, see the online documentation under the  
    following menu path:                                              
    SAP Library -> Human Resources -> Reporting in Human Resources    
    Management -> HR Standard Reports -> Report Selection Screen in   
    Human Resources Management -> Enhancing the Selection Screen -    
    Dynamic Selections.                                                                               
    If you do not want to offer dynamic selections, make the following
    settings:                                                                               
    -   LDB PNP: In the Selection view field, enter PNP_NO_FREE_SEL.  
    -   LDB PNPCE: Leave the Selection view field empty.                                                                               
    Parameters and Options in Screen Area Data Selection Period/Person   
    Selection Period/Payroll Area/Period/Year                                                                               
    o   Available input parameters, date or period entry (today, key date,
       all, and so on), and standard value.                             
       Using the Standard value option, you define which of the selected
       options is shown.                                                                               
    Parameters and Options in Screen Area CE Selection Fields                                                                               
    o   CE selection fields (external person ID, grouping reason, grouping
       value)                                                           
       Using the options in this area, you define whether the external  
       person Id, grouping reason, or grouping value are available on the
       selection screen.                                                
       Note:                                                            
       These parameters are only relevant for you if you implement      
       Concurrent Employment (see also note 517071).                                                                               
    Parameters and Options in Screen Area Selection view                                                                               
    o   Dynamic selections as dialog box                                  
        If this switch is set, you can call the dynamic selections as a   
        dialog box.                                                                               
    o   Dynamic selections active                                         
        If this switch is set, the dynamic selections of the logical      
        database are active at the start of the report.                                                                               
    Note that the following combinations are possible for the last two
        options mentioned:                                                                               
    Dyn.Sel. as dialog box/Dyn.Sel. active: inactive/inactive         
        Dyn.Sel. as dialog box/Dyn.Sel. active: inactive/active           
        Dyn.Sel. as dialog box/Dyn.Sel. active: active/inactive                                                                               
    Activities                                                                               
    1.  Choose Edit -> New entries.                                                                               
    2.  Enter an abbreviation and a long text for the report category.         
        The customer name range for report categories is 0-9.                                                                               
    3.  Select the For the PNPCE logical database checkbox, if you want to     
        create a report category for a program or for queries of the PNPCE     
        logical database.                                                                               
    4.  In the General Data screen area, choose the desired options.           
        If you want to use selection IDs, you must have first created and      
        grouped selection Ids. The IMG path to do this is given in the         
        parameter description section.                                                                               
    5.  In the Data selection period/person selection period or Selection      
        period screen area, choose the desired options.                                                                               
    6.  In the Selection view screen area, choose the desired options.                                                                               
    7.  In the CE selection fields screen area, choose the desired (only       
        possible for report categories of the LDB PNPCE).                                                                               
    8.  Save your entries.                                                                               
    9.  Choose the subactivity Permitted selection criteria.                                                                               
    10. Choose Edit -> New entries.                                                                               
    11. In the Select option field, use the input help to select each field    
        that should be available on the selection screen.                                                                               
    12. Select the checkbox in the 1.page column, if you want this selection   
        field to be available directly when you call the selection screen.                                                                               
    Further notes                                                                               
    13. If you want to copy entries, you still have to enter the selection     
        parameters again in the subsequent screen.                                                                               
    o   If you create the report category '000000000', a selection screen is   
        generated according to report category '00000000'for all reports for   
        which a report category has not explicitly been assigned.                                                                               
    Assign Report Categories                                                                               
    In this step, you assign a report category to your reports.                                                                               
    Example                                                                               
    You have created your own report, for example ZPCTEST1, and would like
        it to have the selection screen that corresponds to that of the       
        evaluation report for Payroll, which is assigned to report category   
        '__M00001'.                                                           
        Assign report category '__M00001' to the report.                                                                               
    Requirements                                                                               
    You must have defined the Report Categories.                                                                               
    Standard settings                                                                               
    SAP Standard Reports:                                                                               
    In the standard system, reports are assigned a report category. If you
        want to override these assignments, perform the activities described  
        here. If you want to assign report categories to standard reports using
        SE38, this represents a modification.                                                                               
    Customer-Specific Reports:                                                                               
    For reports you have developed yourself, you can either assign report 
        categories by performing the activities described here or directly in SE38.
    Recommendation                                                                               
    Only assign a report category if you have created your own reports or if  
    the selection screens in the standard system do not meet your             
    requirements.                                                                               
    Activities                                                                               
    1.  Choose Edit -> New entries.                                                                               
    2.  Perform the required assignment using the Program name and Report     
       category fields.                                                                               
    3.  Save your entries.                   
    reward if helpful
    regards,
    madhumitha

  • How to use Logic DataBase in WDA?

    Hi Experts,
    The LDBs contain: Selection Screen, Authorization check, Data Retrieval, and it is very useful for writing a report within R3 system.
    I am developing some WDA reports, and really need this kind of features too. Is there anyone know how to use LDB in WDA???
    Thanks a lot.
    Best Regards,
    Guo Guo Qing

    Thanks for your reply.
    Could you tell me if there is some standard function module to handle LDB?
    Best Regards,
    Guo Guo Qing

  • Reading Locked records from HR table using LDB PNP

    Hi,
    I am trying to read the table pa0168 using LDB PNP.
    But the problem is that get pernr staement does not retrieve locked records i.e where PA0168-sprps eq "X'.
    Can anybody help me with this.
    I have to use LDB  so i don't want a solution of writing a select * for the pa0168 table.
    hence i have to use get pernr statement but it should also retrieve locked records.
    how can i achieve that.? please help
    Thanks
    GT
    Message was edited by: GT

    Hi GT,
    In the START-OF-SELECTION event, set the parameter value
    pnp-sw-ignorelockedrecords = 'N'.
    Good Luck,
    Suresh Datti
    ( Pl award points if the answer helps you )

  • FM's used in report program using ldb pnpce

    hii all,
      will anybody provide me function modules that are used to populate data in report program using ldb pnpce.
    <REMOVED BY MODERATOR>
    thanks in advance
    regards
    Ashweeni.
    Edited by: Alvaro Tejada Galindo on Mar 18, 2008 6:01 PM

    U can use all the FM's which were used for LDB PNP ..
    For ex : Use the below to get the payroll results ..
    To get the results directory
      call function 'CU_READ_RGDIR'
        exporting
          persnr          = peras-pernr
        tables
          in_rgdir        = pc261_tab
        exceptions
          no_record_found = 1
          others          = 2.
    to get evaluation periods ...
    call function 'CD_EVALUATION_PERIODS'
    There are no particular FM's that will populate data in report
    program .. please let me know what is the requirement ...

  • Want to use ldb selection screen with select queries

    I want to use ldb selection screen with select queries since ldb having performance issue .How can I use the fields of the dynamic selection of LDB in the select queries

    Hi,
    Check the code snippet below: Here 'XXXX' is the table for your select query.
      DATA L_DS_CLAUSES TYPE RSDS_WHERE.
      MOVE 'XXXX' TO L_DS_CLAUSES-TABLENAME.
      READ TABLE DYN_SEL-CLAUSES WITH KEY L_DS_CLAUSES-TABLENAME
                                 INTO L_DS_CLAUSES.
      SELECT * FROM XXXX
              WHERE field1 IN ...
               AND   field2 ....
               AND (L_DS_CLAUSES-WHERE_TAB).
          PUT XXXX.
      ENDSELECT.
    You can also try using the FM 'RS_REFRESH_FROM_DYNAMICAL_SEL' passing SY-CPROG in curr_report and 'M'  for mode to get the dynamic selection screen values.
    Regards,
    Munesh.

  • Screen Change when using LDB - pnp

    Hi ,
    I am facing a strange problem.
    I am using LDB -> pnp and HRIN0013 as Master data rep ,
    in one of the programs that i developed.
    The Screen and program behave fine in the development server.
    Once i transport it to the production server, the Screen changes to something completely different.
    What i noticed is that in attributes -->'Report category assignment' , HRIN0013 is not present.
    This means that HRIN0013 has not been transported?
    What can the problem be and how can i fix it?? I need to get this in by tommorow. Help will be highly appreciated.

    Hi Sanchit,
    when I change the report class in an HR report, the system tells me for the change request number.
    This change request, introduces, I think, a new record in some customize tables, like t599C.
    There must be a record in this table, for the report class that you create.
    Hope this helps you,
    Carles

Maybe you are looking for