Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8594

Re: BAPI / FM for MEK2

$
0
0

Hi Prasenjit,

 

I have written code below : condition record is updated but when I check the record through tcode MEK2, "valid from date" is not getting updated.

 

Is there anything else to be done in the code ??

 

   REPORT  ZGEQ_TEST.

PARAMETERS: p_KBETR type KBETR DEFAULT '99'.
*PARAMETERS: p_KNUMA type KNUMA_AG DEFAULT 'X000009996'.
PARAMETERS: p_datef type sy-datum DEFAULT '20130401'.
PARAMETERS: p_datet type sy-datum DEFAULT '20130731'.
*PARAMETERS: p_kunnr TYPE kunnr DEFAULT '28523272'.
PARAMETERS: p_matnr type matnr DEFAULT 'P7734527'.
PARAMETERS: p_werks type werks DEFAULT '8001'.

START-OF-SELECTION.

DATA:
cr LIKE TABLE OF komv WITH HEADER LINE, " copy_records
nr, "New_Record
key_fields LIKE TABLE OF komg WITH HEADER LINE,
komk LIKE TABLE OF komk WITH HEADER LINE,
komp LIKE TABLE OF komp WITH HEADER LINE,
COPY_RECS_IDOC LIKE TABLE OF KOMV_IDOC WITH HEADER LINE,
i_kona TYPE kona.

**********************************************************

* KOMK/KOMP Fuellen

*Fill KOMK

komk-mandt = '250'.
*komk-vkorg = '1310'.
*komk-vtweg = '01'.
*komk-spart = '01'.
*komk-kunnr = p_kunnr.
komk-kappl = 'M'.
komk-werks = p_werks.
komk-ERDAT = sy-datum.
komp-kposn = '000001'.
komp-matnr = p_matnr.
*komp-KNUMA_AG = p_KNUMA.
komp-kposn = '000001'.

key_fields-mandt  = '250'.
*key_fields-vkorg = '3376'.
*key_fields-kunnr = p_kunnr.
*key_fields-vtweg = '01'.
*key_fields-spart = '01'.
key_fields-matnr p_matnr.

cr-kappl = 'M'.
cr-kschl = 'ZGFB'.
cr-krech = 'C'.
cr-KBETR = p_KBETR.
cr-waers = 'INR'.
cr-kpein = 1.
cr-kmein = 'EA'.
cr-kopos = 01.
cr-kzbzg = 'C'.
*cr-knumh = '0005014306'.
APPEND cr.

i_kona-abtyp = 'C'.
*  i_kona-knuma  =  p_knuma.
*COPY_RECS_IDOC-KNUMA_AG = p_KNUMA.
*append COPY_RECS_IDOC.

CALL FUNCTION 'RV_CONDITION_RESET'.

* --> KOMK/KOMP werden korrekt gef#llt. Funktion i.o.

**********************************************************

CALL FUNCTION 'RV_CONDITION_COPY'
  EXPORTING
    application              = 'M'
    condition_table          = '915'
    condition_type           = 'ZGFB'
    date_from                = p_datef
    date_to                  = p_datet
    enqueue                  = 'X'
    i_komk                   = komk
    i_komp                   = komp
    key_fields               = key_fields
    maintain_mode            = 'B'
*    no_authority_check       = space
    no_field_check           = 'X'
    keep_old_records         = space
*    overlap_confirmed        = 'X'
    i_kona                   = i_kona
*    SELECTION_DATE           = sy-datum
  IMPORTING
    e_komk                   = komk
    e_komp                   = komp
    new_record               = nr
  TABLES
    copy_records             = cr
    COPY_RECS_IDOC           = COPY_RECS_IDOC
  EXCEPTIONS
    enqueue_on_record        = 01
    invalid_application      = 02
    invalid_condition_number = 03
    invalid_condition_type   = 04
    no_authority_ekorg       = 05
    no_authority_kschl       = 06
    no_authority_vkorg       = 07
    no_selection             = 08
    table_not_valid          = 09.

CALL FUNCTION 'RV_CONDITION_SAVE'.
CALL FUNCTION 'RV_CONDITION_RESET'.
commit work.


Viewing all articles
Browse latest Browse all 8594

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>