Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FM- ERROR

SG141
Active Participant
0 Likes
1,929
loop at gt_cc.
 
call function 'CHANGEDOCUMENT_READ'
  exporting
*   ARCHIVE_HANDLE                   = 0
*   CHANGENUMBER                     = ' '
*   DATE_OF_CHANGE                   = '00000000'
    objectclass                      = 'MATERIAL'
    OBJECTID                         =  gt_cc-matnr
    TABLEKEY                         = 
  tables
    editpos                          =  CHGDOC
* EXCEPTIONS
*   NO_POSITION_FOUND                = 1
*   WRONG_ACCESS_TO_ARCHIVE          = 2
*   TIME_ZONE_CONVERSION_ERROR       = 3
*   OTHERS                           = 4
          .
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
 
  
endloop.

Getting a error "Field "TABLES" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement"

How to fix this error.

19 REPLIES 19
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,796

The problem is that you are not specifying the parameter before the TABLES line.



call function 'CHANGEDOCUMENT_READ'
  exporting
*   ARCHIVE_HANDLE                   = 0
*   CHANGENUMBER                     = ' '
*   DATE_OF_CHANGE                   = '00000000'
    objectclass                      = 'MATERIAL'
    OBJECTID                         =  gt_cc-matnr
    TABLEKEY                         =                       "<<--- RIGHT HERE
  tables
    editpos                          =  CHGDOC


Either comment it out, or provide a parameter/value here.

REgards,

Rich Heilman

Read only

SG141
Active Participant
0 Likes
1,796

What has to filled to the Table_key... I am passing the material number and would like to get the changes in the quantity of the material...

Read only

0 Likes
1,796

You can leave it blank i guess

The table key is the key of a changed table entry.

If no table key is specified, all change document positions with the

specified change document number are determined.

If a table key is specified, only the change document positions with the

specified change document number and table key are determined.

Read only

SG141
Active Participant
0 Likes
1,796

can i give the field name, whose changes i want to record and update in table key.

Thank you.

Read only

Former Member
0 Likes
1,796

check out the one in bold..if you are not passing any value to this..just comment that

loop at gt_cc.

call function 'CHANGEDOCUMENT_READ'

exporting

  • ARCHIVE_HANDLE = 0

  • CHANGENUMBER = ' '

  • DATE_OF_CHANGE = '00000000'

objectclass = 'MATERIAL'

OBJECTID = gt_cc-matnr

<b>TABLEKEY =</b>

tables

editpos = CHGDOC

  • EXCEPTIONS

  • NO_POSITION_FOUND = 1

  • WRONG_ACCESS_TO_ARCHIVE = 2

  • TIME_ZONE_CONVERSION_ERROR = 3

  • OTHERS = 4

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endloop.

Read only

Former Member
0 Likes
1,796

Hi,

your call is wrong:

call function 'CHANGEDOCUMENT_READ'

exporting

  • ARCHIVE_HANDLE = 0

  • CHANGENUMBER = ' '

  • DATE_OF_CHANGE = '00000000'

objectclass = 'MATERIAL'

OBJECTID = gt_cc-matnr

<b> TABLEKEY =</b>

tables

editpos = CHGDOC

  • EXCEPTIONS

  • NO_POSITION_FOUND = 1

  • WRONG_ACCESS_TO_ARCHIVE = 2

  • TIME_ZONE_CONVERSION_ERROR = 3

  • OTHERS = 4

.

You have to fill TABLEKEY!!

Regards, Dieter

Read only

ferry_lianto
Active Contributor
0 Likes
1,796

Hi Karthik,

Please do this if you don't have tablekey parameter.


loop at gt_cc.
 
call function 'CHANGEDOCUMENT_READ'
  exporting
*   ARCHIVE_HANDLE                   = 0
*   CHANGENUMBER                     = ' '
*   DATE_OF_CHANGE                   = '00000000'
    objectclass                      = 'MATERIAL'
    OBJECTID                         =  gt_cc-matnr
*   TABLEKEY                         =                      "Change here (commented)
  tables
    editpos                          =  CHGDOC
* EXCEPTIONS
*   NO_POSITION_FOUND                = 1
*   WRONG_ACCESS_TO_ARCHIVE          = 2
*   TIME_ZONE_CONVERSION_ERROR       = 3
*   OTHERS                           = 4
          .
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
  
endloop.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,796

Hi,

try this

DATA: CDRED TYPE TABLE OF CDRED.

CALL FUNCTION 'CHANGEDOCUMENT_READ'

EXPORTING

OBJECTCLASS = 'MATERIAL'

OBJECTID = '000000000000000001'

TABLES

EDITPOS = CDRED

EXCEPTIONS

NO_POSITION_FOUND = 1

WRONG_ACCESS_TO_ARCHIVE = 2

TIME_ZONE_CONVERSION_ERROR = 3

OTHERS = 4.

*

and look into CDRED.

Regards, Dieter

Read only

SG141
Active Participant
0 Likes
1,796

Getting Error.

The function module interface allows you to specify only fields                
of a particular type under "OBJECTID". The field "GT_CC-MATNR" specified here  
has a different field type

Read only

0 Likes
1,796

Define a varaible of the smae type as OBJECTID and move the value GT_CC-MATNR to that variable before calling the FM. Pass that variable instead of the GT_CC-MATNR to the FM's interface

Regards,

Ravi

Read only

Former Member
0 Likes
1,796

Hi,

try this:

PARAMETERS: P_MATNR LIKE MARA-MATNR.

  • Änderungen von Stammdaten/Belegen anzeigen lassen.

DATA: CDRED TYPE TABLE OF CDRED.

DATA: OBJECTID LIKE CDHDR-OBJECTID.

*

OBJECTID = P_MATNR.

*

CALL FUNCTION 'CHANGEDOCUMENT_READ'

EXPORTING

OBJECTCLASS = 'MATERIAL'

OBJECTID = OBJECTID

TABLES

EDITPOS = CDRED

EXCEPTIONS

NO_POSITION_FOUND = 1

WRONG_ACCESS_TO_ARCHIVE = 2

TIME_ZONE_CONVERSION_ERROR = 3

OTHERS = 4.

*

IF SY-SUBRC <> 0. WRITE SY-SUBRC. ENDIF.

Regards, Dieter

Read only

SG141
Active Participant
0 Likes
1,796

can i give the field name, whose changes i want to record and display in table key.

Thank you.

Read only

0 Likes
1,796

No

Read only

SG141
Active Participant
0 Likes
1,796

My requirement is to go thru FM CHANGEDOCUMENT_READ give the service entry number and get the old and new values of amount for a PO.

Please demonstrate how to achieve this

Read only

0 Likes
1,796

You can only give PO number to this function module, get all the changes for the given date range and then keep only the field changes that you are interested in. The changes are tracked using the key fields of the main table EKKO which is the PO number.

Read only

SG141
Active Participant
0 Likes
1,796

I was told give the Service Entry Number to track the changes.......

However I am really not able to understand how to work with fm...

can you explain me in detail with a clear example.

Thank you.

Read only

0 Likes
1,796

What is a service entry number in your system? Is it a service PO? Please check if there is an entry in EKKO with that number. What transaction do you use to see the sevice entry? If it is PO like document, then you can call this function module by sending the service PO number (with leading zeros) to the OBJECTID, OBJECTCLASS = 'EINKBELEG' and DATE_OF_CHANGE = date since you want to track the changes for this PO

Read only

Former Member
0 Likes
1,796

Hi Karthik,

i'm not quiet sure if the changes, wich you want to see, are be stored.

The simples way is, make the changes by yourselve and look in

table CDHDR with the date and your user-id. If you find some entries

in CDHDR takes this Informations for the FM CHANGEDOCUMENT_READ

If you don't find any entries in CDHDR you cannot use this FM.

Hope it helps.

Regards, Dieter

Read only

Former Member
0 Likes
1,796

Hi,

problem solved????????????

Regards, Dieter