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

Function Module

former_member196438
Participant
0 Likes
723

Kindly explain about the function module ME_CHANGEDOC_SELECT ?

3 REPLIES 3
Read only

Former Member
0 Likes
585

hi

good

check this code which ll give you brief idea about this FM

The following example code will get the version no. in PO :-

referesh : erevitem.

clear : erevlines.

SELECT SINGLE * FROM cdpos

WHERE objectid = ebeln AND

value_old = 'G' AND

value_new = 'B'.

IF sy-subrc EQ 0.

erevlines = erevlines + 1.

ELSE.

erevlines = 0.

ENDIF.

SELECT * FROM nast

INTO CORRESPONDING FIELDS OF TABLE itab_nast

WHERE objky = ebeln AND

vstat NE '0'.

CLEAR itab_nast.

SORT itab_nast DESCENDING BY erdat eruhr.

READ TABLE itab_nast INDEX 1.

IF sy-subrc EQ 0.

IF itab_nast-vstat NE '0'.

LOOP AT l_doc-xekpo INTO tekpo.

CALL FUNCTION 'ME_CHANGEDOC_SELECT'

EXPORTING

i_document_category = pekko-bstyp

i_document_number = ebeln

i_document_item = tekpo-ebelp

  • I_DATE_START =

  • I_TIME_START =

  • I_DATE_END =

  • I_TIME_END =

  • I_USERNAME =

  • I_ALL_ITEMS =

  • I_GRIDHANDLE =

  • I_REVISIONLIST =

  • I_ARCHIVE_HANDLE =

IMPORTING

  • E_LINES =

e_outtab = imecdgrid.

it_mecdgrid[] = imecdgrid[].

LOOP AT it_mecdgrid INTO wa_mecdgrid WHERE tabkey+13(5) = tekpo-ebelp.

IF wa_mecdgrid-fname = 'MENGE'.

itab_po_change-matnr = tekpo-matnr.

itab_po_change-text = '***** Quantity Change ******'.

erevlines = erevlines + 1.

APPEND itab_po_change.

ENDIF.

IF wa_mecdgrid-fname = 'NETWR'.

itab_po_change-matnr = tekpo-matnr.

itab_po_change-text = '***** Price Change ******'.

erevlines = erevlines + 1.

APPEND itab_po_change.

ENDIF.

ENDLOOP.

ENDLOOP.

SORT itab_po_change BY matnr text.

LOOP AT itab_po_change.

DELETE ADJACENT DUPLICATES FROM itab_po_change COMPARING matnr text.

ENDLOOP.

ENDIF.

ENDIF.

SELECT * FROM erev INTO CORRESPONDING FIELDS OF TABLE erev WHERE edokn = pekko-ebeln.

SORT erev BY revno DESCENDING.

LOOP AT erev.

MOVE-CORRESPONDING erev TO erevitem.

APPEND erevitem.

ENDLOOP.

DESCRIBE TABLE erevitem LINES erevlines.

IF erevlines = 1.

CLEAR erevitem[].

erevlines = 0.

ENDIF.

*

    • erevlines = erevlines - 1.

*

DELETE erevitem WHERE revno = 0.

CLEAR erevlines.

DESCRIBE TABLE erevitem LINES erevlines.

call function fm_name

exporting

erevlines = erevlines

tables

erev = erevitem

endform.

IN SSF :

loop at erev into wa_erev where erevlines > '0'.

wa_erevlines-revno(.0) for version no.

wa_erevlines-txz01 for version text

reward point if helpful.

thanks

mrutyun^

Read only

Former Member
0 Likes
585

Hi Aiswarya,

Can you tell what is ur exact requirement so that it will be helpful in providing you the exact details?

Regards,

Gopi Krishnan R

Read only

former_member196438
Participant
0 Likes
585

Hi,

I want to know the purpose of this function module. Actually my requirement was to determine the release date and time of a contract. I somehow managed to get this function module from the Where-Used list and found that this function module gives the change details of a contract. I wanted to know more about this function module. But its documentation is not available in english. So it would be better if anybody could help me out with the same. Thanks in advance.