[Series] ABAP SAP ABAP MRKO enhanced

No public: SAP Technical
Author: Matinal
 

 

The preface

We can focus on my public number, the number public in the layout better, read more comfortable.

Body part

MRKO actually a reporting program

This report program there are a lot of problems

Very often can not meet use

1: do Enhanced

2: Copy Rewrite

I'm being made to enhance

1: Export RMVKON00

2: Enhanced hermit

Examples of enhanced exports draws online

Consignment record sheet:
RKWA, "Consignment Withdrawals
RKWA-stauts = '00' is unsettled
= '01' is already rkwa-status settlement
-related information obtained from this table when the consignment settlement, including price information, tax codes.
If you need change the appropriate number of take the logic when posting, such as: posting date, tax codes and the like may be used RMVKON00 this enhanced.
DETAILED by two the EXIT:
EXIT_RMVKON00_001: financial documents (invoices), BKPF, BSEG information
EXIT_RMVKON00_002: RKWA information
Further consignment Compare trouble clearing write-off, it should be no material evidence can not use FB08 or MR8M write-off must be written off consignment consumption (storage certificates), then this write-off of the storage MRKO clearing out, go to FI using the F-03 or F.13 so do clearing (specific reference NOTES: Note 356130).

 

Summary

Symptom

A consignment withdrawal is settled with Transaction MRKO. Only an FI Financial Accounting document is posted. If you try to reverse this document in FI, the system displays error message F5673 'Not possible to reverse the document in financial accounting'.

Additional key words

Reversal, MRKO, consignment, F5673, 673

Cause and prerequisites

This works as designed.

Solution

The consignment document should be cancelled in inventory management. The reversal document should then be settled using Transaction MRKO. As a result, a credit memo is posted. The FI document and this credit memo should then be cleared against each other in FI.

Header Data


Enhancing the sample (refer to the rise of change): 
* & --------------------------------------- ------------------------------ * 
* & include ZXM08U11 
* & ------------- -------------------------------------------------- * ------ 

the IF SY-tcode = ' MRKO ' . " the AND i_bukrs = '1400'. 
  LOOP  the AT t_bkpf.
     the CONCATENATE SY-SY-Datum uzeit the INTO t_bkpf-xblnr SEPARATED BY  ' - ' .
     the MODIFY t_bkpf TRANSPORTING xblnr.
   ENDLOOP .
 ENDIF .

Enhancing the sample (turn over accounts date): 
* & --------------------------------------- ------------------------------ * 
* & include ZXM08U11 
* & ------------- -------------------------------------------------- * ------ 
the DATA : wa_rkwa the TYPE RKWA, 
      wa_bseg the TYPE BSEG, 
      wa_bkpf the TYPE BKPF, 
      fieldName ( 80 ), 
      myidx the TYPE I, 
      ex_poper the LIKE t009b- Poper, 
      ex_gjahr the LIKE t009b- bdatj.
 the FIELD-the SYMBOLS : <fs_date> the TYPE rkwa-bldat.


  MOVE '(RMVKON00)SO_BUDAT-HIGH' TO fieldname.  "<fs_bkpf>-budat.
  ASSIGN (fieldname) TO <fs_date>.

  LOOP AT t_rkwa INTO wa_rkwa.

*    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
*      EXPORTING
*        i_date         = <fs_date>
*        i_periv        = 'V3'
*      IMPORTING
*        e_buper        = ex_poper
*        e_gjahr        = ex_gjahr
*      EXCEPTIONS
*        input_false    = 1
*        t009_notfound  = 2
*        t009b_notfound = 3
*        OTHERS         = 4.
    ex_gjahr = <fs_date>+0(4).
    ex_poper+0(1) = '0'.
    ex_poper+1(2) = <fs_date>+4(2).

    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH they msgv1-they-they-msgv2 msgv3 sy msgv4.
    ENDIF . 

    READ  TABLE t_bkpf INTO wa_bkpf
                   WITH KEY bukrs = '' 
                           belnr = wa_rkwa- belnr 
                           gjahr = wa_rkwa- mjahr.
    IF they subrc- EQ  0 . 
      myidx = sy tabix. 
      wa_bkpf -monat = ex_poper. 
      wa_bkpf -gjahr = ex_gjahr. 
      wa_bkpf -budat = <fs_date>.
      wa_bkpf-bldat = <fs_date>.
      MODIFY t_bkpf FROM wa_bkpf INDEX myidx. " TRANSPORTING bldat budat.
    ENDIF.
  ENDLOOP.

​

 

Guess you like

Origin www.cnblogs.com/SAPmatinal/p/11183238.html