OTHER TABLE FIELD

Hi all
i am compiling the below code am getting evrything fine but am not able to get the G/L account description from the table SKAT.The other firlds that am accessing from BSEG table are getting through.Please help
with regards
vijay
REPORT  ZGLACCT4.
TYPE-POOLS:SLIS.
TABLES:SKB1,BSEG,SKAT.
DATA:x like SKAT-SAKNR.
DATA:IT_SKB1 TYPE STANDARD TABLE OF SKB1 WITH HEADER LINE.
*DATA:IT_BSEG TYPE STANDARD TABLE OF BSEG WITH HEADER LINE.
*DATA:IT_SKAT TYPE STANDARD TABLE OF SKAT WITH HEADER LINE.
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,
      gd_repid     like sy-repid.
DATA:BEGIN OF IT_BSEG OCCURS 0,
    BUKRS like BSEG-BUKRS,
  BELNR like BSEG-BELNR,
  GJAHR like BSEG-GJAHR,
  BUZEI LIKE BSEG-BUZEI,
  SAKNR1 LIKE BSEG-SAKNR,
  HKONT like BSEG-HKONT,
TXT50 like SKAT-TXT50,
MCOD1 LIKE SKAT-MCOD1,
END OF IT_BSEG.
DATA:BEGIN OF IT_SKAT OCCURS 0,
   MCOD1 LIKE SKAT-MCOD1,
   TXT50 LIKE SKAT-TXT50,
   SAKNR LIKE SKAT-SAKNR,
   END OF IT_SKAT.
DATA:BEGIN OF IT_FINAL OCCURS 0,
  BUKRS like BSEG-BUKRS,
  BELNR like BSEG-BELNR,
  GJAHR like BSEG-GJAHR,
  BUZEI LIKE BSEG-BUZEI,
  HKONT like BSEG-HKONT,
MCOD1 like SKAT-MCOD1,
  TXT50 LIKE SKAT-TXT50,
  END OF IT_FINAL.
SELECTION-SCREEN:BEGIN OF BLOCK B1.
*PARAMETERS:CODE TYPE BSEG-BUKRS.
PARAMETERS:CODE TYPE SKB1-BUKRS.
SELECT-OPTIONS:ACCOUNT FOR SKB1-SAKNR.
*SELECT-OPTIONS:ACCOUNT FOR BSEG-HKONT.
SELECT-OPTIONS:YEAR FOR BSEG-GJAHR.
SELECTION-SCREEN:END OF BLOCK B1.
*DATA SAKNRA_1 LIKE LINE OF SAKNRA.
AT SELECTION-SCREEN ON CODE.
IF CODE IS INITIAL.
MESSAGE 'Please enter a value ' TYPE 'E'.
ENDIF.
AUTHORITY-CHECK OBJECT 'S_CODE'
ID 'BUKRS' FIELD CODE
ID 'ACTVT' FIELD '03'.
IF SY-SUBRC = 4.
MESSAGE 'No authorization for CODE' TYPE  'E'.
ENDIF.
AT SELECTION-SCREEN.
IF ACCOUNT is INITIAL.
MESSAGE 'Please enter values' TYPE 'W'.
ENDIF.
*ELSEIF sy-subrc eq 0.
START-OF-SELECTION.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = ACCOUNT
IMPORTING
   OUTPUT        = ACCOUNT.
SELECT BUKRS BELNR GJAHR BUZEI HKONT FROM BSEG
   INTO  TABLE IT_FINAL
  WHERE HKONT NOT IN ACCOUNT AND BUKRS = CODE.
SELECT TXT50 FROM SKAT INTO TABLE
  IT_SKAT WHERE SPRAS EQ 'EN' AND  SAKNR EQ IT_BSEG-HKONT.
WHERE SAKNR EQ IT_BSEG-SAKNR .
*FOR ALL ENTRIES IN IT_BSEG
END-OF-SELECTION.
*WRITE:/ IT_SKAT-MCOD1.
LOOP AT IT_BSEG .
   IF SY-SUBRC = 0.
  READ TABLE IT_SKAT WITH KEY SAKNR = IT_BSEG-SAKNR1.
  if sy-SUBRC = 0.
  IT_FINAL-BUKRS = IT_BSEG-BUKRS.
  IT_FINAL-BELNR = IT_BSEG-BELNR.
  IT_FINAL-GJAHR = IT_BSEG-GJAHR.
  IT_FINAL-BUZEI = IT_BSEG-BUZEI.
  IT_FINAL-HKONT = IT_BSEG-HKONT.
IT_FINAL-TXT50 = IT_SKAT-TXT50.
  endif.
  endif.
  ENDLOOP.
LOOP AT IT_SKAT.
   IF SY-SUBRC = 0.
      IT_SKAT-TXT50.
     endif.
     ENDLOOP.
perform build_fieldcatalog.
*perform build_layout.
perform display_alv_report.
*PERFORM top-of-page.
FORM build_fieldcatalog.
fieldcatalog-FIELDNAME   = 'BUKRS'.
fieldcatalog-seltext_m   = 'CODE '.
fieldcatalog-col_pos     =  0.
fieldcatalog-outputlen     = 6.
fieldcatalog-tabname = 'it_final'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
    fieldcatalog-FIELDNAME   = 'BELNR'.
    fieldcatalog-seltext_m   = 'DOCUMENT NUMBER'.
    fieldcatalog-tabname = 'it_final'.
    fieldcatalog-col_pos     = 1.
    fieldcatalog-outputlen     = 18.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
          fieldcatalog-FIELDNAME = 'GJAHR'.
          fieldcatalog-seltext_m   = 'YEAR'.
          fieldcatalog-tabname = 'it_final'.
          fieldcatalog-col_pos     = 2.
          fieldcatalog-outputlen     = 5.
          APPEND fieldcatalog TO fieldcatalog.
          CLEAR fieldcatalog.
                fieldcatalog-FIELDNAME = 'BUZEI'.
                fieldcatalog-seltext_m   = 'LINE ITEM'.
                fieldcatalog-tabname = 'it_final'.
                fieldcatalog-col_pos     = 3.
                fieldcatalog-outputlen     = 9.
                APPEND fieldcatalog TO fieldcatalog.
                CLEAR fieldcatalog.
                      fieldcatalog-FIELDNAME = 'HKONT'.
                      fieldcatalog-seltext_m   = 'G/L ACCOUNT'.
                      fieldcatalog-tabname = 'IT_FINAL'.
                      fieldcatalog-col_pos     = 4.
                      fieldcatalog-outputlen     = 12.
                      APPEND fieldcatalog TO fieldcatalog.
                      CLEAR fieldcatalog.
                              fieldcatalog-FIELDNAME = 'TXT50'.
                              fieldcatalog-seltext_m   = 'G/L ACCOUNT DESCRIPTION'.
                              fieldcatalog-tabname = 'IT_skat'.
                              fieldcatalog-col_pos     = 5.
                              fieldcatalog-outputlen     = 50.
                              APPEND fieldcatalog TO fieldcatalog.
                              CLEAR fieldcatalog.
ENDFORM.
*form build_layout.
gd_layout-no_input          = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text       = 'Totals'(500).
ENDFORM.
form display_alv_report.
  gd_repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
         exporting
           i_callback_program      = gd_repid
              i_callback_top_of_page   = 'TOP-OF-PAGE'
                is_layout = gd_layout
                  it_fieldcat = FIELDCATALOG[]
                    I_SAVE = 'X'
TABLES
  t_outtab = it_final
    EXCEPTIONS
      program_error = 1
        OTHERS = 2.
ENDFORM.

Hi
Remove the field SAKNR1 from IT_BSEG table
and you are fetching data from BSEG into IT_FINAL which is wrong
<b>SELECT BUKRS BELNR GJAHR BUZEI HKONT FROM BSEG
INTO TABLE<b> IT_BSEG</b>
WHERE HKONT NOT IN ACCOUNT AND BUKRS = CODE.
if not it_bseg[] is initial.
SELECT TXT50 FROM SKAT INTO TABLE
IT_SKAT
for all entries in it_bseg
WHERE SPRAS EQ 'EN' AND SAKNR EQ IT_BSEG-HKONT.
endif.
LOOP AT IT_BSEG .
IF SY-SUBRC = 0.
READ TABLE IT_SKAT WITH KEY SAKNR = <b>IT_BSEG-HKONT</b>.
if sy-SUBRC = 0.
  it_Final-Txt50 = it_skat-txt50.
endif.</b>
Reward points if useful
Regards
Anji

Similar Messages

  • Required ATP Table field name

    Hello Gurus,
    As per my client requirement, durig the time of internet sales, The customer (user) while ordering for a material there should be a field where in customer can view the available quantity for that particular material.
    I ve checked in MD04 and i got the structure MDEZ [field MNG04]. But i want to know whether i can fetch data from this field or is there any other table/field where i can get the GATP quantities for the particular material. Anybody please provide the exact Table and field name.......
    Thanks in advance....
    Edited by: Praveen on Jan 7, 2009 5:59 AM
    Edited by: Praveen on Jan 7, 2009 9:35 AM
    Edited by: Praveen on Jan 7, 2009 9:52 AM

    Dear Praveen
    In Table MDTB,  you can see fields like
    -  MNG01:::Recd / Req.quantity
    -  MNG02:::Scrap
    -  MNG03:::Shortage Quantity
    You can make use of these fields according to your requirement.
    thanks
    G. Lakshmipathi

  • Field != then Insert Into Other Table

    Hi,
    I cannot figure out how to create a trigger that will insert data based on if a old.field != new.field. If the field was changed in
    one table tbl_test then insert that record into the other table tbl_test_history. This is a little different since I want to insert a record if a update
    took place. The update will still take place in tbl_test but I want a insert to take place in tbl_test_history.
    CREATE OR REPLACE TRIGGER AU_INSERT_TEST_HISTORY
      AFTER UPDATE
      ON TBL_TEST   FOR EACH ROW
    WHEN (
        OLD.Orange != NEW.Orange
    OR OLD.Apple != NEW.Apple
    BEGIN
    INSERT INTO TBL_TEST_HISTORY
    (ORANGE,
      APPLE
      BANANA,
      GRAPE
      select ORANGE,
             APPLE
             BANANA,
             GRAPE
    FROM TBL_TEST, TBL_TEST_HISTORY
      WHERE  TBL_TEST.PK_TEST_ID = TBL_TEST_HISTORY.PK_TEST_ID;
    END AU_INSERT_TEST_HISTORY;
    /I will have a separate trigger that will insert records from tbl_test to tbl_test_history. This trigger compiles with no errors but when I
    create a record in tbl_test I receive an error. I am not sure if the syntax is correct, can anyone help me with this?

    My bad. I put the colon : into the when clause. They weren't there in your code. Usually I use an if condition, which is a little different.
    I added some NVL logic to to consider comparison of NULL values too.
    CREATE OR REPLACE TRIGGER AU_INSERT_TEST_HISTORY
      AFTER UPDATE  ON TBL_TEST  
      FOR EACH ROW
    BEGIN
      if nvl(:old.ORANGE,'xxx') != nvl(:new.ORANGE,'yyy')
         OR nvl(:old.APPLE,'xxx') != nvl(:new.APPLE,'yyy')
      then
        INSERT INTO TBL_TEST_HISTORY
         (ORANGE, APPLE, BANANA, GRAPE)
        values (:new.ORANGE,
                 :new.APPLE,
                 :new.BANANA,
                 :new.GRAPE);
      end if;
    END AU_INSERT_TEST_HISTORY;
    / You can additionally consider to make this trigger an AFTER INSERT OR UPDATE trigger.
    Then you would also put the inserted values from the start into your history table.
    Edited by: Sven W. on Aug 9, 2012 4:14 PM

  • Is there any other table like BSEG with same fields.

    Hi Abapers,
    I want to use BSEG table.But due to some promblem BSEG table is not supporting.So is there any other table like BSEG with same fields.
    can any one help me.
    with regards

    Since performance may be an issue when hitting BSEG table
    Any of the below accounting tables can be used.
    1.BSAD
    2.BSAK
    3.BSAS
    4.BSID
    5.BSIK
    6.BSIS
    These are normal database tables, not clusters. Normally every record from BSEG can be found in one of these 6 tables. The program which selects data
    From these tables runs faster than from BSEG.
    Plz reward if helpful.
    Thanks.
    Ramya

  • Unable to access the data and table fields from handheld

    Hi,
    I've created a Testing.sdf file on the local pc using SQL Server Management Studio, creating table, fields and insert some data. in local pc i can access the the data as normal. the problem is after i moved the file to handheld device i
    cannot access the data within the table, it shown error 'Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)' . I tried to google it, but still got no solution.
    Thanks,

    'Name Space
    Imports System.Data.SqlServerCe
    'String Connection
    'Data Source = D:\SKUDWN3 .sdf'
    Public Sub CreateDB(ByVal StrConn As String)
            'Declaration
            Dim cn As SqlCeConnection = Nothing
            Dim cm As SqlCeCommand = Nothing
            Dim SQLEngine As SqlCeEngine = Nothing
            Dim rs As SqlCeResultSet = Nothing
            Dim rec As SqlServerCe.SqlCeUpdatableRecord = Nothing
            'Tables -
            Const TB_SKUDWN3 As String = "SKUDWN3"
            'Fields TB_SKUDWN3
            Const FL_SKUDWN3_UPC As String = "UPC"
            Const FL_SKUDWN3_SKU As String = "SKU"
            Const FL_SKUDWN3_LD As String = "LD"
            Const FL_SKUDWN3_SD As String = "SD"
            Const FL_SKUDWN3_AN As String = "AN"
            Const FL_SKUDWN3_Price As String = "Price"
            Const FL_SKUDWN3_GST_FLAG As String = "GSTFLAG"
            'Create Database
            SQLEngine = New SqlCeEngine(StrConn)
            SQLEngine.CreateDatabase()
            SQLEngine.Dispose()
            'Open Connection
            If IsNothing(cn) Then cn = New SqlCeConnection(StrConn)
            If cn.State = Data.ConnectionState.Closed Then cn.Open()
            cm = cn.CreateCommand
            'Create Table, Fields
            cm.CommandText = "CREATE TABLE " & TB_SKUDWN3 & " (" & FL_SKUDWN3_UPC & " NVARCHAR (13)," & _
                " " & FL_SKUDWN3_SKU & " NVARCHAR (9), " & FL_SKUDWN3_LD & " NVARCHAR(30)," & _
                " " & FL_SKUDWN3_SD & " NVARCHAR (18), " & FL_SKUDWN3_AN & " NVARCHAR(15), " & _
                " " & FL_SKUDWN3_Price & " NVARCHAR (10), " & FL_SKUDWN3_GST_FLAG & " BIT)"
            cm.ExecuteNonQuery()
            'Close Connection
            cm = Nothing
            If Not IsNothing(cn) Then
                If cn.State = ConnectionState.Open Then cn.Close()
                cn.Close()
                cn.Dispose()
            End If
        End Sub
    'The DB was successfully created, but after moving to Handheld the fields of table can't be accessed

  • How do I write a select statement to see if table field is in variable list

    I was wondering if someone knew the best way to write a query to pull back rows where a table field is found in a a variable string.  I'm using Cold Fusion 10 on Microsoft SQL Server.
    The table has a series of fields such as
    carcode          carname
    G                Garage
    C                Carport
    A               Attached
    D               Detached
    And another query pulls back a field that stores as text all the abbreviations that apply
    I want to pull back all the carnames that would match the abbreviations stored in that field.  I thought I could use a contains line but that does not work.  How do I pull back matches against a variable string... I tried an IN statment but that didn't work.
    CFQUERY...
    Select carname from CarTable WHERE CONTAINS (carcode, '#query.carlist#') does not work. 
       select carname from CarTable WHERE CONTAINS(carcode, 'G,A')
    I'm stumped.  The list of abbreviations could be very LOOOONG or short and I just need to translate those abbreviations into the full names by grabbing it from another table.  It isn't just one abbreviation so I can't use LIKE in the one to one sense.
    Thank you so much.

    If you have records with these values,
    G,A
    0
    then your first mistake is that you designed your database poorly.  Storing lists in a single field is essentially stroring unuseable data.  A one to many relationship is better.  If you don't know what that is, I've heard good things about the book, Database Design for Mere Mortals.
    Next, this syntax, #queryname.car_storage#, only returns the first record.  To get all the records, use the valuelist function.
    Next, in sql, if you have a list of strings, each one has to be quoted.  Something like this.
    where myfield in ('a', 'b', 'c')
    The best way to achieve this in ColdFusion is to use the cfqueryparam tag with the list attribute set to yes.

  • Which table field I can confirm if the PO has done invoice receipt

    Hi,
    From which table field, I can confirm the PO has done invoice receipt. and in case of that with reference a PO, I have done the IR, but it was reversed, which means PO has not done invoice receipt.
    For this case, I don't want to read table EKBE to retrieve the invoice number, the read table RBKP to judge if there is a reverse IR for it.
    If there any status table field which indicate if the PO has done invoice receipt.
    Many thanks,
    Aries

    Hi Raj,
    For invoice receipt and credit memo, EKBE-BEWTP is all set with 'Q', so if there is reversed invoice. Also you can retrieve data from EKBE. But actually the PO also needs a invoice receipt. So it can not meets the requirement.
    Regards,
    Aries

  • How to Track the changes made to the custom table field value

    I want to track the changes made to the custom table field value in table maintenance generator.please help me it is very urgent
    Thanks & Regards,
    Kranti

    Hi Satya,
    These are the steps you've to do.
    1. Enable the change document flag in the data element level for the fields of the tables you want to monitor.
    2. Go to transaction SCDO. Create a new change object, and add your table to this object. After generation, you'll get a function module.
    3. Call this function module in the table maintainence generator screen, after the data is saved to the database table. This function module automaticallly writes the changes, with the old and new values, and the fields that were changed to the tables CDHDR and CDPOS.
    4. You can keep track of the changes made to the table by monitoring these tables.
    Regards
    Anil Madhavan

  • F110 - Grouping the vendor invoices by BSEG table fields

    Hi,
    I want to group the vendor invoices while making the payment through F110,  based on a BSEG table field. The settings in Grouping Key configuration (OBAP) only allows me to choose the fileds from BSIK table and not possible to select the fields from BSEG table.  Is there any other way to group the vendor invoices based on BSEG fileds?  How can we achieve this requirement in SAP?
    Thanks and Regards
    Koteswararao padarti

    Hi,
    I created the substitution and also grouping key based on the BSIK-KIDNO filed. But the system is not able to group the vendor invoices by payment reference.  I already tried the following options
    Seperate Payments for each Ref in FBZP settings
    Can anyone let me know what is missing in the configuration to group the invoices for payment by payment reference.
    Regards
    Koteswararao Padarti

  • How to show all table fields in correct alv disply

    Hi all,
    This is my report that disply in ALV . but this is only displying the join table (t_p0001_p0002) fields.i want to disply the other two table fields i.e t_pa0315 and t_pa0007.what is the logic to ALV disply the other two table fields like the table t_pa0001_pa0002.pls help me regarding this.
    send me the code its urgent.
    thanks!
    Vipin
    pls find the code below:->
    REPORT Y_WP03 .
    DEFINE m_fieldcat.
      add 1 to ls_fieldcat-col_pos.
      ls_fieldcat-fieldname   = &1.
      ls_fieldcat-ref_tabname = &2.
      append ls_fieldcat to lt_fieldcat.
    END-OF-DEFINITION.
    TYPE-POOLS: slis.                      " ALV Global types
    tables:pa0001,
           pa0315,
           pa0007,
           disvariant.
         Selection-Screen
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    *SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS: s_pernr FOR pa0001-pernr.            " Personnel No
    SELECT-OPTIONS: s_orgeh FOR pa0001-orgeh .           " Organization unit
    SELECT-OPTIONS: s_werks FOR pa0001-werks.            " Personnel Area
    SELECT-OPTIONS: s_plans FOR pa0001-plans.            " Position
    SELECT-OPTIONS: s_ebeln FOR pa0315-ebeln.            " Purchase order
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK b2k2 WITH FRAME TITLE text-002.
    *SELECT-OPTIONS: s_var FOR disvariant-variant.
    PARAMETERS: p_disva1 LIKE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK b2k2.
                     Type Definition                                     *
    TYPES :
    BEGIN OF ty_pa0001_pa0002,
        pernr TYPE pa0001-pernr , " Personnel no.
        endda TYPE pa0001-endda , " end date
        begda TYPE pa0001-begda , " start date
        bukrs TYPE pa0001-bukrs , " company code
        werks TYPE pa0001-werks , " Personnnel area
        persg TYPE pa0001-persg , " Employee group
        persk TYPE pa0001-persk , " Employee subgroup
        btrtl TYPE pa0001-btrtl , " Personnnel subarea
        abkrs TYPE pa0001-abkrs , " Payroll area
        kostl TYPE pa0001-kostl , " cost center
        orgeh TYPE pa0001-orgeh , " Organizational Unit
        plans TYPE pa0001-plans , " Position
        nachn TYPE pa0002-nachn , " Last name
        vorna TYPE pa0002-vorna , " First name
        midnm TYPE pa0002-midnm , " Middle name
      END   OF ty_pa0001_pa0002 ,
    BEGIN OF ty_pa0315,
       pernr TYPE pa0315-pernr , " Personnel no.
       kostl TYPE pa0315-kostl , " Sending cost center
       lstar TYPE pa0315-lstar , " Activity type
       werks TYPE pa0315-werks , " Plant
       lifnr TYPE pa0315-lifnr , " Vendor number
       ebeln TYPE pa0315-ebeln , " Sending pruchase ord
       ebelp TYPE pa0315-ebelp , " Sending PO item
       lstnr TYPE pa0315-lstnr , " Activity number
    END   OF ty_pa0315,
    BEGIN  OF ty_pa0007,
      pernr TYPE pa0007-pernr,
      schkz TYPE pa0007-schkz,
    END  OF ty_pa0007.
    *BEGIN  OF ty_pa0002,
    pernr TYPE pa0002-pernr,
    nachn TYPE pa0002-nachn,
    vorna TYPE pa0002-vorna,
    midnm TYPE pa0002-midnm,
    *END  OF ty_pa0002.
                     Data Declaration                                    *
    DATA :
      t_pa0001_pa0002 TYPE STANDARD TABLE OF ty_pa0001_pa0002 ,
      w_pa0001_pa0002 TYPE ty_pa0001_pa0002 ,
      t_pa0315 TYPE STANDARD TABLE OF ty_pa0315 ,
      w_pa0315 TYPE ty_pa0315 ,
      t_pa0007 TYPE STANDARD TABLE OF ty_pa0007 ,
      w_pa0007 TYPE ty_pa0007 .
    t_pa0002 TYPE STANDARD TABLE OF ty_pa0002 ,
    w_pa0002 TYPE ty_pa0002 .
    START-OF-SELECTION .
      SELECT a~pernr
             a~endda
             a~begda
             a~bukrs
             a~werks
             a~persg
             a~persk
             a~btrtl
             a~abkrs
             a~kostl
             a~orgeh
             a~plans
             b~nachn
             b~vorna
             b~midnm
             INTO TABLE t_pa0001_pa0002
             FROM pa0001 AS a INNER JOIN pa0002 AS b
             ON apernr = bpernr
             WHERE a~pernr IN s_pernr
             AND   a~werks IN s_werks
             AND   a~orgeh IN s_orgeh
             AND   a~plans IN s_plans.
      SORT t_pa0001_pa0002 BY pernr .
      IF NOT t_pa0001_pa0002[] IS INITIAL .
        SELECT pernr
               kostl
               lstar
               werks
               lifnr
               ebeln
               ebelp
               lstnr
               FROM pa0315
               INTO TABLE t_pa0315
               FOR ALL ENTRIES IN t_pa0001_pa0002
               WHERE pernr = t_pa0001_pa0002-pernr
               AND   kostl = t_pa0001_pa0002-kostl
               AND   ebeln IN s_ebeln.
        SELECT pernr
               schkz
               FROM pa0007
               INTO TABLE t_pa0007
               FOR ALL ENTRIES IN t_pa0001_pa0002
               WHERE pernr = t_pa0001_pa0002-pernr.
        SELECT pernr
               nachn
               vorna
               midnm
               FROM pa0002
               INTO TABLE t_pa0002
               FOR ALL ENTRIES IN t_pa0001
               WHERE pernr = t_pa0001-pernr .
      ENDIF.
    PERFORM f_display_data.
    FORM f_display_data.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    Build the field catalog
      m_fieldcat 'PERNR' 'PA0001'.
      m_fieldcat 'NACHN' 'PA0002'.
      m_fieldcat 'VORNA' 'PA0002'.
      m_fieldcat 'MIDNM' 'PA0002'.
      m_fieldcat 'BUKRS' 'PA0001'.
      m_fieldcat 'WERKS' 'PA0001'.
      m_fieldcat 'PERSG' 'PA0001'.
      m_fieldcat 'PERSK' 'PA0001'.
      m_fieldcat 'BTRTL' 'PA0001'.
      m_fieldcat 'ABKRS' 'PA0001'.
      m_fieldcat 'ORGEH' 'PA0001'.
      m_fieldcat 'PLANS' 'PA0001'.
      m_fieldcat 'SCHKZ' 'PA0007'.
      m_fieldcat 'KOSTL' 'PA0315'.
      m_fieldcat 'LSTAR' 'PA0315'.
      m_fieldcat 'WERKS' 'PA0315'.
      m_fieldcat 'LIFNR' 'PA0315'.
      m_fieldcat 'EBELN' 'PA0315'.
      m_fieldcat 'EBELP' 'PA0315'.
      m_fieldcat 'LSTNR' 'PA0315'.
      m_fieldcat 'BEGDA' 'PA0001'.
      m_fieldcat 'ENDDA' 'PA0001'.
    Display the list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = lt_fieldcat
        TABLES
          t_outtab                = t_pa0001_pa0002.
    ENDFORM.                               " F_DISPLAY_DATA_VBAK
          FORM USER_COMMAND                                             *
    FORM user_command USING u_ucomm     TYPE syucomm
                            us_selfield TYPE slis_selfield.     "#EC CALLED
      CASE u_ucomm.
        WHEN '&IC1'.
          READ TABLE t_pa0001_pa0002 INDEX us_selfield-tabindex INTO
    w_pa0001_pa0002.
          CHECK sy-subrc EQ 0.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND

    Hey,
    Look at ur code.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-cprog
    i_callback_user_command = 'USER_COMMAND'
    it_fieldcat = lt_fieldcat
    TABLES
    t_outtab = <b>t_pa0001_pa0002</b>.
    Here you're passing only the join table t_pa0001_pa0002. If you want to display the other tables as well, then u must have an internal table that has the columns of all the 3 tables. Then u need to buil;d the fieldcatalog accordingly and then display that table,
    Cheers,
    Sam

  • Passing a table-field value in Crystal to a Store Procedure in SQL Server

    I have been checking all over the interenet via searches and although some seem to come close to this, its still not what I want.
    Essentially I need to pass value from Table-Field record (for each record read/selected) via a paramete to a Stored Procedure(SP) in SQL Server 2205/2008.  I do NOT want to be prompted for a value for this parameter each time the report is run, simple pass the value in which will be used along with other select criteria to bring back one value for the report to use in a calcuation per record.
    The value of the parameter is a date, but I understand it would be better to pass it in as a varchar(8) - 'YYYYMMDD' - and then reconvert it inside the SP, as follows:
    In Crystal Reports 2008 SP3, I have a formula defined as,
    trans_date = ToText ({F1ARS_STMT_WS_TRAN.TRANS_DATEI}, 'YYYYMMDD')
    and essential just want to pass this to the SP below ... i.e. trans_date  ---> @strTransDate
    I then link the key fields [EXCH_RATE_TABLE_NAME] and [TRANS_CCY_CODE] to other tables in the Database Expert, and put [EXCH_RATE_AMT] on the report and use it to calculate what I want.
    This works fine when the prompt comes up and I put in a proper date, but I don't what it to prompt, but simple pass the F1ARS_STMT_WS_TRAN.TRANS_DATEI in via the fornula/parameter and let teh SQL do the rest for each record selected..
    CREATE PROCEDURE [dbo].sp_GET_EXCH_RATE_AMT (@strTransDate varchar(8))     --use format 'YYYYMMDD' to represent the date as a string.
         -- Add the parameters for the stored procedure here
         -- @TransDate datetime = now
    AS
           declare @TransDate datetime
         set @TransDate = CONVERT(DATETIME, @strTransDate, 112)
    BEGIN
         -- SET NOCOUNT ON added to prevent extra result sets from
         -- interfering with SELECT statements.
         SET NOCOUNT ON;
        -- Insert statements for procedure here
    SELECT [EXCH_RATE_TABLE_NAME], [TRANS_CCY_CODE], [EXCH_RATE_AMT]
    FROM [F1CCY_EXCH_RATE]
    WHERE [MAJOR_CCY_CODE] = 'BBD'
    AND   [START_DATEI] =
         SELECT MAX([START_DATEI])
         FROM [F1CCY_EXCH_RATE]
         WHERE [MAJOR_CCY_CODE] = 'BBD'
         AND   [START_DATEI] <= @TransDate
    END
    GO
    GRANT EXECUTE ON sp_GET_EXCH_RATE_AMT TO PUBLIC
    GO
    Thanks for any help.  Can't tell the headache this has caused my both literally and figuratively.

    Hello,
    I moved your post to the Report Design forum. Lots of SQL help in here...
    I believe the problem is due to you using a Parameterized Stored Procedure. The first thing CR has to do is connect to your DB source which requires the date parameter before it can run the query to add the date filter, it's the SP that is prompting for the parameter. Therefore the report has not run so it can't get the field value from the report until you fill in the info for the SP. Catch 22 problem.... Which came first, the Chicken or the Parameter....
    The report will work as you have noted but I don't know of anyway to refresh unless parameter is filled in again....
    Jason has a lot of great solutions when it comes to these dilemmas, Possibly using a Command Object may help but I believe you will still run into the same issue....
    Only way I can think of is to not use a parameter in the SP and let CR do the filtering client side. Of course this means all data is coming back to the client PC as you are likely trying to find a work around for.
    Thank you
    Don

  • What is table field name for order status report  of rate per unit and  bal

    hi  i want to make FS for order status report i almost get all table and field but i don't get only two field  rate per unit and balance value  table field didn't get please help me searching in field and table
      i want to develop my status report

    Hi,
    Check tables VBAK and VBAP wherein you will get all header and item details.
    VBUK and VBUP for header and line item statuses.
    KONV would give you rates/pricing details for each condition type determines in the sales order.
    VBAK-KNUMV = KONV-KNUMV is how you relate both of them.
    Hope that helps.
    Regards,
    Amit

  • Table field and structure field

    Hi ,
    I am working on an user exit.
    I have to update a field on the transaction screen DFBATCH-MHD_IO (DFBATCH is a struture).
    Now the same field is defined in table MARA-VFDAT (MARA is a table).
    Now in the user exit function module I have written a code which will update the table field MARA-VFDAT.
    So will the structure field also gets updated automatically since that structure field is same as the table field (only name is different) or I have to explicitly equate table field to structure field.
    Raghu.

    How do you know that DFBATCH-MHD_IO is tied to MARA-VFDAT.   Is there a line of code in the transaction like this.
    MARA-VFDAT = DFBATCH-MHD_IO. 
    or
    DFBATCH-MHD_IO = MARA-VFDAT. 
    If you are updating MARA-VFDAT from your userexit, and the existing code in the transaction is filling the DFBATCH-MHD_IO from MARA-VFDAT,  then no you shouldn't need to fill it.
    Regards,
    Rich Heilman

  • Connection between Structure Field and Table Field

    Hello everybody,
    I'm trying to find a connection between a field in the structure and the actual filed in the table of the database. For example in the structure CAUFVD you have the field PLNNR. This information is stored in the table AFFL in the field PLNNR.
    In the transaction SE84 you can display a structure with all it's fields but I don't see anywhere from which table and field the information is gathered.
    Can you please help me in finding the connection between the structure field and the table field in the database in which the displayed information is stored?
    Thanks and best regards,
    CALIN Marius-Bogdan
    SAP - PP-KeyUser

    Double-click on the structure field and you can do a where-used to find the codepoints, interface usage, etc.  You might find it that way.  You could also look at the flow logic of your screen and try to trace it back.  Otherwise, you'd have to use watchpoints, the debugger, runtime analysis or various other developer tools to find the data population.  If you are a user and not a developer as your signature indicates, you might need to find a developer for this.  Sometimes, it can be incredibly frustrating with SAP because the data field will be handed off 4 or 5 times before it actually reaches its destination field.  Unfortunately, I haven't worked with PP in at least 10 years so I can't give you a better answer; maybe someone else can.

  • Regarding Internal Table Field Validation [Modification]

    Hi All,
    I have a small issue with formatting of a field.
    The Field is POTX1 - it would get the value as 'New MT-EPPE0097-COMP02',
    Means i have one internal table field as i_error-POTX1 in that some times we get value as 'New MT-EPPE0097-COMP02'.
    Whenever i get 'New' literal in that internal table field i have to remove that literal from that internal table field. And Left Justify the remaining part of the field.
    Ex:  'New MT-EPPE0097-COMP02'
         should become 'MT-EPPE0097-COMP02'.
    For this first i have to find wether 'New' Literal exists in the Internal table field or not then i have to remove it.
    Can anybody tell me how can i solve this issue.
    Thanks in advance.
    Thanks & Regards,
    Rayeezuddin.

    Hi,
    Take a look :
    loop at i_error.
      if i_error-potx1(3) = 'New'
        w_potx1 = i_error-potx1.
        i_error-potx1 = w_potx1+3(37).
        MODIFY i_error.
      endif.
    ENDLOOP.
    Regards,
    Erwan.
    Message was edited by: Erwan LE BRUN

Maybe you are looking for

  • New iphone 5 not working properly

    Why my iphone not showing the plug icon on battery even it is 100% charge ,lightning icon is not changing .and also the rotation of the screen is not working ..what should i do?its is new just used it for one day.

  • How can I make NETRIS listings work on Firefox.

    I have always kept NETRIS on Internet E because it will not work on Firefox. Some of the buttons will not work. A tech guys said yesterday that it now works and to ditch internet E because it causes problems. But I still cannot get the search etc. bu

  • Using dynamic info in html region?

    Is it possible to use the output of a query in the source area of an html region? I'd like to display some data in the source I have in the html region of a page, but I can't find any documentation on how to do that.

  • Error code 143 on JVM exit

    Hello, I have a program (with multiple threads, running under MS-Windows) which works fine almost all the time. In one case, it terminated unexpectedly, and the exit code (via ERRORLEVEL) is 143. There are no other outputs in order to diagnose the pr

  • Wi-Fi slow in Windows 7 x64 with Retina MacBook Pro / MacBook Pro (same generation)

    We have two MacBook Pros same generation but one is Retina I'm using a Linksys EA4500 router, firmware is fully up to date Under 10.8.1 (fully up to date) both machines see a 300 to 450Mbits speed and if I ping the wireless router all of the pings ar