Table & Field Name Problem

Hi Mentors,
I am creating a z report in that one perticular field i want new value, old value details.
Field is in MMR - Foreigh trade import - CAS numner (pharma) this field we are using for material status.( ex. A,B,C)
Table Name - MARA Fiels name - CASNR
This status we will change every three months. so when i am taking the report i need old value and new value status.
For new value i will get from MARA-CASNR But, where i will find the old value table.
Ex. if i edit master record MM02 and go to top - environment-dispay changes- in that i am finding the chage details, if i choose the details option i am getting old value and new value details.
pls help me any one to find the old value details.
Highly appreciated any solution
award points if use ful answer
Regards
Laxman

Hi Laxman,
I have found one program Please check the same.
*& Report  ZAK_MM_CHANGE_HISTORY                                       *
REPORT  ZAK_MM_CHANGE_HISTORY                   .
TABLES:
        CDHDR, CDPOS, MARA, MAKT, MARD.
FIELD-GROUPS: HEADER.
DATA: BEGIN OF CHGDOC OCCURS 50.
        INCLUDE STRUCTURE CDRED.
DATA: END OF CHGDOC.
DATA:
      CHGTYPE(1),
      PLANT(4),
      MATNR1 LIKE CHGDOC-OBJECTID.
SELECT-OPTIONS:
    XMATNR  FOR CDHDR-OBJECTID,    "Material
    XUDATE  FOR CDHDR-UDATE,       "Change Date
    XUNAME  FOR CDHDR-USERNAME,    "User Name
    XTCODE  FOR CDHDR-TCODE,       "Transaction Code
    XWERKS  FOR MARD-WERKS.        "Plants
SELECTION-SCREEN SKIP.
*Filter change type
SELECTION-SCREEN BEGIN OF BLOCK CHG0 WITH FRAME TITLE TEXT-001.
   PARAMETERS : XCHG1 AS CHECKBOX DEFAULT 'X',
                XCHG2 AS CHECKBOX DEFAULT 'X',
                XCHG3 AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK CHG0.
START-OF-SELECTION.
INSERT:
        CHGDOC-OBJECTID        "Material
        CHGTYPE                "Change type
        PLANT
        CHGDOC-CHANGENR
        CHGDOC-USERNAME
        CHGDOC-UDATE
        CHGDOC-TCODE
        CHGDOC-TABNAME
        CHGDOC-TABKEY
        CHGDOC-CHNGIND
        CHGDOC-FNAME
        CHGDOC-FTEXT
        CHGDOC-TEXTART
        CHGDOC-OUTLEN
        CHGDOC-F_OLD
        CHGDOC-F_NEW
INTO HEADER.
SELECT * FROM MARA WHERE MATNR IN XMATNR.
   MATNR1 = MARA-MATNR.
   CALL FUNCTION 'CHANGEDOCUMENT_READ'
     EXPORTING
        ARCHIVE_HANDLE             = 0
        CHANGENUMBER               = ' '
        DATE_OF_CHANGE             = '00000000'
          OBJECTCLASS                = 'MATERIAL'
          OBJECTID                   = MATNR1
        TABLEKEY                   = ' '
        TABLENAME                  = ' '
        TIME_OF_CHANGE             = '000000'
        USERNAME                   = ' '
        LOCAL_TIME                 = ' '
     TABLES
          EDITPOS                    = CHGDOC
     EXCEPTIONS
          NO_POSITION_FOUND          = 1
          WRONG_ACCESS_TO_ARCHIVE    = 2
          TIME_ZONE_CONVERSION_ERROR = 3
          OTHERS                     = 4.
   LOOP AT CHGDOC.
      CHECK:  CHGDOC-UDATE    IN XUDATE,
              CHGDOC-USERNAME IN XUNAME,
              CHGDOC-TCODE    IN XTCODE.
    Chg type: 1. Part revision, 2. Price change, 3. Others
      CASE CHGDOC-TCODE.
         WHEN 'MM01' OR 'MM02' OR 'MM03'.  CHGTYPE = '1'.
         WHEN 'MR21'.  CHGTYPE = '2'.
         WHEN OTHERS.  CHGTYPE = '3'.
      ENDCASE.
    Filter chg type
      IF ( CHGTYPE = '1' AND XCHG1 <> 'X' ) OR
         ( CHGTYPE = '2' AND XCHG2 <> 'X' ) OR
         ( CHGTYPE = '3' AND XCHG3 <> 'X' ).
         CONTINUE.
      ENDIF.
    Plant is a substring of tabkey
      PLANT = CHGDOC-TABKEY+21(4).
      IF NOT ( XWERKS IS INITIAL ) AND NOT ( PLANT IS INITIAL ).
         CHECK PLANT IN XWERKS.
      ENDIF.
      EXTRACT HEADER.
   ENDLOOP.
ENDSELECT.
END-OF-SELECTION.
SORT.
LOOP.
Material
   AT NEW CHGDOC-OBJECTID.
      SELECT SINGLE * FROM MAKT  WHERE MATNR = CHGDOC-OBJECTID.
      FORMAT INTENSIFIED ON.
      SKIP.  SKIP.
      WRITE:/' *** Material:', (18) CHGDOC-OBJECTID, MAKT-MAKTX.
   ENDAT.
Change type
   AT NEW CHGTYPE.
      FORMAT INTENSIFIED ON.
      SKIP.
      CASE CHGTYPE.
         WHEN '1'.   WRITE:/ '  **  Change type:  PARTS REVISION'.
         WHEN '2'.   WRITE:/ '  **  Change type:  PRICE CHANGE'.
         WHEN '3'.   WRITE:/ '  **  Change type:  OTHERS'.
      ENDCASE.
      SKIP.
   ENDAT.
   SHIFT CHGDOC-F_OLD LEFT DELETING LEADING SPACE.
   SHIFT CHGDOC-F_NEW LEFT DELETING LEADING SPACE.
   FORMAT INTENSIFIED OFF.
   WRITE:
     /     PLANT          UNDER 'Plant',
      (50) CHGDOC-FTEXT   UNDER 'Field',
      (45) CHGDOC-F_OLD   UNDER 'Old value',
      (45) CHGDOC-F_NEW   UNDER 'New value'.
   AT NEW CHGDOC-CHANGENR.
      FORMAT INTENSIFIED OFF.
      WRITE:
           CHGDOC-CHANGENR   UNDER 'Change doc',
           CHGDOC-TCODE      UNDER 'Tcod',
           CHGDOC-USERNAME   UNDER 'User name   ',
           CHGDOC-UDATE      UNDER 'Date    ' DD/MM/YY.
   ENDAT.
   AT END OF CHGDOC-OBJECTID.
      SKIP.
      ULINE.
      SKIP.
   ENDAT.
ENDLOOP.
TOP-OF-PAGE.
WRITE: / SY-DATUM, SY-UZEIT,
    50 'ABC PTE LTD',
   100 'page', SY-PAGNO,
       / SY-REPID,
    48 'Change Documents Report',
   100 SY-UNAME.
SKIP.
ULINE.
WRITE:/3
        'Change doc',
        'Tcod',
        'User name   ',
        'Date    ',
        'Plant',
   (50) 'Field',
   (45) 'Old value',
   (45) 'New value'.
ULINE.
Go to SE38 Create one Z report and paste the program without disturbing anything and execute. If it doesnot show any values in this report use Leading zeros formulae ieGive material no like 000000000000100222 etc. Try this i have tried in my system and its working.
Reg,
Ashok
Assign points if useful.

Similar Messages

  • Internal table field name problem

    Dear All,
              I am declaring one internal table & fetching data using inner join. Following is my structure of internal table but it is not fetching data into MATNR1, the data is there in the table.
    Kindly suggest why this is happening?
    Regards,
    Dilip Gupchup
    internal table
    data : begin of sales_to_purchase_link_itab occurs 10,
    *******FOR P O RELATED INFORMATION
             EBELN LIKE EKKN-EBELN,"DOCUMENT NO
             AEDAT LIKE EKPO-AEDAT,"P O DATE
             EBELP LIKE EKKN-EBELP," ITEM
             MATNR LIKE EKPO-MATNR,"MATERIAL
             MENGE LIKE EKKN-MENGE,"QUANTITY
             SAKTO LIKE EKKN-SAKTO,"G/L Account Number
             NETWR LIKE EKKN-NETWR,"Net order value in PO
    *******END FOR P O RELATED INFORMATION
    *******FOR SALES ORDER RELATED INFORMATION
             VBELN LIKE EKKN-VBELN,"SALES DOC NO
             VBELP LIKE EKKN-VBELP,"SALES DOC ITEM
             MATNR1 LIKE VBAP-MATNR,"SALES MATERIAL
             ERDAT LIKE VBAP-ERDAT,"SALES DOC DATE
             ARKTX LIKE VBAP-ARKTX,"MATERIAL DESCRIPTION
             ZMENG LIKE VBAP-ZMENG,"QUANTITY
             NETPR LIKE VBAP-NETPR,"SALE VALUE
    *******FOR SALES ORDER RELATED INFORMATION
       end of sales_to_purchase_link_itab.
    select query
    select
    ekkn~ebeln
    EKKN~EBELP
    EKKN~SAKTO
    EKKO~AEDAT
    ekko~bukrs
    EKPO~MATNR
    EKPO~MENGE
    EKPO~NETWR
    vbap~vbeln
    ekkn~vbelp
    vbap~arktx
    VBAP~MATNR
    into corresponding fields of table
    sales_to_purchase_link_itab from ekkn
    inner join ekko on ekknebeln eq ekkoebeln "UP TO 10 ROWS.
    INNER JOIN EKPO ON EKKOEBELN EQ EKPOEBELN
    inner join vbap on ekknvbeln eq vbapvbeln
    WHERE
    EKPO~AEDAT IN S_ERDAT1.

    Hi,
    or change your coding like that:
    DATA rep LIKE sy-repid.
    TYPE-POOLS : slis.
    DATA : fcat TYPE slis_t_fieldcat_alv.
    DATA wa TYPE  slis_fieldcat_alv.
    DATA : BEGIN OF fld OCCURS 0,
    name(50),
    END OF fld.
    rep = sy-repid.
    *only possible if fields of itab are defined with LIKE !
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
         EXPORTING
              i_program_name         = rep
              i_internal_tabname     = 'SALES_TO_PURCHASE_LINK_ITAB'
              i_client_never_display = 'X'
              i_inclname             = rep
         CHANGING
              ct_fieldcat            = fcat.
    LOOP AT fcat INTO wa.
      CONCATENATE wa-ref_tabname '~' wa-fieldname INTO fld-name.
      APPEND fld.
    ENDLOOP.
    SELECT (fld)
    INTO TABLE sales_to_purchase_link_itab
    FROM ekkn
    INNER JOIN ekko ON ekkn~ebeln EQ ekko~ebeln "UP TO 10 ROWS.
    INNER JOIN ekpo ON ekko~ebeln EQ ekpo~ebeln
    INNER JOIN vbap ON ekkn~vbeln EQ vbap~vbeln
    WHERE
    ekpo~aedat IN s_erdat1.
    Andreas

  • Authorization object to display table field names in english text in SE17

    Hi,
    One of users have issues with the filed name getting displayed in technical format instead of english text while browsing table information in SE17. Normally we can set this in through Settings->User Parameters. But here for this user, user parameter option is greyed out and he doesn't have access to SE16.
    Is there any other way to change user specific parameters, instead of granting him accesss to SE16 or enabling user parameters in SE17?
    Thanks,
    Mano

    Hi,
    I made him run SU53 on SE17 transaction the log is showing that authorization check failed for S_ALV_LAYO with value 23.
    Actually i have access SE16 and for me also, user parameter option is greyed out in SE17. I ran SU53 on SE17 in my session i also got same log.
    One more observation is, the user's colleague also doesn't have access to SE16 and user parameter option is greyed out in SE17 but he can view the table field names in english. So we are wondering if some authorization object is missing here.
    We do not want user to make any changes through GUI.
    Thanks,
    Mano.

  • Table & Field Name for Plan Data in CO

    Hi All,
    Can anyone tell me the table & field name where we can get the planned data in Cost Center Accounting and Profit Center Accounting.
    I checked out the COSP(which is Totals) and COEP tables for CCA but i could find the fields only for actual data and not planned data.
    Same for PCA...i checked out the GLPCT & GLPCA tables but in vain.
    Regards & Thanks
    Piyush Kothari.

    Hi,
    Thanks for the reply but COKL is only for Activity Type which contains Allocation Cost Elements.
    I would like to have the Table & Field name for Plan data of Primary Cost Element.
    Piyush

  • Table field name

    Hi
    Good afternoon to all ,
    can any one tell me the table fields name for
    1. bill amount : ?
    2. tds : ?
    3>passed amount : ?
    transaction use is mir7 .
    Regards
    Rakesh kumar singh

    Use transaction ST05 and run an SQL trace when running this transaction.
    It is what I would do if I needed to know this information, instead of coming on here and getting someone else to tell me.

  • Get Table fields name for an SAP table

    hi,
    i need to pass SAP table name as a parameter to the selection screen of a Report program.
    This prog shud give me the table Fields name along with type and length.
    Is there any standard SAP report program for the same or i have to write my own logic?
    Please advise.
    regards,
    ags.

    Hi,
    For your requirement you have to write own program in dynamic manner by using field symbol concept.
    Use this FM DDIF_FIELDINFO_GET and get the field information of database table.
      call function 'DDIF_FIELDINFO_GET'
        exporting
          tabname        = <master>    u201C Table name
        Tables   
          DFIES_TAB      = <table_field> u201C here you will get field information of table
        exceptions
          not_found      = 1
          internal_error = 2
          others         = 3.
      if sy-subrc <> 0.
        message  text-005 type 'E' .
      endif.
    Loop <table_field> assignigng <field>
    *---here you have to collect the relevant information that you are going to display in your output.
    Endloop.
    Use any one of ALV or OOALV and display your records.
    Regards,
    Peranandam

  • What  balance value  in sales order  and iwant to know table field name in

    where the balance value come in sales order i want make sales order report in which i want to add this filed how we add it  and tell me table field name of balance vlue and how we give it in FS please help me in this my report are left without it please give me solution

    Hello
    where the balance value come in sales order
    Please note that when you raise your question at SDN forum, your question needs to be clear...
    What do you mean by BALANCE VALUE ????
    Regards,
    Sarthak

  • How to get the database table field names from program

    Hi,
    Can any one tell me,whether any function module is there which can get the table field name and its details ,when we pass database table name to it.
    Thanks in Advance
    <REMOVED BY MODERATOR>
    Regards
    Shibin
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 12:41 PM

    Hi,
    DD02L Table contains the SAP Tables.
    DD02T Table contains the SAP Table Texts.
    DD01L Table contains the Domains
    DD01T Table contains the Domain Texts.
    DD03L Table contains the Table Fields.
    DD03T Table contains the Table Field Texts. (Language Dependent)
    DD04L Table contains the Data Elements.
    DD04T Table contains the Data Element Texts.
    DD05s Table contains the Foreign Key Fields
    last words with L and T only. L->Database Fetch T-> Text
    For ur question use table DD03L or DD03T.
    Regards,
    Chandru

  • Table & field name related to credit

    Hi experts,
    Are the tables/field names below are correct?
    If yes, what reasons would be for the field of sales value shows zero in SE16 while the field shows correct amount in FD33?
    If not, pls provide the correct table & field name for credit exposure & sales value. Thx.
    Table KNKK - SKFOR = credit exposure
    Table KNKK - SAUFT = Sales value.

    Hi
    You are looking the right table
    However field KNKK - SAUFT = Sales value, displays the Total of all order values which have not been transferred to FI, but which are taken into consideration when checking the credit limit.
    You can check following fields
    Table KNKK - KLIMK = Credit LIMIT
    Table KNKK - SKFOR = Credit Exposure (i.e Total Receivables)
    Check for the values appearing against  Receivables field (skfor) on the customer credit management : status page (FD33).
    Regards
    Tejpal

  • TABLE-FIELD NAME FOR AGENT (SALES ORDER)

    HI
    I am making despatch report agent wise .
    Can any one tell me the table-field name for agent it is used in saleorder
    t.code va01 .
    Regards
    Rakesh Kumar Singh

    Whereever you can see that Input Field for Agent..Click F1, click Technical Information..You can see the Table and Data Element and Field Name..
    Incase it is a structure, click on the data element..click Where Used List..You will get a list of tables.

  • Using table field name as a variable

    Hi ,
    Is it possible to map some values to a field in a Ztable , if I have the field name of the Ztable in a variable.
    For ex:
    I have a ZTABLE -- which has some fields - ZF1 and ZF2.
    In my code, I determine the field in which I want to put data at runtime. For ex, in my code i determine at runtime I want to update field ZF2 , but I have this field name in a variable <V_FIELDNAME>
    So, Is it possible to do something as:
    <V_FIELDNAME> = ZF2.
    ZTABLE-<V_FIELDNAME>    =    <VARIABLE -SOME VALUE>.
    and this value should actually maps to ZTABLE-ZF2.
    If it is possible , how to do it ?
    Thanks-

    Hi Tamas,
    Thanks a lot for ur post ! it did certainly help. However, I need some more help.
    Here is what I need -
    I will have a string coming up from an interface which would be something like : Val1;Val2;Val3
    And in SAP R/3 I have a variable maintained as : Field1;Field2;Field3
    Field1 Field2 and Field3 are fields of a ZTABLE.
    So , at runtime, using the variable I have to determine which Value goes to which field and then insert this field in ZTABLE.
    So, ultimately , code should perform the following actions:
    ZTABLE-FIELD1 = Val1
    ZTABLE-FIELD2 = Val2
    ZTABLE-FIELD3 = Val3
    Insert ZTABLE.
    Going by code you provided, I can assign individual values, But then ultimately I need to map it to a structure which can be used to insert in a DB table. How can I do this?
    Thanks-

  • Wanted Table & Field Names.

    hi All,
              i am preparing a ageing report, my requirement is to get the
    amount as
    total outstanding as on date  and
    toal outstanding as on due date.
    please tell me the table and field names and also based on what field i need to get the amout to these fields.
    thanks,
    srikanth.

    Hi Srikanth,
    This info is available on standard SAP reports.  If you are the developer (as your name suggests), then I would go back to your business / functional analyst and ask them to prepare a proper spec for you if they don't feel that the standard reports fit their needs.
    Regards,
    Tony

  • Web Service XML Changes Return Table  Field Names

    I am writing a Web service to return a employee information from SAP using .Net Connector. My Webservice XML changes return table column names with few escape characters. Does anyone know why this happens? and How to prevent it?
    Every column name is changed: e.g. PERS_NO to PERS_--5fNO
    NCo -> 2.0
    RFC- > Custom Function module
    RFC Return Type -> ZFPSYNC
    VS.Net -> VS Studio 2003, ( C# Web service)
    Here is part of XML document:
      <?xml version="1.0" encoding="utf-8" ?>
    - <ArrayOfZFPSYNC xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
    - <ZFPSYNC>
      <PERS_5fNO>00100001</PERS_5fNO>
      <PDS_5fEMPID>00054740</PDS_5fEMPID>
      <SSN>001380261</SSN>
      <NAME_--5fPFX />
      <FIRST_5fNAME>Tuesday</FIRST_5fNAME>
      <LAST_5fNAME>October</LAST_5fNAME>
      <NAME_--5fSFX />
      <PRIOR_5fNAME>Tuesday October</PRIOR_5fNAME>
      <NICKNAME />
      <CO_5fCODE>TAX</CO_5fCODE>
      <CO_5fCODE_5fT>Tax LLP</CO_5fCODE_5fT>
      <CO_5fCTRY>US</CO_5fCTRY>
      <ORG_5fUNIT>50191687</ORG_5fUNIT>
      <ORG_5fUNIT_5fT>Northeast Region Lead Tax</ORG_5fUNIT_5fT>
      <EE_5fLEVEL>C1</EE_5fLEVEL>
      <EE_5fLEVEL_5fT>Firm Director</EE_5fLEVEL_5fT>
      <SRV_5fAREA>TAX</SRV_5fAREA>
      <SRV_5fAREA_5fT>Tax</SRV_5fAREA_5fT>
      <JOB_5fFAM>CS-TAX</JOB_5fFAM>
      <JOB_5fFAM_5fT>CS - Tax</JOB_5fFAM_5fT>
      <PER_5fAREA>BOSX</PER_5fAREA>
      <PER_5fAREA_5fT>Boston-Berkeley St-TAX</PER_5fAREA_5fT>
      <PER_5fADDR>200 Berkeley Street</PER_5fADDR>

    Please install patch from OSS note 506603. This should correct the problem.

  • Tables & field names used in PS?

    Hi ALL
    I need all the Tables and fields names that are used in PS.If anyone provide it then it will be of great help.
    Thanks in advance

    Hi,
    refer below link
    https://forums.sdn.sap.com/click.jspa?searchID=26790042&messageID=7548930
    Regards,
    Sandeep

  • I want the table fields name for the screen fields of transactions lm59

    Hi all
      I am enhancing transactions LM58,LM59and  LM 60
      But in that transactions underthe lable of storage bin , there are 3 input fields . I want to know the exact table fields for those 3 input screen fields .

    Ravi,
    OK.
    You can look to tables EKPO, EKKO for PO-related fields.
    Look to SE84 under   ABAP Dictionary > Fields > Table Fields   - This is search tool for existing names.  Or can create custom Y-   and  Z- fields, data elements, domains to meet your needs.
    Please reward points.

Maybe you are looking for