No records when inputting new field from linked tables.

I have linked two tables in a report.  If I use only fields from one table, no problem.  As soon as I add a field from the other table no records are pulled.  I am using the same filed "IncidentID" in both tables as a link.  If I attempt to pull the "IncidentID" from the second table no records are pulled.  There does not appear to be any key fields or indexes in either table if that helps.

Here are the SQL queries.  The first string is without any fields from "WorkLog".  The second is after adding the field "WorkLog.Incident Number" to the form.
SELECT "HPD_Help_Desk"."Incident Number", "HPD_Help_Desk"."Reported Date", "HPD_Help_Desk"."Direct Contact Site", "HPD_Help_Desk"."Assignee", "HPD_Help_Desk"."Status", "HPD_Help_Desk"."Last Modified Date", "HPD_Help_Desk"."Description", "HPD_Help_Desk"."Priority"
FROM   "HPD:Help Desk" "HPD_Help_Desk"
WHERE  "HPD_Help_Desk"."Status"='Pending' AND ("HPD_Help_Desk"."Assignee"='Debbie Kiolbasa' OR "HPD_Help_Desk"."Assignee"='John L King' OR "HPD_Help_Desk"."Assignee"='Ligaya Plumlee' OR "HPD_Help_Desk"."Assignee"='Ryan Keeler')
ORDER BY "HPD_Help_Desk"."Assignee"
SELECT "HPD_Help_Desk"."Incident Number", "HPD_Help_Desk"."Reported Date", "HPD_Help_Desk"."Direct Contact Site", "HPD_Help_Desk"."Assignee", "HPD_Help_Desk"."Status", "HPD_Help_Desk"."Last Modified Date", "HPD_Help_Desk"."Description", "HPD_Help_Desk"."Priority", "HPD_WorkLog"."Incident Number"
FROM   "HPD:Help Desk" "HPD_Help_Desk" INNER JOIN "HPD:WorkLog" "HPD_WorkLog" ON ("HPD_Help_Desk"."Incident Number"="HPD_WorkLog"."Incident Number") AND ("HPD_Help_Desk"."InstanceId"="HPD_WorkLog"."InstanceId")
WHERE  "HPD_Help_Desk"."Status"='Pending' AND ("HPD_Help_Desk"."Assignee"='Debbie Kiolbasa' OR "HPD_Help_Desk"."Assignee"='John L King' OR "HPD_Help_Desk"."Assignee"='Ligaya Plumlee' OR "HPD_Help_Desk"."Assignee"='Ryan Keeler')
ORDER BY "HPD_Help_Desk"."Assignee"
BTW - The "Left Outer Join" receives the errors noted in above post whereas the default "Inner Join" just comes back with empty records.
Unable to use the third party tools due to restrictions on loading software.  Also we are unable to access the lower level database.
Thanks

Similar Messages

  • SAP GRC 10.1 AMF No data selected when adding duplicate fields from separate tables for configurable data sources

    Hi There,
    In SAP GRC 10.0, our team had an issue where we could not add duplicate fields from separate table (see ERROR: Select Currency/UoM field for the selected analyzed fields). This was resolved by the SAP Note 1904313/ 1904314 (http://service.sap.com/sap/support/notes/1904313).
    We upgraded our system to SAP GRC 10.1 SP05 and could now add the duplicate fields from separate tables. SAP Note 1904313/ 1904314 was part of SAP GRC 10.1 SP03 so it makes sense that we, in a higher version (SP05), would be able to do this.
    The issue now is when we add the duplicate fields from different tables and run the Ad-hoc Query to test if the data source works correctly, the No Data Selected warning persists. This means that the data source provides no data for analysis, which is required to write our business rules.
    Below is an example:
    Basic data source with just one currency reference field EBAN-WAERS.
    When you run the Ad-Hoc Query you receive data.
    Basic data source with second currency reference field EKKO-WAERS.
    When you run the Ad-Hoc Query no data is found.
    Please also make reference to the following thread logged by my colleague (ERROR: Select Currency/UoM field for the selected analyzed fields)
    Any assistance to receive data with duplicate fields from separate tables will be highly appreciated.
    Thanking you in advance.
    Regards
    Gary Khan

    Hi
    following are the  error messages from dump
    hrtText
       There is already a line with the same key.
    hat happened?
       Error in ABAP application program.
       The current ABAP program "SAPLCKMS" had to be terminated because one of the
       statements could not be executed.
       This is probably due to an error in the ABAP program.
    rror analysis
       You wanted to add an entry to table "\FUNCTION-POOL=CKMS\DATA=T_DYN_CKMLCR",
        which you declared
       with a UNIQUE KEY. However, there was already an entry with the
       same key.
       This may have been in an INSERT or MOVE statement, or within a
       SELECT ... INTO statement.
       In particular, you cannot insert more than one initial line into a
       table with a unique key using the INSERT INITIAL LINE... statement.
    rigger Location of Runtime Error
       Program                                 SAPLCKMS
       Include                                 LCKMSF01
       Row                                     226
       Module type                             (FORM)
       Module Name                             DYNAMIC_PERIOD_CLOSING
    Source code where dump ocured
    222
    223           APPEND ht_ckmlpp TO t_add_ckmlpp.
    224           APPEND LINES OF ht_ckmlcr TO t_add_ckmlcr.
    225           INSERT ht_ckmlpp INTO TABLE t_dyn_ckmlpp.
    >>>>           INSERT LINES OF ht_ckmlcr INTO TABLE t_dyn_ckmlcr.
    227         ENDWHILE.
    Also I guess there is problem with material ledger in R/3 side
    I have never worked on material ledger before so dont hav idea of Tcode and tables in SAP R/3 for material ledger.
    Thanks
    Navneet

  • Add a new field(from transparent table) to the infoset

    Hi,
    I need to add a new field to the existing infoset in HR. I found that field exist in the CSKS table. in the infoset they are using PNP logical database. As per my understaning i have to link the CSKS-KOSTL with P0001-KOSTL.
    Could you tell me how to do this?
    Please do the needful.
    Thanks & Regards,
    Krishna.

    Hi,
    I have added that KOSAR in the additional fields and i added the code for that like
    clear kosar.
    select single kosar
      into kosar
      from csks
      where kokrs = p0001-kokrs
        and kostl = p0001-kostl.
    Is it will work now? One more help how to add this change to the transport?
    Please do the needful.
    Thanks & Regards,
    Krishna.

  • Generate delta records by comparing multiple fields from two tables?

    I have two tables with similar fields. Let's say Table 1 (T1) has fields Customer, A, B and C. Table 2 (T2) has fields Customer0002, A0002, B0002 and C0002. For each customer (each record) I want to check whether there is any difference in field A and A0002 or B and B0002 or C and C0002. If there is a difference between any of these pairs of fields then I will update that customer's record. Currently I have a piece of code
       DATA: ls_source TYPE y_source_fields,
            ls_target TYPE y_target_fields.
      LOOP AT it_source INTO ls_source.
        if not ( ls_source-A = ls_source-A0002 ).
          MOVE-CORRESPONDING ls_source TO ls_target.
          APPEND ls_target TO et_target.
        endif.
      ENDLOOP.
    This checks for the difference between one pair - A and A0002. How can I make it check 3 pairs and update when any of them have differences?

    Hello Khaled
    Why don't you add  B and B0002 - C and C0002 fields into your if declaration?
    LOOP AT it_source INTO ls_source.
        if not (
    ls_source-A = ls_source-A0002 and
    ls_source-B = ls_source-B0002 and
    ls_source-C = ls_source-C0002
          MOVE-CORRESPONDING ls_source TO ls_target.
          APPEND ls_target TO et_target.
        endif.
      ENDLOOP.
    I think you have more than 3 fields and the count of these fields are dynamic right?
    Do you about the ASSIGN COMPONENT x OF STRUCTURE y TO <field_symbol>.  usage?
    Can you explain your need in detail please.
    Edited by: Bulent Balci on Jul 27, 2010 4:18 PM

  • How can i delete Record when i click on Delete Link in a report

    hi,
    i have to create report
    select S_NO,BILL_NO,LED_NAME,PUR_LED,VAT,BILL_DATE,ST_GRP_UND,GODOWN_NAME,
    ITEM_NAME,UNIT,QTY,RATE,PER,DIS,AMOUNT,'Delete' from DUMY_AC_LED_PURASEI want to delete corressponding record when i click on Delete Link.
    Here S_NO is P.k.
    How can i delete Record when i click on Delete Link.

    Manoj,
    If something does not work then you should report back on the same thread so that there is continuity to the whole episode. Be as lucid as you can be so that people know whats the scenario. E.g. is not working is not enough. What happens? Does is show error , go blank, goes to another page... all that is important.
    Its for posterity, down the line others will also visit the thread (may be).
    Regards,

  • Add a new field to existing Table

    Hi , We want to add a new field to existing table from ECC  and populate historical data .
    We have already extracted data from ECC to VBAK Table . We have to add a new field - Incoterms in HANA . This field exists in ECC .
    Please guide.

    Hi Vicky,
        I dont think you can add new fields to the condition table once you have activated the condition table.
    SAP says you can only make limited changes to the condition table, like changing the description, fast entry screen, header and footer fields, but not able to add new fields to the table, and I think that is the correct approch or else for the same table you will have two sets of condition records.
    Please refer to the below link:
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/de/7a8534c960a134e10000009b38f83b/frameset.htm
    What you can do is create a new condition table with additional field and assign this table before the currently used table in the access sequence.
    Hope this helps.
    Regards
    Raj

  • How  to implement PCCD001 exit for new field in AENR table

    Dear experts,
    I am implementing PCCD0001 exit for a new field in AENR table secnario below.
    Tcode CC31/CC32/CC33 required additional field which stores value in AENR table. in AENR in implemented include(CI_AENR) and added new field. After i implemnted PCCD0001 screen exit for CC31/CC32/CC33.
    in that two function exit are there, one for passing data to  screen EXIT_SAPMC29C_001
    another for getting data from screen EXIT_SAPMC29C_002.
    which table or structure i use to place field in screen exit to pass data to EXIT_SAPMC29C_002, in this function i don't have import parameter.
    Adv. thanks,
    Venkey

    Hi sekhar,
    Your Requirement can be implemented by OVS(Object Value selector) This is the custom search help .So that you can define on what basis the value has to be fetched.
    Look at the below link
    http://wiki.sdn.sap.com/wiki/display/WDABAP/ABAPWDObjectValueSelector(OVS)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    You need to use the component WDR_OVS.
    It has 3 phases
    In phase 1
         You will fetch the value from input field to F4 help dialog box.
    In phase 2
         You will generate the search results , in this phase look for the input value given in field 2 and accordingly generate search result for the field 3.
    In phase 3
         The selected value will be returned to the original screen.
    Regards
    Karthiheyan M

  • Fetch only required fields from SQL Table

    Hi,
    We have a table like below which will get data thru a job.
    And I'm writing a Job/SP which will fetch 4 fields from that table and send  them in a Email to Admins informing how many new employee are added newly.
    How to loop thru these fields  and not only there might be a chance where we will have 100 records and I need to take only first 30 of them and send.
    EmpId
    Empname
    Deptname
    Designation
     Can any one has any solution on achieving this?
    Thanks

    Please refer the below link:
    http://beyondrelational.com/modules/2/blogs/77/posts/11386/sql-server-t-sql-different-ways-to-generate-a-comma-separated-string-from-a-table.aspx
    You need to use the Top30 query as your table in the script :
    select top 30 EmpID,EmpName,DeptName,Designation
    from tbl_name
    order by EmpID
    Eg: You may need to do for other columns:
    --WARNING: THIS SCRIPT IS PROVIDED AS-IS AND WITHOUT
    -- WARRANTY.
    -- FOR DEMONSTRATION PURPOSES ONLY
    --Step 01: Generate Temp table to store source data
    DECLARE @NamesTable TABLE (Id INT,
    Name NVARCHAR(50))
    --Step 02: Generate test data
    INSERT INTO @NamesTable VALUES (1,'A'),
    (2,'D'),
    (2,'C'),
    (3,'E'),
    (3,'H'),
    (3,'G')
    DECLARE @listIds VARCHAR(MAX) --DO NOT initialize this one!
    SELECT @listIds = COALESCE(@listIds + ',' ,'') + Cast(nt.Id as varchar(10))
    FROM @NamesTable nt Order by ID asc
    DECLARE @listNames VARCHAR(MAX) --DO NOT initialize this one!
    SELECT @listNames = COALESCE(@listNames + ',' ,'') + nt.Name
    FROM @NamesTable nt Order by ID asc
    SELECT 'EmpID: ' + @listIds+', EmpName: ' + @listNames

  • Adding new field in customized table ZPM_QMEL_EXT

    Hi all,
    My requirement is  to add a new field in ZPM_QMEL_EXT table numeric field no of  months due (ZZ_CO_MON_DUE) .
    Its value will be calculated as the # of invoices that were paid vs. what has not been paid and then from there, value of this field will be fetched.It has to be populated during the time of notifcation screen entry (iw51). The logic will be similar to this
      SELECT FAEDN FROM DFKKOP INTO TABLE IT_DU_DT
                                  WHERE GPART EQ WA_QMEL-KUNUM AND
                                        VKONT EQ WA_QMEL-ZZ_VKONT.
        SORT IT_DU_DT BY FAEDN ASCENDING.
        READ TABLE IT_DU_DT INTO WA_DU_DT INDEX 1.
        MOVE WA_DU_DT-FAEDN TO DUE_DT.
        CALL FUNCTION 'HR_MONTHS_BETWEEN_TWO_DATES'
          EXPORTING
            I_DATUM_BIS = SY-DATUM
            I_DATUM_VON = DUE_DT
          IMPORTING
            E_MONATE    = NO_MT.
        IF NO_MT IN P_DU_MT.
          WA_QMEL-DUE_MONTHS = NO_MT.
    Awaiting your kind help .
    Thanks
    hariom.

    Hi,
    There is only one option to include extra field for standard tables that is Append Structure other than we don't have any option.
    For Customizing tables we can use Append structure as well as Include Structure.
    Rules: Append Structure should be in last in Field column but include structure you can insert in any where it means between the fields.
    Delivery class option  and data class will take care automatically while upgrading the sap system one version to Another version.(upgrading).
    For that you should maintain the those properties when data base table creation.
    i hope the above information may helpful to you.
    Best Regards
    Sreenivas Pachva

  • Read contents of changing fields from internal table

    Hi Folks,
    Please help me in my query below:
    Consider there is a Z-table with two fields TABNAM and FIELD having values KNA1 and NAME1 respectively.
    In my report I have fetched entries for customers from KNA1. Now based on the field from Z-table I want to populate a variable suppose V_FREE_VAR with the value from KNA1 table.
    Here V_FREE_VAR is of CHAR200 so that it accomodate all types of values from KNA1.
    The value of Z-table FIELD can change daily i.e next day the value may be PSTLZ.
    So how can I read the particular field from internal table as the field to be read is dynamic.
    Note: using case is not feasible.
    Thanks in advance.
    Regards,
    Shardul

    @Hartmut P
    As Rob said i want to get the value of the field from internal table. the code is something like this.
    I_KNA1 contains records for customers.
    Suppose values of Z-table are in internal table I_TEMP_TABLE.
    Entries in I_TEMP_TABLE are as follows
    TABNAME      FIELDNAME
    KNA1                 NAME1
    The value of FIELNAME in Z-table can be changed
    Loop at I_TEMP_TABLE into WA_TEMP_TABLE.
    Read I_KNA1 into WA_KNA1 with key KUNNR = '0001002234'.
    IF SY-SUBRC EQ 0.
       CASE WA_TEMP_TABLE-FIELDNAME.
            WHEN 'NAME1'.
                 V_VAR = WA_KNA1-NAME1.
             WHEN 'PSTLZ'
                  V_VAR = WA_KNA1-PSTLZ.
    ENDIF.
    But using case is not appropriate as KNA1 contains 176 fields.

  • Adding a new field to the table

    Hello friends,
    I have a custom table and is in  use from a long time now.
    Now i need to add a new field to that table.
    1 - can i go directly to the change mode and then add it or is their any other way that needs to be followed.
    2 - once added do i need to go to SE14 and do something thr for the changes done to the table.
    This table also has a table Maintenence generator. Do I need to do something thr.
    Thanks,
    Bob.

    Hi,
    Check whether the change in ur custom table is going to impact any Custom program or not.
    If its so then adjust ur ABAP code so as to fit with the new table.
    Decide whether this field is going to be aprt of primary key or simple field.
    Is there any data present in ur custom table already?
    Regards,
    Lakshman.

  • I NEED FIELDS FROM VBFA TABLE

    HI ALL,
    I NEED FIELDS FROM VBFA TABLE
    THE FIELDS I WANT IS :
    CUSTOMER-ID
    CUSTOMER NAME
    CONTACT NAME
    PROJECTID
    ORDER NO
    SALES MAN ID
    ORDER PROCESS DATE
    INVOICE DATE
    GROSS AMOUNT
    NET AMOUNT POSTAL CODE.
    THANKS & REGARDS,
    R.VINOD.

    Hi Vinod..
    Try this Code. I made all the modifications in your code .. It will solve ur issues..
    REPORT zsdr_omvsa40.
    TYPE-POOLS
    TYPE-POOLS: slis.
    TABLE DECLARATIONS
    TABLES : vbak, vbkd,
    zzvbak,
    kna1, vbrk, vbrp, knvp .
    INTERNALTABLE DECLARATION *
    DATA: BEGIN OF i_vbak OCCURS 0,
    vbelv LIKE vbfa-vbelv, " Sales Order no
    vbeln like vbfa-vbeln, "Invoice No
    erdat LIKE vbak-erdat, " Date on Which Record Was Created
    kunnr LIKE vbak-kunnr,
    ps_psp_pnr LIKE vbak-ps_psp_pnr, " Work Breakdown Structure Element
    END OF i_vbak.
    *DATA : BEGIN OF i_zzvbak OCCURS 0,
    *vbeln LIKE zzvbak-vbeln,
    *zssidc LIKE zzvbak-zssidc, "Salesman ID
    *END OF i_zzvbak.
    DATA : BEGIN OF i_vbrk OCCURS 0,
    vbeln LIKE vbrk-vbeln,
    fkdat LIKE vbrk-fkdat, "Invoice Date
    END OF i_vbrk.
    DATA : BEGIN OF i_kna1 OCCURS 0,
    kunnr LIKE kna1-kunnr , " Customer Number 1
    name1 LIKE kna1-name1, " Customer Name
    pstlz LIKE kna1-pstlz , " Postal Code
    END OF i_kna1.
    DATA : BEGIN OF i_vbrp OCCURS 0,
    vbeln LIKE vbrp-vbeln,
    aubel LIKE vbrp-aubel,
    netwr LIKE vbrp-netwr , " Net Value in Document Currency
    kzwi1 LIKE vbrp-kzwi1, " Subtotal 1 from pricing procedure for condition
    erdat LIKE vbrp-erdat, "Billing document.
    END OF i_vbrp.
    DATA : BEGIN OF i_knvp OCCURS 0,
    parvw LIKE knvp-parvw , " Partner Function
    kunnr LIKE knvp-kunnr ,
    parnr LIKE knvp-parnr , " Number of contact person
    END OF i_knvp .
    DATA : BEGIN OF i_data OCCURS 0,
    erdat LIKE vbak-erdat, " Date on Which Record Was Created
    vbeln LIKE vbak-vbeln, " Sales Order no
    fkdat LIKE vbrk-fkdat, " Invoice date.
    kunnr LIKE kna1-kunnr , " Customer Number
    ps_psp_pnr LIKE vbak-ps_psp_pnr, " Work Breakdown Structure Element
    name1 LIKE kna1-name1, " Customer Name
    netwr LIKE vbrp-netwr , " Net Value in Document Currency
    kzwi1 LIKE vbrp-kzwi1, " Subtotal 1 from pricing procedure for condition
    parvw LIKE knvp-parvw , " Partner Function
    parnr LIKE knvp-parnr , " Number of contact person
    *zssidc LIKE zzvbak-zssidc, "Salesman ID
    pstlz LIKE kna1-pstlz , " Postal Code
    END OF i_data.
    ALV Declaraton
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    gd_tab_group TYPE slis_t_sp_group_alv,
    gd_layout TYPE slis_layout_alv,
    it_listheader TYPE slis_t_listheader,
    gd_repid LIKE sy-repid.
    Selection - Screen
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS creation FOR vbak-erdat . " Sales Order Date
    SELECT-OPTIONS period FOR vbrk-fkdat . " Invoice Date
    SELECT-OPTIONS order FOR vbak-vbeln . " Sales order no
    SELECT-OPTIONS name FOR kna1-name1 . " Customer Name
    SELECT-OPTIONS contact FOR knvp-parnr . " Contact Name.
    *SELECT-OPTIONS ssid FOR zzvbak-zssidc . " Salesman ID
    SELECT-OPTIONS project FOR vbak-ps_psp_pnr . " Work Breakdown Structure Element
    SELECTION-SCREEN : END OF BLOCK b1.
    START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
    PERFORM BUILD_LAYOUT.
    PERFORM top_of_page.
      PERFORM fill_listheader USING it_listheader.
      PERFORM display_alv_report.
    END-OF-SELECTION.
    *TOP-OF-PAGE.
    TOP-OF-PAGE.
    END-OF-PAGE.
    *& Form BUILD_FIELDCATALOG
    text
    FORM build_fieldcatalog.
      fieldcatalog-fieldname = 'KUNNR'.
      fieldcatalog-seltext_m = 'Sold to Party'.
      fieldcatalog-col_pos = 0.
      fieldcatalog-outputlen = 10.
      fieldcatalog-emphasize = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'NAME1'.
      fieldcatalog-seltext_m = 'Hlev Customer'.
      fieldcatalog-col_pos = 1.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'PARNR'.
      fieldcatalog-seltext_m = 'Contact name'.
      fieldcatalog-col_pos = 2.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'PS_PSP_PNR'.
      fieldcatalog-seltext_m = 'Project ID'.
      fieldcatalog-col_pos = 3.
      fieldcatalog-do_sum = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'VBELN'.
      fieldcatalog-seltext_m = 'Sales Document Type'.
      fieldcatalog-col_pos = 4.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'ZSSIDC'.
      fieldcatalog-seltext_m = 'SSID'.
      fieldcatalog-col_pos = 5.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'ERDAT'.
      fieldcatalog-seltext_m = 'so date'.
      fieldcatalog-col_pos = 6.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'FKDAT'.
      fieldcatalog-seltext_m = 'inv date'.
      fieldcatalog-col_pos = 7.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'KWZI1'.
      fieldcatalog-seltext_m = 'gross amt'.
      fieldcatalog-col_pos = 8.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'NETWR'.
      fieldcatalog-seltext_m = 'net amt'.
      fieldcatalog-col_pos = 9.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'PSTLZ'.
      fieldcatalog-seltext_m = 'Postal code'.
      fieldcatalog-col_pos = 10.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
    ENDFORM. "BUILD_FIELDCATALOG
    *& Form DATA_RETRIEVAL
    text
    FORM data_retrieval.
      SELECT VBFAvbelv VBFAvbeln
             VBAKerdat VBAKkunnr VBAK~ps_psp_pnr
             INTO TABLE i_vbak
      FROM VBFA
      INNER JOIN vbak
      ON VBFAVBELV = VBAKVBELN
      WHERE VBAK~erdat IN creation
      AND VBFA~vbelV IN ORDER
      AND VBAK~ps_psp_pnr IN project
      AND VBFA~VBTYP_N = 'M'  "Subsequent doc is Invoice
      AND VBFA~VBTYP_V = 'C'  "Prec doc is Sales order
      IF NOT i_vbak[] IS INITIAL.
    **Change of ORDER in SELECTS HERE
        SELECT vbeln fkdat FROM vbrk INTO TABLE i_vbrk
        FOR ALL ENTRIES IN i_vbak
        WHERE vbeln = i_vbak-vbeln
        AND fkdat IN period.
        IF NOT i_vbrk[] IS INITIAL.
          SELECT vbeln aubel netwr kzwi1 FROM vbrp INTO TABLE i_vbrp
          FOR ALL ENTRIES IN i_vbrk
          WHERE VBELN = i_vbrk-vbeln.
        endif.
        SELECT kunnr name1  pstlz  FROM kna1 INTO TABLE i_kna1 FOR ALL ENTRIES IN i_vbak
        WHERE kunnr = i_vbak-kunnr
        AND name1 IN name.
    *SELECT vbeln zssidc FROM zzvbak INTO TABLE i_zzvbak FOR ALL ENTRIES IN i_vbak
    *WHERE vbeln = i_vbak-vbeln
    *AND zssidc IN ssid .
    select netwr kzwi1 erdat from vbrp into table i_vbrp for all entries in i_vbak
    where erdat = i_vbak-erdat.
        SELECT kunnr parnr parvw FROM knvp INTO CORRESPONDING FIELDS OF TABLE i_knvp FOR ALL ENTRIES IN i_vbak
        WHERE kunnr = i_vbak-kunnr
        AND parvw = 'AP'
        AND parnr IN contact.
      ENDIF .
      SORT I_VBAK BY VBELN .
      SORT I_VBRK BY VBELN .
      LOOP AT i_vbrp.  "Invoice Item data
        MOVE i_vbrp-netwr TO i_data-netwr .
        MOVE i_vbrp-kzwi1 TO i_data-kzwi1.
        READ table I_VBAK WITH KEY VBELN = I_VBRP-VBELN BINARY SEARCH.  "Sales Order info
        IF SY-SUBRC = 0.
          MOVE I_VBAK-VBELV TO I_DATA-VBELN.   "Sales Order no
          MOVE I_VBAK-erdat TO I_DATA-erdat.   " Date on Which Record Was Created
          MOVE I_VBAK-kunnr TO I_DATA-KUNNR.    "Customer No
          MOVE I_VBAK-ps_psp_pnr TO I_DATA-ps_psp_pnr. " Work Breakdown Structure Element
        endif.
        READ TABLE I_VBRK WITH KEY VBELN = I_VBRP-VBELN BINARY SEARCH.   "Invoice header info
        IF SY-SUBRC = 0.
          MOVE i_vbrk-fkdat TO i_data-fkdat.
        endif.
        READ TABLE I_KNA1 WITH KEY KUNNR = I_VBAK-KUNNR BINARY SEARCH.   "Customer info
        IF SY-SUBRC = 0.
          MOVE i_kna1-kunnr TO i_data-kunnr.
          MOVE i_kna1-name1 TO i_data-name1.
          MOVE i_kna1-pstlz TO i_data-pstlz .
        endif.
        READ TABLE I_KNvp WITH KEY KUNNR = I_VBAK-KUNNR BINARY SEARCH.   "Partner info
        IF SY-SUBRC = 0.
          MOVE i_knvp-parnr TO i_data-parnr.
        endif.
        APPEND i_data.
      ENDLOOP.
    ENDFORM. "DATA_RETRIEVAL
    *& Form DISPLAY_ALV_REPORT
    text
    FORM display_alv_report.
    GD_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
      i_callback_program = sy-repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
      i_callback_top_of_page = 'TOP_OF_PAGE'
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
      it_fieldcat = fieldcatalog[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    I_HTML_HEIGHT_TOP = 0
    I_HTML_HEIGHT_END = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    IR_SALV_FULLSCREEN_ADAPTER =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
      TABLES
      t_outtab = i_data.
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2 .
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ENDFORM. "DISPLAY_ALV_REPORT
    FORM FOR FILLING LISTHEADER *
    FORM fill_listheader USING it_listheader TYPE slis_t_listheader.
      DATA : wa_listheader TYPE slis_listheader.
      wa_listheader-typ = 'H'.
      wa_listheader-info = 'Noel Gifts International Limited '.
      APPEND wa_listheader TO it_listheader.
      wa_listheader-typ = 'S'.
      wa_listheader-info = 'CUSTOMER CREDIT EXCEPTION REPORT' .
      APPEND wa_listheader TO it_listheader.
      CLEAR wa_listheader.
    ENDFORM. "fill_listheader
    *& Form top_of_page
    text
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_listheader.
    ENDFORM. "top_of_page
    REWARD IF HELPFUL.

  • How to add new fields  to a table control in a standard transaction JHA3X

    Hi All,
            We have a requirement where we have to add two new fields  to  a table control
            in a standard transaction JHA3X .
           We don't want any changes into our standard code and also we don't have any USER EXIT for that
           screen.
           Please provide with some solutions for the same .
           Thanks in advance .

    You will need add this to the /var/clientlibs/libs/cq/security/widgets.js and add the field under the 'CQ.security.UserProperties'.  For example, if you wanted to add a field to show the 'Middle Name' under the 'First Name' field, you can try adding the following:
                "items":[{
                        "xtype":"textfield",
                        "fieldLabel":CQ.I18n.getMessage("Login"),
                        "anchor":"100%",
                        "disabled":true,
                        "allowBlank":false,
                        "name":"rep:userId"
                        "xtype":"textfield",
                        "fieldLabel":CQ.I18n.getMessage("First Name"),
                        "anchor":"100%",
                        "name":"givenName"
                        "xtype":"textfield",
                        "fieldLabel":CQ.I18n.getMessage("Middle Name"),
                        "anchor":"100%",
                        "name":"middleName",
                        "xtype":"textfield",
                        "fieldLabel":CQ.I18n.getMessage("Last Name"),
                        "anchor":"100%",
                        "name":"familyName",
                        "allowBlank":false
    Hope this helps.
    -Ron

  • How to print the data  if we take different fields from diffrent tables

    Hi ABAPers,
    I take diff fields from 3 tables. Those are
    these fields from EKBE
           EBELN
           EBELP
           BELNR
           BUZEI
           BWART
           BUDAT
           AREWR
           REEWR
           WERKS
           MWSKZ
    these fields from EKKO
           BUKRS
           BSART
           WAERS
    these field from EKPO
           TXZ01
           MATNR
           MTART
    I want to print the data all fields.What logic can i write?
    Please help me for this question and i am waiting for your response.
    Regards,
    Raja Sekhar.

    Hi,
    First you have to fetch data from all the three tables and then consolidate into final table.
    In Declaration:
    1.Declare Internal Table for EKKO holding:
    EBELN
    BUKRS
    BSART
    WAERS
    2.Declare Internal Table for EKPO holding:
    EBELN
    EBELP
    TXZ01
    MATNR
    MTART
    3.Declare Internal Table for EKBe holding:
    EBELN
    EBELP
    BELNR
    BUZEI
    BWART
    BUDAT
    AREWR
    REEWR
    WERKS
    MWSKZ
    *==> This table has
    MANDT
    EBELN
    EBELP
    ZEKKN
    VGABE
    GJAHR
    BELNR
    BUZEI
    as Primary keys field,you should have values for all the PK aotherwise you will get multiple entries*
    4.Declare a Final Internal Table i_final with all the fields you want
    EBELN
    EBELP
    BUKRS
    BSART
    WAERS
    TXZ01
    MATNR
    MTART
    BELNR
    BUZEI
    BWART
    BUDAT
    AREWR
    REEWR
    WERKS
    MWSKZ
    Data Fetching
    select EBELN
    BUKRS
    BSART
    WAERS
    from EKKO
    into table i_ekko
    where .........<selection criteria>.
    if not i_ekko is initial.
    select EBELN
    EBELP
    TXZ01
    MATNR
    MTART
    from EKPO
    into table i_ekpo
    for all entries in i_ekko
    where EBELN = I_EKKO-EBELN
    AND ......<If any other selection criteria>.
    if not i_ekpo is initial.
    select EBELN
    EBELP
    BELNR
    BUZEI
    BWART
    BUDAT
    AREWR
    REEWR
    WERKS
    MWSKZ
    from EKBE
    into table i_ekbe
    for all entries in i_ekpo
    where ebeln = i_ekpo-ebeln
    and ebelp = i_ekpo-ebelp
    and ..........<If any othet selection criteria>
    endif.
    endif.
    Consolidate
    sort i_ekko by ebeln.
    sort i_ekpo by ebeln ebelp.
    sort i_ekbe by ebeln ebelp.
    LOOP AT i_ekbe into wa_ekbe.
    read table i_ekko into wa_ekko with key ebeln = wa_ekbe-vbeln binary search.
    if sy-subrc = 0.
    ====>Move all the required firlds from I_EKKO to i_final  , like
    wa_final-BUKRS = wa_ekko-BUKRS.
    endif.
    read table i_ekpo into wa_ekpo with key ebeln = wa_ekbe-vbeln
    ebelp = wa_ekbe-ebelp binary search.
    if sy-subrc = 0.
    ====>Move all the required firlds from I_EKPO to i_final  , like
    wa_final-EBELP = wa_ekko-EBELP.
    wa_final-TXZ01 = wa_ekko-TXZ01.
    endif.
    ==>Also all the required fields from EKBE to final table, like
    wa_final-BELNR = wa_ekbe-BELNR.
    endloop.

  • I need to add a single field from with_item table . need to write select query with reference to company code , account doc no , fiscal year

    I need to add a single field from with_item table . need to write select query with reference to company code , account doc no , fiscal year

    Hi Arun ,
    Can you explain little bit more ??
    what is account doc no? 
    what are the transactions should be displayed in your output??
    -Rajesh N

Maybe you are looking for