Application Development 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: 

how to use fm

Former Member
0 Kudos

how to use this FM "CHANGEDOCUMENT_READ_POSITIONS'"

hi gurus pls let me know how to use this function module............

if u have any sample program send to me which is very useful for me........

cheers

Venky

8 REPLIES 8

Former Member
0 Kudos

Keep the cursor on the FM name and check for Where Used List to find the usage of this program

Former Member
0 Kudos

hi

go to SE37

give FM name and

F7

here u find and button Funtion module documentation

check this documentation

Cheers

Snehi

Former Member
0 Kudos

Hi,

The function module reads change document items and processes both the old and the new values according to their category. In some cases, the units and currencies are added on to the value fields. Additionally, the corresponding table header is determined.

The change document number is required as a minimum entry.

The program RSSCD100 uses this function module and can be regarded as a possible application.

Example call:

DATA: NUMMER LIKE CDPOS-CHANGNR,

TABNAME LIKE CDPOS-TABNAME,

TABKEY LIKE CDPOS-TABKEY.

DATA: BEGIN OF EDIT_FORM OCCURS 50.

INCLUDE STRUCTURE CDSHW.

DATA: END OF EDIT_FORM.

CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'

EXPORTING CHANGENR = NUMMER

TABLENAME = TABKEY

TABLEKEY = TABKEY

IMPORTING HEADER = CDHDR

TABLES EDITPOS = EDIT_FORM.

Regards,

Venkat n

0 Kudos

Hello,

The function module reads change document items and processes both the old and the new values according to their category. In some cases, the units and currencies are added on to the value fields. Additionally, the corresponding table header is determined.

The change document number is required as a minimum entry.

The program RSSCD100 uses this function module and can be regarded as a possible application.

Example call:

DATA: NUMMER LIKE CDPOS-CHANGNR,

TABNAME LIKE CDPOS-TABNAME,

TABKEY LIKE CDPOS-TABKEY.

DATA: BEGIN OF EDIT_FORM OCCURS 50.

INCLUDE STRUCTURE CDSHW.

DATA: END OF EDIT_FORM.

...

CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'

EXPORTING CHANGENR = NUMMER

TABLENAME = TABKEY

TABLEKEY = TABKEY

IMPORTING HEADER = CDHDR

TABLES EDITPOS = EDIT_FORM

EXCEPTIONS ...

Regards

Mustameer

Former Member
0 Kudos

Hi VENKAT,

 DATA:   NUMMER      LIKE CDPOS-CHANGNR,
          TABNAME     LIKE CDPOS-TABNAME,
          TABKEY      LIKE CDPOS-TABKEY.


  DATA: BEGIN OF EDIT_FORM OCCURS 50.
          INCLUDE STRUCTURE CDSHW.
  DATA: END OF EDIT_FORM.


          ...


  CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
                 EXPORTING   CHANGENR      = NUMMER
                             TABLENAME     = TABKEY
                             TABLEKEY      = TABKEY
                IMPORTING   HEADER        = CDHDR
                 TABLES      EDITPOS       = EDIT_FORM
                EXCEPTIONS .

Regards,

Mahi.

Former Member
0 Kudos

DATA: NUMMER LIKE CDPOS-CHANGNR,

TABNAME LIKE CDPOS-TABNAME,

TABKEY LIKE CDPOS-TABKEY.

DATA: BEGIN OF EDIT_FORM OCCURS 50.

INCLUDE STRUCTURE CDSHW.

DATA: END OF EDIT_FORM.

...

CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'

EXPORTING CHANGENR = NUMMER

TABLENAME = TABKEY

TABLEKEY = TABKEY

IMPORTING HEADER = CDHDR

TABLES EDITPOS = EDIT_FORM

EXCEPTIONS .

Regards,

Mahi.

former_member541575
Participant
0 Kudos

hi

Click on the Tab Pattern on the top menu bar and give the FM name and click on ok.

you will get the FM parameters and put cursor on the FM and double click you can get the whole source code ,export,import parameters.

regards

atul

Former Member
0 Kudos

CHANGEDOCUMENT_READ_POSITIONS

Get the details of a change document, and store them in an internal table. This will tell you whether a field was changed, deleted, or updated.

CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
           EXPORTING
                objectclass = 'EINKBELEG'
                objectid    = l_objectid
                username    = space
           TABLES
                i_cdhdr     = lt_cdhdr.

      LOOP AT lt_cdhdr WHERE udate IN s_aedat.
        CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
             EXPORTING
                  changenumber = lt_cdhdr-changenr
             TABLES
                  editpos      = lt_editpos.

        LOOP AT lt_editpos WHERE fname = 'LOEKZ'
                           AND   f_new = 'L'.
          p_desc = text-r01. " Cancel Contract
        ENDLOOP.
      ENDLOOP.

refer to the link for Sample program:

http://www.sap-img.com/ab024.htm

With luck,

Pritam.